]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.1.0780: MS-Windows: incorrect Win32 error checking v9.1.0780
authorNir Lichtman <nir@lichtman.org>
Sun, 13 Oct 2024 17:44:07 +0000 (19:44 +0200)
committerChristian Brabandt <cb@256bit.org>
Sun, 13 Oct 2024 17:44:07 +0000 (19:44 +0200)
commitb516598092b37be5b486373b44fbc5a26ef54540
treeeb079148a9dae204be489dd66ec1f109c6a74150
parenta2aa921f767da17d4b619f41b7a1210c762c91e2
patch 9.1.0780: MS-Windows: incorrect Win32 error checking

Problem:  MS-Windows: incorrect Win32 error checking
Solution: fix wrong order of error handling and perform
          some minor refactoring (Nir Lichtman)

In the function that adjusts the process privileges there is a mistake
in which GetLastError is called after CloseHandle, though clearly the
last error check is meant for the privileges related call before hand
and the current state appears like a mistake.

So fix this problem, and also perform the following:

- Remove the static variable done since the PlatformId is only called
  during initialization
- Fix incorrect parameter passed to the Win32 API privileges function

closes: #15845

Signed-off-by: Nir Lichtman <nir@lichtman.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/os_win32.c
src/version.c