Commit 04cccae9 authored by Paul Bryan Roberts's avatar Paul Bryan Roberts Committed by Alexandre Julliard

advapi32: LookupAccountNameW() - use ACCOUNT_SIDS domain and name_use fields for well known SIDS.

parent e9e4da8f
...@@ -2536,11 +2536,30 @@ BOOL WINAPI LookupAccountNameW( LPCWSTR lpSystemName, LPCWSTR lpAccountName, PSI ...@@ -2536,11 +2536,30 @@ BOOL WINAPI LookupAccountNameW( LPCWSTR lpSystemName, LPCWSTR lpAccountName, PSI
{ {
if (!strcmpW(lpAccountName, ACCOUNT_SIDS[i].account)) if (!strcmpW(lpAccountName, ACCOUNT_SIDS[i].account))
{ {
if (*cchReferencedDomainName) ret = CreateWellKnownSid(ACCOUNT_SIDS[i].type, NULL, Sid, cbSid);
*ReferencedDomainName = '\0';
*cchReferencedDomainName = 0; domainName = ACCOUNT_SIDS[i].domain;
*peUse = SidTypeWellKnownGroup; nameLen = strlenW(domainName);
return CreateWellKnownSid(ACCOUNT_SIDS[i].type, NULL, Sid, cbSid);
if (*cchReferencedDomainName <= nameLen && ReferencedDomainName)
{
SetLastError(ERROR_INSUFFICIENT_BUFFER);
nameLen += 1;
ret = FALSE;
}
else if (ReferencedDomainName && domainName)
{
strcpyW(ReferencedDomainName, domainName);
}
*cchReferencedDomainName = nameLen;
if (ret)
{
*peUse = ACCOUNT_SIDS[i].name_use;
}
return ret;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment