mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
Fixed return value of GetUserNameExA
This commit is contained in:
@@ -207,6 +207,9 @@ BOOL LogonUserExW(LPCWSTR lpszUsername, LPCWSTR lpszDomain, LPCWSTR lpszPassword
|
||||
|
||||
BOOL GetUserNameExA(EXTENDED_NAME_FORMAT NameFormat, LPSTR lpNameBuffer, PULONG nSize)
|
||||
{
|
||||
WINPR_ASSERT(lpNameBuffer);
|
||||
WINPR_ASSERT(nSize);
|
||||
|
||||
switch (NameFormat)
|
||||
{
|
||||
case NameSamCompatible:
|
||||
@@ -229,9 +232,8 @@ BOOL GetUserNameExA(EXTENDED_NAME_FORMAT NameFormat, LPSTR lpNameBuffer, PULONG
|
||||
#else
|
||||
strncpy(lpNameBuffer, getlogin(), *nSize);
|
||||
#endif
|
||||
if (*nSize > 1)
|
||||
*nSize = strnlen(lpNameBuffer, *nSize - 1) + 1;
|
||||
break;
|
||||
*nSize = strnlen(lpNameBuffer, *nSize);
|
||||
return TRUE;
|
||||
|
||||
case NameFullyQualifiedDN:
|
||||
case NameDisplay:
|
||||
|
||||
Reference in New Issue
Block a user