From 25248671edf6ee39f357d9d691de824cceeed8a0 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 24 Jul 2008 01:22:30 +0000 Subject: [PATCH] freeldr: - make SectionId a ULONG_PTR - same for some Loaderblock members svn path=/branches/ros-amd64-bringup/; revision=34722 --- reactos/boot/freeldr/freeldr/bootmgr.c | 6 ++--- .../boot/freeldr/freeldr/include/inifile.h | 16 +++++++------- .../boot/freeldr/freeldr/inifile/inifile.c | 22 +++++++++---------- reactos/boot/freeldr/freeldr/oslist.c | 4 ++-- .../boot/freeldr/freeldr/reactos/reactos.c | 14 ++++++------ .../boot/freeldr/freeldr/reactos/setupldr.c | 12 +++++----- reactos/boot/freeldr/freeldr/ui/ui.c | 4 ++-- 7 files changed, 39 insertions(+), 39 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/bootmgr.c b/reactos/boot/freeldr/freeldr/bootmgr.c index 904f1ef309b..fc3b9a2fddb 100644 --- a/reactos/boot/freeldr/freeldr/bootmgr.c +++ b/reactos/boot/freeldr/freeldr/bootmgr.c @@ -23,7 +23,7 @@ VOID RunLoader(VOID) { CHAR SettingName[80]; CHAR SettingValue[80]; - ULONG SectionId; + ULONG_PTR SectionId; ULONG OperatingSystemCount; PCSTR *OperatingSystemSectionNames; PCSTR *OperatingSystemDisplayNames; @@ -169,7 +169,7 @@ ULONG GetDefaultOperatingSystem(PCSTR OperatingSystemList[], ULONG OperatingSy { CHAR DefaultOSText[80]; PCSTR DefaultOSName; - ULONG SectionId; + ULONG_PTR SectionId; ULONG DefaultOS = 0; ULONG Idx; @@ -206,7 +206,7 @@ LONG GetTimeOut(VOID) { CHAR TimeOutText[20]; LONG TimeOut; - ULONG SectionId; + ULONG_PTR SectionId; TimeOut = CmdLineGetTimeOut(); if (0 <= TimeOut) diff --git a/reactos/boot/freeldr/freeldr/include/inifile.h b/reactos/boot/freeldr/freeldr/include/inifile.h index aebf1f38ab1..a36d4577685 100644 --- a/reactos/boot/freeldr/freeldr/include/inifile.h +++ b/reactos/boot/freeldr/freeldr/include/inifile.h @@ -72,14 +72,14 @@ VOID IniExtractSettingValue(PCHAR SettingValue, PCHAR SettingValueLine, ULONG Li BOOLEAN IniFileInitialize(VOID); -BOOLEAN IniOpenSection(PCSTR SectionName, ULONG* SectionId); -ULONG IniGetNumSectionItems(ULONG SectionId); -ULONG IniGetSectionSettingNameSize(ULONG SectionId, ULONG SettingIndex); -ULONG IniGetSectionSettingValueSize(ULONG SectionId, ULONG SettingIndex); -BOOLEAN IniReadSettingByNumber(ULONG SectionId, ULONG SettingNumber, PCHAR SettingName, ULONG NameSize, PCHAR SettingValue, ULONG ValueSize); -BOOLEAN IniReadSettingByName(ULONG SectionId, PCSTR SettingName, PCHAR Buffer, ULONG BufferSize); -BOOLEAN IniAddSection(PCSTR SectionName, ULONG* SectionId); -BOOLEAN IniAddSettingValueToSection(ULONG SectionId, PCSTR SettingName, PCSTR SettingValue); +BOOLEAN IniOpenSection(PCSTR SectionName, ULONG_PTR* SectionId); +ULONG IniGetNumSectionItems(ULONG_PTR SectionId); +ULONG IniGetSectionSettingNameSize(ULONG_PTR SectionId, ULONG SettingIndex); +ULONG IniGetSectionSettingValueSize(ULONG_PTR SectionId, ULONG SettingIndex); +BOOLEAN IniReadSettingByNumber(ULONG_PTR SectionId, ULONG SettingNumber, PCHAR SettingName, ULONG NameSize, PCHAR SettingValue, ULONG ValueSize); +BOOLEAN IniReadSettingByName(ULONG_PTR SectionId, PCSTR SettingName, PCHAR Buffer, ULONG BufferSize); +BOOLEAN IniAddSection(PCSTR SectionName, ULONG_PTR* SectionId); +BOOLEAN IniAddSettingValueToSection(ULONG_PTR SectionId, PCSTR SettingName, PCSTR SettingValue); #endif // defined __PARSEINI_H diff --git a/reactos/boot/freeldr/freeldr/inifile/inifile.c b/reactos/boot/freeldr/freeldr/inifile/inifile.c index 3180083f785..753c8f75b9e 100644 --- a/reactos/boot/freeldr/freeldr/inifile/inifile.c +++ b/reactos/boot/freeldr/freeldr/inifile/inifile.c @@ -20,7 +20,7 @@ #include #include -BOOLEAN IniOpenSection(PCSTR SectionName, ULONG* SectionId) +BOOLEAN IniOpenSection(PCSTR SectionName, ULONG_PTR* SectionId) { PINI_SECTION Section; @@ -35,7 +35,7 @@ BOOLEAN IniOpenSection(PCSTR SectionName, ULONG* SectionId) { // We found it if (SectionId) - *SectionId = (ULONG)Section; + *SectionId = (ULONG_PTR)Section; DbgPrint((DPRINT_INIFILE, "IniOpenSection() Found it! SectionId = 0x%x\n", SectionId)); return TRUE; } @@ -49,7 +49,7 @@ BOOLEAN IniOpenSection(PCSTR SectionName, ULONG* SectionId) return FALSE; } -ULONG IniGetNumSectionItems(ULONG SectionId) +ULONG IniGetNumSectionItems(ULONG_PTR SectionId) { PINI_SECTION Section = (PINI_SECTION)SectionId; @@ -59,7 +59,7 @@ ULONG IniGetNumSectionItems(ULONG SectionId) return Section->SectionItemCount; } -PINI_SECTION_ITEM IniGetSettingByNumber(ULONG SectionId, ULONG SettingNumber) +PINI_SECTION_ITEM IniGetSettingByNumber(ULONG_PTR SectionId, ULONG SettingNumber) { PINI_SECTION Section = (PINI_SECTION)SectionId; PINI_SECTION_ITEM SectionItem; @@ -83,7 +83,7 @@ PINI_SECTION_ITEM IniGetSettingByNumber(ULONG SectionId, ULONG SettingNumber) return NULL; } -ULONG IniGetSectionSettingNameSize(ULONG SectionId, ULONG SettingIndex) +ULONG IniGetSectionSettingNameSize(ULONG_PTR SectionId, ULONG SettingIndex) { PINI_SECTION_ITEM SectionItem; @@ -96,7 +96,7 @@ ULONG IniGetSectionSettingNameSize(ULONG SectionId, ULONG SettingIndex) return (strlen(SectionItem->ItemName) + 1); } -ULONG IniGetSectionSettingValueSize(ULONG SectionId, ULONG SettingIndex) +ULONG IniGetSectionSettingValueSize(ULONG_PTR SectionId, ULONG SettingIndex) { PINI_SECTION_ITEM SectionItem; @@ -109,7 +109,7 @@ ULONG IniGetSectionSettingValueSize(ULONG SectionId, ULONG SettingIndex) return (strlen(SectionItem->ItemValue) + 1); } -BOOLEAN IniReadSettingByNumber(ULONG SectionId, ULONG SettingNumber, PCHAR SettingName, ULONG NameSize, PCHAR SettingValue, ULONG ValueSize) +BOOLEAN IniReadSettingByNumber(ULONG_PTR SectionId, ULONG SettingNumber, PCHAR SettingName, ULONG NameSize, PCHAR SettingValue, ULONG ValueSize) { PINI_SECTION_ITEM SectionItem; DbgPrint((DPRINT_INIFILE, ".001 NameSize = %d ValueSize = %d\n", NameSize, ValueSize)); @@ -142,7 +142,7 @@ BOOLEAN IniReadSettingByNumber(ULONG SectionId, ULONG SettingNumber, PCHAR Setti return TRUE; } -BOOLEAN IniReadSettingByName(ULONG SectionId, PCSTR SettingName, PCHAR Buffer, ULONG BufferSize) +BOOLEAN IniReadSettingByName(ULONG_PTR SectionId, PCSTR SettingName, PCHAR Buffer, ULONG BufferSize) { PINI_SECTION Section = (PINI_SECTION)SectionId; PINI_SECTION_ITEM SectionItem; @@ -174,7 +174,7 @@ BOOLEAN IniReadSettingByName(ULONG SectionId, PCSTR SettingName, PCHAR Buffer, U return FALSE; } -BOOLEAN IniAddSection(PCSTR SectionName, ULONG* SectionId) +BOOLEAN IniAddSection(PCSTR SectionName, ULONG_PTR* SectionId) { PINI_SECTION Section; @@ -202,12 +202,12 @@ BOOLEAN IniAddSection(PCSTR SectionName, ULONG* SectionId) IniFileSectionCount++; InsertHeadList(&IniFileSectionListHead, &Section->ListEntry); - *SectionId = (ULONG)Section; + *SectionId = (ULONG_PTR)Section; return TRUE; } -BOOLEAN IniAddSettingValueToSection(ULONG SectionId, PCSTR SettingName, PCSTR SettingValue) +BOOLEAN IniAddSettingValueToSection(ULONG_PTR SectionId, PCSTR SettingName, PCSTR SettingValue) { PINI_SECTION Section = (PINI_SECTION)SectionId; PINI_SECTION_ITEM SectionItem; diff --git a/reactos/boot/freeldr/freeldr/oslist.c b/reactos/boot/freeldr/freeldr/oslist.c index 56725d11f3c..2461a8d3fe9 100644 --- a/reactos/boot/freeldr/freeldr/oslist.c +++ b/reactos/boot/freeldr/freeldr/oslist.c @@ -26,8 +26,8 @@ BOOLEAN InitOperatingSystemList(PCSTR **SectionNamesPointer, PCSTR **DisplayName CHAR SettingName[260]; CHAR SettingValue[260]; ULONG OperatingSystemCount; - ULONG SectionId; - ULONG OperatingSystemSectionId; + ULONG_PTR SectionId; + ULONG_PTR OperatingSystemSectionId; ULONG SectionSettingCount; PCHAR *OperatingSystemSectionNames; PCHAR *OperatingSystemDisplayNames; diff --git a/reactos/boot/freeldr/freeldr/reactos/reactos.c b/reactos/boot/freeldr/freeldr/reactos/reactos.c index 91ac1536291..2e56a7ed1d1 100644 --- a/reactos/boot/freeldr/freeldr/reactos/reactos.c +++ b/reactos/boot/freeldr/freeldr/reactos/reactos.c @@ -571,7 +571,7 @@ LoadAndBootReactOS(PCSTR OperatingSystemName) CHAR szKernelName[255]; CHAR szFileName[255]; CHAR MsgBuffer[256]; - ULONG SectionId; + ULONG_PTR SectionId; PIMAGE_NT_HEADERS NtHeader; PVOID LoadBase; ULONG_PTR Base; @@ -596,19 +596,19 @@ LoadAndBootReactOS(PCSTR OperatingSystemName) * Setup multiboot information structure */ LoaderBlock.CommandLine = reactos_kernel_cmdline; - LoaderBlock.PageDirectoryStart = (ULONG)&PageDirectoryStart; - LoaderBlock.PageDirectoryEnd = (ULONG)&PageDirectoryEnd; + LoaderBlock.PageDirectoryStart = (ULONG_PTR)&PageDirectoryStart; + LoaderBlock.PageDirectoryEnd = (ULONG_PTR)&PageDirectoryEnd; LoaderBlock.ModsCount = 0; LoaderBlock.ModsAddr = reactos_modules; LoaderBlock.DrivesAddr = reactos_arc_disk_info; - LoaderBlock.RdAddr = (ULONG)gRamDiskBase; + LoaderBlock.RdAddr = (ULONG_PTR)gRamDiskBase; LoaderBlock.RdLength = gRamDiskSize; - LoaderBlock.MmapLength = (unsigned long)MachGetMemoryMap((PBIOS_MEMORY_MAP)reactos_memory_map, 32) * sizeof(memory_map_t); + LoaderBlock.MmapLength = (SIZE_T)MachGetMemoryMap((PBIOS_MEMORY_MAP)reactos_memory_map, 32) * sizeof(memory_map_t); if (LoaderBlock.MmapLength) { ULONG i; LoaderBlock.Flags |= MB_FLAGS_MEM_INFO | MB_FLAGS_MMAP_INFO; - LoaderBlock.MmapAddr = (unsigned long)&reactos_memory_map; + LoaderBlock.MmapAddr = (ULONG_PTR)&reactos_memory_map; reactos_memory_map_descriptor_size = sizeof(memory_map_t); // GetBiosMemoryMap uses a fixed value of 24 for (i=0; i<(LoaderBlock.MmapLength/sizeof(memory_map_t)); i++) { @@ -698,7 +698,7 @@ LoadAndBootReactOS(PCSTR OperatingSystemName) /* * Detect hardware */ - LoaderBlock.ArchExtra = (ULONG)MachHwDetect(); + LoaderBlock.ArchExtra = (ULONG_PTR)MachHwDetect(); UiDrawProgressBarCenter(5, 100, szLoadingMsg); LoaderBlock.DrivesCount = reactos_disk_count; diff --git a/reactos/boot/freeldr/freeldr/reactos/setupldr.c b/reactos/boot/freeldr/freeldr/reactos/setupldr.c index cc1f29b06cb..f36ddded09d 100644 --- a/reactos/boot/freeldr/freeldr/reactos/setupldr.c +++ b/reactos/boot/freeldr/freeldr/reactos/setupldr.c @@ -183,20 +183,20 @@ VOID RunLoader(VOID) /* Setup multiboot information structure */ LoaderBlock.CommandLine = reactos_kernel_cmdline; - LoaderBlock.PageDirectoryStart = (ULONG)&PageDirectoryStart; - LoaderBlock.PageDirectoryEnd = (ULONG)&PageDirectoryEnd; + LoaderBlock.PageDirectoryStart = (ULONG_PTR)&PageDirectoryStart; + LoaderBlock.PageDirectoryEnd = (ULONG_PTR)&PageDirectoryEnd; LoaderBlock.ModsCount = 0; LoaderBlock.ModsAddr = reactos_modules; LoaderBlock.MmapLength = (unsigned long)MachGetMemoryMap((PBIOS_MEMORY_MAP)reactos_memory_map, 32) * sizeof(memory_map_t); if (LoaderBlock.MmapLength) { -#ifdef _M_IX86 +#if defined (_M_IX86) || defined (_M_AMD64) ULONG i; #endif LoaderBlock.Flags |= MB_FLAGS_MEM_INFO | MB_FLAGS_MMAP_INFO; - LoaderBlock.MmapAddr = (unsigned long)&reactos_memory_map; + LoaderBlock.MmapAddr = (ULONG_PTR)&reactos_memory_map; reactos_memory_map_descriptor_size = sizeof(memory_map_t); // GetBiosMemoryMap uses a fixed value of 24 -#ifdef _M_IX86 +#if defined (_M_IX86) || defined (_M_AMD64) for (i=0; i<(LoaderBlock.MmapLength/sizeof(memory_map_t)); i++) { if (BiosMemoryUsable == reactos_memory_map[i].type && @@ -231,7 +231,7 @@ VOID RunLoader(VOID) /* Detect hardware */ UiDrawStatusText("Detecting hardware..."); - LoaderBlock.ArchExtra = (ULONG)MachHwDetect(); + LoaderBlock.ArchExtra = (ULONG_PTR)MachHwDetect(); UiDrawStatusText(""); /* set boot device */ diff --git a/reactos/boot/freeldr/freeldr/ui/ui.c b/reactos/boot/freeldr/freeldr/ui/ui.c index 19d4c010ef5..ce66c8141bc 100644 --- a/reactos/boot/freeldr/freeldr/ui/ui.c +++ b/reactos/boot/freeldr/freeldr/ui/ui.c @@ -80,7 +80,7 @@ BOOLEAN UiInitialize(BOOLEAN ShowGui) { VIDEODISPLAYMODE UiDisplayMode; // Tells us if we are in text or graphics mode BOOLEAN UiMinimal = FALSE; // Tells us if we should use a minimal console-like UI - ULONG SectionId; + ULONG_PTR SectionId; CHAR DisplayModeText[260]; CHAR SettingText[260]; ULONG Depth; @@ -408,7 +408,7 @@ VOID UiShowMessageBoxesInSection(PCSTR SectionName) CHAR SettingValue[80]; PCHAR MessageBoxText; ULONG MessageBoxTextSize; - ULONG SectionId; + ULONG_PTR SectionId; if (!IniOpenSection(SectionName, &SectionId)) {