CVS: winex/loader module.c,1.29,1.30

[email protected] 31 Jul 2007 18:10:12 -0000
Newsgroups gmane.comp.emulators.winex.cvs
Message-ID <[email protected]>
Subject: winex/loader module.c,1.29,1.30Update of /var/lib/cvsd/cvsroot/winex/loader
In directory agravaine:/tmp/cvs-serv27332/loader

Modified Files:
	module.c 
Log Message:
Fix broken path name check when looking for modules. We need to compare short
names to short names, as we have no idea what kind of name the app passed 
to us.  


Index: module.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/loader/module.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- module.c	31 Jul 2007 18:01:18 -0000	1.29
+++ module.c	31 Jul 2007 18:10:10 -0000	1.30
@@ -487,7 +487,7 @@
     ofs = (OFSTRUCT *)(pModule + 1);
     memset( ofs, 0, of_size );
     ofs->cBytes = of_size < 256 ? of_size : 255;   /* FIXME */
-    strcpy( ofs->szPathName, filename );
+    strcpy( (char *)ofs->szPathName, filename );
 
     pSegment = (SEGTABLEENTRY*)((char*)(pModule + 1) + ((of_size + 3) & ~3));
     pModule->seg_table = (int)pSegment - (int)pModule;
@@ -530,12 +530,14 @@
 	LPCSTR path	/* [in] pathname of module/library to be found */
 ) {
     WINE_MODREF	*wm;
-    char dllname[260], *p;
+    char dllname[260], shortdllname[MAX_PATH], *p;
 
     /* Append .DLL to name if no extension present */
     strcpy( dllname, path );
     if (!(p = strrchr( dllname, '.')) || strchr( p, '/' ) || strchr( p, '\\'))
             strcat( dllname, ".DLL" );
+ 
+    GetShortPathNameA(dllname, shortdllname, MAX_PATH);
 
     for ( wm = MODULE_modref_list; wm; wm = wm->next )
     {
@@ -547,6 +549,8 @@
             break;
         if ( !FILE_strcasecmp( dllname, wm->short_filename ) )
             break;
+        if ( !FILE_strcasecmp( shortdllname, wm->short_filename ) )
+            break;
     }
 
     return wm;