Commit af5745f5 authored by Bertho Stultiens's avatar Bertho Stultiens Committed by Alexandre Julliard

Attach notifications must be send after all recursive dependencies are

loaded and not before.
parent 0b52adaa
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment