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:
parent
1a7dd7cdbe
commit
3c1edaaae5
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue