fix code that depends on GCC's void* pointer arithmetic extension
Modified: trunk/reactos/drivers/dd/ramdrv/ramdrv.c
Modified: trunk/reactos/drivers/fs/cdfs/dirctl.c
Modified: trunk/reactos/drivers/fs/cdfs/fcb.c
Modified: trunk/reactos/drivers/fs/np/rw.c
Modified: trunk/reactos/drivers/fs/ntfs/attrib.c
Modified: trunk/reactos/drivers/fs/ntfs/mft.c
Modified: trunk/reactos/drivers/lib/ip/network/receive.c
Modified: trunk/reactos/drivers/lib/ip/transport/udp/udp.c
Modified: trunk/reactos/drivers/net/dd/pcnet/pcnet.c
Modified: trunk/reactos/drivers/net/dd/pcnet/pcnet.h
Modified: trunk/reactos/drivers/net/ndis/ndis/io.c
Modified: trunk/reactos/drivers/storage/atapi/atapi.c
Modified: trunk/reactos/drivers/storage/cdrom/cdrom.c
Modified: trunk/reactos/drivers/storage/scsiport/scsiport.c
Modified: trunk/reactos/drivers/video/displays/vga/objects/bitblt.c
Modified: trunk/reactos/drivers/video/displays/vga/vgavideo/vgavideo.c
Modified: trunk/reactos/drivers/video/videoprt/videoprt.c
Modified: trunk/reactos/include/reactos/helper.h
Modified: trunk/reactos/lib/crt/search/lsearch.c
Modified: trunk/reactos/lib/kernel32/file/find.c
Modified: trunk/reactos/lib/kernel32/mem/global.c
Modified: trunk/reactos/lib/kernel32/process/create.c
Modified: trunk/reactos/lib/ntdll/csr/lpc.c
Modified: trunk/reactos/lib/ntdll/ldr/startup.c
Modified: trunk/reactos/lib/ntdll/ldr/utils.c
Modified: trunk/reactos/lib/rosrtl/thread/i386/context.c
Modified: trunk/reactos/lib/rtl/image.c
Modified: trunk/reactos/lib/rtl/process.c
Modified: trunk/reactos/lib/rtl/registry.c
Modified: trunk/reactos/lib/user32/windows/bitmap.c
_____
Modified: trunk/reactos/drivers/dd/ramdrv/ramdrv.c
--- trunk/reactos/drivers/dd/ramdrv/ramdrv.c 2005-07-04 23:05:17 UTC
(rev 16419)
+++ trunk/reactos/drivers/dd/ramdrv/ramdrv.c 2005-07-05 00:24:36 UTC
(rev 16420)
@@ -63,9 +63,9 @@
Stk->Parameters.Read.Length = devext->Size -
Stk->Parameters.Read.ByteOffset.u.LowPart;
if( Stk->MajorFunction == IRP_MJ_READ )
RtlCopyMemory( MmGetSystemAddressForMdl( Irp->MdlAddress ),
- devext->Buffer +
Stk->Parameters.Read.ByteOffset.u.LowPart,
+ (PVOID)((ULONG_PTR)devext->Buffer +
Stk->Parameters.Read.ByteOffset.u.LowPart),
Stk->Parameters.Read.Length );
- else RtlCopyMemory( devext->Buffer +
Stk->Parameters.Read.ByteOffset.u.LowPart,
+ else RtlCopyMemory( (PVOID)((ULONG_PTR)devext->Buffer +
Stk->Parameters.Read.ByteOffset.u.LowPart),
MmGetSystemAddressForMdl( Irp->MdlAddress ),
Stk->Parameters.Read.Length );
Irp->IoStatus.Status = STATUS_SUCCESS;
_____
Modified: trunk/reactos/drivers/fs/cdfs/dirctl.c
--- trunk/reactos/drivers/fs/cdfs/dirctl.c 2005-07-04 23:05:17 UTC
(rev 16419)
+++ trunk/reactos/drivers/fs/cdfs/dirctl.c 2005-07-05 00:24:36 UTC
(rev 16420)
@@ -69,10 +69,10 @@
Record = (PDIR_RECORD)*Block;
while (Index < *pIndex)
{
- (*Ptr) += Record->RecordLength;
+ (*Ptr) = (PVOID)((ULONG_PTR)(*Ptr) + Record->RecordLength);
(*CurrentOffset) += Record->RecordLength;
Record = *Ptr;
- if (*Ptr - *Block >= BLOCKSIZE || Record->RecordLength == 0)
+ if ((ULONG_PTR)(*Ptr) - (ULONG_PTR)(*Block) >= BLOCKSIZE ||
Record->RecordLength == 0)
{
DPRINT("Map next sector\n");
CcUnpinData(*Context);
@@ -96,7 +96,7 @@
}
}
- if (*Ptr - *Block >= BLOCKSIZE || Record->RecordLength == 0)
+ if ((ULONG_PTR)(*Ptr) - (ULONG_PTR)(*Block) >= BLOCKSIZE ||
Record->RecordLength == 0)
{
DPRINT("Map next sector\n");
CcUnpinData(*Context);
@@ -259,11 +259,11 @@
return STATUS_UNSUCCESSFUL;
}
- Record = (PDIR_RECORD) (Block + Offset % BLOCKSIZE);
+ Record = (PDIR_RECORD) ((ULONG_PTR)Block + Offset % BLOCKSIZE);
if (Offset)
{
Offset += Record->RecordLength;
- Record = (PVOID)Record + Record->RecordLength;
+ Record = (PDIR_RECORD)((ULONG_PTR)Record + Record->RecordLength);
}
while(TRUE)
@@ -356,7 +356,7 @@
}
Offset += Record->RecordLength;
- Record = (PVOID)Record + Record->RecordLength;
+ Record = (PDIR_RECORD)((ULONG_PTR)Record + Record->RecordLength);
DirIndex++;
}
_____
Modified: trunk/reactos/drivers/fs/cdfs/fcb.c
--- trunk/reactos/drivers/fs/cdfs/fcb.c 2005-07-04 23:05:17 UTC (rev
16419)
+++ trunk/reactos/drivers/fs/cdfs/fcb.c 2005-07-05 00:24:36 UTC (rev
16420)
@@ -580,7 +580,7 @@
Offset += Record->RecordLength;
BlockOffset += Record->RecordLength;
- Record = (PDIR_RECORD)(Block + BlockOffset);
+ Record = (PDIR_RECORD)((ULONG_PTR)Block + BlockOffset);
if (BlockOffset >= BLOCKSIZE || Record->RecordLength == 0)
{
DPRINT("Map next sector\n");
@@ -597,7 +597,7 @@
DPRINT("CcMapData() failed\n");
return(STATUS_UNSUCCESSFUL);
}
- Record = (PDIR_RECORD)(Block + BlockOffset);
+ Record = (PDIR_RECORD)((ULONG_PTR)Block + BlockOffset);
}
if (Offset >= DirSize)
_____
Modified: trunk/reactos/drivers/fs/np/rw.c
--- trunk/reactos/drivers/fs/np/rw.c 2005-07-04 23:05:17 UTC (rev
16419)
+++ trunk/reactos/drivers/fs/np/rw.c 2005-07-05 00:24:36 UTC (rev
16420)
@@ -390,7 +390,7 @@
Information = Irp->IoStatus.Information;
Length =
IoGetCurrentIrpStackLocation(Irp)->Parameters.Read.Length;
ASSERT (Information <= Length);
- Buffer += Information;
+ Buffer = (PVOID)((ULONG_PTR)Buffer + Information);
Length -= Information;
Status = STATUS_SUCCESS;
@@ -450,24 +450,24 @@
while (Length > 0 && Fcb->ReadDataAvailable > 0)
{
CopyLength = min(Fcb->ReadDataAvailable, Length);
- if (Fcb->ReadPtr + CopyLength <= Fcb->Data +
Fcb->MaxDataLength)
+ if ((ULONG_PTR)Fcb->ReadPtr + CopyLength <=
(ULONG_PTR)Fcb->Data + Fcb->MaxDataLength)
{
memcpy(Buffer, Fcb->ReadPtr, CopyLength);
- Fcb->ReadPtr += CopyLength;
- if (Fcb->ReadPtr == Fcb->Data + Fcb->MaxDataLength)
+ Fcb->ReadPtr = (PVOID)((ULONG_PTR)Fcb->ReadPtr +
CopyLength);
+ if (Fcb->ReadPtr == (PVOID)((ULONG_PTR)Fcb->Data +
Fcb->MaxDataLength))
{
Fcb->ReadPtr = Fcb->Data;
}
}
else
{
- TempLength = Fcb->Data + Fcb->MaxDataLength -
Fcb->ReadPtr;
+ TempLength = (ULONG)((ULONG_PTR)Fcb->Data +
Fcb->MaxDataLength - (ULONG_PTR)Fcb->ReadPtr);
memcpy(Buffer, Fcb->ReadPtr, TempLength);
- memcpy(Buffer + TempLength, Fcb->Data, CopyLength -
TempLength);
- Fcb->ReadPtr = Fcb->Data + CopyLength - TempLength;
+ memcpy((PVOID)((ULONG_PTR)Buffer + TempLength),
Fcb->Data, CopyLength - TempLength);
+ Fcb->ReadPtr = (PVOID)((ULONG_PTR)Fcb->Data +
CopyLength - TempLength);
}
- Buffer += CopyLength;
+ Buffer = (PVOID)((ULONG_PTR)Buffer + CopyLength);
Length -= CopyLength;
Information += CopyLength;
@@ -505,7 +505,7 @@
if (Fcb->ReadDataAvailable > Length)
{
- memmove(Fcb->Data, Fcb->Data + Length,
+ memmove(Fcb->Data, (PVOID)((ULONG_PTR)Fcb->Data +
Length),
Fcb->ReadDataAvailable - Length);
Fcb->ReadDataAvailable -= Length;
Status = STATUS_MORE_ENTRIES;
@@ -694,21 +694,21 @@
while (Length > 0 && ReaderFcb->WriteQuotaAvailable > 0)
{
CopyLength = min(Length, ReaderFcb->WriteQuotaAvailable);
- if (ReaderFcb->WritePtr + CopyLength <= ReaderFcb->Data +
ReaderFcb->MaxDataLength)
+ if ((ULONG_PTR)ReaderFcb->WritePtr + CopyLength <=
(ULONG_PTR)ReaderFcb->Data + ReaderFcb->MaxDataLength)
{
memcpy(ReaderFcb->WritePtr, Buffer, CopyLength);
- ReaderFcb->WritePtr += CopyLength;
- if (ReaderFcb->WritePtr == ReaderFcb->Data +
ReaderFcb->MaxDataLength)
+ ReaderFcb->WritePtr =
(PVOID)((ULONG_PTR)ReaderFcb->WritePtr + CopyLength);
+ if ((ULONG_PTR)ReaderFcb->WritePtr ==
(ULONG_PTR)ReaderFcb->Data + ReaderFcb->MaxDataLength)
{
ReaderFcb->WritePtr = ReaderFcb->Data;
}
}
else
{
- TempLength = ReaderFcb->Data +
ReaderFcb->MaxDataLength - ReaderFcb->WritePtr;
+ TempLength = (ULONG)((ULONG_PTR)ReaderFcb->Data +
ReaderFcb->MaxDataLength - (ULONG_PTR)ReaderFcb->WritePtr);
memcpy(ReaderFcb->WritePtr, Buffer, TempLength);
memcpy(ReaderFcb->Data, Buffer + TempLength,
CopyLength - TempLength);
- ReaderFcb->WritePtr = ReaderFcb->Data + CopyLength -
TempLength;
+ ReaderFcb->WritePtr =
(PVOID)((ULONG_PTR)ReaderFcb->Data + CopyLength - TempLength);
}
Buffer += CopyLength;
_____
Modified: trunk/reactos/drivers/fs/ntfs/attrib.c
--- trunk/reactos/drivers/fs/ntfs/attrib.c 2005-07-04 23:05:17 UTC
(rev 16419)
+++ trunk/reactos/drivers/fs/ntfs/attrib.c 2005-07-05 00:24:36 UTC
(rev 16420)
@@ -125,7 +125,7 @@
ResAttr = (PRESIDENT_ATTRIBUTE)Attribute;
// DbgPrint(" Length %lu Offset %hu ", ResAttr->ValueLength,
ResAttr->ValueOffset);
- FileNameAttr = (PFILENAME_ATTRIBUTE)((PVOID)ResAttr +
ResAttr->ValueOffset);
+ FileNameAttr = (PFILENAME_ATTRIBUTE)((ULONG_PTR)ResAttr +
ResAttr->ValueOffset);
DbgPrint(" '%.*S' ", FileNameAttr->NameLength,
FileNameAttr->Name);
}
@@ -141,7 +141,7 @@
ResAttr = (PRESIDENT_ATTRIBUTE)Attribute;
// DbgPrint(" Length %lu Offset %hu ", ResAttr->ValueLength,
ResAttr->ValueOffset);
- VolumeName = (PWCHAR)((PVOID)ResAttr + ResAttr->ValueOffset);
+ VolumeName = (PWCHAR)((ULONG_PTR)ResAttr + ResAttr->ValueOffset);
DbgPrint(" '%.*S' ", ResAttr->ValueLength / sizeof(WCHAR),
VolumeName);
}
@@ -157,7 +157,7 @@
ResAttr = (PRESIDENT_ATTRIBUTE)Attribute;
// DbgPrint(" Length %lu Offset %hu ", ResAttr->ValueLength,
ResAttr->ValueOffset);
- VolInfoAttr = (PVOLINFO_ATTRIBUTE)((PVOID)ResAttr +
ResAttr->ValueOffset);
+ VolInfoAttr = (PVOLINFO_ATTRIBUTE)((ULONG_PTR)ResAttr +
ResAttr->ValueOffset);
DbgPrint(" NTFS Version %u.%u Flags 0x%04hx ",
VolInfoAttr->MajorVersion,
VolInfoAttr->MinorVersion,
_____
Modified: trunk/reactos/drivers/fs/ntfs/mft.c
--- trunk/reactos/drivers/fs/ntfs/mft.c 2005-07-04 23:05:17 UTC (rev
16419)
+++ trunk/reactos/drivers/fs/ntfs/mft.c 2005-07-05 00:24:36 UTC (rev
16420)
@@ -208,7 +208,7 @@
ULONG n = m > 0 ? (index & m) : 0;
- memcpy(file, p + n * BytesPerFileRecord, BytesPerFileRecord);
+ memcpy(file, (PVOID)((ULONG_PTR)p + n * BytesPerFileRecord),
BytesPerFileRecord);
ExFreePool(p);
@@ -290,7 +290,7 @@
VOID FixupUpdateSequenceArray(PFILE_RECORD_HEADER file)
{
- PUSHORT usa = (PUSHORT)((PVOID)file + file->Ntfs.UsaOffset);
+ PUSHORT usa = (PUSHORT)((ULONG_PTR)file + file->Ntfs.UsaOffset);
PUSHORT sector = (PUSHORT)file;
ULONG i;
_____
Modified: trunk/reactos/drivers/lib/ip/network/receive.c
--- trunk/reactos/drivers/lib/ip/network/receive.c 2005-07-04
23:05:17 UTC (rev 16419)
+++ trunk/reactos/drivers/lib/ip/network/receive.c 2005-07-05
00:24:36 UTC (rev 16420)
@@ -225,7 +225,7 @@
/* Copy the header into the buffer */
RtlCopyMemory(IPPacket->Header, &IPDR->IPv4Header, IPDR->HeaderSize);
- Data = IPPacket->Header + IPDR->HeaderSize;
+ Data = (PVOID)((ULONG_PTR)IPPacket->Header + IPDR->HeaderSize);
IPPacket->Data = Data;
/* Copy data from all fragments into buffer */
_____
Modified: trunk/reactos/drivers/lib/ip/transport/udp/udp.c
--- trunk/reactos/drivers/lib/ip/transport/udp/udp.c 2005-07-04
23:05:17 UTC (rev 16419)
+++ trunk/reactos/drivers/lib/ip/transport/udp/udp.c 2005-07-05
00:24:36 UTC (rev 16420)
@@ -44,7 +44,7 @@
sizeof(UDP_HEADER), (PVOID *)&UDPHeader );
/* Build UDP header */
- UDPHeader = (PUDP_HEADER)(IPPacket->Data - sizeof(UDP_HEADER));
+ UDPHeader = (PUDP_HEADER)((ULONG_PTR)IPPacket->Data -
sizeof(UDP_HEADER));
/* Port values are already big-endian values */
UDPHeader->SourcePort = LocalPort;
UDPHeader->DestPort = RemotePort;
_____
Modified: trunk/reactos/drivers/net/dd/pcnet/pcnet.c
--- trunk/reactos/drivers/net/dd/pcnet/pcnet.c 2005-07-04 23:05:17 UTC
(rev 16419)
+++ trunk/reactos/drivers/net/dd/pcnet/pcnet.c 2005-07-05 00:24:36 UTC
(rev 16420)
@@ -564,7 +564,7 @@
NdisMDeregisterInterrupt(&Adapter->InterruptObject);
/* deregister i/o port range */
- NdisMDeregisterIoPortRange(Adapter->MiniportAdapterHandle,
Adapter->IoBaseAddress, NUMBER_OF_PORTS, Adapter->PortOffset);
+ NdisMDeregisterIoPortRange(Adapter->MiniportAdapterHandle,
Adapter->IoBaseAddress, NUMBER_OF_PORTS, (PVOID)Adapter->PortOffset);
/* free shared memory */
MiFreeSharedMemory(Adapter);
@@ -852,8 +852,8 @@
}
/* register an IO port range */
- Status = NdisMRegisterIoPortRange(&Adapter->PortOffset,
Adapter->MiniportAdapterHandle,
- Adapter->IoBaseAddress, NUMBER_OF_PORTS);
+ Status = NdisMRegisterIoPortRange((PVOID*)&Adapter->PortOffset,
Adapter->MiniportAdapterHandle,
+ (UINT)Adapter->IoBaseAddress, NUMBER_OF_PORTS);
if(Status != NDIS_STATUS_SUCCESS)
{
DPRINT1("NdisMRegisterIoPortRange failed: 0x%x\n", Status);
@@ -914,7 +914,7 @@
NdisMFreeMapRegisters(Adapter->MiniportAdapterHandle); /* doesn't
hurt to free if we never alloc'd? */
if(Adapter->PortOffset)
- NdisMDeregisterIoPortRange(Adapter->MiniportAdapterHandle,
Adapter->IoBaseAddress, NUMBER_OF_PORTS, Adapter->PortOffset);
+ NdisMDeregisterIoPortRange(Adapter->MiniportAdapterHandle,
Adapter->IoBaseAddress, NUMBER_OF_PORTS, (PVOID)Adapter->PortOffset);
if(InterruptRegistered)
NdisMDeregisterInterrupt(&Adapter->InterruptObject);
_____
Modified: trunk/reactos/drivers/net/dd/pcnet/pcnet.h
--- trunk/reactos/drivers/net/dd/pcnet/pcnet.h 2005-07-04 23:05:17 UTC
(rev 16419)
+++ trunk/reactos/drivers/net/dd/pcnet/pcnet.h 2005-07-05 00:24:36 UTC
(rev 16420)
@@ -57,7 +57,7 @@
ULONG Flags;
ULONG InterruptVector;
ULONG IoBaseAddress;
- PVOID PortOffset;
+ ULONG_PTR PortOffset;
NDIS_MINIPORT_INTERRUPT InterruptObject;
NDIS_MEDIA_STATE MediaState;
NDIS_MINIPORT_TIMER MediaDetectionTimer;
_____
Modified: trunk/reactos/drivers/net/ndis/ndis/io.c
--- trunk/reactos/drivers/net/ndis/ndis/io.c 2005-07-04 23:05:17 UTC
(rev 16419)
+++ trunk/reactos/drivers/net/ndis/ndis/io.c 2005-07-05 00:24:36 UTC
(rev 16420)
@@ -487,7 +487,7 @@
*/
{
PLOGICAL_ADAPTER Adapter = 0;
- VOID *CurrentVa;
+ PVOID CurrentVa;
ULONG TotalLength;
PHYSICAL_ADDRESS ReturnedAddress;
UINT LoopCount = 0;
@@ -514,7 +514,7 @@
PhysicalAddressArray[LoopCount].Length = Length;
TotalLength -= Length;
- CurrentVa += Length;
+ CurrentVa = (PVOID)((ULONG_PTR)CurrentVa + Length);
LoopCount++;
}
_____
Modified: trunk/reactos/drivers/storage/atapi/atapi.c
--- trunk/reactos/drivers/storage/atapi/atapi.c 2005-07-04 23:05:17 UTC
(rev 16419)
+++ trunk/reactos/drivers/storage/atapi/atapi.c 2005-07-05 00:24:36 UTC
(rev 16420)
@@ -3066,7 +3066,7 @@
DPRINT("AtapiInitDma()\n");
StartAddress = Srb->DataBuffer;
- EndAddress = StartAddress + Srb->DataTransferLength;
+ EndAddress = (PVOID)((ULONG_PTR)StartAddress +
Srb->DataTransferLength);
DevExt->PRDCount = 0;
while (StartAddress < EndAddress)
@@ -3105,7 +3105,7 @@
return FALSE;
}
PhysicalAddress.u.LowPart += tmpLength;
- StartAddress += tmpLength;
+ StartAddress = (PVOID)((ULONG_PTR)StartAddress +
tmpLength);
Length -= tmpLength;
PRDEntry->PhysAddress = PhysicalAddress.u.LowPart;
}
@@ -3114,7 +3114,7 @@
PRDEntry->PhysAddress = PhysicalAddress.u.LowPart;
PRDEntry->Length = tmpLength;
PRDEntry++;
- StartAddress += tmpLength;
+ StartAddress = (PVOID)((ULONG_PTR)StartAddress + tmpLength);
PhysicalAddress.u.LowPart += tmpLength;
Length -= tmpLength;
}
_____
Modified: trunk/reactos/drivers/storage/cdrom/cdrom.c
--- trunk/reactos/drivers/storage/cdrom/cdrom.c 2005-07-04 23:05:17 UTC
(rev 16419)
+++ trunk/reactos/drivers/storage/cdrom/cdrom.c 2005-07-05 00:24:36 UTC
(rev 16420)
@@ -1485,10 +1485,10 @@
if (Retry == TRUE &&
(ULONG)OrigNextIrpStack->Parameters.Others.Argument1 > 0)
{
- DPRINT1 ("Try again (Retry count %lu)\n",
+ DPRINT1 ("Try again (Retry count 0x%p)\n",
(ULONG)OrigNextIrpStack->Parameters.Others.Argument1);
- (ULONG)OrigNextIrpStack->Parameters.Others.Argument1--;
+ OrigNextIrpStack->Parameters.Others.Argument1 =
(PVOID)((ULONG_PTR)OrigNextIrpStack->Parameters.Others.Argument1 - 1);
/* Release 'old' buffers */
ExFreePool (Srb->SenseInfoBuffer);
_____
Modified: trunk/reactos/drivers/storage/scsiport/scsiport.c
--- trunk/reactos/drivers/storage/scsiport/scsiport.c 2005-07-04
23:05:17 UTC (rev 16419)
+++ trunk/reactos/drivers/storage/scsiport/scsiport.c 2005-07-05
00:24:36 UTC (rev 16420)
@@ -478,7 +478,7 @@
}
if (Srb == NULL)
{
- EndAddress = DeviceExtension->VirtualAddress +
DeviceExtension->CommonBufferLength;
+ EndAddress = (PVOID)((ULONG_PTR)DeviceExtension->VirtualAddress +
DeviceExtension->CommonBufferLength);
if (VirtualAddress >= DeviceExtension->VirtualAddress &&
VirtualAddress < EndAddress)
{
Offset = (ULONG_PTR)VirtualAddress -
(ULONG_PTR)DeviceExtension->VirtualAddress;
@@ -506,14 +506,14 @@
}
else
{
- EndAddress = Srb->DataBuffer + Srb->DataTransferLength;
+ EndAddress = (PVOID)((ULONG_PTR)Srb->DataBuffer +
Srb->DataTransferLength);
if (VirtualAddress == NULL)
{
VirtualAddress = Srb->DataBuffer;
}
else if (VirtualAddress < Srb->DataBuffer || VirtualAddress >=
EndAddress)
{
- EndAddress = Srb->SenseInfoBuffer +
Srb->SenseInfoBufferLength;
+ EndAddress = (PVOID)((ULONG_PTR)Srb->SenseInfoBuffer +
Srb->SenseInfoBufferLength);
if (VirtualAddress < Srb->SenseInfoBuffer || VirtualAddress >=
EndAddress)
{
PhysicalAddress.QuadPart = 0LL;
@@ -530,18 +530,18 @@
}
BufferLength = PAGE_SIZE - (ULONG_PTR)VirtualAddress % PAGE_SIZE;
- while (VirtualAddress + BufferLength < EndAddress)
+ while ((ULONG_PTR)VirtualAddress + BufferLength <
(ULONG_PTR)EndAddress)
{
- NextPhysicalAddress = MmGetPhysicalAddress(VirtualAddress +
BufferLength);
+ NextPhysicalAddress =
MmGetPhysicalAddress((PVOID)((ULONG_PTR)VirtualAddress + BufferLength));
if (PhysicalAddress.QuadPart + BufferLength !=
NextPhysicalAddress.QuadPart)
{
break;
}
BufferLength += PAGE_SIZE;
}
- if (VirtualAddress + BufferLength >= EndAddress)
+ if ((ULONG_PTR)VirtualAddress + BufferLength >=
(ULONG_PTR)EndAddress)
{
- BufferLength = EndAddress - VirtualAddress;
+ BufferLength = (ULONG)((ULONG_PTR)EndAddress -
(ULONG_PTR)VirtualAddress);
}
}
if (Length != NULL)
@@ -1786,7 +1786,7 @@
if (index != 0xffffffff)
{
DeviceExtension->CurrentSrbExtensions++;
- Srb->SrbExtension = DeviceExtension->VirtualAddress + index *
DeviceExtension->SrbExtensionSize;
+ Srb->SrbExtension =
(PVOID)((ULONG_PTR)DeviceExtension->VirtualAddress + index *
DeviceExtension->SrbExtensionSize);
}
}
DPRINT("%x\n", Srb->SrbExtension);
_____
Modified: trunk/reactos/drivers/video/displays/vga/objects/bitblt.c
--- trunk/reactos/drivers/video/displays/vga/objects/bitblt.c
2005-07-04 23:05:17 UTC (rev 16419)
+++ trunk/reactos/drivers/video/displays/vga/objects/bitblt.c
2005-07-05 00:24:36 UTC (rev 16420)
@@ -52,14 +52,14 @@
if (NULL == ColorTranslation || 0 != (ColorTranslation->flXlate &
XO_TRIVIAL))
{
DIB_BltToVGA(DestRect->left, DestRect->top, dx, dy,
- Source->pvScan0 + SourcePoint->y * Source->lDelta +
(SourcePoint->x >> 1),
+ (PVOID)((ULONG_PTR)Source->pvScan0 + SourcePoint->y
* Source->lDelta + (SourcePoint->x >> 1)),
Source->lDelta, SourcePoint->x % 2);
}
else
{
/* Perform color translation */
DIB_BltToVGAWithXlate(DestRect->left, DestRect->top, dx, dy,
- Source->pvScan0 + SourcePoint->y *
Source->lDelta + (SourcePoint->x >> 1),
+ (PVOID)((ULONG_PTR)Source->pvScan0 +
SourcePoint->y * Source->lDelta + (SourcePoint->x >> 1)),
Source->lDelta, ColorTranslation);
}
return FALSE;
_____
Modified: trunk/reactos/drivers/video/displays/vga/vgavideo/vgavideo.c
--- trunk/reactos/drivers/video/displays/vga/vgavideo/vgavideo.c
2005-07-04 23:05:17 UTC (rev 16419)
+++ trunk/reactos/drivers/video/displays/vga/vgavideo/vgavideo.c
2005-07-05 00:24:36 UTC (rev 16420)
@@ -409,7 +409,7 @@
/* Reset the destination. */
for (j = 0; j < h; j++)
{
- memset(b + (j * Dest_lDelta), 0, abs(Dest_lDelta));
+ memset((PVOID)((ULONG_PTR)b + (j * Dest_lDelta)), 0,
abs(Dest_lDelta));
}
for (plane = 0; plane < 4; plane++)
@@ -986,7 +986,7 @@
int i, j, dib_shift;
bpX = b;
- dib = bdib + y * dibw + (x / 2);
+ dib = (unsigned char *)bdib + y * dibw + (x / 2);
for (i=w; i>0; i--) {
@@ -1015,7 +1015,7 @@
int i, j, dib_shift, dib_and;
bpX = b;
- dib = bdib + y * dibw + (x / 2);
+ dib = (unsigned char *)bdib + y * dibw + (x / 2);
for (i=w; i>0; i--) {
_____
Modified: trunk/reactos/drivers/video/videoprt/videoprt.c
--- trunk/reactos/drivers/video/videoprt/videoprt.c 2005-07-04
23:05:17 UTC (rev 16419)
+++ trunk/reactos/drivers/video/videoprt/videoprt.c 2005-07-05
00:24:36 UTC (rev 16420)
@@ -57,7 +57,7 @@
if (Va == 0)
return NULL;
- return (PVOID)(BaseAddress + Va);
+ return (PVOID)((ULONG_PTR)BaseAddress + Va);
}
PVOID STDCALL
@@ -103,7 +103,7 @@
((ULONG_PTR)BaseAddress + (ULONG_PTR)ExportDir->AddressOfNames);
for (i = 0; i < ExportDir->NumberOfNames; i++, NamePtr++,
OrdinalPtr++)
{
- if (!_strnicmp((PCHAR)FunctionName, (PCHAR)(BaseAddress +
*NamePtr),
+ if (!_strnicmp((PCHAR)FunctionName,
(PCHAR)((ULONG_PTR)BaseAddress + *NamePtr),
strlen((PCHAR)FunctionName)))
{
return (PVOID)((ULONG_PTR)BaseAddress +
_____
Modified: trunk/reactos/include/reactos/helper.h
--- trunk/reactos/include/reactos/helper.h 2005-07-04 23:05:17 UTC
(rev 16419)
+++ trunk/reactos/include/reactos/helper.h 2005-07-05 00:24:36 UTC
(rev 16420)
@@ -25,7 +25,7 @@
sizeof (IMAGE_NT_SIGNATURE) +
\
sizeof (IMAGE_FILE_HEADER)))
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) +
((D)<<24))
-#define RVA(m, b) ((ULONG)b + m)
+#define RVA(m, b) ((PVOID)((ULONG_PTR)(b) + (ULONG_PTR)(m)))
#define NTSTAT_SEVERITY_SHIFT 30
#define NTSTAT_SEVERITY_MASK 0x00000003
#define NTSTAT_FACILITY_SHIFT 16
_____
Modified: trunk/reactos/lib/crt/search/lsearch.c
--- trunk/reactos/lib/crt/search/lsearch.c 2005-07-04 23:05:17 UTC
(rev 16419)
+++ trunk/reactos/lib/crt/search/lsearch.c 2005-07-05 00:24:36 UTC
(rev 16420)
@@ -13,11 +13,8 @@
if (ret_find != NULL)
return ret_find;
-#ifdef __GNUC__
- memcpy(base + (*nelp*width), key, width);
-#else
- memcpy((int*)base + (*nelp*width), key, width);
-#endif
+ memcpy((void*)((int*)base + (*nelp*width)), key, width);
+
(*nelp)++;
return base;
}
_____
Modified: trunk/reactos/lib/kernel32/file/find.c
--- trunk/reactos/lib/kernel32/file/find.c 2005-07-04 23:05:17 UTC
(rev 16419)
+++ trunk/reactos/lib/kernel32/file/find.c 2005-07-05 00:24:36 UTC
(rev 16420)
@@ -54,11 +54,11 @@
if (IData->pFileInfo->NextEntryOffset != 0)
{
- IData->pFileInfo = (PVOID)IData->pFileInfo +
IData->pFileInfo->NextEntryOffset;
+ IData->pFileInfo = (PVOID)((ULONG_PTR)IData->pFileInfo +
IData->pFileInfo->NextEntryOffset);
DPRINT("Found
%.*S\n",IData->pFileInfo->FileNameLength/sizeof(WCHAR),
IData->pFileInfo->FileName);
return TRUE;
}
- IData->pFileInfo = (PVOID)IData +
sizeof(KERNEL32_FIND_FILE_DATA);
+ IData->pFileInfo = (PVOID)((ULONG_PTR)IData +
sizeof(KERNEL32_FIND_FILE_DATA));
IData->pFileInfo->FileIndex = 0;
Status = NtQueryDirectoryFile (IData->DirectoryHandle,
NULL,
@@ -271,7 +271,7 @@
SetLastErrorByStatus (Status);
return(NULL);
}
- IData->pFileInfo = (PVOID)IData +
sizeof(KERNEL32_FIND_FILE_DATA);
+ IData->pFileInfo = (PVOID)((ULONG_PTR)IData +
sizeof(KERNEL32_FIND_FILE_DATA));
IData->pFileInfo->FileIndex = 0;
Status = NtQueryDirectoryFile (IData->DirectoryHandle,
_____
Modified: trunk/reactos/lib/kernel32/mem/global.c
--- trunk/reactos/lib/kernel32/mem/global.c 2005-07-04 23:05:17 UTC
(rev 16419)
+++ trunk/reactos/lib/kernel32/mem/global.c 2005-07-05 00:24:36 UTC
(rev 16420)
@@ -39,7 +39,7 @@
#define HANDLE_TO_INTERN(h) ((PGLOBAL_HANDLE)(((char *)(h))-4))
#define INTERN_TO_HANDLE(i) ((HGLOBAL) &((i)->Pointer))
-#define POINTER_TO_HANDLE(p) (*(PHANDLE)(p - HANDLE_SIZE))
+#define POINTER_TO_HANDLE(p) (*(PHANDLE)((ULONG_PTR)p - HANDLE_SIZE))
#define ISHANDLE(h) ((((ULONG)(h)) & 0x4)!=0)
#define ISPOINTER(h) ((((ULONG)(h)) & 0x4)==0)
@@ -105,7 +105,7 @@
if (palloc)
{
*(PHANDLE)palloc = INTERN_TO_HANDLE(phandle);
- phandle->Pointer = palloc + HANDLE_SIZE;
+ phandle->Pointer = (PVOID)((ULONG_PTR)palloc +
HANDLE_SIZE);
}
else /*failed to allocate the memory block*/
{
@@ -237,7 +237,7 @@
}
if(phandle->Pointer)
- RtlFreeHeap(GetProcessHeap(), 0, phandle->Pointer -
HANDLE_SIZE);
+ RtlFreeHeap(GetProcessHeap(), 0,
(PVOID)((ULONG_PTR)phandle->Pointer - HANDLE_SIZE));
RtlFreeHeap(GetProcessHeap(), 0, phandle);
}
@@ -549,7 +549,7 @@
if(phandle->Pointer)
{
palloc = RtlReAllocateHeap(GetProcessHeap(),
heap_flags,
- phandle->Pointer -
HANDLE_SIZE,
+
(PVOID)((ULONG_PTR)phandle->Pointer - HANDLE_SIZE),
dwBytes + HANDLE_SIZE);
if (0 == palloc)
{
@@ -558,7 +558,7 @@
else
{
*(PHANDLE)palloc = hMem;
- phandle->Pointer = palloc + HANDLE_SIZE;
+ phandle->Pointer = (PVOID)((ULONG_PTR)palloc +
HANDLE_SIZE);
}
}
else
@@ -571,7 +571,7 @@
else
{
*(PHANDLE)palloc = hMem;
- phandle->Pointer = palloc + HANDLE_SIZE;
+ phandle->Pointer = (PVOID)((ULONG_PTR)palloc +
HANDLE_SIZE);
}
}
}
@@ -579,7 +579,7 @@
{
if(phandle->Pointer)
{
- RtlFreeHeap(GetProcessHeap(), 0, phandle->Pointer -
HANDLE_SIZE);
+ RtlFreeHeap(GetProcessHeap(), 0,
(PVOID)((ULONG_PTR)phandle->Pointer - HANDLE_SIZE));
phandle->Pointer = 0;
}
}
@@ -613,7 +613,7 @@
{
if (0 != phandle->Pointer)/*NOT DISCARDED*/
{
- retval = RtlSizeHeap(GetProcessHeap(), 0,
phandle->Pointer - HANDLE_SIZE);
+ retval = RtlSizeHeap(GetProcessHeap(), 0,
(PVOID)((ULONG_PTR)phandle->Pointer - HANDLE_SIZE));
if (retval == (SIZE_T)-1) /*RtlSizeHeap failed*/
{
_____
Modified: trunk/reactos/lib/kernel32/process/create.c
--- trunk/reactos/lib/kernel32/process/create.c 2005-07-04 23:05:17 UTC
(rev 16419)
+++ trunk/reactos/lib/kernel32/process/create.c 2005-07-05 00:24:36 UTC
(rev 16420)
@@ -505,7 +505,7 @@
while(*ptr++);
}
ptr++;
- EnvSize = (PVOID)ptr - ParentEnv;
+ EnvSize = (ULONG)((ULONG_PTR)ptr - (ULONG_PTR)ParentEnv);
}
else if (NtCurrentPeb()->ProcessParameters->Environment != NULL)
{
@@ -572,7 +572,7 @@
/* write pointer to environment */
Offset = FIELD_OFFSET(RTL_USER_PROCESS_PARAMETERS, Environment);
NtWriteVirtualMemory(ProcessHandle,
- (PVOID)(PpbBase + Offset),
+ (PVOID)((ULONG_PTR)PpbBase + Offset),
&EnvPtr,
sizeof(EnvPtr),
&BytesWritten);
_____
Modified: trunk/reactos/lib/ntdll/csr/lpc.c
--- trunk/reactos/lib/ntdll/csr/lpc.c 2005-07-04 23:05:17 UTC (rev
16419)
+++ trunk/reactos/lib/ntdll/csr/lpc.c 2005-07-05 00:24:36 UTC (rev
16420)
@@ -48,7 +48,7 @@
memcpy(Block, ParameterBuffer, ParameterBufferSize);
}
*ClientAddress = Block;
- *ServerAddress = Block - CsrSectionMapBase + CsrSectionMapServerBase;
+ *ServerAddress = (PVOID)((ULONG_PTR)Block -
(ULONG_PTR)CsrSectionMapBase + (ULONG_PTR)CsrSectionMapServerBase);
return(STATUS_SUCCESS);
}
_____
Modified: trunk/reactos/lib/ntdll/ldr/startup.c
--- trunk/reactos/lib/ntdll/ldr/startup.c 2005-07-04 23:05:17 UTC
(rev 16419)
+++ trunk/reactos/lib/ntdll/ldr/startup.c 2005-07-05 00:24:36 UTC
(rev 16420)
@@ -266,7 +266,7 @@
&NlsTable);
RtlResetRtlTranslations (&NlsTable);
- NTHeaders = (PIMAGE_NT_HEADERS)(ImageBase +
PEDosHeader->e_lfanew);
+ NTHeaders = (PIMAGE_NT_HEADERS)((ULONG_PTR)ImageBase +
PEDosHeader->e_lfanew);
/* Get number of processors */
Status = ZwQuerySystemInformation(SystemBasicInformation,
_____
Modified: trunk/reactos/lib/ntdll/ldr/utils.c
--- trunk/reactos/lib/ntdll/ldr/utils.c 2005-07-04 23:05:17 UTC (rev
16419)
+++ trunk/reactos/lib/ntdll/ldr/utils.c 2005-07-05 00:24:36 UTC (rev
16420)
@@ -162,7 +162,7 @@
TRACE_LDR("%wZ - Calling tls callback at %x\n",
&Module->BaseDllName, TlsCallback);
TlsCallback(Module->DllBase, dwReason, NULL);
- TlsCallback++;
+ TlsCallback =
(PIMAGE_TLS_CALLBACK)((ULONG_PTR)TlsCallback + sizeof(PVOID));
}
}
}
@@ -205,7 +205,7 @@
return STATUS_NO_MEMORY;
}
- TlsData = (PVOID)TlsPointers + LdrpTlsCount * sizeof(PVOID);
+ TlsData = (PVOID)((ULONG_PTR)TlsPointers + LdrpTlsCount *
sizeof(PVOID));
Teb->ThreadLocalStoragePointer = TlsPointers;
TlsInfo = LdrpTlsArray;
@@ -216,12 +216,12 @@
if (TlsInfo->TlsDataSize)
{
memcpy(TlsData, TlsInfo->StartAddressOfRawData,
TlsInfo->TlsDataSize);
- TlsData += TlsInfo->TlsDataSize;
+ TlsData = (PVOID)((ULONG_PTR)TlsData +
TlsInfo->TlsDataSize);
}
if (TlsInfo->TlsZeroSize)
{
memset(TlsData, 0, TlsInfo->TlsZeroSize);
- TlsData += TlsInfo->TlsZeroSize;
+ TlsData = (PVOID)((ULONG_PTR)TlsData +
TlsInfo->TlsZeroSize);
}
}
}
@@ -471,7 +471,7 @@
Module->DllBase = (PVOID)ImageBase;
Module->EntryPoint =
(PVOID)NTHeaders->OptionalHeader.AddressOfEntryPoint;
if (Module->EntryPoint != 0)
- Module->EntryPoint += (ULONG)Module->DllBase;
+ Module->EntryPoint = (PVOID)((ULONG_PTR)Module->EntryPoint +
(ULONG_PTR)Module->DllBase);
Module->SizeOfImage = LdrpGetResidentSize(NTHeaders);
if (NtCurrentPeb()->Ldr->Initialized == TRUE)
{
@@ -803,7 +803,7 @@
DPRINT("Scanning %wZ at %p\n", &ModulePtr->BaseDllName,
ModulePtr->DllBase);
if ((Address >= ModulePtr->DllBase) &&
- (Address <= (ModulePtr->DllBase + ModulePtr->SizeOfImage)))
+ ((ULONG_PTR)Address <= ((ULONG_PTR)ModulePtr->DllBase +
ModulePtr->SizeOfImage)))
{
*Module = ModulePtr;
RtlLeaveCriticalSection(NtCurrentPeb()->LoaderLock);
@@ -1030,7 +1030,7 @@
ExportDir->AddressOfFunctions
);
DPRINT(
- "LdrGetExportByOrdinal(Ordinal %d) = %x\n",
+ "LdrGetExportByOrdinal(Ordinal %d) = %p\n",
Ordinal,
RVA(BaseAddress, ExFunctions[Ordinal - ExportDir->Base]
)
);
@@ -1270,7 +1270,7 @@
{
Count = (RelocationDir->SizeOfBlock -
sizeof(IMAGE_BASE_RELOCATION)) /
sizeof(USHORT);
- Page = ImageBase + RelocationDir->VirtualAddress;
+ Page = (PVOID)((ULONG_PTR)ImageBase +
(ULONG_PTR)RelocationDir->VirtualAddress);
TypeOffset = (PUSHORT)(RelocationDir + 1);
/* Unprotect the page(s) we're about to relocate. */
@@ -1289,7 +1289,7 @@
if (RelocationDir->VirtualAddress + PAGE_SIZE <
NTHeaders->OptionalHeader.SizeOfImage)
{
- ProtectPage2 = ProtectPage + PAGE_SIZE;
+ ProtectPage2 = (PVOID)((ULONG_PTR)ProtectPage + PAGE_SIZE);
Status = NtProtectVirtualMemory(NtCurrentProcess(),
&ProtectPage2,
&ProtectSize,
@@ -1391,16 +1391,16 @@
}
/* Get the import address list. */
- ImportAddressList = (PVOID *)(Module->DllBase +
(ULONG_PTR)ImportModuleDirectory->FirstThunk);
+ ImportAddressList = (PVOID *)((ULONG_PTR)Module->DllBase +
(ULONG_PTR)ImportModuleDirectory->FirstThunk);
/* Get the list of functions to import. */
if (ImportModuleDirectory->OriginalFirstThunk != 0)
{
- FunctionNameList = (PULONG) (Module->DllBase +
(ULONG_PTR)ImportModuleDirectory->OriginalFirstThunk);
+ FunctionNameList = (PULONG) ((ULONG_PTR)Module->DllBase +
(ULONG_PTR)ImportModuleDirectory->OriginalFirstThunk);
}
else
{
- FunctionNameList = (PULONG)(Module->DllBase +
(ULONG_PTR)ImportModuleDirectory->FirstThunk);
+ FunctionNameList = (PULONG)((ULONG_PTR)Module->DllBase +
(ULONG_PTR)ImportModuleDirectory->FirstThunk);
}
/* Get the size of IAT. */
@@ -1550,16 +1550,16 @@
{
/* Get the import address list. */
- ImportAddressList = (PVOID *)(Module->DllBase +
(ULONG_PTR)ImportModuleDirectory->FirstThunk);
+ ImportAddressList = (PVOID *)((ULONG_PTR)Module->DllBase +
(ULONG_PTR)ImportModuleDirectory->FirstThunk);
/* Get the list of functions to import. */
if (ImportModuleDirectory->OriginalFirstThunk != 0)
{
- FunctionNameList = (PULONG) (Module->DllBase +
(ULONG_PTR)ImportModuleDirectory->OriginalFirstThunk);
+ FunctionNameList = (PULONG) ((ULONG_PTR)Module->DllBase
+ (ULONG_PTR)ImportModuleDirectory->OriginalFirstThunk);
}
else
{
- FunctionNameList = (PULONG)(Module->DllBase +
(ULONG_PTR)ImportModuleDirectory->FirstThunk);
+ FunctionNameList = (PULONG)((ULONG_PTR)Module->DllBase +
(ULONG_PTR)ImportModuleDirectory->FirstThunk);
}
/* Get the size of IAT. */
@@ -1585,15 +1585,15 @@
NTHeaders = RtlImageNtHeader (ImportedModule->DllBase);
Start = (PVOID)NTHeaders->OptionalHeader.ImageBase;
- End = Start + ImportedModule->SizeOfImage;
- Offset = ImportedModule->DllBase - Start;
+ End = (PVOID)((ULONG_PTR)Start +
ImportedModule->SizeOfImage);
+ Offset = (ULONG)((ULONG_PTR)ImportedModule->DllBase -
(ULONG_PTR)Start);
/* Walk through function list and fixup addresses. */
while (*FunctionNameList != 0L)
{
if (*ImportAddressList >= Start && *ImportAddressList <
End)
{
- (*ImportAddressList) += Offset;
+ (*ImportAddressList) =
(PVOID)((ULONG_PTR)(*ImportAddressList) + Offset);
}
ImportAddressList++;
FunctionNameList++;
@@ -1903,7 +1903,7 @@
* to the DLL's image.
*/
DosHeader = (PIMAGE_DOS_HEADER) ImageBase;
- NTHeaders = (PIMAGE_NT_HEADERS) (ImageBase + DosHeader->e_lfanew);
+ NTHeaders = (PIMAGE_NT_HEADERS) ((ULONG_PTR)ImageBase +
DosHeader->e_lfanew);
/*
* If the base address is different from the
@@ -1978,7 +1978,7 @@
DPRINT("AddressOfEntryPoint =
%x\n",(ULONG)NTHeaders->OptionalHeader.AddressOfEntryPoint);
if (NTHeaders->OptionalHeader.AddressOfEntryPoint != 0)
{
- EntryPoint = (PEPFUNC) (ImageBase
+ EntryPoint = (PEPFUNC) ((ULONG_PTR)ImageBase
+
NTHeaders->OptionalHeader.AddressOfEntryPoint);
}
DPRINT("LdrPEStartup() = %x\n",EntryPoint);
@@ -3108,17 +3108,17 @@
break;
case IMAGE_REL_BASED_HIGH:
- ShortPtr = (PUSHORT)(Address + Offset);
+ ShortPtr = (PUSHORT)((ULONG_PTR)Address + Offset);
*ShortPtr += HIWORD(Delta);
break;
case IMAGE_REL_BASED_LOW:
- ShortPtr = (PUSHORT)(Address + Offset);
+ ShortPtr = (PUSHORT)((ULONG_PTR)Address + Offset);
*ShortPtr += LOWORD(Delta);
break;
case IMAGE_REL_BASED_HIGHLOW:
- LongPtr = (PULONG)(Address + Offset);
+ LongPtr = (PULONG)((ULONG_PTR)Address + Offset);
*LongPtr += Delta;
break;
_____
Modified: trunk/reactos/lib/rosrtl/thread/i386/context.c
--- trunk/reactos/lib/rosrtl/thread/i386/context.c 2005-07-04
23:05:17 UTC (rev 16419)
+++ trunk/reactos/lib/rosrtl/thread/i386/context.c 2005-07-05
00:24:36 UTC (rev 16420)
@@ -44,7 +44,7 @@
if(!NT_SUCCESS(nErrCode)) return nErrCode;
/* too many parameters */
- if((nParamsSize + sizeof(ULONG_PTR)) > (SIZE_T)(pStackBase -
pStackLimit))
+ if((nParamsSize + sizeof(ULONG_PTR)) > (SIZE_T)((ULONG_PTR)pStackBase
- (ULONG_PTR)pStackLimit))
return STATUS_STACK_OVERFLOW;
memset(Context, 0, sizeof(CONTEXT));
_____
Modified: trunk/reactos/lib/rtl/image.c
--- trunk/reactos/lib/rtl/image.c 2005-07-04 23:05:17 UTC (rev
16419)
+++ trunk/reactos/lib/rtl/image.c 2005-07-05 00:24:36 UTC (rev
16420)
@@ -72,7 +72,7 @@
*Size =
NtHeader->OptionalHeader.DataDirectory[Directory].Size;
if (bFlag)
- return (PVOID)(BaseAddress + Va);
+ return (PVOID)((ULONG_PTR)BaseAddress + Va);
/* image mapped as ordinary file, we must find raw pointer */
return (PVOID)RtlImageRvaToVa (NtHeader, BaseAddress, Va, NULL);
@@ -138,10 +138,10 @@
*SectionHeader = Section;
}
- return (ULONG)(BaseAddress +
+ return (ULONG)((ULONG_PTR)BaseAddress +
Rva +
Section->PointerToRawData -
- Section->VirtualAddress);
+ (ULONG_PTR)Section->VirtualAddress);
}
/* EOF */
_____
Modified: trunk/reactos/lib/rtl/process.c
--- trunk/reactos/lib/rtl/process.c 2005-07-04 23:05:17 UTC (rev
16419)
+++ trunk/reactos/lib/rtl/process.c 2005-07-05 00:24:36 UTC (rev
16420)
@@ -161,7 +161,7 @@
/* write pointer to environment */
Offset = FIELD_OFFSET(RTL_USER_PROCESS_PARAMETERS, Environment);
ZwWriteVirtualMemory(ProcessHandle,
- (PVOID)(PpbBase + Offset),
+ (PVOID)((ULONG_PTR)PpbBase + Offset),
&EnvPtr,
sizeof(EnvPtr),
&BytesWritten);
@@ -291,7 +291,7 @@
0,
&Sii.StackReserve,
&Sii.StackCommit,
- ImageBaseAddress + (ULONG)Sii.EntryPoint,
+ (PVOID)((ULONG_PTR)ImageBaseAddress + (ULONG_PTR)Sii.EntryPoint),
(PVOID)PEB_BASE,
&ProcessInfo->ThreadHandle,
&ProcessInfo->ClientId
_____
Modified: trunk/reactos/lib/rtl/registry.c
--- trunk/reactos/lib/rtl/registry.c 2005-07-04 23:05:17 UTC (rev
16419)
+++ trunk/reactos/lib/rtl/registry.c 2005-07-05 00:24:36 UTC (rev
16420)
@@ -787,7 +787,7 @@
!(QueryEntry->Flags &
RTL_QUERY_REGISTRY_NOEXPAND))
{
DPRINT("Expand REG_MULTI_SZ type\n");
- StringPtr = (PWSTR)((PVOID)FullValueInfo +
FullValueInfo->DataOffset);
+ StringPtr = (PWSTR)((ULONG_PTR)FullValueInfo +
FullValueInfo->DataOffset);
while (*StringPtr != 0)
{
StringLen = (wcslen(StringPtr) + 1) *
sizeof(WCHAR);
@@ -807,7 +807,7 @@
{
DPRINT("Expand REG_EXPAND_SZ type\n");
- StringPtr = (PWSTR)((PVOID)FullValueInfo +
FullValueInfo->DataOffset);
+ StringPtr = (PWSTR)((ULONG_PTR)FullValueInfo +
FullValueInfo->DataOffset);
ExpandBuffer = ExAllocatePool(PagedPool,
FullValueInfo->DataLength * 2);
if (ExpandBuffer == NULL)
{
@@ -841,7 +841,7 @@
{
Status = QueryEntry->QueryRoutine(ValueName,
FullValueInfo->Type,
-
(PVOID)FullValueInfo + FullValueInfo->DataOffset,
+
(PVOID)((ULONG_PTR)FullValueInfo + FullValueInfo->DataOffset),
FullValueInfo->DataLength,
Context,
QueryEntry->EntryContext);
_____
Modified: trunk/reactos/lib/user32/windows/bitmap.c
--- trunk/reactos/lib/user32/windows/bitmap.c 2005-07-04 23:05:17 UTC
(rev 16419)
+++ trunk/reactos/lib/user32/windows/bitmap.c 2005-07-05 00:24:36 UTC
(rev 16420)
@@ -534,7 +534,7 @@
}
HeaderSize = sizeof(BITMAPINFOHEADER) + ColorCount *
sizeof(RGBQUAD);
}
- Data = (PVOID)BitmapInfo + HeaderSize;
+ Data = (PVOID)((ULONG_PTR)BitmapInfo + HeaderSize);
PrivateInfo = RtlAllocateHeap(GetProcessHeap(), 0, HeaderSize);
if (PrivateInfo == NULL)