From f3ff195d8f18c21c2695dfee6548cf014f978fbb Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Wed, 9 Sep 2015 14:59:29 +0000 Subject: [PATCH] [BOOTMGFW] - Fix a bunch of bugs svn path=/trunk/; revision=69149 --- reactos/boot/environ/lib/misc/util.c | 6 +++--- reactos/boot/environ/lib/mm/descriptor.c | 8 ++++---- reactos/boot/environ/lib/mm/pagealloc.c | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/reactos/boot/environ/lib/misc/util.c b/reactos/boot/environ/lib/misc/util.c index 2bd951a3ae6..fbbacea0f99 100644 --- a/reactos/boot/environ/lib/misc/util.c +++ b/reactos/boot/environ/lib/misc/util.c @@ -201,17 +201,17 @@ BlTblFindEntry ( ) { PVOID Entry = NULL; - ULONG Index = 0; + ULONG Index; BOOLEAN Result; /* Check for invalid parameters */ - if (!(Table) || !(EntryIndex) || !(Count)) + if (!(Table) || !(EntryIndex)) { return Entry; } /* Loop each entry in the table */ - while (Index < Count) + for (Index = 0; Index < Count; Index++) { /* Check if this entry is filled out */ if (Table[Index]) diff --git a/reactos/boot/environ/lib/mm/descriptor.c b/reactos/boot/environ/lib/mm/descriptor.c index 7913ad0febe..866721e77c0 100644 --- a/reactos/boot/environ/lib/mm/descriptor.c +++ b/reactos/boot/environ/lib/mm/descriptor.c @@ -751,7 +751,7 @@ MmMdFindSatisfyingRegion ( /* Bail out if the type doesn't match */ if (Descriptor->Type != MemoryType) { - //EarlyPrint(L"Incorrect descriptor type\r\n"); + //EfiPrintf(L"Incorrect descriptor type: %lx %lx\r\n", Descriptor->Type, MemoryType); return FALSE; } @@ -761,7 +761,7 @@ MmMdFindSatisfyingRegion ( NewDescriptor->Type = Descriptor->Type; NewDescriptor->VirtualPage = VirtualPage; NewDescriptor->Flags = Descriptor->Flags; - //EarlyPrint(L"Found a matching descriptor: %08I64X with %08I64X pages\r\n", BasePage, Pages); + //EfiPrintf(L"Found a matching descriptor: %08I64X with %08I64X pages\r\n", BasePage, Pages); return TRUE; } @@ -795,8 +795,8 @@ MmMdFreeGlobalDescriptors ( } /* Save the links */ - OldFlink = OldDescriptor->ListEntry.Blink; - OldBlink = OldDescriptor->ListEntry.Flink; + OldBlink = OldDescriptor->ListEntry.Blink; + OldFlink = OldDescriptor->ListEntry.Flink; /* Make the copy */ *Descriptor = *OldDescriptor; diff --git a/reactos/boot/environ/lib/mm/pagealloc.c b/reactos/boot/environ/lib/mm/pagealloc.c index 120f5014e84..017cb52ee1f 100644 --- a/reactos/boot/environ/lib/mm/pagealloc.c +++ b/reactos/boot/environ/lib/mm/pagealloc.c @@ -84,13 +84,13 @@ MmPapAllocateRegionFromMdl ( ListHead = CurrentList->First; if (Request->Type & BL_MM_REQUEST_TOP_DOWN_TYPE) { - NextEntry = ListHead->Flink; - TopDown = FALSE; + NextEntry = ListHead->Blink; + TopDown = TRUE; } else { - NextEntry = ListHead->Blink; - TopDown = TRUE; + NextEntry = ListHead->Flink; + TopDown = FALSE; } /* Loop through the list */