CVS: winex/dlls/shell32 shell32_main.c,1.6,1.7

[email protected] 1 Aug 2007 12:29:20 -0000
Newsgroups gmane.comp.emulators.winex.cvs
Message-ID <[email protected]>
Subject: winex/dlls/shell32 shell32_main.c,1.6,1.7Update of /var/lib/cvsd/cvsroot/winex/dlls/shell32
In directory agravaine:/tmp/cvs-serv28622/dlls/shell32

Modified Files:
	shell32_main.c 
Log Message:

- fixed GetModuleFileNameA() to properly return a truncated filename error code.  GetModuleFileNameW() just calls GetModuleFileNameA(), so its error codes should be updated as well.
- fixed all the calls to GetModuleFileNameA/W() to check for small buffer and bad module errors.  Currently small buffer errors are just reported and are allowed to proceed with either an empty string or truncated string for the filename.  In the case of an error retrieving the module filename (error == 0), the calling function reports the error and returns immediately.


Index: shell32_main.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/dlls/shell32/shell32_main.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- shell32_main.c	1 Aug 2007 12:22:26 -0000	1.6
+++ shell32_main.c	1 Aug 2007 12:29:18 -0000	1.7
@@ -122,9 +122,7 @@
 
 
         /* resize the buffer and try again */
-        /* NOTE: the hack in the loop guard is to compensate for the incorrect return value in GetModuleFileNameW().
-                 Remove it when that function is fixed. */
-        while (result == 0 || result == maxChars /* <HACK> */ - 1 /* </HACK> */){
+        while (result == 0 || result == maxChars){
             size *= 2;
             hargv = CLTAW_REALLOC(hargv, size + (2 * sizeof(WCHAR)), 0);
             argv =  CLTAW_LOCK(hargv);