LoadModule32/WinExec32 should return 16-bit hInstance/hTask.
diff --git a/loader/module.c b/loader/module.c
index 48f7ef7..f1aca82 100644
--- a/loader/module.c
+++ b/loader/module.c
@@ -525,15 +525,10 @@
NULL, &startup, &info ))
return GetLastError(); /* guaranteed to be < 32 */
- /* Get hInstance from process */
+ /* Get 16-bit hInstance/hTask from process */
pdb = PROCESS_IdToPDB( info.dwProcessId );
- if ( pdb->exe_modref )
- hInstance = pdb->exe_modref->module;
- else
- {
- tdb = pdb? (TDB *)GlobalLock16( pdb->task ) : NULL;
- hInstance = tdb? tdb->hInstance : 0;
- }
+ tdb = pdb? (TDB *)GlobalLock16( pdb->task ) : NULL;
+ hInstance = tdb && tdb->hInstance? tdb->hInstance : pdb? pdb->task : 0;
/* Close off the handles */
CloseHandle( info.hThread );