msi: GetUserName sets last error to ERROR_INSUFFICIENT_BUFFER if the buffer is too small.

This commit is contained in:
Hans Leidekker 2011-06-01 14:48:01 +02:00 committed by Alexandre Julliard
parent 0875abcce0
commit 926fe27718
1 changed files with 1 additions and 1 deletions

View File

@ -1005,7 +1005,7 @@ static VOID set_installer_properties(MSIPACKAGE *package)
msi_set_property( package->db, szProductState, bufstr );
len = 0;
if (!GetUserNameW( NULL, &len ) && GetLastError() == ERROR_MORE_DATA)
if (!GetUserNameW( NULL, &len ) && GetLastError() == ERROR_INSUFFICIENT_BUFFER)
{
WCHAR *username;
if ((username = msi_alloc( len * sizeof(WCHAR) )))