From 2aad33e032d1e0c9f9b70cbfac1174b466f4c19a Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Thu, 10 Dec 1998 08:30:30 +0000 Subject: [PATCH] LoadModule32/WinExec32 should return 16-bit hInstance/hTask. --- loader/module.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/loader/module.c b/loader/module.c index 48f7ef7085e..f1aca823f38 100644 --- a/loader/module.c +++ b/loader/module.c @@ -525,15 +525,10 @@ HINSTANCE32 WINAPI LoadModule32( LPCSTR name, LPVOID paramBlock ) 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 );