advapi32: Set last error directly in GetUserName.

Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Gijs Vermeulen 2020-05-14 23:12:23 +02:00 committed by Alexandre Julliard
parent 1a7dd7cdbe
commit 3c1edaaae5
1 changed files with 2 additions and 0 deletions

View File

@ -49,6 +49,7 @@ BOOL WINAPI GetUserNameA( LPSTR name, LPDWORD size )
if (!len) return FALSE; if (!len) return FALSE;
if ((ret = (len < *size))) len++; if ((ret = (len < *size))) len++;
else SetLastError( ERROR_INSUFFICIENT_BUFFER );
*size = len; *size = len;
return ret; return ret;
} }
@ -64,6 +65,7 @@ BOOL WINAPI GetUserNameW( LPWSTR name, LPDWORD size )
if (!len) return FALSE; if (!len) return FALSE;
if ((ret = (len < *size))) len++; if ((ret = (len < *size))) len++;
else SetLastError( ERROR_INSUFFICIENT_BUFFER );
*size = len; *size = len;
return ret; return ret;
} }