Strike 2: Patch 2/2 for SmartForms Installer: GetModuleFileNameW called by 16-bit task

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

 



This patch fixes another error encountered in the Smart Forms installer 
(somewhat related to bug 575).

The SmartForms installer (a 16-bit NE EXE) calls GetModuleFileNameW 
through a 32-bit procedure using CallProc32. Since the task is 16-bit, 
GetCurrentTask must be used instead of MODULE32_LookupHMODULE.

Modified Files:
wine/loader/module.c

Changelog:
Changed GetModuleFileNameA to use GetCurrentTask instead of 
MODULE32_LookupHMODULE when called by a 16-bit task.

License:
GPL
X11

Josh Thielen

Index: wine/loader/module.c
===================================================================
RCS file: /home/wine/wine/loader/module.c,v
retrieving revision 1.150
diff -u -r1.150 module.c
--- wine/loader/module.c	2 Apr 2002 19:47:30 -0000	1.150
+++ wine/loader/module.c	22 Jun 2002 03:20:45 -0000
@@ -1247,8 +1247,17 @@
     RtlEnterCriticalSection( &loader_section );
 
     lpFileName[0] = 0;
-    if ((wm = MODULE32_LookupHMODULE( hModule )))
+    if(!hModule && !(NtCurrentTeb()->tibflags & TEBF_WIN32)) {
+        /* 16-bit task - get current NE module name */ 
+        NE_MODULE *pModule;
+        hModule = GetCurrentTask();
+
+        if ((pModule = NE_GetPtr( hModule ))) {
+            GetLongPathNameA(NE_MODULE_NAME(pModule), lpFileName, size);
+        }
+    } else if ((wm = MODULE32_LookupHMODULE( hModule ))) {
         lstrcpynA( lpFileName, wm->filename, size );
+    }
 
     RtlLeaveCriticalSection( &loader_section );
     TRACE("%s\n", lpFileName );

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

  Powered by Linux