Author: ion Date: Wed Sep 9 14:59:29 2015 New Revision: 69149 URL: http://svn.reactos.org/svn/reactos?rev=69149&view=rev Log: [BOOTMGFW] - Fix a bunch of bugs
Modified: trunk/reactos/boot/environ/lib/misc/util.c trunk/reactos/boot/environ/lib/mm/descriptor.c trunk/reactos/boot/environ/lib/mm/pagealloc.c Modified: trunk/reactos/boot/environ/lib/misc/util.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/misc/util.c?rev=69149&r1=69148&r2=69149&view=diff ============================================================================== --- trunk/reactos/boot/environ/lib/misc/util.c [iso-8859-1] (original) +++ trunk/reactos/boot/environ/lib/misc/util.c [iso-8859-1] Wed Sep 9 14:59:29 2015 @@ -201,17 +201,17 @@ ) { 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]) Modified: trunk/reactos/boot/environ/lib/mm/descriptor.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/mm/descriptor.c?rev=69149&r1=69148&r2=69149&view=diff ============================================================================== --- trunk/reactos/boot/environ/lib/mm/descriptor.c [iso-8859-1] (original) +++ trunk/reactos/boot/environ/lib/mm/descriptor.c [iso-8859-1] Wed Sep 9 14:59:29 2015 @@ -751,7 +751,7 @@ /* 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 @@ 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 @@ } /* Save the links */ - OldFlink = OldDescriptor->ListEntry.Blink; - OldBlink = OldDescriptor->ListEntry.Flink; + OldBlink = OldDescriptor->ListEntry.Blink; + OldFlink = OldDescriptor->ListEntry.Flink; /* Make the copy */ *Descriptor = *OldDescriptor; Modified: trunk/reactos/boot/environ/lib/mm/pagealloc.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/mm/pagealloc.c?rev=69149&r1=69148&r2=69149&view=diff ============================================================================== --- trunk/reactos/boot/environ/lib/mm/pagealloc.c [iso-8859-1] (original) +++ trunk/reactos/boot/environ/lib/mm/pagealloc.c [iso-8859-1] Wed Sep 9 14:59:29 2015 @@ -84,13 +84,13 @@ ListHead = CurrentList->First; if (Request->Type & BL_MM_REQUEST_TOP_DOWN_TYPE) { + NextEntry = ListHead->Blink; + TopDown = TRUE; + } + else + { NextEntry = ListHead->Flink; TopDown = FALSE; - } - else - { - NextEntry = ListHead->Blink; - TopDown = TRUE; } /* Loop through the list */