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

Alexandre Julliard julliard at winehq.org
Wed Jun 1 12:11:09 CDT 2011


Module: wine
Branch: master
Commit: 926fe277185778e275b3ad17bd2b86e5413ba959
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=926fe277185778e275b3ad17bd2b86e5413ba959

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Wed Jun  1 14:48:01 2011 +0200

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

---

 dlls/msi/package.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/msi/package.c b/dlls/msi/package.c
index c421805..1cbb221 100644
--- a/dlls/msi/package.c
+++ b/dlls/msi/package.c
@@ -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) )))




More information about the wine-cvs mailing list