Find the main winelib app with GetModuleHandle

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ChangeLog
	Check if the name passed to GetModuleHandle() is the name
	of the main executable. As those normally don't have an extension
	".DLL" was appended and the search failed.
Index: loader/module.c
===================================================================
RCS file: /home/wine/wine/loader/module.c,v
retrieving revision 1.166
diff -u -3 -d -p -r1.166 module.c
--- loader/module.c	15 Oct 2002 02:25:19 -0000	1.166
+++ loader/module.c	17 Oct 2002 19:26:25 -0000
@@ -497,6 +497,16 @@ WINE_MODREF *MODULE_FindModule(
     WINE_MODREF	*wm;
     char dllname[260], *p;
 
+    /* Check if path is the main exe module */
+    if ( exe_modref )
+    {
+        if ( !FILE_strcasecmp( path, exe_modref->modname ) ||
+            !FILE_strcasecmp( path, exe_modref->filename ) ||
+            !FILE_strcasecmp( path, exe_modref->short_modname ) ||
+            !FILE_strcasecmp( path, exe_modref->short_filename ) )
+            return exe_modref;
+    }
+
     /* Append .DLL to name if no extension present */
     strcpy( dllname, path );
     if (!(p = strrchr( dllname, '.')) || strchr( p, '/' ) || strchr( p, '\\'))

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux