advapi32: LookupAccountNameW() - correct call in SetEntriesInAclW().

This commit is contained in:
Paul Bryan Roberts 2008-10-18 20:56:08 +01:00 committed by Alexandre Julliard
parent 04cccae943
commit a3e0bc10bb
1 changed files with 2 additions and 2 deletions

View File

@ -2541,7 +2541,7 @@ BOOL WINAPI LookupAccountNameW( LPCWSTR lpSystemName, LPCWSTR lpAccountName, PSI
domainName = ACCOUNT_SIDS[i].domain; domainName = ACCOUNT_SIDS[i].domain;
nameLen = strlenW(domainName); nameLen = strlenW(domainName);
if (*cchReferencedDomainName <= nameLen && ReferencedDomainName) if (*cchReferencedDomainName <= nameLen || !ret)
{ {
SetLastError(ERROR_INSUFFICIENT_BUFFER); SetLastError(ERROR_INSUFFICIENT_BUFFER);
nameLen += 1; nameLen += 1;
@ -3244,7 +3244,7 @@ DWORD WINAPI SetEntriesInAclW( ULONG count, PEXPLICIT_ACCESSW pEntries,
case TRUSTEE_IS_NAME: case TRUSTEE_IS_NAME:
{ {
DWORD sid_size = FIELD_OFFSET(SID, SubAuthority[SID_MAX_SUB_AUTHORITIES]); DWORD sid_size = FIELD_OFFSET(SID, SubAuthority[SID_MAX_SUB_AUTHORITIES]);
DWORD domain_size = 0; DWORD domain_size = MAX_COMPUTERNAME_LENGTH + 1;
SID_NAME_USE use; SID_NAME_USE use;
if (!LookupAccountNameW(NULL, pEntries[i].Trustee.ptstrName, ppsid[i], &sid_size, NULL, &domain_size, &use)) if (!LookupAccountNameW(NULL, pEntries[i].Trustee.ptstrName, ppsid[i], &sid_size, NULL, &domain_size, &use))
{ {