mirror of
https://github.com/reactos/reactos.git
synced 2024-10-02 07:26:47 +00:00
Fixed the load count in LdrpDetachProcess. That made it again possible to call the dll entry with DLL_PROCESS_DETACH.
svn path=/trunk/; revision=17193
This commit is contained in:
parent
e41e25c1e1
commit
a3bc4d9c07
|
@ -104,7 +104,7 @@ static __inline LONG LdrpDecrementLoadCount(PLDR_DATA_TABLE_ENTRY Module, BOOLEA
|
|||
RtlEnterCriticalSection (NtCurrentPeb()->LoaderLock);
|
||||
}
|
||||
LoadCount = Module->LoadCount;
|
||||
if (Module->LoadCount > 0)
|
||||
if (Module->LoadCount > 0 && Module->LoadCount != 0xFFFF)
|
||||
{
|
||||
Module->LoadCount--;
|
||||
}
|
||||
|
@ -2397,7 +2397,7 @@ LdrpDetachProcess(BOOLEAN UnloadAll)
|
|||
while (Entry != ModuleListHead)
|
||||
{
|
||||
Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InInitializationOrderModuleList);
|
||||
if (((UnloadAll && Module->LoadCount <= 0) || Module->LoadCount == 0) &&
|
||||
if (((UnloadAll && Module->LoadCount == 0xFFFF) || Module->LoadCount == 0) &&
|
||||
Module->Flags & LDRP_ENTRY_PROCESSED &&
|
||||
!(Module->Flags & LDRP_UNLOAD_IN_PROGRESS))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue