Commit fe30b79d authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

advapi32: Handle well qualified names in LookupAccountNameW for account names.

parent 1862826a
......@@ -2753,13 +2753,23 @@ BOOL WINAPI LookupAccountNameW( LPCWSTR lpSystemName, LPCWSTR lpAccountName, PSI
userName = HeapAlloc(GetProcessHeap(), 0, nameLen*sizeof(WCHAR));
if (GetUserNameW(userName, &nameLen) && !strcmpW(lpAccountName, userName))
if (lpDomainNamePtr)
{
/* check to make sure this account is on this computer */
if (GetComputerNameW(userName, &nameLen) && strcmpW(lpDomainNamePtr, userName))
{
SetLastError(ERROR_NONE_MAPPED);
ret = FALSE;
}
}
if (GetUserNameW(userName, &nameLen) && !strcmpW(lpAccountNamePtr, userName))
ret = lookup_user_account_name(Sid, cbSid, ReferencedDomainName,
cchReferencedDomainName, peUse);
else
{
nameLen = UNLEN + 1;
if (GetComputerNameW(userName, &nameLen) && !strcmpW(lpAccountName, userName))
if (GetComputerNameW(userName, &nameLen) && !strcmpW(lpAccountNamePtr, userName))
ret = lookup_computer_account_name(Sid, cbSid, ReferencedDomainName,
cchReferencedDomainName, peUse);
else
......
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