From cba7be79547d42bb30967dd74405f1979df1acbf Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Sun, 19 Mar 2000 12:46:56 +0000 Subject: [PATCH] Now attaching imported DLLs of a winelib executable. --- loader/main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/loader/main.c b/loader/main.c index 96c39134e06..b9d787e6460 100644 --- a/loader/main.c +++ b/loader/main.c @@ -178,6 +178,7 @@ HINSTANCE MAIN_WinelibInit( int *argc, char *argv[] ) { NE_MODULE *pModule; HMODULE16 hModule; + PDB *curr; /* Main initialization */ if (!MAIN_MainInit( *argc, argv, TRUE )) return 0; @@ -195,14 +196,19 @@ HINSTANCE MAIN_WinelibInit( int *argc, char *argv[] ) return 0; /* Increment EXE refcount */ - assert( PROCESS_Current()->exe_modref ); - PROCESS_Current()->exe_modref->refCount++; + curr = PROCESS_Current(); + assert( curr->exe_modref ); + curr->exe_modref->refCount++; /* Load system DLLs into the initial process (and initialize them) */ if ( !LoadLibrary16("GDI.EXE" ) || !LoadLibraryA("GDI32.DLL" ) || !LoadLibrary16("USER.EXE") || !LoadLibraryA("USER32.DLL")) ExitProcess( 1 ); + /* attach the imported DLLs */ + if ( !MODULE_DllProcessAttach( curr->exe_modref, NULL ) ) + ExitProcess( 1 ); + /* Get pointers to USER routines called by KERNEL */ THUNK_InitCallout();