Sec: Fix GetUserNameExA
Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
034a0ce74f
commit
bbe3da0303
@ -35,7 +35,7 @@ static BOOLEAN GetUserNameExA(_In_ EXTENDED_NAME_FORMAT NameFormat, _Inout_ std:
|
|||||||
if (::GetLastError() == ERROR_MORE_DATA) {
|
if (::GetLastError() == ERROR_MORE_DATA) {
|
||||||
// Allocate buffer on heap and retry.
|
// Allocate buffer on heap and retry.
|
||||||
sName.resize(ulSize - 1);
|
sName.resize(ulSize - 1);
|
||||||
if (::GetUserNameExA(NameFormat, &ulSize[0], &ulSize))
|
if (::GetUserNameExA(NameFormat, &sName[0], &ulSize))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user