https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9e066abe2ae7ddd40525f…
commit 9e066abe2ae7ddd40525f1de469eec0927275aa4
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Mon Apr 23 11:27:49 2018 +0200
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Sat Aug 4 19:19:34 2018 +0200
[DRIVERS] Fix 64 bit issues
---
drivers/bus/acpi/include/list.h | 2 +-
drivers/bus/acpi/osl.c | 2 +-
drivers/bus/pcix/arb/ar_busno.c | 2 +-
drivers/bus/pcix/arb/ar_memio.c | 4 ++--
drivers/bus/pcix/arb/tr_irq.c | 4 ++--
drivers/filesystems/mup/mup.c | 2 +-
drivers/filters/fltmgr/Object.c | 4 ++--
drivers/network/afd/afd/write.c | 2 +-
drivers/network/ndis/ndis/miniport.c | 6 +++---
drivers/network/tcpip/include/debug.h | 4 ++--
drivers/parallel/parport/pdo.c | 8 ++++----
drivers/sac/driver/chanmgr.c | 2 +-
drivers/sac/driver/dispatch.c | 2 +-
drivers/sac/driver/util.c | 8 ++++----
drivers/storage/fdc/fdc/fdo.c | 4 ++--
drivers/usb/usbehci/hardware.cpp | 16 ++++++++--------
drivers/usb/usbohci/hardware.cpp | 6 +++---
drivers/usb/usbstor/scsi.c | 6 +++---
drivers/usb/usbuhci/hardware.cpp | 18 +++++++++---------
sdk/lib/drivers/libusb/hub_controller.cpp | 3 ++-
sdk/lib/drivers/ntoskrnl_vista/ke.c | 2 +-
sdk/lib/drivers/rxce/rxce.c | 2 +-
sdk/lib/drivers/sound/mmebuddy/mixer/mxdMessage.c | 2 +-
sdk/lib/drivers/sound/mment4/detect.c | 2 +-
sdk/lib/drivers/sound/mment4/registry.c | 4 ++--
sdk/lib/drivers/sound/mmixer/midi.c | 2 +-
sdk/lib/drivers/sound/mmixer/wave.c | 2 +-
27 files changed, 61 insertions(+), 60 deletions(-)
diff --git a/drivers/bus/acpi/include/list.h b/drivers/bus/acpi/include/list.h
index bac8727aa7..9054690662 100644
--- a/drivers/bus/acpi/include/list.h
+++ b/drivers/bus/acpi/include/list.h
@@ -183,7 +183,7 @@
* @member: the name of the list_struct within the struct.
*/
#define list_entry(ptr, type, member) \
- ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
+ ((type *)((char *)(ptr)-(uintptr_t)(&((type *)0)->member)))
/**
* list_for_each - iterate over a list
diff --git a/drivers/bus/acpi/osl.c b/drivers/bus/acpi/osl.c
index 06bad3c1d6..8b8176cbde 100644
--- a/drivers/bus/acpi/osl.c
+++ b/drivers/bus/acpi/osl.c
@@ -217,7 +217,7 @@ ACPI_THREAD_ID
AcpiOsGetThreadId (void)
{
/* Thread ID must be non-zero */
- return (ULONG)PsGetCurrentThreadId() + 1;
+ return (ULONG_PTR)PsGetCurrentThreadId() + 1;
}
ACPI_STATUS
diff --git a/drivers/bus/pcix/arb/ar_busno.c b/drivers/bus/pcix/arb/ar_busno.c
index 2751daa10d..9618146aa3 100644
--- a/drivers/bus/pcix/arb/ar_busno.c
+++ b/drivers/bus/pcix/arb/ar_busno.c
@@ -60,7 +60,7 @@ arbusno_Constructor(IN PVOID DeviceExtension,
UNREFERENCED_PARAMETER(Interface);
/* Make sure it's the expected interface */
- if ((ULONG)InterfaceData != CmResourceTypeBusNumber)
+ if ((ULONG_PTR)InterfaceData != CmResourceTypeBusNumber)
{
/* Arbiter support must have been initialized first */
if (FdoExtension->ArbitersInitialized)
diff --git a/drivers/bus/pcix/arb/ar_memio.c b/drivers/bus/pcix/arb/ar_memio.c
index e6d0e917c0..63aeaa9acd 100644
--- a/drivers/bus/pcix/arb/ar_memio.c
+++ b/drivers/bus/pcix/arb/ar_memio.c
@@ -74,7 +74,7 @@ ario_Constructor(IN PVOID DeviceExtension,
UNREFERENCED_PARAMETER(Interface);
/* Make sure it's the expected interface */
- if ((ULONG)InterfaceData != CmResourceTypePort)
+ if ((ULONG_PTR)InterfaceData != CmResourceTypePort)
{
/* Arbiter support must have been initialized first */
if (FdoExtension->ArbitersInitialized)
@@ -170,7 +170,7 @@ armem_Constructor(IN PVOID DeviceExtension,
UNREFERENCED_PARAMETER(Interface);
/* Make sure it's the expected interface */
- if ((ULONG)InterfaceData != CmResourceTypeMemory)
+ if ((ULONG_PTR)InterfaceData != CmResourceTypeMemory)
{
/* Arbiter support must have been initialized first */
if (FdoExtension->ArbitersInitialized)
diff --git a/drivers/bus/pcix/arb/tr_irq.c b/drivers/bus/pcix/arb/tr_irq.c
index 9841ca3267..f6b393a913 100644
--- a/drivers/bus/pcix/arb/tr_irq.c
+++ b/drivers/bus/pcix/arb/tr_irq.c
@@ -59,7 +59,7 @@ tranirq_Constructor(IN PVOID DeviceExtension,
UNREFERENCED_PARAMETER(Size);
/* Make sure it's the right resource type */
- if ((ULONG)InterfaceData != CmResourceTypeInterrupt)
+ if ((ULONG_PTR)InterfaceData != CmResourceTypeInterrupt)
{
/* Fail this invalid request */
DPRINT1("PCI - IRQ trans constructor doesn't like %p in
InterfaceSpecificData\n",
@@ -69,7 +69,7 @@ tranirq_Constructor(IN PVOID DeviceExtension,
/* Get the bus, and use this as the interface-specific data */
BaseBus = FdoExtension->BaseBus;
- InterfaceData = (PVOID)BaseBus;
+ InterfaceData = UlongToPtr(BaseBus);
/* Check if this is the root bus */
if (PCI_IS_ROOT_FDO(FdoExtension))
diff --git a/drivers/filesystems/mup/mup.c b/drivers/filesystems/mup/mup.c
index 84f318af47..e8cc8d7e9b 100644
--- a/drivers/filesystems/mup/mup.c
+++ b/drivers/filesystems/mup/mup.c
@@ -158,7 +158,7 @@ MuppIsDfsEnabled(VOID)
return TRUE;
}
- return ((ULONG)KeyQueryOutput.KeyInfo.Data != 1);
+ return ((ULONG_PTR)KeyQueryOutput.KeyInfo.Data != 1);
}
VOID
diff --git a/drivers/filters/fltmgr/Object.c b/drivers/filters/fltmgr/Object.c
index 5daf9033a1..9597738a3d 100644
--- a/drivers/filters/fltmgr/Object.c
+++ b/drivers/filters/fltmgr/Object.c
@@ -255,7 +255,7 @@ FltpObjectPointerReference(_In_ PFLT_OBJECT Object)
/* Store the old count and increment */
Result = &Object->PointerCount;
- InterlockedIncrement((PLONG)&Object->PointerCount);
+ InterlockedIncrementSizeT(&Object->PointerCount);
/* Return the initial value */
return *Result;
@@ -264,7 +264,7 @@ FltpObjectPointerReference(_In_ PFLT_OBJECT Object)
VOID
FltpObjectPointerDereference(_In_ PFLT_OBJECT Object)
{
- if (!InterlockedDecrement((PLONG)Object->PointerCount))
+ if (InterlockedDecrementSizeT(&Object->PointerCount) == 0)
{
// Cleanup
FLT_ASSERT(FALSE);
diff --git a/drivers/network/afd/afd/write.c b/drivers/network/afd/afd/write.c
index 605676102a..29ad9501b7 100644
--- a/drivers/network/afd/afd/write.c
+++ b/drivers/network/afd/afd/write.c
@@ -22,7 +22,7 @@ static NTSTATUS NTAPI SendComplete
PIO_STACK_LOCATION NextIrpSp;
PAFD_SEND_INFO SendReq = NULL;
PAFD_MAPBUF Map;
- UINT TotalBytesCopied = 0, TotalBytesProcessed = 0, SpaceAvail, i;
+ SIZE_T TotalBytesCopied = 0, TotalBytesProcessed = 0, SpaceAvail, i;
UINT SendLength, BytesCopied;
BOOLEAN HaltSendQueue;
diff --git a/drivers/network/ndis/ndis/miniport.c b/drivers/network/ndis/ndis/miniport.c
index 3301682b97..38ee5d01b3 100644
--- a/drivers/network/ndis/ndis/miniport.c
+++ b/drivers/network/ndis/ndis/miniport.c
@@ -512,7 +512,7 @@ MiniRequestComplete(
/* We are doing this internally, so we'll signal this event we've stashed
in the MacBlock */
ASSERT(MacBlock->Unknown1 != NULL);
ASSERT(MacBlock->Unknown3 == NULL);
- MacBlock->Unknown3 = (PVOID)Status;
+ MacBlock->Unknown3 = UlongToPtr(Status);
KeSetEvent(MacBlock->Unknown1, IO_NO_INCREMENT, FALSE);
}
@@ -789,7 +789,7 @@ MiniSetInformation(
if (NdisStatus == NDIS_STATUS_PENDING)
{
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
- NdisStatus = (NDIS_STATUS)MacBlock->Unknown3;
+ NdisStatus = PtrToUlong(MacBlock->Unknown3);
}
*BytesRead = NdisRequest->DATA.SET_INFORMATION.BytesRead;
@@ -849,7 +849,7 @@ MiniQueryInformation(
if (NdisStatus == NDIS_STATUS_PENDING)
{
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
- NdisStatus = (NDIS_STATUS)MacBlock->Unknown3;
+ NdisStatus = PtrToUlong(MacBlock->Unknown3);
}
*BytesWritten = NdisRequest->DATA.QUERY_INFORMATION.BytesWritten;
diff --git a/drivers/network/tcpip/include/debug.h
b/drivers/network/tcpip/include/debug.h
index 303d66a555..4411c591e0 100644
--- a/drivers/network/tcpip/include/debug.h
+++ b/drivers/network/tcpip/include/debug.h
@@ -72,7 +72,7 @@
#define CP CHECKPOINT
#define ASSERT_KM_POINTER(_x) \
- ASSERT(((PVOID)_x) != (PVOID)0xcccccccc); \
- ASSERT(((PVOID)_x) >= (PVOID)0x80000000);
+ ASSERT(((ULONG_PTR)(_x)) != (ULONG_PTR)0xccccccccccccccccULL); \
+ ASSERT(((PVOID)(_x)) >= MmSystemRangeStart);
/* EOF */
diff --git a/drivers/parallel/parport/pdo.c b/drivers/parallel/parport/pdo.c
index ccd00a88a2..0760ffabb4 100644
--- a/drivers/parallel/parport/pdo.c
+++ b/drivers/parallel/parport/pdo.c
@@ -121,7 +121,7 @@ PdoWrite(IN PDEVICE_OBJECT DeviceObject,
do
{
KeStallExecutionProcessor(10);
- PortStatus = READ_PORT_UCHAR((PUCHAR)(FdoDeviceExtension->BaseAddress +
1));
+ PortStatus = READ_PORT_UCHAR(UlongToPtr(FdoDeviceExtension->BaseAddress +
1));
ulCount++;
}
while (ulCount < 500000 && !(PortStatus & LP_PBUSY));
@@ -138,15 +138,15 @@ PdoWrite(IN PDEVICE_OBJECT DeviceObject,
}
/* Write character */
- WRITE_PORT_UCHAR((PUCHAR)FdoDeviceExtension->BaseAddress, Buffer[i]);
+ WRITE_PORT_UCHAR(UlongToPtr(FdoDeviceExtension->BaseAddress), Buffer[i]);
KeStallExecutionProcessor(10);
- WRITE_PORT_UCHAR((PUCHAR)(FdoDeviceExtension->BaseAddress + 2), (LP_PSELECP |
LP_PINITP | LP_PSTROBE));
+ WRITE_PORT_UCHAR(UlongToPtr(FdoDeviceExtension->BaseAddress + 2), (LP_PSELECP
| LP_PINITP | LP_PSTROBE));
KeStallExecutionProcessor(10);
- WRITE_PORT_UCHAR((PUCHAR)(FdoDeviceExtension->BaseAddress + 2), (LP_PSELECP |
LP_PINITP));
+ WRITE_PORT_UCHAR(UlongToPtr(FdoDeviceExtension->BaseAddress + 2), (LP_PSELECP
| LP_PINITP));
}
Irp->IoStatus.Information = 0;
diff --git a/drivers/sac/driver/chanmgr.c b/drivers/sac/driver/chanmgr.c
index 7dc406116d..cf2947f916 100644
--- a/drivers/sac/driver/chanmgr.c
+++ b/drivers/sac/driver/chanmgr.c
@@ -393,7 +393,7 @@ ChanMgrCreateChannel(OUT PSAC_CHANNEL *Channel,
{
/* Free slot found, attempt to use it */
ASSERT(!CHANNEL_SLOT_IS_IN_USE(i));
- _InterlockedCompareExchange((PLONG)&ChannelArray[i], (LONG)NewChannel,
0);
+ InterlockedCompareExchangePointer((PVOID*)&ChannelArray[i], NewChannel,
NULL);
if (ChannelArray[i] == NewChannel) break;
}
}
diff --git a/drivers/sac/driver/dispatch.c b/drivers/sac/driver/dispatch.c
index 60944186e6..80c7f099d0 100644
--- a/drivers/sac/driver/dispatch.c
+++ b/drivers/sac/driver/dispatch.c
@@ -64,7 +64,7 @@ TimerDpcRoutine(IN PKDPC Dpc,
IN PVOID SystemArgument2)
{
HEADLESS_RSP_GET_BYTE ByteValue;
- ULONG ValueSize;
+ SIZE_T ValueSize;
BOOLEAN GotChar;
NTSTATUS Status;
PSAC_DEVICE_EXTENSION SacExtension;
diff --git a/drivers/sac/driver/util.c b/drivers/sac/driver/util.c
index 791bb321e9..06446c93e8 100644
--- a/drivers/sac/driver/util.c
+++ b/drivers/sac/driver/util.c
@@ -397,7 +397,7 @@ GetRegistryValueBuffer(IN PCWSTR KeyName,
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING DestinationString;
HANDLE Handle;
- SIZE_T ResultLength = 0;
+ ULONG ResultLength = 0;
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC GetRegistryValueBuffer: Entering.\n");
CHECK_PARAMETER1(KeyName);
CHECK_PARAMETER2(ValueName);
@@ -539,7 +539,7 @@ TranslateMachineInformationXML(IN PWCHAR *Buffer,
IN PWCHAR ExtraData)
{
NTSTATUS Status;
- ULONG Size;
+ SIZE_T Size;
PWCHAR p;
CHECK_PARAMETER1(Buffer);
@@ -694,7 +694,7 @@ InitializeMachineInformation(VOID)
ULONG SuiteTypeMessage;
BOOLEAN SetupInProgress = FALSE;
GUID SystemGuid;
- ULONG RealSize, Size, OutputSize;
+ SIZE_T RealSize, Size, OutputSize;
PKEY_VALUE_PARTIAL_INFORMATION PartialInfo;
RTL_OSVERSIONINFOEXW VersionInformation;
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC Initialize Machine Information :
Entering.\n");
@@ -1102,7 +1102,7 @@ RegisterBlueScreenMachineInformation(VOID)
{
PWCHAR XmlBuffer;
PHEADLESS_CMD_SET_BLUE_SCREEN_DATA BsBuffer;
- ULONG Length, HeaderLength, TotalLength;
+ SIZE_T Length, HeaderLength, TotalLength;
NTSTATUS Status;
ULONG i;
diff --git a/drivers/storage/fdc/fdc/fdo.c b/drivers/storage/fdc/fdc/fdo.c
index b1c7125f8e..d9a759c5d2 100644
--- a/drivers/storage/fdc/fdc/fdo.c
+++ b/drivers/storage/fdc/fdc/fdo.c
@@ -134,7 +134,7 @@ FdcFdoStartDevice(
PartialDescriptor->u.Port.Start.u.LowPart,
PartialDescriptor->u.Port.Length);
if (PartialDescriptor->u.Port.Length >= 6)
- DeviceExtension->ControllerInfo.BaseAddress =
(PUCHAR)PartialDescriptor->u.Port.Start.u.LowPart;
+ DeviceExtension->ControllerInfo.BaseAddress =
(PUCHAR)(ULONG_PTR)PartialDescriptor->u.Port.Start.QuadPart;
break;
case CmResourceTypeInterrupt:
@@ -206,7 +206,7 @@ FdcFdoConfigCallback(
if (PartialDescriptor->Type == CmResourceTypePort)
{
- if ((PUCHAR)PartialDescriptor->u.Port.Start.LowPart ==
DeviceExtension->ControllerInfo.BaseAddress)
+ if ((PUCHAR)(ULONG_PTR)PartialDescriptor->u.Port.Start.QuadPart ==
DeviceExtension->ControllerInfo.BaseAddress)
ControllerFound = TRUE;
}
}
diff --git a/drivers/usb/usbehci/hardware.cpp b/drivers/usb/usbehci/hardware.cpp
index 52478f9b93..8562eaa4b3 100644
--- a/drivers/usb/usbehci/hardware.cpp
+++ b/drivers/usb/usbehci/hardware.cpp
@@ -221,7 +221,7 @@ CUSBHardwareDevice::SetCommandRegister(PEHCI_USBCMD_CONTENT UsbCmd)
{
PULONG Register;
Register = (PULONG)UsbCmd;
- WRITE_REGISTER_ULONG((PULONG)((ULONG)m_Base + EHCI_USBCMD), *Register);
+ WRITE_REGISTER_ULONG((PULONG)((PUCHAR)m_Base + EHCI_USBCMD), *Register);
}
VOID
@@ -230,19 +230,19 @@ CUSBHardwareDevice::GetCommandRegister(PEHCI_USBCMD_CONTENT UsbCmd)
{
PULONG Register;
Register = (PULONG)UsbCmd;
- *Register = READ_REGISTER_ULONG((PULONG)((ULONG)m_Base + EHCI_USBCMD));
+ *Register = READ_REGISTER_ULONG((PULONG)((PUCHAR)m_Base + EHCI_USBCMD));
}
ULONG
CUSBHardwareDevice::EHCI_READ_REGISTER_ULONG(ULONG Offset)
{
- return READ_REGISTER_ULONG((PULONG)((ULONG)m_Base + Offset));
+ return READ_REGISTER_ULONG((PULONG)((PUCHAR)m_Base + Offset));
}
VOID
CUSBHardwareDevice::EHCI_WRITE_REGISTER_ULONG(ULONG Offset, ULONG Value)
{
- WRITE_REGISTER_ULONG((PULONG)((ULONG)m_Base + Offset), Value);
+ WRITE_REGISTER_ULONG((PULONG)((PUCHAR)m_Base + Offset), Value);
}
VOID
@@ -384,7 +384,7 @@ CUSBHardwareDevice::PnpStart(
//
// each entry is a 4 bit field EHCI 2.2.5
//
- Value = READ_REGISTER_UCHAR((PUCHAR)(ULONG)ResourceBase +
EHCI_HCSP_PORTROUTE + Count);
+ Value = READ_REGISTER_UCHAR((PUCHAR)(ULONG_PTR)ResourceBase +
EHCI_HCSP_PORTROUTE + Count);
m_Capabilities.PortRoute[Count*2] = (Value & 0xF0);
if ((Count*2) + 1 < m_Capabilities.HCSParams.PortCount)
@@ -397,7 +397,7 @@ CUSBHardwareDevice::PnpStart(
//
// Set m_Base to the address of Operational Register Space
//
- m_Base = (PULONG)((ULONG)ResourceBase + m_Capabilities.Length);
+ m_Base = (PULONG)((ULONG_PTR)ResourceBase + m_Capabilities.Length);
break;
}
}
@@ -1282,7 +1282,7 @@ InterruptServiceRoutine(
return TRUE;
}
- KeInsertQueueDpc(&This->m_IntDpcObject, This, (PVOID)CStatus);
+ KeInsertQueueDpc(&This->m_IntDpcObject, This, UlongToPtr(CStatus));
return TRUE;
}
@@ -1299,7 +1299,7 @@ EhciDeferredRoutine(
EHCI_USBCMD_CONTENT UsbCmd;
This = (CUSBHardwareDevice*) SystemArgument1;
- CStatus = (ULONG) SystemArgument2;
+ CStatus = PtrToUlong(SystemArgument2);
DPRINT("EhciDeferredRoutine CStatus %lx\n", CStatus);
diff --git a/drivers/usb/usbohci/hardware.cpp b/drivers/usb/usbohci/hardware.cpp
index 599f218665..4ff9bebd8b 100644
--- a/drivers/usb/usbohci/hardware.cpp
+++ b/drivers/usb/usbohci/hardware.cpp
@@ -1412,7 +1412,7 @@ InterruptServiceRoutine(
// defer processing
//
DPRINT("Status %x Acknowledge %x FrameNumber %x\n", Status, Acknowledge,
This->m_HCCA->CurrentFrameNumber);
- KeInsertQueueDpc(&This->m_IntDpcObject, (PVOID)Status, (PVOID)(DoneHead &
~1));
+ KeInsertQueueDpc(&This->m_IntDpcObject, UlongToPtr(Status),
UlongToPtr(DoneHead & ~1));
//
// interrupt handled
@@ -1436,8 +1436,8 @@ OhciDeferredRoutine(
// get parameters
//
This = (CUSBHardwareDevice*)DeferredContext;
- CStatus = (ULONG) SystemArgument1;
- DoneHead = (ULONG)SystemArgument2;
+ CStatus = PtrToUlong(SystemArgument1);
+ DoneHead = PtrToUlong(SystemArgument2);
DPRINT("OhciDeferredRoutine Status %x DoneHead %x\n", CStatus, DoneHead);
diff --git a/drivers/usb/usbstor/scsi.c b/drivers/usb/usbstor/scsi.c
index ee5bfba189..b5f9fbc9f2 100644
--- a/drivers/usb/usbstor/scsi.c
+++ b/drivers/usb/usbstor/scsi.c
@@ -99,9 +99,9 @@ USBSTOR_IsCSWValid(
return FALSE;
}
- if (Context->csw->Tag != (ULONG)Context->csw)
+ if (Context->csw->Tag != (ULONG_PTR)Context->csw)
{
- DPRINT1("[USBSTOR] Expected Tag %x but got %x\n",
(ULONG)Context->csw, Context->csw->Tag);
+ DPRINT1("[USBSTOR] Expected Tag %Ix but got %x\n",
(ULONG_PTR)Context->csw, Context->csw->Tag);
return FALSE;
}
@@ -660,7 +660,7 @@ USBSTOR_SendRequest(
//
// now build the cbw
//
- USBSTOR_BuildCBW((ULONG)Context->cbw,
+ USBSTOR_BuildCBW(PtrToUlong(Context->cbw),
TransferDataLength,
PDODeviceExtension->LUN,
CommandLength,
diff --git a/drivers/usb/usbuhci/hardware.cpp b/drivers/usb/usbuhci/hardware.cpp
index 2281496943..44605a9dbe 100644
--- a/drivers/usb/usbuhci/hardware.cpp
+++ b/drivers/usb/usbuhci/hardware.cpp
@@ -295,7 +295,7 @@ CUSBHardwareDevice::PnpStart(
//
// Store Resource base
//
- m_Base = (PULONG)ResourceDescriptor->u.Port.Start.LowPart; //FIXME
+ m_Base = (PULONG)(ULONG_PTR)ResourceDescriptor->u.Port.Start.QuadPart;
//FIXME
DPRINT("UHCI Base %p Length %x\n", m_Base,
ResourceDescriptor->u.Port.Length);
break;
}
@@ -559,7 +559,7 @@ CUSBHardwareDevice::GlobalReset()
// back up start of modify register
//
ASSERT(m_Base);
- UCHAR sofValue = READ_PORT_UCHAR((PUCHAR)((ULONG)m_Base + UHCI_SOFMOD));
+ UCHAR sofValue = READ_PORT_UCHAR((PUCHAR)m_Base + UHCI_SOFMOD);
//
// perform global reset
@@ -592,7 +592,7 @@ CUSBHardwareDevice::GlobalReset()
//
// restore start of modify register
//
- WRITE_PORT_UCHAR((PUCHAR)((ULONG)m_Base + UHCI_SOFMOD), sofValue);
+ WRITE_PORT_UCHAR((PUCHAR)m_Base + UHCI_SOFMOD, sofValue);
}
NTSTATUS
@@ -1340,7 +1340,7 @@ CUSBHardwareDevice::WriteRegister8(
IN ULONG Register,
IN UCHAR Value)
{
- WRITE_PORT_UCHAR((PUCHAR)((ULONG)m_Base + Register), Value);
+ WRITE_PORT_UCHAR((PUCHAR)((PUCHAR)m_Base + Register), Value);
}
@@ -1349,7 +1349,7 @@ CUSBHardwareDevice::WriteRegister16(
ULONG Register,
USHORT Value)
{
- WRITE_PORT_USHORT((PUSHORT)((ULONG)m_Base + Register), Value);
+ WRITE_PORT_USHORT((PUSHORT)((PUCHAR)m_Base + Register), Value);
}
@@ -1358,7 +1358,7 @@ CUSBHardwareDevice::WriteRegister32(
ULONG Register,
ULONG Value)
{
- WRITE_PORT_ULONG((PULONG)((ULONG)m_Base + Register), Value);
+ WRITE_PORT_ULONG((PULONG)((PUCHAR)m_Base + Register), Value);
}
@@ -1366,7 +1366,7 @@ UCHAR
CUSBHardwareDevice::ReadRegister8(
ULONG Register)
{
- return READ_PORT_UCHAR((PUCHAR)((ULONG)m_Base + Register));
+ return READ_PORT_UCHAR((PUCHAR)((PUCHAR)m_Base + Register));
}
@@ -1374,7 +1374,7 @@ USHORT
CUSBHardwareDevice::ReadRegister16(
ULONG Register)
{
- return READ_PORT_USHORT((PUSHORT)((ULONG)m_Base + Register));
+ return READ_PORT_USHORT((PUSHORT)((PUCHAR)m_Base + Register));
}
@@ -1382,7 +1382,7 @@ ULONG
CUSBHardwareDevice::ReadRegister32(
ULONG Register)
{
- return READ_PORT_ULONG((PULONG)((ULONG)m_Base + Register));
+ return READ_PORT_ULONG((PULONG)((PUCHAR)m_Base + Register));
}
VOID
diff --git a/sdk/lib/drivers/libusb/hub_controller.cpp
b/sdk/lib/drivers/libusb/hub_controller.cpp
index 9ebedfbc87..4d0d30d259 100644
--- a/sdk/lib/drivers/libusb/hub_controller.cpp
+++ b/sdk/lib/drivers/libusb/hub_controller.cpp
@@ -408,7 +408,8 @@ CHubController::HandlePnp(
PPNP_BUS_INFORMATION BusInformation;
PDEVICE_RELATIONS DeviceRelations;
NTSTATUS Status;
- ULONG Index = 0, Length;
+ ULONG Index = 0;
+ SIZE_T Length;
USHORT VendorID, DeviceID;
ULONG HiSpeed, NumPorts;
WCHAR Buffer[300];
diff --git a/sdk/lib/drivers/ntoskrnl_vista/ke.c b/sdk/lib/drivers/ntoskrnl_vista/ke.c
index 638af49311..e807225d87 100644
--- a/sdk/lib/drivers/ntoskrnl_vista/ke.c
+++ b/sdk/lib/drivers/ntoskrnl_vista/ke.c
@@ -22,6 +22,6 @@ KeQueryActiveProcessorCount(OUT PKAFFINITY ActiveProcessors OPTIONAL)
*ActiveProcessors = ActiveMap;
}
- RtlInitializeBitMap(&Bitmap, &ActiveMap, sizeof(ActiveMap) * 8);
+ RtlInitializeBitMap(&Bitmap, (PULONG)&ActiveMap, sizeof(ActiveMap) * 8);
return RtlNumberOfSetBits(&Bitmap);
}
diff --git a/sdk/lib/drivers/rxce/rxce.c b/sdk/lib/drivers/rxce/rxce.c
index 8a06e5591a..424294b33d 100644
--- a/sdk/lib/drivers/rxce/rxce.c
+++ b/sdk/lib/drivers/rxce/rxce.c
@@ -2312,7 +2312,7 @@ RxDereferenceAndDeleteRxContext_Real(
/* Is ShadowCrit still owned? Shouldn't happen! */
if (RxContext->ShadowCritOwner != 0)
{
- DPRINT1("ShadowCritOwner not null! %p\n",
(PVOID)RxContext->ShadowCritOwner);
+ DPRINT1("ShadowCritOwner not null! %lx\n",
RxContext->ShadowCritOwner);
ASSERT(FALSE);
}
#endif
diff --git a/sdk/lib/drivers/sound/mmebuddy/mixer/mxdMessage.c
b/sdk/lib/drivers/sound/mmebuddy/mixer/mxdMessage.c
index aa196993b6..0571125885 100644
--- a/sdk/lib/drivers/sound/mmebuddy/mixer/mxdMessage.c
+++ b/sdk/lib/drivers/sound/mmebuddy/mixer/mxdMessage.c
@@ -108,7 +108,7 @@ mxdMessage(
DeviceId,
(LPWAVEOPENDESC) Parameter1, /* unused */
Parameter2,
- (DWORD*) PrivateHandle);
+ (DWORD_PTR*) PrivateHandle);
VALIDATE_MMSYS_PARAMETER(*(DWORD_PTR*)PrivateHandle);
break;
}
diff --git a/sdk/lib/drivers/sound/mment4/detect.c
b/sdk/lib/drivers/sound/mment4/detect.c
index 1395f1bae4..72cee5f0dd 100644
--- a/sdk/lib/drivers/sound/mment4/detect.c
+++ b/sdk/lib/drivers/sound/mment4/detect.c
@@ -153,7 +153,7 @@ DetectNt4SoundDevices(
IN PWSTR BaseDeviceName,
IN SOUND_DEVICE_DETECTED_PROC SoundDeviceDetectedProc)
{
- ULONG DeviceNameLength = 0;
+ SIZE_T DeviceNameLength = 0;
PWSTR DeviceName = NULL;
ULONG Index = 0;
HANDLE DeviceHandle;
diff --git a/sdk/lib/drivers/sound/mment4/registry.c
b/sdk/lib/drivers/sound/mment4/registry.c
index 9a6c175a9f..adb4a3cfb2 100644
--- a/sdk/lib/drivers/sound/mment4/registry.c
+++ b/sdk/lib/drivers/sound/mment4/registry.c
@@ -21,7 +21,7 @@ OpenSoundDriverParametersRegKey(
IN LPWSTR ServiceName,
OUT PHKEY KeyHandle)
{
- ULONG KeyLength;
+ SIZE_T KeyLength;
PWCHAR ParametersKeyName;
VALIDATE_MMSYS_PARAMETER( ServiceName );
@@ -75,7 +75,7 @@ OpenSoundDeviceRegKey(
IN DWORD DeviceIndex,
OUT PHKEY KeyHandle)
{
- DWORD PathLength;
+ SIZE_T PathLength;
PWCHAR RegPath;
VALIDATE_MMSYS_PARAMETER( ServiceName );
diff --git a/sdk/lib/drivers/sound/mmixer/midi.c b/sdk/lib/drivers/sound/mmixer/midi.c
index afe1a22bfd..d659381de0 100644
--- a/sdk/lib/drivers/sound/mmixer/midi.c
+++ b/sdk/lib/drivers/sound/mmixer/midi.c
@@ -386,7 +386,7 @@ MMixerGetMidiDevicePath(
PMIXER_LIST MixerList;
LPMIXER_DATA MixerData;
LPMIDI_INFO MidiInfo;
- ULONG Length;
+ SIZE_T Length;
MIXER_STATUS Status;
/* verify mixer context */
diff --git a/sdk/lib/drivers/sound/mmixer/wave.c b/sdk/lib/drivers/sound/mmixer/wave.c
index cc3e5f24c9..962934b8d5 100644
--- a/sdk/lib/drivers/sound/mmixer/wave.c
+++ b/sdk/lib/drivers/sound/mmixer/wave.c
@@ -665,7 +665,7 @@ MMixerGetWaveDevicePath(
PMIXER_LIST MixerList;
LPMIXER_DATA MixerData;
LPWAVE_INFO WaveInfo;
- ULONG Length;
+ SIZE_T Length;
MIXER_STATUS Status;
/* verify mixer context */