changeset 87998:3ef9b6e3d2fa

(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.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 26 Jan 2008 15:04:33 +0000
parents 13df71a98040
children 26fe370dfb79
files src/w32.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/w32.c	Sat Jan 26 14:54:55 2008 +0000
+++ b/src/w32.c	Sat Jan 26 15:04:33 2008 +0000
@@ -362,10 +362,11 @@
     DWORD n)
 {
   static GetSidSubAuthority_Proc s_pfn_Get_Sid_Sub_Authority = NULL;
+  static DWORD zero = 0U;
   HMODULE hm_advapi32 = NULL;
   if (is_windows_9x () == TRUE)
     {
-      return NULL;
+      return &zero;
     }
   if (g_b_init_get_sid_sub_authority == 0)
     {
@@ -377,7 +378,7 @@
     }
   if (s_pfn_Get_Sid_Sub_Authority == NULL)
     {
-      return NULL;
+      return &zero;
     }
   return (s_pfn_Get_Sid_Sub_Authority (pSid, n));
 }
@@ -386,10 +387,11 @@
     PSID pSid)
 {
   static GetSidSubAuthorityCount_Proc s_pfn_Get_Sid_Sub_Authority_Count = NULL;
+  static UCHAR zero = 0U;
   HMODULE hm_advapi32 = NULL;
   if (is_windows_9x () == TRUE)
     {
-      return NULL;
+      return &zero;
     }
   if (g_b_init_get_sid_sub_authority_count == 0)
     {
@@ -401,7 +403,7 @@
     }
   if (s_pfn_Get_Sid_Sub_Authority_Count == NULL)
     {
-      return NULL;
+      return &zero;
     }
   return (s_pfn_Get_Sid_Sub_Authority_Count (pSid));
 }