- LdrpAttachToProcess() should be called only once per process, so added the check. This fixes a crash when trying to start any app using MFC42.DLL, including 1C.

See issue #2730 for more details.

svn path=/trunk/; revision=29636
This commit is contained in:
Aleksey Bragin 2007-10-17 10:01:03 +00:00
parent 6d8670a692
commit db0466d5e3

View file

@ -748,9 +748,12 @@ LdrLoadDll (IN PWSTR SearchPath OPTIONAL,
if (NT_SUCCESS(Status) &&
(!LoadFlags || 0 == (*LoadFlags & LOAD_LIBRARY_AS_DATAFILE)))
{
RtlEnterCriticalSection(Peb->LoaderLock);
Status = LdrpAttachProcess();
RtlLeaveCriticalSection(Peb->LoaderLock);
if (!(Module->Flags & LDRP_PROCESS_ATTACH_CALLED))
{
RtlEnterCriticalSection(Peb->LoaderLock);
Status = LdrpAttachProcess();
RtlLeaveCriticalSection(Peb->LoaderLock);
}
}
if ((!Module) && (NT_SUCCESS(Status)))