Author: tkreuzer
Date: Mon Sep 8 06:13:51 2008
New Revision: 36046
URL:
http://svn.reactos.org/svn/reactos?rev=36046&view=rev
Log:
Merge 34722, 34723, 34724, 34843, 35528, 35703 from ros-amd64-bringup branch:
- Convert port addresses to PULONG
- fix several ULONG / ULONG_PTR issues
- use %p in DPRINTs for pointer sized values
- fix type of address table entry from PULONG to ULONG
Modified:
trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c
trunk/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c
trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c
trunk/reactos/boot/freeldr/freeldr/arch/i386/i386disk.c
trunk/reactos/boot/freeldr/freeldr/arch/i386/pcdisk.c
trunk/reactos/boot/freeldr/freeldr/arch/i386/pcmem.c
trunk/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c
trunk/reactos/boot/freeldr/freeldr/bootmgr.c
trunk/reactos/boot/freeldr/freeldr/cmdline.c
trunk/reactos/boot/freeldr/freeldr/comm/rs232.c
trunk/reactos/boot/freeldr/freeldr/disk/ramdisk.c
trunk/reactos/boot/freeldr/freeldr/fs/ext2.c
trunk/reactos/boot/freeldr/freeldr/include/inifile.h
trunk/reactos/boot/freeldr/freeldr/inifile/inifile.c
trunk/reactos/boot/freeldr/freeldr/mm/meminit.c
trunk/reactos/boot/freeldr/freeldr/mm/mm.c
trunk/reactos/boot/freeldr/freeldr/oslist.c
trunk/reactos/boot/freeldr/freeldr/reactos/imageldr.c
trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c
trunk/reactos/boot/freeldr/freeldr/reactos/registry.c
trunk/reactos/boot/freeldr/freeldr/reactos/setupldr.c
trunk/reactos/boot/freeldr/freeldr/ui/ui.c
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c [iso-8859-1] Mon Sep 8
06:13:51 2008
@@ -779,21 +779,21 @@
}
static VOID
-InitializeSerialPort(ULONG Port,
+InitializeSerialPort(PUCHAR Port,
ULONG LineControl)
{
- WRITE_PORT_UCHAR((PUCHAR)Port + 3, 0x80); /* set DLAB on */
- WRITE_PORT_UCHAR((PUCHAR)Port, 0x60); /* speed LO byte */
- WRITE_PORT_UCHAR((PUCHAR)Port + 1, 0); /* speed HI byte */
- WRITE_PORT_UCHAR((PUCHAR)Port + 3, LineControl);
- WRITE_PORT_UCHAR((PUCHAR)Port + 1, 0); /* set comm and DLAB to 0 */
- WRITE_PORT_UCHAR((PUCHAR)Port + 4, 0x09); /* DR int enable */
- READ_PORT_UCHAR((PUCHAR)Port + 5); /* clear error bits */
+ WRITE_PORT_UCHAR(Port + 3, 0x80); /* set DLAB on */
+ WRITE_PORT_UCHAR(Port, 0x60); /* speed LO byte */
+ WRITE_PORT_UCHAR(Port + 1, 0); /* speed HI byte */
+ WRITE_PORT_UCHAR(Port + 3, LineControl);
+ WRITE_PORT_UCHAR(Port + 1, 0); /* set comm and DLAB to 0 */
+ WRITE_PORT_UCHAR(Port + 4, 0x09); /* DR int enable */
+ READ_PORT_UCHAR(Port + 5); /* clear error bits */
}
static ULONG
-DetectSerialMouse(ULONG Port)
+DetectSerialMouse(PUCHAR Port)
{
CHAR Buffer[4];
ULONG i;
@@ -801,8 +801,8 @@
UCHAR LineControl;
/* Shutdown mouse or something like that */
- LineControl = READ_PORT_UCHAR((PUCHAR)Port + 4);
- WRITE_PORT_UCHAR((PUCHAR)Port + 4, (LineControl & ~0x02) | 0x01);
+ LineControl = READ_PORT_UCHAR(Port + 4);
+ WRITE_PORT_UCHAR(Port + 4, (LineControl & ~0x02) | 0x01);
StallExecutionProcessor(100000);
/*
@@ -812,18 +812,18 @@
* therefore we must give up after some time.
*/
TimeOut = 200;
- while (READ_PORT_UCHAR((PUCHAR)Port + 5) & 0x01)
+ while (READ_PORT_UCHAR(Port + 5) & 0x01)
{
if (--TimeOut == 0)
return MOUSE_TYPE_NONE;
- READ_PORT_UCHAR((PUCHAR)Port);
+ READ_PORT_UCHAR(Port);
}
/*
* Send modem control with 'Data Terminal Ready', 'Request To Send'
and
* 'Output Line 2' message. This enables mouse to identify.
*/
- WRITE_PORT_UCHAR((PUCHAR)Port + 4, 0x0b);
+ WRITE_PORT_UCHAR(Port + 4, 0x0b);
/* Wait 10 milliseconds for the mouse getting ready */
StallExecutionProcessor(10000);
@@ -832,14 +832,14 @@
TimeOut = 200;
for (i = 0; i < 4; i++)
{
- while (((READ_PORT_UCHAR((PUCHAR)Port + 5) & 1) == 0) && (TimeOut >
0))
+ while (((READ_PORT_UCHAR(Port + 5) & 1) == 0) && (TimeOut > 0))
{
StallExecutionProcessor(1000);
--TimeOut;
if (TimeOut == 0)
return MOUSE_TYPE_NONE;
}
- Buffer[i] = READ_PORT_UCHAR((PUCHAR)Port);
+ Buffer[i] = READ_PORT_UCHAR(Port);
}
DbgPrint((DPRINT_HWDETECT,
@@ -891,26 +891,26 @@
static ULONG
-GetSerialMousePnpId(ULONG Port, char *Buffer)
+GetSerialMousePnpId(PUCHAR Port, char *Buffer)
{
ULONG TimeOut;
ULONG i = 0;
char c;
char x;
- WRITE_PORT_UCHAR((PUCHAR)Port + 4, 0x09);
+ WRITE_PORT_UCHAR(Port + 4, 0x09);
/* Wait 10 milliseconds for the mouse getting ready */
StallExecutionProcessor(10000);
- WRITE_PORT_UCHAR((PUCHAR)Port + 4, 0x0b);
+ WRITE_PORT_UCHAR(Port + 4, 0x0b);
StallExecutionProcessor(10000);
for (;;)
{
TimeOut = 200;
- while (((READ_PORT_UCHAR((PUCHAR)Port + 5) & 1) == 0) && (TimeOut >
0))
+ while (((READ_PORT_UCHAR(Port + 5) & 1) == 0) && (TimeOut > 0))
{
StallExecutionProcessor(1000);
--TimeOut;
@@ -920,7 +920,7 @@
}
}
- c = READ_PORT_UCHAR((PUCHAR)Port);
+ c = READ_PORT_UCHAR(Port);
if (c == 0x08 || c == 0x28)
break;
}
@@ -931,14 +931,14 @@
for (;;)
{
TimeOut = 200;
- while (((READ_PORT_UCHAR((PUCHAR)Port + 5) & 1) == 0) && (TimeOut >
0))
+ while (((READ_PORT_UCHAR(Port + 5) & 1) == 0) && (TimeOut > 0))
{
StallExecutionProcessor(1000);
--TimeOut;
if (TimeOut == 0)
return 0;
}
- c = READ_PORT_UCHAR((PUCHAR)Port);
+ c = READ_PORT_UCHAR(Port);
Buffer[i++] = c;
if (c == x)
break;
@@ -952,7 +952,7 @@
static VOID
DetectSerialPointerPeripheral(PCONFIGURATION_COMPONENT_DATA ControllerKey,
- ULONG Base)
+ PUCHAR Base)
{
CM_PARTIAL_RESOURCE_LIST PartialResourceList;
char Buffer[256];
@@ -1227,7 +1227,7 @@
if (!Rs232PortInUse(Base))
{
/* Detect serial mouse */
- DetectSerialPointerPeripheral(ControllerKey, Base);
+ DetectSerialPointerPeripheral(ControllerKey, UlongToPtr(Base));
}
ControllerNumber++;
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c [iso-8859-1] Mon Sep 8 06:13:51
2008
@@ -30,7 +30,7 @@
/* Find the 'Root System Descriptor Table Pointer' */
Ptr = (PUCHAR)0xE0000;
- while ((ULONG)Ptr < 0x100000)
+ while ((ULONG_PTR)Ptr < 0x100000)
{
if (!memcmp(Ptr, "RSD PTR ", 8))
{
@@ -39,7 +39,7 @@
return (PRSDP_DESCRIPTOR)Ptr;
}
- Ptr = (PUCHAR)((ULONG)Ptr + 0x10);
+ Ptr = (PUCHAR)((ULONG_PTR)Ptr + 0x10);
}
DbgPrint((DPRINT_HWDETECT, "ACPI not supported\n"));
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c [iso-8859-1] Mon Sep 8 06:13:51
2008
@@ -71,7 +71,7 @@
ULONG i;
Table = (PPCI_IRQ_ROUTING_TABLE)0xF0000;
- while ((ULONG)Table < 0x100000)
+ while ((ULONG_PTR)Table < 0x100000)
{
if (Table->Signature == 0x52495024)
{
@@ -98,7 +98,7 @@
return Table;
}
- Table = (PPCI_IRQ_ROUTING_TABLE)((ULONG)Table + 0x10);
+ Table = (PPCI_IRQ_ROUTING_TABLE)((ULONG_PTR)Table + 0x10);
}
return NULL;
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/i386disk.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/i386disk.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/i386disk.c [iso-8859-1] Mon Sep 8
06:13:51 2008
@@ -25,8 +25,6 @@
/////////////////////////////////////////////////////////////////////////////////////////////
// FUNCTIONS
/////////////////////////////////////////////////////////////////////////////////////////////
-
-#ifdef __i386__
BOOLEAN DiskResetController(ULONG DriveNumber)
{
@@ -177,7 +175,7 @@
DbgPrint((DPRINT_DISK, "EED configuration parameters:
%x:%x\n", Ptr[13], Ptr[14]));
if (Ptr[13] != 0xffff && Ptr[14] != 0xffff)
{
- PUCHAR SpecPtr = (PUCHAR)((Ptr[13] << 4) + Ptr[14]);
+ PUCHAR SpecPtr = (PUCHAR)(ULONG_PTR)((Ptr[13] << 4) + Ptr[14]);
DbgPrint((DPRINT_DISK, "SpecPtr:
%x\n", SpecPtr));
DbgPrint((DPRINT_DISK, "physical I/O port base address:
%x\n", *(PUSHORT)&SpecPtr[0]));
DbgPrint((DPRINT_DISK, "disk-drive control port address:
%x\n", *(PUSHORT)&SpecPtr[2]));
@@ -198,6 +196,4 @@
return TRUE;
}
-#endif /* defined __i386__ */
-
/* EOF */
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/pcdisk.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/pcdisk.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/pcdisk.c [iso-8859-1] Mon Sep 8 06:13:51
2008
@@ -83,8 +83,8 @@
Packet->PacketSize = sizeof(I386_DISK_ADDRESS_PACKET);
Packet->Reserved = 0;
Packet->LBABlockCount = SectorCount;
- Packet->TransferBufferOffset = ((ULONG)Buffer) & 0x0F;
- Packet->TransferBufferSegment = ((ULONG)Buffer) >> 4;
+ Packet->TransferBufferOffset = ((ULONG_PTR)Buffer) & 0x0F;
+ Packet->TransferBufferSegment = ((ULONG_PTR)Buffer) >> 4;
Packet->LBAStartBlock = SectorNumber;
// BIOS int 0x13, function 42h - IBM/MS INT 13 Extensions - EXTENDED READ
@@ -211,8 +211,8 @@
RegsIn.b.cl = (PhysicalSector + ((PhysicalTrack & 0x300) >> 2));
RegsIn.b.dh = PhysicalHead;
RegsIn.b.dl = DriveNumber;
- RegsIn.w.es = ((ULONG)Buffer) >> 4;
- RegsIn.w.bx = ((ULONG)Buffer) & 0x0F;
+ RegsIn.w.es = ((ULONG_PTR)Buffer) >> 4;
+ RegsIn.w.bx = ((ULONG_PTR)Buffer) & 0x0F;
//
// Perform the read
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/pcmem.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/pcmem.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/pcmem.c [iso-8859-1] Mon Sep 8 06:13:51
2008
@@ -194,8 +194,8 @@
/* Copy data to caller's buffer */
RtlCopyMemory(&BiosMemoryMap[MapCount], (PVOID)BIOSCALLBUFFER, Regs.x.ecx);
- DbgPrint((DPRINT_MEMORY, "BaseAddress: 0x%x%x\n",
BiosMemoryMap[MapCount].BaseAddress));
- DbgPrint((DPRINT_MEMORY, "Length: 0x%x%x\n",
BiosMemoryMap[MapCount].Length));
+ DbgPrint((DPRINT_MEMORY, "BaseAddress: 0x%p\n",
(PVOID)(ULONG_PTR)BiosMemoryMap[MapCount].BaseAddress));
+ DbgPrint((DPRINT_MEMORY, "Length: 0x%p\n",
(PVOID)(ULONG_PTR)BiosMemoryMap[MapCount].Length));
DbgPrint((DPRINT_MEMORY, "Type: 0x%x\n", BiosMemoryMap[MapCount].Type));
DbgPrint((DPRINT_MEMORY, "Reserved: 0x%x\n",
BiosMemoryMap[MapCount].Reserved));
DbgPrint((DPRINT_MEMORY, "\n"));
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- 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] Mon Sep 8
06:13:51 2008
@@ -361,7 +361,7 @@
static VOID
PcVideoSet480ScanLines(VOID)
{
- int CRTC;
+ INT_PTR CRTC;
/* Read CRTC port */
CRTC = READ_PORT_UCHAR((PUCHAR)0x03CC);
@@ -418,7 +418,7 @@
static VOID
PcVideoSetDisplayEnd(VOID)
{
- int CRTC;
+ INT_PTR CRTC;
/* Read CRTC port */
CRTC = READ_PORT_UCHAR((PUCHAR)0x03CC);
@@ -1054,7 +1054,7 @@
{
USHORT *BufPtr;
- BufPtr = (USHORT *) (VIDEOTEXT_MEM_ADDRESS + Y * BytesPerScanLine + X * 2);
+ BufPtr = (USHORT *) (ULONG_PTR)(VIDEOTEXT_MEM_ADDRESS + Y * BytesPerScanLine + X * 2);
*BufPtr = ((USHORT) Attr << 8) | (Ch & 0xff);
}
Modified: trunk/reactos/boot/freeldr/freeldr/bootmgr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/bootm…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/bootmgr.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/bootmgr.c [iso-8859-1] Mon Sep 8 06:13:51 2008
@@ -23,7 +23,7 @@
{
CHAR SettingName[80];
CHAR SettingValue[80];
- ULONG SectionId;
+ ULONG_PTR SectionId;
ULONG OperatingSystemCount;
PCSTR *OperatingSystemSectionNames;
PCSTR *OperatingSystemDisplayNames;
@@ -161,7 +161,7 @@
{
CHAR DefaultOSText[80];
PCSTR DefaultOSName;
- ULONG SectionId;
+ ULONG_PTR SectionId;
ULONG DefaultOS = 0;
ULONG Idx;
@@ -198,7 +198,7 @@
{
CHAR TimeOutText[20];
LONG TimeOut;
- ULONG SectionId;
+ ULONG_PTR SectionId;
TimeOut = CmdLineGetTimeOut();
if (0 <= TimeOut)
Modified: trunk/reactos/boot/freeldr/freeldr/cmdline.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/cmdli…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/cmdline.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/cmdline.c [iso-8859-1] Mon Sep 8 06:13:51 2008
@@ -61,7 +61,7 @@
// Get ramdisk base address
//
Setting = strstr(CmdLine, "rdbase=");
- if (Setting) gRamDiskBase = (PVOID)strtoul(Setting +
+ if (Setting) gRamDiskBase = (PVOID)(ULONG_PTR)strtoull(Setting +
sizeof("rdbase=") -
sizeof(ANSI_NULL),
NULL,
Modified: trunk/reactos/boot/freeldr/freeldr/comm/rs232.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/comm/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/comm/rs232.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/comm/rs232.c [iso-8859-1] Mon Sep 8 06:13:51 2008
@@ -137,9 +137,9 @@
if (ComPort == 0)
{
- if (Rs232DoesComPortExist ((PUCHAR)BaseArray[2]))
- {
- Rs232PortBase = (PUCHAR)BaseArray[2];
+ if (Rs232DoesComPortExist ((PUCHAR)(ULONG_PTR)BaseArray[2]))
+ {
+ Rs232PortBase = (PUCHAR)(ULONG_PTR)BaseArray[2];
Rs232ComPort = 2;
/*#ifndef NDEBUG
sprintf (buffer,
@@ -149,9 +149,9 @@
HalDisplayString (buffer);
#endif*/ /* NDEBUG */
}
- else if (Rs232DoesComPortExist ((PUCHAR)BaseArray[1]))
- {
- Rs232PortBase = (PUCHAR)BaseArray[1];
+ else if (Rs232DoesComPortExist
((PUCHAR)(ULONG_PTR)BaseArray[1]))
+ {
+ Rs232PortBase = (PUCHAR)(ULONG_PTR)BaseArray[1];
Rs232ComPort = 1;
/*#ifndef NDEBUG
sprintf (buffer,
@@ -171,9 +171,9 @@
}
else
{
- if (Rs232DoesComPortExist ((PUCHAR)BaseArray[ComPort]))
- {
- Rs232PortBase = (PUCHAR)BaseArray[ComPort];
+ if (Rs232DoesComPortExist
((PUCHAR)(ULONG_PTR)BaseArray[ComPort]))
+ {
+ Rs232PortBase = (PUCHAR)(ULONG_PTR)BaseArray[ComPort];
Rs232ComPort = ComPort;
/*#ifndef NDEBUG
sprintf (buffer,
@@ -280,7 +280,7 @@
BOOLEAN Rs232PortInUse(ULONG Base)
{
#ifdef DBG
- return PortInitialized && Rs232PortBase == (PUCHAR)Base ? TRUE : FALSE;
+ return PortInitialized && Rs232PortBase == (PUCHAR)(ULONG_PTR)Base ? TRUE :
FALSE;
#else
return FALSE;
#endif
Modified: trunk/reactos/boot/freeldr/freeldr/disk/ramdisk.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/disk/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/disk/ramdisk.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/disk/ramdisk.c [iso-8859-1] Mon Sep 8 06:13:51
2008
@@ -66,7 +66,7 @@
//
// Get actual pointers and lengths
//
- StartAddress = (PVOID)((ULONG)SectorNumber * 512);
+ StartAddress = (PVOID)((ULONG_PTR)SectorNumber * 512);
Length = SectorCount * 512;
//
Modified: trunk/reactos/boot/freeldr/freeldr/fs/ext2.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/fs/ex…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/fs/ext2.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/fs/ext2.c [iso-8859-1] Mon Sep 8 06:13:51 2008
@@ -951,7 +951,7 @@
}
// Copy the data to their buffer
- RtlCopyMemory(InodeBuffer, (PVOID)(FILESYSBUFFER + (InodeOffsetInBlock *
EXT3_INODE_SIZE(Ext2SuperBlock))), sizeof(EXT2_INODE));
+ RtlCopyMemory(InodeBuffer, (PVOID)(ULONG_PTR)(FILESYSBUFFER + (InodeOffsetInBlock *
EXT3_INODE_SIZE(Ext2SuperBlock))), sizeof(EXT2_INODE));
DbgPrint((DPRINT_FILESYSTEM, "Dumping inode information:\n"));
DbgPrint((DPRINT_FILESYSTEM, "i_mode = 0x%x\n", InodeBuffer->i_mode));
Modified: trunk/reactos/boot/freeldr/freeldr/include/inifile.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/inifile.h [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/inifile.h [iso-8859-1] Mon Sep 8 06:13:51
2008
@@ -72,14 +72,14 @@
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
Modified: trunk/reactos/boot/freeldr/freeldr/inifile/inifile.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inifi…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/inifile/inifile.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/inifile/inifile.c [iso-8859-1] Mon Sep 8 06:13:51
2008
@@ -20,7 +20,7 @@
#include <freeldr.h>
#include <debug.h>
-BOOLEAN IniOpenSection(PCSTR SectionName, ULONG* SectionId)
+BOOLEAN IniOpenSection(PCSTR SectionName, ULONG_PTR* SectionId)
{
PINI_SECTION Section;
@@ -35,7 +35,7 @@
{
// 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 @@
return FALSE;
}
-ULONG IniGetNumSectionItems(ULONG SectionId)
+ULONG IniGetNumSectionItems(ULONG_PTR SectionId)
{
PINI_SECTION Section = (PINI_SECTION)SectionId;
@@ -59,7 +59,7 @@
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 @@
return NULL;
}
-ULONG IniGetSectionSettingNameSize(ULONG SectionId, ULONG SettingIndex)
+ULONG IniGetSectionSettingNameSize(ULONG_PTR SectionId, ULONG SettingIndex)
{
PINI_SECTION_ITEM SectionItem;
@@ -96,7 +96,7 @@
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 @@
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 @@
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 @@
return FALSE;
}
-BOOLEAN IniAddSection(PCSTR SectionName, ULONG* SectionId)
+BOOLEAN IniAddSection(PCSTR SectionName, ULONG_PTR* SectionId)
{
PINI_SECTION Section;
@@ -202,12 +202,12 @@
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;
Modified: trunk/reactos/boot/freeldr/freeldr/mm/meminit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/mm/me…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/mm/meminit.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/mm/meminit.c [iso-8859-1] Mon Sep 8 06:13:51 2008
@@ -169,7 +169,7 @@
ULONG MmGetPageNumberFromAddress(PVOID Address)
{
- return ((ULONG)Address) / MM_PAGE_SIZE;
+ return ((ULONG_PTR)Address) / MM_PAGE_SIZE;
}
PVOID MmGetEndAddressOfAnyMemory(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MapCount)
@@ -195,7 +195,7 @@
DbgPrint((DPRINT_MEMORY, "MmGetEndAddressOfAnyMemory() returning 0x%x\n",
(ULONG)EndAddressOfMemory));
- return (PVOID)(ULONG)EndAddressOfMemory;
+ return (PVOID)(ULONG_PTR)EndAddressOfMemory;
}
ULONG MmGetAddressablePageCountIncludingHoles(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG
MapCount)
@@ -203,7 +203,7 @@
ULONG PageCount;
ULONGLONG EndAddress;
- EndAddress = (ULONGLONG)(ULONG)MmGetEndAddressOfAnyMemory(BiosMemoryMap, MapCount);
+ EndAddress = (ULONGLONG)(ULONG_PTR)MmGetEndAddressOfAnyMemory(BiosMemoryMap, MapCount);
// Since MmGetEndAddressOfAnyMemory() won't
// return addresses higher than 0xFFFFFFFF
@@ -252,7 +252,7 @@
if (TempBiosMemoryMap[Index].Length >= PageLookupTableSize)
{
- PageLookupTableMemAddress = (PVOID)(ULONG)
+ PageLookupTableMemAddress = (PVOID)(ULONG_PTR)
(TempBiosMemoryMap[Index].BaseAddress + (TempBiosMemoryMap[Index].Length -
PageLookupTableSize));
break;
}
@@ -304,8 +304,8 @@
for (Index=0; Index<MapCount; Index++)
{
- MemoryMapStartPage =
MmGetPageNumberFromAddress((PVOID)(ULONG)BiosMemoryMap[Index].BaseAddress);
- MemoryMapEndPage =
MmGetPageNumberFromAddress((PVOID)(ULONG)(BiosMemoryMap[Index].BaseAddress +
BiosMemoryMap[Index].Length - 1));
+ MemoryMapStartPage =
MmGetPageNumberFromAddress((PVOID)(ULONG_PTR)BiosMemoryMap[Index].BaseAddress);
+ MemoryMapEndPage =
MmGetPageNumberFromAddress((PVOID)(ULONG_PTR)(BiosMemoryMap[Index].BaseAddress +
BiosMemoryMap[Index].Length - 1));
MemoryMapPageCount = (MemoryMapEndPage - MemoryMapStartPage) + 1;
switch (BiosMemoryMap[Index].Type)
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] Mon Sep 8 06:13:51 2008
@@ -67,7 +67,7 @@
MmAllocatePagesInLookupTable(PageLookupTableAddress, FirstFreePageFromEnd, PagesNeeded,
MemoryType);
FreePagesInLookupTable -= PagesNeeded;
- MemPointer = (PVOID)(FirstFreePageFromEnd * MM_PAGE_SIZE);
+ MemPointer = (PVOID)((ULONG_PTR)FirstFreePageFromEnd * MM_PAGE_SIZE);
#ifdef DBG
DbgPrint((DPRINT_MEMORY, "Allocated %d bytes (%d pages) of memory starting at page
%d.\n", MemorySize, PagesNeeded, FirstFreePageFromEnd));
@@ -167,7 +167,7 @@
MmAllocatePagesInLookupTable(PageLookupTableAddress, StartPageNumber, PagesNeeded,
MemoryType);
FreePagesInLookupTable -= PagesNeeded;
- MemPointer = (PVOID)(StartPageNumber * MM_PAGE_SIZE);
+ MemPointer = (PVOID)((ULONG_PTR)StartPageNumber * MM_PAGE_SIZE);
#ifdef DBG
DbgPrint((DPRINT_MEMORY, "Allocated %d bytes (%d pages) of memory starting at page
%d.\n", MemorySize, PagesNeeded, StartPageNumber));
@@ -201,7 +201,7 @@
PagesNeeded = ROUND_UP(MemorySize, MM_PAGE_SIZE) / MM_PAGE_SIZE;
// Get the page number for their desired address
- DesiredAddressPageNumber = (ULONG)DesiredAddress / MM_PAGE_SIZE;
+ DesiredAddressPageNumber = (ULONG_PTR)DesiredAddress / MM_PAGE_SIZE;
// If we don't have enough available mem
// then return NULL
@@ -224,7 +224,7 @@
MmAllocatePagesInLookupTable(PageLookupTableAddress, FirstFreePageFromEnd, PagesNeeded,
MemoryType);
FreePagesInLookupTable -= PagesNeeded;
- MemPointer = (PVOID)(FirstFreePageFromEnd * MM_PAGE_SIZE);
+ MemPointer = (PVOID)((ULONG_PTR)FirstFreePageFromEnd * MM_PAGE_SIZE);
#ifdef DBG
DbgPrint((DPRINT_MEMORY, "Allocated %d bytes (%d pages) of memory starting at page
%d.\n", MemorySize, PagesNeeded, FirstFreePageFromEnd));
Modified: trunk/reactos/boot/freeldr/freeldr/oslist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/oslis…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/oslist.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/oslist.c [iso-8859-1] Mon Sep 8 06:13:51 2008
@@ -26,8 +26,8 @@
CHAR SettingName[260];
CHAR SettingValue[260];
ULONG OperatingSystemCount;
- ULONG SectionId;
- ULONG OperatingSystemSectionId;
+ ULONG_PTR SectionId;
+ ULONG_PTR OperatingSystemSectionId;
ULONG SectionSettingCount;
PCHAR *OperatingSystemSectionNames;
PCHAR *OperatingSystemDisplayNames;
Modified: trunk/reactos/boot/freeldr/freeldr/reactos/imageldr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/reactos/imageldr.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/reactos/imageldr.c [iso-8859-1] Mon Sep 8 06:13:51
2008
@@ -231,8 +231,8 @@
USHORT Hint)
{
PIMAGE_EXPORT_DIRECTORY ExportDir;
- PULONG * ExFunctions;
- PULONG * ExNames;
+ ULONG * ExFunctions;
+ ULONG * ExNames;
USHORT * ExOrdinals;
PVOID ExName;
ULONG Ordinal;
@@ -267,10 +267,10 @@
/*
* Get header pointers
*/
- ExNames = (PULONG *)RVA(BaseAddress, ExportDir->AddressOfNames);
+ ExNames = (ULONG *)RVA(BaseAddress, ExportDir->AddressOfNames);
ExOrdinals = (USHORT *)RVA(BaseAddress, ExportDir->AddressOfNameOrdinals);
- ExFunctions = (PULONG *)RVA(BaseAddress, ExportDir->AddressOfFunctions);
-
+ ExFunctions = (ULONG *)RVA(BaseAddress, ExportDir->AddressOfFunctions);
+
/*
* Check the hint first
*/
@@ -348,7 +348,7 @@
PIMAGE_IMPORT_DESCRIPTOR ImportModuleDirectory)
{
PVOID* ImportAddressList;
- PULONG FunctionNameList;
+ PULONG_PTR FunctionNameList;
if (ImportModuleDirectory == NULL || ImportModuleDirectory->Name == 0)
{
@@ -361,11 +361,11 @@
/* Get the list of functions to import. */
if (ImportModuleDirectory->OriginalFirstThunk != 0)
{
- FunctionNameList = (PULONG)RVA(DriverBase,
ImportModuleDirectory->OriginalFirstThunk);
+ FunctionNameList = (PULONG_PTR)RVA(DriverBase,
ImportModuleDirectory->OriginalFirstThunk);
}
else
{
- FunctionNameList = (PULONG)RVA(DriverBase,
ImportModuleDirectory->FirstThunk);
+ FunctionNameList = (PULONG_PTR)RVA(DriverBase,
ImportModuleDirectory->FirstThunk);
}
/* Walk through function list and fixup addresses. */
Modified: trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c [iso-8859-1] Mon Sep 8 06:13:51
2008
@@ -571,7 +571,7 @@
CHAR szKernelName[255];
CHAR szFileName[255];
CHAR MsgBuffer[256];
- ULONG SectionId;
+ ULONG_PTR SectionId;
PIMAGE_NT_HEADERS NtHeader;
PVOID LoadBase;
ULONG_PTR Base;
@@ -628,19 +628,19 @@
UiDrawProgressBarCenter(1, 100, szLoadingMsg);
UiDrawStatusText("Detecting Hardware...");
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++)
{
@@ -730,7 +730,7 @@
/*
* Detect hardware
*/
- LoaderBlock.ArchExtra = (ULONG)MachHwDetect();
+ LoaderBlock.ArchExtra = (ULONG_PTR)MachHwDetect();
UiDrawProgressBarCenter(5, 100, szLoadingMsg);
LoaderBlock.DrivesCount = reactos_disk_count;
Modified: trunk/reactos/boot/freeldr/freeldr/reactos/registry.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/reactos/registry.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/reactos/registry.c [iso-8859-1] Mon Sep 8 06:13:51
2008
@@ -460,8 +460,8 @@
PLIST_ENTRY Ptr;
PVALUE Value = NULL;
- DbgPrint((DPRINT_REGISTRY, "Key 0x%x, ValueName '%S', Type %d, Data 0x%x,
DataSize %d\n",
- (int)Key, ValueName, (int)Type, (int)Data, (int)DataSize));
+ DbgPrint((DPRINT_REGISTRY, "Key 0x%p, ValueName '%S', Type %ld, Data 0x%p,
DataSize %ld\n",
+ Key, ValueName, Type, Data, DataSize));
if ((ValueName == NULL) || (*ValueName == 0))
{
Modified: trunk/reactos/boot/freeldr/freeldr/reactos/setupldr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/reactos/setupldr.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/reactos/setupldr.c [iso-8859-1] Mon Sep 8 06:13:51
2008
@@ -68,20 +68,20 @@
/* 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 &&
@@ -113,7 +113,7 @@
/* Detect hardware */
UiDrawStatusText("Detecting hardware...");
- LoaderBlock.ArchExtra = (ULONG)MachHwDetect();
+ LoaderBlock.ArchExtra = (ULONG_PTR)MachHwDetect();
UiDrawStatusText("");
/* set boot device */
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] Mon Sep 8 06:13:51 2008
@@ -80,7 +80,7 @@
{
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 @@
CHAR SettingValue[80];
PCHAR MessageBoxText;
ULONG MessageBoxTextSize;
- ULONG SectionId;
+ ULONG_PTR SectionId;
if (!IniOpenSection(SectionName, &SectionId))
{