Attach notifications must be send after all recursive dependencies are

loaded and not before.
This commit is contained in:
Bertho Stultiens 1999-04-19 16:32:31 +00:00 committed by Alexandre Julliard
parent 0b52adaac4
commit af5745f504
1 changed files with 12 additions and 8 deletions

View File

@ -1212,8 +1212,20 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HFILE hfile, DWORD flags)
return 0;
}
EnterCriticalSection(&PROCESS_Current()->crit_section);
wm = MODULE_LoadLibraryExA( libname, hfile, flags );
if(wm && !MODULE_DllProcessAttach(wm, NULL))
{
WARN(module, "Attach failed for module '%s', \n", libname);
MODULE_FreeLibrary(wm);
SetLastError(ERROR_DLL_INIT_FAILED);
wm = NULL;
}
LeaveCriticalSection(&PROCESS_Current()->crit_section);
return wm ? wm->module : 0;
}
@ -1290,14 +1302,6 @@ WINE_MODREF *MODULE_LoadLibraryExA( LPCSTR libname, HFILE hfile, DWORD flags )
/* decrement the dependencies through the MODULE_FreeLibrary call. */
pwm->refCount++;
if(!MODULE_DllProcessAttach(pwm, NULL))
{
WARN(module, "Attach failed for module '%s', \n", libname);
MODULE_FreeLibrary(pwm);
SetLastError(ERROR_DLL_INIT_FAILED);
pwm = NULL;
}
LeaveCriticalSection(&PROCESS_Current()->crit_section);
return pwm;
}