Revert part of r23972. Now we can boot again

(+ fix a little bug)

svn path=/trunk/; revision=24019
This commit is contained in:
Hervé Poussineau 2006-09-10 10:26:58 +00:00
parent a9bca34078
commit 65df8c2bad
2 changed files with 7 additions and 25 deletions

View file

@ -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);

View file

@ -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);