Author: tkreuzer Date: Fri Feb 10 19:10:17 2012 New Revision: 55529
URL: http://svn.reactos.org/svn/reactos?rev=55529&view=rev Log: [FREELDR] Fix 64 bit warnings Patch by Samuel Serapion, slightly modified by me
Modified: trunk/reactos/boot/freeldr/freeldr/arch/amd64/winldr.c trunk/reactos/boot/freeldr/freeldr/arch/arm/winldr.c trunk/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c trunk/reactos/boot/freeldr/freeldr/arch/i386/winldr.c trunk/reactos/boot/freeldr/freeldr/cache/blocklist.c trunk/reactos/boot/freeldr/freeldr/cache/cache.c trunk/reactos/boot/freeldr/freeldr/fs/fs.c trunk/reactos/boot/freeldr/freeldr/include/cache.h trunk/reactos/boot/freeldr/freeldr/include/mm.h trunk/reactos/boot/freeldr/freeldr/include/winldr.h trunk/reactos/boot/freeldr/freeldr/inifile/parse.c trunk/reactos/boot/freeldr/freeldr/mm/heap.c trunk/reactos/boot/freeldr/freeldr/mm/meminit.c trunk/reactos/boot/freeldr/freeldr/mm/mm.c trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c trunk/reactos/boot/freeldr/freeldr/reactos/registry.c trunk/reactos/boot/freeldr/freeldr/ui/tui.c trunk/reactos/boot/freeldr/freeldr/ui/tuimenu.c trunk/reactos/boot/freeldr/freeldr/ui/ui.c trunk/reactos/boot/freeldr/freeldr/windows/peloader.c trunk/reactos/boot/freeldr/freeldr/windows/wlmemory.c trunk/reactos/boot/freeldr/freeldr/windows/wlregistry.c
Modified: trunk/reactos/boot/freeldr/freeldr/arch/amd64/winldr.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/a... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/amd64/winldr.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/amd64/winldr.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -145,10 +145,10 @@ return TRUE; }
-ULONG -MempMapRangeOfPages(ULONG64 VirtualAddress, ULONG64 PhysicalAddress, ULONG cPages) -{ - ULONG i; +PFN_NUMBER +MempMapRangeOfPages(ULONG64 VirtualAddress, ULONG64 PhysicalAddress, PFN_NUMBER cPages) +{ + PFN_NUMBER i;
for (i = 0; i < cPages; i++) { @@ -165,8 +165,8 @@ }
BOOLEAN -MempSetupPaging(IN ULONG StartPage, - IN ULONG NumberOfPages, +MempSetupPaging(IN PFN_NUMBER StartPage, + IN PFN_NUMBER NumberOfPages, IN BOOLEAN KernelMapping) { TRACE(">>> MempSetupPaging(0x%lx, %ld, %p)\n", @@ -196,7 +196,7 @@ }
VOID -MempUnmapPage(ULONG Page) +MempUnmapPage(PFN_NUMBER Page) { // TRACE(">>> MempUnmapPage\n"); }
Modified: trunk/reactos/boot/freeldr/freeldr/arch/arm/winldr.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/a... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/arm/winldr.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/arm/winldr.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -80,14 +80,14 @@ /* FUNCTIONS **************************************************************/
BOOLEAN -MempSetupPaging(IN ULONG StartPage, - IN ULONG NumberOfPages) +MempSetupPaging(IN PFN_NUMBER StartPage, + IN PFN_COUNT NumberOfPages) { return TRUE; }
VOID -MempUnmapPage(IN ULONG Page) +MempUnmapPage(IN PFN_NUMBER Page) { return; }
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -416,7 +416,7 @@ CRTC = (CRTC | 0xE2);
/* (write) */ - WRITE_PORT_UCHAR((PUCHAR)0x03C2, CRTC); + WRITE_PORT_UCHAR((PUCHAR)0x03C2, (UCHAR)CRTC); }
static VOID
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/winldr.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/winldr.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/winldr.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -143,13 +143,13 @@ }
BOOLEAN -MempSetupPaging(IN ULONG StartPage, - IN ULONG NumberOfPages, +MempSetupPaging(IN PFN_NUMBER StartPage, + IN PFN_COUNT NumberOfPages, IN BOOLEAN KernelMapping) { PHARDWARE_PTE PhysicalPT; PHARDWARE_PTE KernelPT; - ULONG Entry, Page; + PFN_COUNT Entry, Page;
TRACE("MempSetupPaging: SP 0x%X, Number: 0x%X, Kernel: %s\n", StartPage, NumberOfPages, KernelMapping ? "yes" : "no"); @@ -199,10 +199,10 @@ }
VOID -MempUnmapPage(ULONG Page) +MempUnmapPage(PFN_NUMBER Page) { PHARDWARE_PTE KernelPT; - ULONG Entry = (Page >> 10) + (KSEG0_BASE >> 22); + PFN_NUMBER Entry = (Page >> 10) + (KSEG0_BASE >> 22);
/* Don't unmap hyperspace or HAL entries */ if (Entry == HYPER_SPACE_ENTRY || Entry == 1023)
Modified: trunk/reactos/boot/freeldr/freeldr/cache/blocklist.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/cache/... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/cache/blocklist.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/cache/blocklist.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -175,7 +175,7 @@
VOID CacheInternalCheckCacheSizeLimits(PCACHE_DRIVE CacheDrive) { - ULONG NewCacheSize; + SIZE_T NewCacheSize;
TRACE("CacheInternalCheckCacheSizeLimits()\n");
Modified: trunk/reactos/boot/freeldr/freeldr/cache/cache.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/cache/... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/cache/cache.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/cache/cache.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -31,8 +31,8 @@ BOOLEAN CacheManagerInitialized = FALSE; BOOLEAN CacheManagerDataInvalid = FALSE; ULONG CacheBlockCount = 0; -ULONG CacheSizeLimit = 0; -ULONG CacheSizeCurrent = 0; +SIZE_T CacheSizeLimit = 0; +SIZE_T CacheSizeCurrent = 0;
BOOLEAN CacheInitializeDrive(UCHAR DriveNumber) {
Modified: trunk/reactos/boot/freeldr/freeldr/fs/fs.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/fs/fs.... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/fs/fs.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/fs/fs.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -248,14 +248,14 @@
LONG ArcOpen(CHAR* Path, OPENMODE OpenMode, ULONG* FileId) { - ULONG i, ret; + ULONG Count, i, ret; PLIST_ENTRY pEntry; DEVICE* pDevice; CHAR* DeviceName; CHAR* FileName; CHAR* p; CHAR* q; - ULONG dwCount, dwLength; + SIZE_T Length; OPENMODE DeviceOpenMode; ULONG DeviceId;
@@ -271,16 +271,16 @@ FileName++;
/* Count number of "()", which needs to be replaced by "(0)" */ - dwCount = 0; + Count = 0; for (p = Path; p != FileName; p++) if (*p == '(' && *(p + 1) == ')') - dwCount++; + Count++;
/* Duplicate device name, and replace "()" by "(0)" (if required) */ - dwLength = FileName - Path + dwCount; - if (dwCount != 0) + Length = FileName - Path + Count; + if (Count != 0) { - DeviceName = MmHeapAlloc(FileName - Path + dwCount); + DeviceName = MmHeapAlloc(FileName - Path + Count); if (!DeviceName) return ENOMEM; for (p = Path, q = DeviceName; p != FileName; p++) @@ -302,7 +302,7 @@ while (pEntry != &DeviceListHead) { pDevice = CONTAINING_RECORD(pEntry, DEVICE, ListEntry); - if (strncmp(pDevice->Prefix, DeviceName, dwLength) == 0) + if (strncmp(pDevice->Prefix, DeviceName, Length) == 0) { /* OK, device found. It is already opened? */ if (pDevice->ReferenceCount == 0) @@ -412,18 +412,18 @@ VOID FsRegisterDevice(CHAR* Prefix, const DEVVTBL* FuncTable) { DEVICE* pNewEntry; - ULONG dwLength; + SIZE_T Length;
TRACE("FsRegisterDevice() Prefix = %s\n", Prefix);
- dwLength = strlen(Prefix) + 1; - pNewEntry = MmHeapAlloc(sizeof(DEVICE) + dwLength); + Length = strlen(Prefix) + 1; + pNewEntry = MmHeapAlloc(sizeof(DEVICE) + Length); if (!pNewEntry) return; pNewEntry->FuncTable = FuncTable; pNewEntry->ReferenceCount = 0; pNewEntry->Prefix = (CHAR*)(pNewEntry + 1); - memcpy(pNewEntry->Prefix, Prefix, dwLength); + memcpy(pNewEntry->Prefix, Prefix, Length);
InsertHeadList(&DeviceListHead, &pNewEntry->ListEntry); }
Modified: trunk/reactos/boot/freeldr/freeldr/include/cache.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/cache.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/cache.h [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -67,8 +67,8 @@ extern CACHE_DRIVE CacheManagerDrive; extern BOOLEAN CacheManagerInitialized; extern ULONG CacheBlockCount; -extern ULONG CacheSizeLimit; -extern ULONG CacheSizeCurrent; +extern SIZE_T CacheSizeLimit; +extern SIZE_T CacheSizeCurrent;
/////////////////////////////////////////////////////////////////////////////////////// //
Modified: trunk/reactos/boot/freeldr/freeldr/include/mm.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/mm.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/mm.h [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -60,7 +60,7 @@ typedef struct { TYPE_OF_MEMORY PageAllocated; // Type of allocated memory (LoaderFree if this memory is free) - ULONG PageAllocationLength; // Number of pages allocated (or zero if this isn't the first page in the chain) + PFN_NUMBER PageAllocationLength; // Number of pages allocated (or zero if this isn't the first page in the chain) } PAGE_LOOKUP_TABLE_ITEM, *PPAGE_LOOKUP_TABLE_ITEM; #include <poppack.h>
@@ -72,38 +72,38 @@ #define DUMP_MEM_MAP_ON_VERIFY 0
extern PVOID PageLookupTableAddress; -extern ULONG TotalPagesInLookupTable; -extern ULONG FreePagesInLookupTable; -extern ULONG LastFreePageHint; +extern PFN_NUMBER TotalPagesInLookupTable; +extern PFN_NUMBER FreePagesInLookupTable; +extern PFN_NUMBER LastFreePageHint;
#if DBG PCSTR MmGetSystemMemoryMapTypeString(TYPE_OF_MEMORY Type); #endif
-ULONG MmGetPageNumberFromAddress(PVOID Address); // Returns the page number that contains a linear address -ULONG MmGetAddressablePageCountIncludingHoles(VOID); // Returns the count of addressable pages from address zero including any memory holes and reserved memory regions -PVOID MmFindLocationForPageLookupTable(ULONG TotalPageCount); // Returns the address for a memory chunk big enough to hold the page lookup table (starts search from end of memory) -VOID MmInitPageLookupTable(PVOID PageLookupTable, ULONG TotalPageCount); // Inits the page lookup table according to the memory types in the memory map -VOID MmMarkPagesInLookupTable(PVOID PageLookupTable, ULONG StartPage, ULONG PageCount, TYPE_OF_MEMORY PageAllocated); // Marks the specified pages as allocated or free in the lookup table -VOID MmAllocatePagesInLookupTable(PVOID PageLookupTable, ULONG StartPage, ULONG PageCount, TYPE_OF_MEMORY MemoryType); // Allocates the specified pages in the lookup table -ULONG MmCountFreePagesInLookupTable(PVOID PageLookupTable, ULONG TotalPageCount); // Returns the number of free pages in the lookup table -ULONG MmFindAvailablePages(PVOID PageLookupTable, ULONG TotalPageCount, ULONG PagesNeeded, BOOLEAN FromEnd); // Returns the page number of the first available page range from the beginning or end of memory -ULONG MmFindAvailablePagesBeforePage(PVOID PageLookupTable, ULONG TotalPageCount, ULONG PagesNeeded, ULONG LastPage); // Returns the page number of the first available page range before the specified page -VOID MmUpdateLastFreePageHint(PVOID PageLookupTable, ULONG TotalPageCount); // Sets the LastFreePageHint to the last usable page of memory -BOOLEAN MmAreMemoryPagesAvailable(PVOID PageLookupTable, ULONG TotalPageCount, PVOID PageAddress, ULONG PageCount); // Returns TRUE if the specified pages of memory are available, otherwise FALSE -VOID MmSetMemoryType(PVOID MemoryAddress, ULONG MemorySize, TYPE_OF_MEMORY NewType); // Use with EXTREME caution! +PFN_NUMBER MmGetPageNumberFromAddress(PVOID Address); // Returns the page number that contains a linear address +PFN_NUMBER MmGetAddressablePageCountIncludingHoles(VOID); // Returns the count of addressable pages from address zero including any memory holes and reserved memory regions +PVOID MmFindLocationForPageLookupTable(PFN_NUMBER TotalPageCount); // Returns the address for a memory chunk big enough to hold the page lookup table (starts search from end of memory) +VOID MmInitPageLookupTable(PVOID PageLookupTable, PFN_NUMBER TotalPageCount); // Inits the page lookup table according to the memory types in the memory map +VOID MmMarkPagesInLookupTable(PVOID PageLookupTable, PFN_NUMBER StartPage, PFN_NUMBER PageCount, TYPE_OF_MEMORY PageAllocated); // Marks the specified pages as allocated or free in the lookup table +VOID MmAllocatePagesInLookupTable(PVOID PageLookupTable, PFN_NUMBER StartPage, PFN_NUMBER PageCount, TYPE_OF_MEMORY MemoryType); // Allocates the specified pages in the lookup table +PFN_NUMBER MmCountFreePagesInLookupTable(PVOID PageLookupTable, PFN_NUMBER TotalPageCount); // Returns the number of free pages in the lookup table +PFN_NUMBER MmFindAvailablePages(PVOID PageLookupTable, PFN_NUMBER TotalPageCount, PFN_NUMBER PagesNeeded, BOOLEAN FromEnd); // Returns the page number of the first available page range from the beginning or end of memory +PFN_NUMBER MmFindAvailablePagesBeforePage(PVOID PageLookupTable, PFN_NUMBER TotalPageCount, PFN_NUMBER PagesNeeded, PFN_NUMBER LastPage); // Returns the page number of the first available page range before the specified page +VOID MmUpdateLastFreePageHint(PVOID PageLookupTable, PFN_NUMBER TotalPageCount); // Sets the LastFreePageHint to the last usable page of memory +BOOLEAN MmAreMemoryPagesAvailable(PVOID PageLookupTable, PFN_NUMBER TotalPageCount, PVOID PageAddress, PFN_NUMBER PageCount); // Returns TRUE if the specified pages of memory are available, otherwise FALSE +VOID MmSetMemoryType(PVOID MemoryAddress, SIZE_T MemorySize, TYPE_OF_MEMORY NewType); // Use with EXTREME caution!
-PPAGE_LOOKUP_TABLE_ITEM MmGetMemoryMap(ULONG *NoEntries); // Returns a pointer to the memory mapping table and a number of entries in it +PPAGE_LOOKUP_TABLE_ITEM MmGetMemoryMap(PFN_NUMBER *NoEntries); // Returns a pointer to the memory mapping table and a number of entries in it
//BOOLEAN MmInitializeMemoryManager(ULONG LowMemoryStart, ULONG LowMemoryLength); BOOLEAN MmInitializeMemoryManager(VOID); VOID MmInitializeHeap(PVOID PageLookupTable); -PVOID MmAllocateMemory(ULONG MemorySize); -PVOID MmAllocateMemoryWithType(ULONG MemorySize, TYPE_OF_MEMORY MemoryType); +PVOID MmAllocateMemory(SIZE_T MemorySize); +PVOID MmAllocateMemoryWithType(SIZE_T MemorySize, TYPE_OF_MEMORY MemoryType); VOID MmFreeMemory(PVOID MemoryPointer); -PVOID MmAllocateMemoryAtAddress(ULONG MemorySize, PVOID DesiredAddress, TYPE_OF_MEMORY MemoryType); -PVOID MmAllocateHighestMemoryBelowAddress(ULONG MemorySize, PVOID DesiredAddress, TYPE_OF_MEMORY MemoryType); +PVOID MmAllocateMemoryAtAddress(SIZE_T MemorySize, PVOID DesiredAddress, TYPE_OF_MEMORY MemoryType); +PVOID MmAllocateHighestMemoryBelowAddress(SIZE_T MemorySize, PVOID DesiredAddress, TYPE_OF_MEMORY MemoryType);
PVOID MmHeapAlloc(SIZE_T MemorySize); VOID MmHeapFree(PVOID MemoryPointer); @@ -114,7 +114,7 @@
PVOID HeapCreate( - ULONG MaximumSize, + SIZE_T MaximumSize, TYPE_OF_MEMORY MemoryType);
VOID
Modified: trunk/reactos/boot/freeldr/freeldr/include/winldr.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/winldr.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/winldr.h [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -162,12 +162,12 @@ MempAllocatePageTables();
BOOLEAN -MempSetupPaging(IN ULONG StartPage, - IN ULONG NumberOfPages, +MempSetupPaging(IN PFN_NUMBER StartPage, + IN PFN_NUMBER NumberOfPages, IN BOOLEAN KernelMapping);
VOID -MempUnmapPage(ULONG Page); +MempUnmapPage(PFN_NUMBER Page);
VOID MempDump();
Modified: trunk/reactos/boot/freeldr/freeldr/inifile/parse.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inifil... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/inifile/parse.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/inifile/parse.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -73,7 +73,7 @@
// Get the line of data CurrentOffset = IniGetNextLine(IniFileData, IniFileSize, IniFileLine, IniFileLineSize, CurrentOffset); - LineLength = strlen(IniFileLine); + LineLength = (ULONG)strlen(IniFileLine);
// If it is a blank line or a comment then skip it if (IniIsLineEmpty(IniFileLine, LineLength) || IniIsCommentLine(IniFileLine, LineLength))
Modified: trunk/reactos/boot/freeldr/freeldr/mm/heap.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/mm/hea... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/mm/heap.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/mm/heap.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -30,8 +30,8 @@
typedef struct _BLOCK_DATA { - ULONG Flink; - ULONG Blink; + ULONG_PTR Flink; + ULONG_PTR Blink; } BLOCK_DATA, *PBLOCK_DATA;
typedef struct _HEAP_BLOCK @@ -44,26 +44,26 @@
typedef struct _HEAP { - ULONG MaximumSize; - ULONG CurrentAllocBytes; - ULONG MaxAllocBytes; + SIZE_T MaximumSize; + SIZE_T CurrentAllocBytes; + SIZE_T MaxAllocBytes; ULONG NumAllocs; ULONG NumFrees; - ULONG LargestAllocation; + SIZE_T LargestAllocation; ULONGLONG AllocationTime; ULONGLONG FreeTime; - ULONG TerminatingBlock; + ULONG_PTR TerminatingBlock; HEAP_BLOCK Blocks; } HEAP, *PHEAP;
PVOID HeapCreate( - ULONG MaximumSize, + SIZE_T MaximumSize, TYPE_OF_MEMORY MemoryType) { PHEAP Heap; PHEAP_BLOCK Block; - ULONG Remaining; + SIZE_T Remaining; USHORT PreviousSize; TRACE("HeapCreate(MemoryType=%ld)\n", MemoryType);
@@ -136,7 +136,7 @@ /* Mark all pages as firmware temporary, so they are free for the kernel */ MmMarkPagesInLookupTable(PageLookupTableAddress, (ULONG_PTR)Heap / MM_PAGE_SIZE, - Heap->MaximumSize / MM_PAGE_SIZE, + (PFN_COUNT)(Heap->MaximumSize / MM_PAGE_SIZE), LoaderFirmwareTemporary); }
@@ -147,7 +147,7 @@ PHEAP Heap = HeapHandle; PHEAP_BLOCK Block; PUCHAR StartAddress, EndAddress; - ULONG FreePages, AllFreePages = 0; + PFN_COUNT FreePages, AllFreePages = 0; TRACE("HeapRelease(%p)\n", HeapHandle);
/* Loop all heap chunks */ @@ -176,7 +176,7 @@ EndAddress = ALIGN_DOWN_POINTER_BY(Block->Data, PAGE_SIZE); }
- FreePages = (EndAddress - StartAddress) / MM_PAGE_SIZE; + FreePages = (PFN_COUNT)((EndAddress - StartAddress) / MM_PAGE_SIZE); AllFreePages += FreePages;
/* Now mark the pages free */ @@ -449,7 +449,7 @@ }
PVOID -MmHeapAlloc(ULONG MemorySize) +MmHeapAlloc(SIZE_T MemorySize) { return HeapAllocate(FrLdrDefaultHeap, MemorySize, 'pHmM'); }
Modified: trunk/reactos/boot/freeldr/freeldr/mm/meminit.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/mm/mem... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/mm/meminit.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/mm/meminit.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -53,11 +53,11 @@ #endif
PVOID PageLookupTableAddress = NULL; -ULONG TotalPagesInLookupTable = 0; -ULONG FreePagesInLookupTable = 0; -ULONG LastFreePageHint = 0; -ULONG MmLowestPhysicalPage = 0xFFFFFFFF; -ULONG MmHighestPhysicalPage = 0; +PFN_NUMBER TotalPagesInLookupTable = 0; +PFN_NUMBER FreePagesInLookupTable = 0; +PFN_NUMBER LastFreePageHint = 0; +PFN_NUMBER MmLowestPhysicalPage = 0xFFFFFFFF; +PFN_NUMBER MmHighestPhysicalPage = 0;
PFREELDR_MEMORY_DESCRIPTOR BiosMemoryMap; ULONG BiosMemoryMapEntryCount; @@ -232,15 +232,15 @@ } #endif
-ULONG MmGetPageNumberFromAddress(PVOID Address) +PFN_NUMBER MmGetPageNumberFromAddress(PVOID Address) { return ((ULONG_PTR)Address) / MM_PAGE_SIZE; }
-ULONG MmGetAddressablePageCountIncludingHoles(VOID) +PFN_NUMBER MmGetAddressablePageCountIncludingHoles(VOID) { const FREELDR_MEMORY_DESCRIPTOR* MemoryDescriptor = NULL; - ULONG PageCount; + PFN_NUMBER PageCount;
// // Go through the whole memory map to get max address @@ -277,12 +277,12 @@ return PageCount; }
-PVOID MmFindLocationForPageLookupTable(ULONG TotalPageCount) +PVOID MmFindLocationForPageLookupTable(PFN_NUMBER TotalPageCount) { const FREELDR_MEMORY_DESCRIPTOR* MemoryDescriptor = NULL; - ULONG PageLookupTableSize; - ULONG PageLookupTablePages; - ULONG PageLookupTableStartPage = 0; + SIZE_T PageLookupTableSize; + PFN_NUMBER PageLookupTablePages; + PFN_NUMBER PageLookupTableStartPage = 0; PVOID PageLookupTableMemAddress = NULL;
// Calculate how much pages we need to keep the page lookup table @@ -316,11 +316,11 @@ return PageLookupTableMemAddress; }
-VOID MmInitPageLookupTable(PVOID PageLookupTable, ULONG TotalPageCount) +VOID MmInitPageLookupTable(PVOID PageLookupTable, PFN_NUMBER TotalPageCount) { const FREELDR_MEMORY_DESCRIPTOR* MemoryDescriptor = NULL; - ULONG PageLookupTableStartPage; - ULONG PageLookupTablePageCount; + PFN_NUMBER PageLookupTableStartPage; + PFN_NUMBER PageLookupTablePageCount;
TRACE("MmInitPageLookupTable()\n");
@@ -359,10 +359,10 @@ MmMarkPagesInLookupTable(PageLookupTable, PageLookupTableStartPage, PageLookupTablePageCount, LoaderFirmwareTemporary); }
-VOID MmMarkPagesInLookupTable(PVOID PageLookupTable, ULONG StartPage, ULONG PageCount, TYPE_OF_MEMORY PageAllocated) -{ - PPAGE_LOOKUP_TABLE_ITEM RealPageLookupTable = (PPAGE_LOOKUP_TABLE_ITEM)PageLookupTable; - ULONG Index; +VOID MmMarkPagesInLookupTable(PVOID PageLookupTable, PFN_NUMBER StartPage, PFN_NUMBER PageCount, TYPE_OF_MEMORY PageAllocated) +{ + PPAGE_LOOKUP_TABLE_ITEM RealPageLookupTable = (PPAGE_LOOKUP_TABLE_ITEM)PageLookupTable; + PFN_NUMBER Index; TRACE("MmMarkPagesInLookupTable()\n");
/* Validate the range */ @@ -389,10 +389,10 @@ TRACE("MmMarkPagesInLookupTable() Done\n"); }
-VOID MmAllocatePagesInLookupTable(PVOID PageLookupTable, ULONG StartPage, ULONG PageCount, TYPE_OF_MEMORY MemoryType) +VOID MmAllocatePagesInLookupTable(PVOID PageLookupTable, PFN_NUMBER StartPage, PFN_NUMBER PageCount, TYPE_OF_MEMORY MemoryType) { PPAGE_LOOKUP_TABLE_ITEM RealPageLookupTable = (PPAGE_LOOKUP_TABLE_ITEM)PageLookupTable; - ULONG Index; + PFN_NUMBER Index;
StartPage -= MmLowestPhysicalPage; for (Index=StartPage; Index<(StartPage+PageCount); Index++) @@ -402,11 +402,11 @@ } }
-ULONG MmCountFreePagesInLookupTable(PVOID PageLookupTable, ULONG TotalPageCount) +PFN_NUMBER MmCountFreePagesInLookupTable(PVOID PageLookupTable, PFN_NUMBER TotalPageCount) { PPAGE_LOOKUP_TABLE_ITEM RealPageLookupTable = (PPAGE_LOOKUP_TABLE_ITEM)PageLookupTable; - ULONG Index; - ULONG FreePageCount; + PFN_NUMBER Index; + PFN_NUMBER FreePageCount;
FreePageCount = 0; for (Index=0; Index<TotalPageCount; Index++) @@ -420,11 +420,11 @@ return FreePageCount; }
-ULONG MmFindAvailablePages(PVOID PageLookupTable, ULONG TotalPageCount, ULONG PagesNeeded, BOOLEAN FromEnd) +PFN_NUMBER MmFindAvailablePages(PVOID PageLookupTable, PFN_NUMBER TotalPageCount, PFN_NUMBER PagesNeeded, BOOLEAN FromEnd) { PPAGE_LOOKUP_TABLE_ITEM RealPageLookupTable = (PPAGE_LOOKUP_TABLE_ITEM)PageLookupTable; - ULONG AvailablePagesSoFar; - ULONG Index; + PFN_NUMBER AvailablePagesSoFar; + PFN_NUMBER Index;
if (LastFreePageHint > TotalPageCount) { @@ -479,11 +479,11 @@ return 0; }
-ULONG MmFindAvailablePagesBeforePage(PVOID PageLookupTable, ULONG TotalPageCount, ULONG PagesNeeded, ULONG LastPage) +PFN_NUMBER MmFindAvailablePagesBeforePage(PVOID PageLookupTable, PFN_NUMBER TotalPageCount, PFN_NUMBER PagesNeeded, PFN_NUMBER LastPage) { PPAGE_LOOKUP_TABLE_ITEM RealPageLookupTable = (PPAGE_LOOKUP_TABLE_ITEM)PageLookupTable; - ULONG AvailablePagesSoFar; - ULONG Index; + PFN_NUMBER AvailablePagesSoFar; + PFN_NUMBER Index;
if (LastPage > TotalPageCount) { @@ -512,10 +512,10 @@ return 0; }
-VOID MmUpdateLastFreePageHint(PVOID PageLookupTable, ULONG TotalPageCount) +VOID MmUpdateLastFreePageHint(PVOID PageLookupTable, PFN_NUMBER TotalPageCount) { PPAGE_LOOKUP_TABLE_ITEM RealPageLookupTable = (PPAGE_LOOKUP_TABLE_ITEM)PageLookupTable; - ULONG Index; + PFN_NUMBER Index;
for (Index=TotalPageCount-1; Index>0; Index--) { @@ -527,11 +527,11 @@ } }
-BOOLEAN MmAreMemoryPagesAvailable(PVOID PageLookupTable, ULONG TotalPageCount, PVOID PageAddress, ULONG PageCount) +BOOLEAN MmAreMemoryPagesAvailable(PVOID PageLookupTable, PFN_NUMBER TotalPageCount, PVOID PageAddress, PFN_NUMBER PageCount) { PPAGE_LOOKUP_TABLE_ITEM RealPageLookupTable = (PPAGE_LOOKUP_TABLE_ITEM)PageLookupTable; - ULONG StartPage; - ULONG Index; + PFN_NUMBER StartPage; + PFN_NUMBER Index;
StartPage = MmGetPageNumberFromAddress(PageAddress);
Modified: trunk/reactos/boot/freeldr/freeldr/mm/mm.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/mm/mm.... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/mm/mm.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/mm/mm.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -27,12 +27,12 @@
DBG_DEFAULT_CHANNEL(MEMORY);
-ULONG LoaderPagesSpanned = 0; - -PVOID MmAllocateMemoryWithType(ULONG MemorySize, TYPE_OF_MEMORY MemoryType) -{ - ULONG PagesNeeded; - ULONG FirstFreePageFromEnd; +PFN_NUMBER LoaderPagesSpanned = 0; + +PVOID MmAllocateMemoryWithType(SIZE_T MemorySize, TYPE_OF_MEMORY MemoryType) +{ + PFN_NUMBER PagesNeeded; + PFN_NUMBER FirstFreePageFromEnd; PVOID MemPointer;
if (MemorySize == 0) @@ -83,10 +83,10 @@ return MemPointer; }
-PVOID MmAllocateMemoryAtAddress(ULONG MemorySize, PVOID DesiredAddress, TYPE_OF_MEMORY MemoryType) -{ - ULONG PagesNeeded; - ULONG StartPageNumber; +PVOID MmAllocateMemoryAtAddress(SIZE_T MemorySize, PVOID DesiredAddress, TYPE_OF_MEMORY MemoryType) +{ + PFN_NUMBER PagesNeeded; + PFN_NUMBER StartPageNumber; PVOID MemPointer;
if (MemorySize == 0) @@ -142,10 +142,10 @@ return MemPointer; }
-VOID MmSetMemoryType(PVOID MemoryAddress, ULONG MemorySize, TYPE_OF_MEMORY NewType) -{ - ULONG PagesNeeded; - ULONG StartPageNumber; +VOID MmSetMemoryType(PVOID MemoryAddress, SIZE_T MemorySize, TYPE_OF_MEMORY NewType) +{ + PFN_NUMBER PagesNeeded; + PFN_NUMBER StartPageNumber;
// Find out how many blocks it will take to // satisfy this allocation @@ -158,11 +158,11 @@ MmAllocatePagesInLookupTable(PageLookupTableAddress, StartPageNumber, PagesNeeded, NewType); }
-PVOID MmAllocateHighestMemoryBelowAddress(ULONG MemorySize, PVOID DesiredAddress, TYPE_OF_MEMORY MemoryType) -{ - ULONG PagesNeeded; - ULONG FirstFreePageFromEnd; - ULONG DesiredAddressPageNumber; +PVOID MmAllocateHighestMemoryBelowAddress(SIZE_T MemorySize, PVOID DesiredAddress, TYPE_OF_MEMORY MemoryType) +{ + PFN_NUMBER PagesNeeded; + PFN_NUMBER FirstFreePageFromEnd; + PFN_NUMBER DesiredAddressPageNumber; PVOID MemPointer;
if (MemorySize == 0) @@ -221,7 +221,7 @@
VOID DumpMemoryAllocMap(VOID) { - ULONG Idx; + PFN_NUMBER Idx; PPAGE_LOOKUP_TABLE_ITEM RealPageLookupTable = (PPAGE_LOOKUP_TABLE_ITEM)PageLookupTableAddress;
DbgPrint("----------- Memory Allocation Bitmap -----------\n"); @@ -295,7 +295,7 @@ } #endif // DBG
-PPAGE_LOOKUP_TABLE_ITEM MmGetMemoryMap(ULONG *NoEntries) +PPAGE_LOOKUP_TABLE_ITEM MmGetMemoryMap(PFN_NUMBER *NoEntries) { PPAGE_LOOKUP_TABLE_ITEM RealPageLookupTable = (PPAGE_LOOKUP_TABLE_ITEM)PageLookupTableAddress;
Modified: trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/reacto... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -15,7 +15,7 @@ /* GLOBALS ********************************************************************/
extern CHAR reactos_arc_hardware_data[]; -ULONG FldrpHwHeapLocation; +SIZE_T FldrpHwHeapLocation; PCONFIGURATION_COMPONENT_DATA FldrArcHwTreeRoot;
BOOLEAN UseRealHeap = FALSE; @@ -30,7 +30,7 @@
PVOID NTAPI -FldrpHwHeapAlloc(IN ULONG Size) +FldrpHwHeapAlloc(IN SIZE_T Size) { PVOID Buffer;
@@ -62,7 +62,7 @@ FldrSetIdentifier(IN PCONFIGURATION_COMPONENT_DATA ComponentData, IN PCHAR IdentifierString) { - ULONG IdentifierLength; + SIZE_T IdentifierLength; PCONFIGURATION_COMPONENT Component = &ComponentData->ComponentEntry; PCHAR Identifier;
@@ -75,7 +75,7 @@ RtlCopyMemory(Identifier, IdentifierString, IdentifierLength);
/* Set component information */ - Component->IdentifierLength = IdentifierLength; + Component->IdentifierLength = (ULONG)IdentifierLength; Component->Identifier = Identifier; }
Modified: trunk/reactos/boot/freeldr/freeldr/reactos/registry.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/reacto... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/reactos/registry.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/reactos/registry.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -174,8 +174,8 @@ FRLDRHKEY NewKey; PWCHAR p; PCWSTR name; - int subkeyLength; - int stringLength; + SIZE_T subkeyLength; + SIZE_T stringLength; ULONG NameSize; int CmpResult;
@@ -220,7 +220,7 @@ stringLength = subkeyLength; name = KeyName; } - NameSize = (subkeyLength + 1) * sizeof(WCHAR); + NameSize = (ULONG)((subkeyLength + 1) * sizeof(WCHAR));
Ptr = CurrentKey->SubKeyList.Flink; CmpResult = 1; @@ -345,8 +345,8 @@ FRLDRHKEY CurrentKey; PWCHAR p; PCWSTR name; - int subkeyLength; - int stringLength; + SIZE_T subkeyLength; + SIZE_T stringLength; ULONG NameSize;
TRACE("KeyName '%S'\n", KeyName); @@ -391,7 +391,7 @@ stringLength = subkeyLength; name = KeyName; } - NameSize = (subkeyLength + 1) * sizeof(WCHAR); + NameSize = (ULONG)((subkeyLength + 1) * sizeof(WCHAR));
Ptr = CurrentKey->SubKeyList.Flink; while (Ptr != &CurrentKey->SubKeyList) @@ -495,7 +495,7 @@ InsertTailList(&Key->ValueList, &Value->ValueList); Key->ValueCount++;
- Value->NameSize = (wcslen(ValueName)+1) * sizeof(WCHAR); + Value->NameSize = (ULONG)(wcslen(ValueName)+1) * sizeof(WCHAR); Value->Name = MmHeapAlloc(Value->NameSize); if (Value->Name == NULL) return ERROR_OUTOFMEMORY; wcscpy(Value->Name, ValueName);
Modified: trunk/reactos/boot/freeldr/freeldr/ui/tui.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/ui/tui... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/ui/tui.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/ui/tui.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -128,7 +128,7 @@ // // Draw title text // - TuiDrawText( (UiScreenWidth / 2) - (strlen(UiTitleBoxTitleText) / 2), + TuiDrawText( (UiScreenWidth / 2) - ((ULONG)strlen(UiTitleBoxTitleText) / 2), 2, UiTitleBoxTitleText, ATTR(UiTitleBoxFgColor, UiTitleBoxBgColor)); @@ -332,12 +332,12 @@
VOID TuiDrawCenteredText(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCSTR TextString, UCHAR Attr) { - ULONG TextLength; + SIZE_T TextLength; ULONG BoxWidth; ULONG BoxHeight; ULONG LineBreakCount; - ULONG Index; - ULONG LastIndex; + SIZE_T Index; + SIZE_T LastIndex; ULONG RealLeft; ULONG RealTop; ULONG X; @@ -361,7 +361,7 @@ { if ((Index - LastIndex) > BoxWidth) { - BoxWidth = (Index - LastIndex); + BoxWidth = (ULONG)(Index - LastIndex); } } } @@ -381,7 +381,7 @@ } else { - X = RealLeft + LastIndex; + X = (ULONG)(RealLeft + LastIndex); Y = RealTop; LastIndex++; Temp[0] = TextString[Index]; @@ -393,14 +393,14 @@
VOID TuiDrawStatusText(PCSTR StatusText) { - ULONG i; + SIZE_T i;
TuiDrawText(0, UiScreenHeight-1, " ", ATTR(UiStatusBarFgColor, UiStatusBarBgColor)); TuiDrawText(1, UiScreenHeight-1, StatusText, ATTR(UiStatusBarFgColor, UiStatusBarBgColor));
for (i=strlen(StatusText)+1; i<UiScreenWidth; i++) { - TuiDrawText(i, UiScreenHeight-1, " ", ATTR(UiStatusBarFgColor, UiStatusBarBgColor)); + TuiDrawText((ULONG)i, UiScreenHeight-1, " ", ATTR(UiStatusBarFgColor, UiStatusBarBgColor)); }
VideoCopyOffScreenBufferToVRAM(); @@ -459,7 +459,7 @@ strcat(DateString, TempString);
// Draw the date - TuiDrawText(UiScreenWidth-strlen(DateString)-2, 1, DateString, ATTR(UiTitleBoxFgColor, UiTitleBoxBgColor)); + TuiDrawText(UiScreenWidth-(ULONG)strlen(DateString)-2, 1, DateString, ATTR(UiTitleBoxFgColor, UiTitleBoxBgColor));
// Get the hour and change from 24-hour mode to 12-hour if (TimeInfo->Hour > 12) @@ -498,7 +498,7 @@ }
// Draw the time - TuiDrawText(UiScreenWidth-strlen(TimeString)-2, 2, TimeString, ATTR(UiTitleBoxFgColor, UiTitleBoxBgColor)); + TuiDrawText(UiScreenWidth-(ULONG)strlen(TimeString)-2, 2, TimeString, ATTR(UiTitleBoxFgColor, UiTitleBoxBgColor)); }
VOID TuiSaveScreen(PUCHAR Buffer)
Modified: trunk/reactos/boot/freeldr/freeldr/ui/tuimenu.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/ui/tui... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/ui/tuimenu.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/ui/tuimenu.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -151,7 +151,7 @@ // // Get the string length and make it become the new width if necessary // - Length = strlen(MenuInfo->MenuItemList[i]); + Length = (ULONG)strlen(MenuInfo->MenuItemList[i]); if (Length > Width) Width = Length; }
@@ -248,7 +248,7 @@ // Copy the integral time text string, and remove the last 2 chars // strcpy(TempString, UiTimeText); - i = strlen(TempString); + i = (ULONG)strlen(TempString); TempString[i - 2] = 0;
// @@ -271,7 +271,7 @@ // // Display it in the center of the menu // - UiDrawText(MenuInfo->Right - strlen(MenuLineText) - 1, + UiDrawText(MenuInfo->Right - (ULONG)strlen(MenuLineText) - 1, MenuInfo->Bottom, MenuLineText, ATTR(UiMenuFgColor, UiMenuBgColor)); @@ -303,7 +303,7 @@ // if (UiCenterMenu) { - UiDrawText(MenuInfo->Right - strlen(MenuLineText) - 1, + UiDrawText(MenuInfo->Right - (ULONG)strlen(MenuLineText) - 1, MenuInfo->Bottom, MenuLineText, ATTR(UiMenuFgColor, UiMenuBgColor)); @@ -364,7 +364,7 @@ // how many spaces will be to the left and right // SpaceTotal = (MenuInfo->Right - MenuInfo->Left - 2) - - strlen(MenuInfo->MenuItemList[MenuItemNumber]); + (ULONG)strlen(MenuInfo->MenuItemList[MenuItemNumber]); SpaceLeft = (SpaceTotal / 2) + 1; SpaceRight = (SpaceTotal - SpaceLeft) + 1;
Modified: trunk/reactos/boot/freeldr/freeldr/ui/ui.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/ui/ui.... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/ui/ui.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/ui/ui.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -228,7 +228,8 @@ BOOLEAN SetupUiInitialize(VOID) { CHAR DisplayModeText[260]; - ULONG Depth, Length; + ULONG Depth; + SIZE_T Length;
DisplayModeText[0] = '\0'; @@ -313,12 +314,12 @@
VOID UiInfoBox(PCSTR MessageText) { - ULONG TextLength; + SIZE_T TextLength; ULONG BoxWidth; ULONG BoxHeight; ULONG LineBreakCount; - ULONG Index; - ULONG LastIndex; + SIZE_T Index; + SIZE_T LastIndex; ULONG Left; ULONG Top; ULONG Right; @@ -341,7 +342,7 @@ { if ((Index - LastIndex) > BoxWidth) { - BoxWidth = (Index - LastIndex); + BoxWidth = (ULONG)(Index - LastIndex); } } }
Modified: trunk/reactos/boot/freeldr/freeldr/windows/peloader.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/window... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/windows/peloader.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/windows/peloader.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -453,7 +453,7 @@ { PWSTR Buffer; UNICODE_STRING UnicodeNamePA; - ULONG i, Length; + SIZE_T i, Length;
/* First obvious check: for length of two names */ Length = strlen(DllName);
Modified: trunk/reactos/boot/freeldr/freeldr/windows/wlmemory.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/window... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/windows/wlmemory.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/windows/wlmemory.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -49,8 +49,8 @@
extern PFREELDR_MEMORY_DESCRIPTOR BiosMemoryMap; extern ULONG BiosMemoryMapEntryCount; -extern ULONG MmLowestPhysicalPage; -extern ULONG MmHighestPhysicalPage; +extern PFN_NUMBER MmLowestPhysicalPage; +extern PFN_NUMBER MmHighestPhysicalPage;
/* GLOBALS ***************************************************************/
@@ -63,8 +63,8 @@
VOID MempAddMemoryBlock(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, - ULONG BasePage, - ULONG PageCount, + PFN_NUMBER BasePage, + PFN_NUMBER PageCount, ULONG Type) { BOOLEAN Status = TRUE; @@ -195,10 +195,10 @@ BOOLEAN WinLdrSetupMemoryLayout(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock) { - ULONG i, PagesCount, MemoryMapSizeInPages; - ULONG LastPageIndex, LastPageType, MemoryMapStartPage; + PFN_NUMBER i, PagesCount, MemoryMapSizeInPages, NoEntries; + PFN_NUMBER LastPageIndex, MemoryMapStartPage; PPAGE_LOOKUP_TABLE_ITEM MemoryMap; - ULONG NoEntries; + ULONG LastPageType; //PKTSS Tss; //BOOLEAN Status;
Modified: trunk/reactos/boot/freeldr/freeldr/windows/wlregistry.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/window... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/windows/wlregistry.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/windows/wlregistry.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -720,7 +720,7 @@ if (ImagePath && (wcslen(ImagePath) > 0)) { // Just copy ImagePath to the corresponding field in the structure - PathLength = wcslen(ImagePath) * sizeof(WCHAR) + sizeof(UNICODE_NULL); + PathLength = (USHORT)wcslen(ImagePath) * sizeof(WCHAR) + sizeof(UNICODE_NULL);
BootDriverEntry->FilePath.Length = 0; BootDriverEntry->FilePath.MaximumLength = PathLength; @@ -743,7 +743,7 @@ else { // we have to construct ImagePath ourselves - PathLength = wcslen(ServiceName)*sizeof(WCHAR) + sizeof(L"system32\drivers\.sys"); + PathLength = (USHORT)wcslen(ServiceName)*sizeof(WCHAR) + sizeof(L"system32\drivers\.sys"); BootDriverEntry->FilePath.Length = 0; BootDriverEntry->FilePath.MaximumLength = PathLength; BootDriverEntry->FilePath.Buffer = MmHeapAlloc(PathLength); @@ -780,7 +780,7 @@ }
// Add registry path - PathLength = (wcslen(RegistryPath) + wcslen(ServiceName))*sizeof(WCHAR) + sizeof(UNICODE_NULL); + PathLength = (USHORT)(wcslen(RegistryPath) + wcslen(ServiceName))*sizeof(WCHAR) + sizeof(UNICODE_NULL); BootDriverEntry->RegistryPath.Length = 0; BootDriverEntry->RegistryPath.MaximumLength = PathLength; BootDriverEntry->RegistryPath.Buffer = MmHeapAlloc(PathLength);