LoadModule32/WinExec32 should return 16-bit hInstance/hTask.

This commit is contained in:
Ulrich Weigand 1998-12-10 08:30:30 +00:00 committed by Alexandre Julliard
parent e82199121f
commit 2aad33e032
1 changed files with 3 additions and 8 deletions

View File

@ -525,15 +525,10 @@ HINSTANCE32 WINAPI LoadModule32( LPCSTR name, LPVOID paramBlock )
NULL, &startup, &info )) NULL, &startup, &info ))
return GetLastError(); /* guaranteed to be < 32 */ return GetLastError(); /* guaranteed to be < 32 */
/* Get hInstance from process */ /* Get 16-bit hInstance/hTask from process */
pdb = PROCESS_IdToPDB( info.dwProcessId ); pdb = PROCESS_IdToPDB( info.dwProcessId );
if ( pdb->exe_modref ) tdb = pdb? (TDB *)GlobalLock16( pdb->task ) : NULL;
hInstance = pdb->exe_modref->module; hInstance = tdb && tdb->hInstance? tdb->hInstance : pdb? pdb->task : 0;
else
{
tdb = pdb? (TDB *)GlobalLock16( pdb->task ) : NULL;
hInstance = tdb? tdb->hInstance : 0;
}
/* Close off the handles */ /* Close off the handles */
CloseHandle( info.hThread ); CloseHandle( info.hThread );