Commit 31dd4af5 authored by Alexandre Julliard's avatar Alexandre Julliard

Don't call process attach notification during process shutdown.

Make sure we don't insert a module in the same list twice.
parent 388b9c6d
......@@ -875,6 +875,8 @@ static NTSTATUS process_attach( WINE_MODREF *wm, LPVOID lpReserved )
NTSTATUS status = STATUS_SUCCESS;
int i;
if (process_detaching) return status;
/* prevent infinite recursion in case of cyclical dependencies */
if ( ( wm->ldr.Flags & LDR_LOAD_IN_PROGRESS )
|| ( wm->ldr.Flags & LDR_PROCESS_ATTACHED ) )
......@@ -911,8 +913,9 @@ static NTSTATUS process_attach( WINE_MODREF *wm, LPVOID lpReserved )
current_modref = prev;
}
InsertTailList(&NtCurrentTeb()->Peb->LdrData->InInitializationOrderModuleList,
&wm->ldr.InInitializationOrderModuleList);
if (!wm->ldr.InInitializationOrderModuleList.Flink)
InsertTailList(&NtCurrentTeb()->Peb->LdrData->InInitializationOrderModuleList,
&wm->ldr.InInitializationOrderModuleList);
/* Remove recursion flag */
wm->ldr.Flags &= ~LDR_LOAD_IN_PROGRESS;
......
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