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

This commit is contained in:
Aric Stewart 2009-05-18 14:47:36 -05:00 committed by Alexandre Julliard
parent 1862826a87
commit fe30b79d72
1 changed files with 12 additions and 2 deletions

View File

@ -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