Commit b516598
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>1 parent a2aa921 commit b516598
2 files changed
Lines changed: 20 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
918 | 918 | | |
919 | 919 | | |
920 | 920 | | |
921 | | - | |
| 921 | + | |
922 | 922 | | |
923 | | - | |
924 | 923 | | |
925 | 924 | | |
926 | 925 | | |
| |||
937 | 936 | | |
938 | 937 | | |
939 | 938 | | |
940 | | - | |
941 | | - | |
| 939 | + | |
942 | 940 | | |
943 | | - | |
944 | | - | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
945 | 946 | | |
946 | | - | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
947 | 952 | | |
948 | | - | |
| 953 | + | |
| 954 | + | |
949 | 955 | | |
950 | 956 | | |
951 | 957 | | |
| |||
961 | 967 | | |
962 | 968 | | |
963 | 969 | | |
964 | | - | |
965 | | - | |
966 | | - | |
967 | | - | |
968 | | - | |
969 | 970 | | |
970 | 971 | | |
971 | 972 | | |
972 | | - | |
| 973 | + | |
| 974 | + | |
973 | 975 | | |
974 | 976 | | |
975 | 977 | | |
| |||
985 | 987 | | |
986 | 988 | | |
987 | 989 | | |
988 | | - | |
| 990 | + | |
| 991 | + | |
989 | 992 | | |
990 | | - | |
991 | 993 | | |
992 | 994 | | |
993 | 995 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
704 | 704 | | |
705 | 705 | | |
706 | 706 | | |
| 707 | + | |
| 708 | + | |
707 | 709 | | |
708 | 710 | | |
709 | 711 | | |
| |||
0 commit comments