[NTOSKRNL]

Skip all images that were loaded using MmLoadSystemImage in MiFindInitializationCode. Drivers loaded by Mm are handled in MmFreeDriverInitialization (which we currently run for boot loaded images as well, so duplicated work...). But now at least session loaded images are NOT processed this way. Because even though they can have INIT sections, they don't neccessarily like it when stuff gets removed, especially win32k doesn't like it when it's .rsrc section is being discarded due to it's section flags!

svn path=/trunk/; revision=61076
This commit is contained in:
Timo Kreuzer 2013-11-22 12:51:40 +00:00
parent cd2e06b94c
commit 746a4e93ea

View file

@ -1457,6 +1457,15 @@ MiFindInitializationCode(OUT PVOID *StartVa,
LdrEntry = CONTAINING_RECORD(NextEntry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks);
DllBase = (ULONG_PTR)LdrEntry->DllBase;
/* Only process boot loaded images. Other drivers are processed by
MmFreeDriverInitialization */
if (LdrEntry->Flags & LDRP_MM_LOADED)
{
/* Keep going */
NextEntry = NextEntry->Flink;
continue;
}
/* Get the NT header */
NtHeader = RtlImageNtHeader((PVOID)DllBase);
if (!NtHeader)
@ -2562,6 +2571,10 @@ MiSetPagingOfDriver(IN PMMPTE PointerPte,
PMMPFN Pfn1;
PAGED_CODE();
/* The page fault handler is broken and doesn't page back in! */
DPRINT1("WARNING: MiSetPagingOfDriver() called, but paging is broken! ignoring!\n");
return;
/* Get the driver's base address */
ImageBase = MiPteToAddress(PointerPte);
ASSERT(MI_IS_SESSION_IMAGE_ADDRESS(ImageBase) == FALSE);