From 65df8c2badf0c9ebd4f2eca359f88340c726bcf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Sun, 10 Sep 2006 10:26:58 +0000 Subject: [PATCH] Revert part of r23972. Now we can boot again (+ fix a little bug) svn path=/trunk/; revision=24019 --- reactos/ntoskrnl/ldr/loader.c | 12 +++--------- reactos/ntoskrnl/mm/section.c | 20 ++++---------------- 2 files changed, 7 insertions(+), 25 deletions(-) diff --git a/reactos/ntoskrnl/ldr/loader.c b/reactos/ntoskrnl/ldr/loader.c index 0c320666754..19324d1f9a5 100644 --- a/reactos/ntoskrnl/ldr/loader.c +++ b/reactos/ntoskrnl/ldr/loader.c @@ -634,10 +634,7 @@ LdrLookupPageProtection ( for (Idx = 0; Idx < PEFileHeader->NumberOfSections && (!Write || !Execute); Idx++) { Characteristics = PESectionHeaders[Idx].Characteristics; - // - // This field is RESERVED and not respected by Windows - // - //if (!(Characteristics & IMAGE_SCN_TYPE_NOLOAD)) + if (!(Characteristics & IMAGE_SCN_TYPE_NOLOAD)) { Length = max(PESectionHeaders[Idx].Misc.VirtualSize, PESectionHeaders[Idx].SizeOfRawData); BaseAddress = PESectionHeaders[Idx].VirtualAddress + (char*)DriverBase; @@ -734,10 +731,7 @@ LdrPEProcessModule( DriverSize = 0; for (Idx = 0; Idx < PENtHeaders->FileHeader.NumberOfSections; Idx++) { - // - // This field is RESERVED and not respected by Windows - // - //if (!(PESectionHeaders[Idx].Characteristics & IMAGE_SCN_TYPE_NOLOAD)) + if (!(PESectionHeaders[Idx].Characteristics & IMAGE_SCN_TYPE_NOLOAD)) { CurrentSize = PESectionHeaders[Idx].VirtualAddress + PESectionHeaders[Idx].Misc.VirtualSize; DriverSize = max(DriverSize, CurrentSize); @@ -1154,7 +1148,7 @@ LdrPEGetOrLoadModule ( NameString.MaximumLength = NameString.Length = PathLength + DriverName.Length; /* NULL-terminate */ - NameString.MaximumLength++; + NameString.MaximumLength += sizeof(WCHAR); NameBuffer[NameString.Length / sizeof(WCHAR)] = 0; Status = LdrLoadModule(&NameString, ImportedModule); diff --git a/reactos/ntoskrnl/mm/section.c b/reactos/ntoskrnl/mm/section.c index 67cf0bb0a6e..d6e5dbdd4b2 100644 --- a/reactos/ntoskrnl/mm/section.c +++ b/reactos/ntoskrnl/mm/section.c @@ -3994,10 +3994,7 @@ MmUnmapViewOfSection(PEPROCESS Process, * and calculate the image base address */ for (i = 0; i < NrSegments; i++) { - // - // This field is RESERVED and not respected by Windows - // - //if (!(SectionSegments[i].Characteristics & IMAGE_SCN_TYPE_NOLOAD)) + if (!(SectionSegments[i].Characteristics & IMAGE_SCN_TYPE_NOLOAD)) { if (Segment == &SectionSegments[i]) { @@ -4013,10 +4010,7 @@ MmUnmapViewOfSection(PEPROCESS Process, for (i = 0; i < NrSegments; i++) { - // - // This field is RESERVED and not respected by Windows - // - //if (!(SectionSegments[i].Characteristics & IMAGE_SCN_TYPE_NOLOAD)) + if (!(SectionSegments[i].Characteristics & IMAGE_SCN_TYPE_NOLOAD)) { PVOID SBaseAddress = (PVOID) ((char*)ImageBaseAddress + (ULONG_PTR)SectionSegments[i].VirtualAddress); @@ -4482,10 +4476,7 @@ MmMapViewOfSection(IN PVOID SectionObject, ImageSize = 0; for (i = 0; i < NrSegments; i++) { - // - // This field is RESERVED and not respected by Windows - // - //if (!(SectionSegments[i].Characteristics & IMAGE_SCN_TYPE_NOLOAD)) + if (!(SectionSegments[i].Characteristics & IMAGE_SCN_TYPE_NOLOAD)) { ULONG_PTR MaxExtent; MaxExtent = (ULONG_PTR)SectionSegments[i].VirtualAddress + @@ -4515,10 +4506,7 @@ MmMapViewOfSection(IN PVOID SectionObject, for (i = 0; i < NrSegments; i++) { - // - // This field is RESERVED and not respected by Windows - // - //if (!(SectionSegments[i].Characteristics & IMAGE_SCN_TYPE_NOLOAD)) + if (!(SectionSegments[i].Characteristics & IMAGE_SCN_TYPE_NOLOAD)) { PVOID SBaseAddress = (PVOID) ((char*)ImageBase + (ULONG_PTR)SectionSegments[i].VirtualAddress);