2015-04-29 06:25:06 -07:00
|
|
|
From 616c17cc58a4943d3a367704943e737d5713740d Mon Sep 17 00:00:00 2001
|
2015-04-18 12:43:36 -07:00
|
|
|
From: Qian Hong <qhong@codeweavers.com>
|
|
|
|
Date: Tue, 7 Apr 2015 11:23:34 +0800
|
|
|
|
Subject: advapi32: Fallback to Sid string when LookupAccountSid fails.
|
|
|
|
|
|
|
|
---
|
2015-04-29 06:25:06 -07:00
|
|
|
dlls/advapi32/lsa.c | 31 +++++++++++++++++++++++++++++++
|
|
|
|
1 file changed, 31 insertions(+)
|
2015-04-18 12:43:36 -07:00
|
|
|
|
|
|
|
diff --git a/dlls/advapi32/lsa.c b/dlls/advapi32/lsa.c
|
2015-04-29 06:25:06 -07:00
|
|
|
index 258b8ca..93afa20 100644
|
2015-04-18 12:43:36 -07:00
|
|
|
--- a/dlls/advapi32/lsa.c
|
|
|
|
+++ b/dlls/advapi32/lsa.c
|
|
|
|
@@ -29,6 +29,7 @@
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winreg.h"
|
|
|
|
#include "winternl.h"
|
|
|
|
+#include "sddl.h"
|
|
|
|
#include "advapi32_misc.h"
|
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
@@ -554,6 +555,21 @@ NTSTATUS WINAPI LsaLookupSids(
|
|
|
|
heap_free(name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ WCHAR *strsid = NULL;
|
|
|
|
+
|
|
|
|
+ if (ConvertSidToStringSidW(Sids[i], &strsid))
|
|
|
|
+ {
|
|
|
|
+ name_size = strlenW(strsid) + 1;
|
|
|
|
+
|
|
|
|
+ (*Names)[i].Name.Length = (name_size - 1) * sizeof(WCHAR);
|
|
|
|
+ (*Names)[i].Name.MaximumLength = name_size * sizeof(WCHAR);
|
|
|
|
+ name_fullsize += (*Names)[i].Name.MaximumLength;
|
|
|
|
+
|
|
|
|
+ LocalFree(strsid);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
/* now we have full length needed for both */
|
2015-04-29 06:25:06 -07:00
|
|
|
@@ -593,6 +609,21 @@ NTSTATUS WINAPI LsaLookupSids(
|
2015-04-18 12:43:36 -07:00
|
|
|
heap_free(domain.Buffer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ WCHAR *strsid = NULL;
|
|
|
|
+
|
|
|
|
+ if (ConvertSidToStringSidW(Sids[i], &strsid))
|
|
|
|
+ {
|
|
|
|
+ name_size = strlenW(strsid) + 1;
|
2015-04-29 06:25:06 -07:00
|
|
|
+ mapped++;
|
2015-04-18 12:43:36 -07:00
|
|
|
+
|
|
|
|
+ (*Names)[i].Name.Buffer = name_buffer;
|
|
|
|
+ memcpy((*Names)[i].Name.Buffer, strsid, name_size * sizeof(WCHAR));
|
|
|
|
+
|
|
|
|
+ LocalFree(strsid);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
|
|
name_buffer += name_size;
|
|
|
|
}
|
|
|
|
--
|
|
|
|
2.3.5
|
|
|
|
|