diff options
| author | Eli Zaretskii | 2008-01-26 15:04:33 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2008-01-26 15:04:33 +0000 |
| commit | 6811b9f4e614162634a783e74e0ab976bdfa9440 (patch) | |
| tree | 0418bc9e14421d4462216280e2d0363001126f36 /src | |
| parent | 5d449a36ccff14cfa371f61cf57501e073e5d2f9 (diff) | |
| download | emacs-6811b9f4e614162634a783e74e0ab976bdfa9440.tar.gz emacs-6811b9f4e614162634a783e74e0ab976bdfa9440.zip | |
(get_sid_sub_authority, get_sid_sub_authority_count): Fix return values
on Windows 9x or when the corresponding advapi32.dll functions are
not available.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32.c | 10 |
1 files changed, 6 insertions, 4 deletions
| @@ -362,10 +362,11 @@ PDWORD WINAPI get_sid_sub_authority ( | |||
| 362 | DWORD n) | 362 | DWORD n) |
| 363 | { | 363 | { |
| 364 | static GetSidSubAuthority_Proc s_pfn_Get_Sid_Sub_Authority = NULL; | 364 | static GetSidSubAuthority_Proc s_pfn_Get_Sid_Sub_Authority = NULL; |
| 365 | static DWORD zero = 0U; | ||
| 365 | HMODULE hm_advapi32 = NULL; | 366 | HMODULE hm_advapi32 = NULL; |
| 366 | if (is_windows_9x () == TRUE) | 367 | if (is_windows_9x () == TRUE) |
| 367 | { | 368 | { |
| 368 | return NULL; | 369 | return &zero; |
| 369 | } | 370 | } |
| 370 | if (g_b_init_get_sid_sub_authority == 0) | 371 | if (g_b_init_get_sid_sub_authority == 0) |
| 371 | { | 372 | { |
| @@ -377,7 +378,7 @@ PDWORD WINAPI get_sid_sub_authority ( | |||
| 377 | } | 378 | } |
| 378 | if (s_pfn_Get_Sid_Sub_Authority == NULL) | 379 | if (s_pfn_Get_Sid_Sub_Authority == NULL) |
| 379 | { | 380 | { |
| 380 | return NULL; | 381 | return &zero; |
| 381 | } | 382 | } |
| 382 | return (s_pfn_Get_Sid_Sub_Authority (pSid, n)); | 383 | return (s_pfn_Get_Sid_Sub_Authority (pSid, n)); |
| 383 | } | 384 | } |
| @@ -386,10 +387,11 @@ PUCHAR WINAPI get_sid_sub_authority_count ( | |||
| 386 | PSID pSid) | 387 | PSID pSid) |
| 387 | { | 388 | { |
| 388 | static GetSidSubAuthorityCount_Proc s_pfn_Get_Sid_Sub_Authority_Count = NULL; | 389 | static GetSidSubAuthorityCount_Proc s_pfn_Get_Sid_Sub_Authority_Count = NULL; |
| 390 | static UCHAR zero = 0U; | ||
| 389 | HMODULE hm_advapi32 = NULL; | 391 | HMODULE hm_advapi32 = NULL; |
| 390 | if (is_windows_9x () == TRUE) | 392 | if (is_windows_9x () == TRUE) |
| 391 | { | 393 | { |
| 392 | return NULL; | 394 | return &zero; |
| 393 | } | 395 | } |
| 394 | if (g_b_init_get_sid_sub_authority_count == 0) | 396 | if (g_b_init_get_sid_sub_authority_count == 0) |
| 395 | { | 397 | { |
| @@ -401,7 +403,7 @@ PUCHAR WINAPI get_sid_sub_authority_count ( | |||
| 401 | } | 403 | } |
| 402 | if (s_pfn_Get_Sid_Sub_Authority_Count == NULL) | 404 | if (s_pfn_Get_Sid_Sub_Authority_Count == NULL) |
| 403 | { | 405 | { |
| 404 | return NULL; | 406 | return &zero; |
| 405 | } | 407 | } |
| 406 | return (s_pfn_Get_Sid_Sub_Authority_Count (pSid)); | 408 | return (s_pfn_Get_Sid_Sub_Authority_Count (pSid)); |
| 407 | } | 409 | } |