[DRIVERS] Fix 64 bit issues

This commit is contained in:
Timo Kreuzer 2018-04-23 11:27:49 +02:00
parent f8bf0e9c3a
commit 9e066abe2a
27 changed files with 61 additions and 60 deletions

View file

@ -183,7 +183,7 @@
* @member: the name of the list_struct within the struct. * @member: the name of the list_struct within the struct.
*/ */
#define list_entry(ptr, type, member) \ #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 * list_for_each - iterate over a list

View file

@ -217,7 +217,7 @@ ACPI_THREAD_ID
AcpiOsGetThreadId (void) AcpiOsGetThreadId (void)
{ {
/* Thread ID must be non-zero */ /* Thread ID must be non-zero */
return (ULONG)PsGetCurrentThreadId() + 1; return (ULONG_PTR)PsGetCurrentThreadId() + 1;
} }
ACPI_STATUS ACPI_STATUS

View file

@ -60,7 +60,7 @@ arbusno_Constructor(IN PVOID DeviceExtension,
UNREFERENCED_PARAMETER(Interface); UNREFERENCED_PARAMETER(Interface);
/* Make sure it's the expected interface */ /* Make sure it's the expected interface */
if ((ULONG)InterfaceData != CmResourceTypeBusNumber) if ((ULONG_PTR)InterfaceData != CmResourceTypeBusNumber)
{ {
/* Arbiter support must have been initialized first */ /* Arbiter support must have been initialized first */
if (FdoExtension->ArbitersInitialized) if (FdoExtension->ArbitersInitialized)

View file

@ -74,7 +74,7 @@ ario_Constructor(IN PVOID DeviceExtension,
UNREFERENCED_PARAMETER(Interface); UNREFERENCED_PARAMETER(Interface);
/* Make sure it's the expected interface */ /* Make sure it's the expected interface */
if ((ULONG)InterfaceData != CmResourceTypePort) if ((ULONG_PTR)InterfaceData != CmResourceTypePort)
{ {
/* Arbiter support must have been initialized first */ /* Arbiter support must have been initialized first */
if (FdoExtension->ArbitersInitialized) if (FdoExtension->ArbitersInitialized)
@ -170,7 +170,7 @@ armem_Constructor(IN PVOID DeviceExtension,
UNREFERENCED_PARAMETER(Interface); UNREFERENCED_PARAMETER(Interface);
/* Make sure it's the expected interface */ /* Make sure it's the expected interface */
if ((ULONG)InterfaceData != CmResourceTypeMemory) if ((ULONG_PTR)InterfaceData != CmResourceTypeMemory)
{ {
/* Arbiter support must have been initialized first */ /* Arbiter support must have been initialized first */
if (FdoExtension->ArbitersInitialized) if (FdoExtension->ArbitersInitialized)

View file

@ -59,7 +59,7 @@ tranirq_Constructor(IN PVOID DeviceExtension,
UNREFERENCED_PARAMETER(Size); UNREFERENCED_PARAMETER(Size);
/* Make sure it's the right resource type */ /* Make sure it's the right resource type */
if ((ULONG)InterfaceData != CmResourceTypeInterrupt) if ((ULONG_PTR)InterfaceData != CmResourceTypeInterrupt)
{ {
/* Fail this invalid request */ /* Fail this invalid request */
DPRINT1("PCI - IRQ trans constructor doesn't like %p in InterfaceSpecificData\n", 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 */ /* Get the bus, and use this as the interface-specific data */
BaseBus = FdoExtension->BaseBus; BaseBus = FdoExtension->BaseBus;
InterfaceData = (PVOID)BaseBus; InterfaceData = UlongToPtr(BaseBus);
/* Check if this is the root bus */ /* Check if this is the root bus */
if (PCI_IS_ROOT_FDO(FdoExtension)) if (PCI_IS_ROOT_FDO(FdoExtension))

View file

@ -158,7 +158,7 @@ MuppIsDfsEnabled(VOID)
return TRUE; return TRUE;
} }
return ((ULONG)KeyQueryOutput.KeyInfo.Data != 1); return ((ULONG_PTR)KeyQueryOutput.KeyInfo.Data != 1);
} }
VOID VOID

View file

@ -255,7 +255,7 @@ FltpObjectPointerReference(_In_ PFLT_OBJECT Object)
/* Store the old count and increment */ /* Store the old count and increment */
Result = &Object->PointerCount; Result = &Object->PointerCount;
InterlockedIncrement((PLONG)&Object->PointerCount); InterlockedIncrementSizeT(&Object->PointerCount);
/* Return the initial value */ /* Return the initial value */
return *Result; return *Result;
@ -264,7 +264,7 @@ FltpObjectPointerReference(_In_ PFLT_OBJECT Object)
VOID VOID
FltpObjectPointerDereference(_In_ PFLT_OBJECT Object) FltpObjectPointerDereference(_In_ PFLT_OBJECT Object)
{ {
if (!InterlockedDecrement((PLONG)Object->PointerCount)) if (InterlockedDecrementSizeT(&Object->PointerCount) == 0)
{ {
// Cleanup // Cleanup
FLT_ASSERT(FALSE); FLT_ASSERT(FALSE);

View file

@ -22,7 +22,7 @@ static NTSTATUS NTAPI SendComplete
PIO_STACK_LOCATION NextIrpSp; PIO_STACK_LOCATION NextIrpSp;
PAFD_SEND_INFO SendReq = NULL; PAFD_SEND_INFO SendReq = NULL;
PAFD_MAPBUF Map; PAFD_MAPBUF Map;
UINT TotalBytesCopied = 0, TotalBytesProcessed = 0, SpaceAvail, i; SIZE_T TotalBytesCopied = 0, TotalBytesProcessed = 0, SpaceAvail, i;
UINT SendLength, BytesCopied; UINT SendLength, BytesCopied;
BOOLEAN HaltSendQueue; BOOLEAN HaltSendQueue;

View file

@ -512,7 +512,7 @@ MiniRequestComplete(
/* We are doing this internally, so we'll signal this event we've stashed in the MacBlock */ /* We are doing this internally, so we'll signal this event we've stashed in the MacBlock */
ASSERT(MacBlock->Unknown1 != NULL); ASSERT(MacBlock->Unknown1 != NULL);
ASSERT(MacBlock->Unknown3 == NULL); ASSERT(MacBlock->Unknown3 == NULL);
MacBlock->Unknown3 = (PVOID)Status; MacBlock->Unknown3 = UlongToPtr(Status);
KeSetEvent(MacBlock->Unknown1, IO_NO_INCREMENT, FALSE); KeSetEvent(MacBlock->Unknown1, IO_NO_INCREMENT, FALSE);
} }
@ -789,7 +789,7 @@ MiniSetInformation(
if (NdisStatus == NDIS_STATUS_PENDING) if (NdisStatus == NDIS_STATUS_PENDING)
{ {
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
NdisStatus = (NDIS_STATUS)MacBlock->Unknown3; NdisStatus = PtrToUlong(MacBlock->Unknown3);
} }
*BytesRead = NdisRequest->DATA.SET_INFORMATION.BytesRead; *BytesRead = NdisRequest->DATA.SET_INFORMATION.BytesRead;
@ -849,7 +849,7 @@ MiniQueryInformation(
if (NdisStatus == NDIS_STATUS_PENDING) if (NdisStatus == NDIS_STATUS_PENDING)
{ {
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
NdisStatus = (NDIS_STATUS)MacBlock->Unknown3; NdisStatus = PtrToUlong(MacBlock->Unknown3);
} }
*BytesWritten = NdisRequest->DATA.QUERY_INFORMATION.BytesWritten; *BytesWritten = NdisRequest->DATA.QUERY_INFORMATION.BytesWritten;

View file

@ -72,7 +72,7 @@
#define CP CHECKPOINT #define CP CHECKPOINT
#define ASSERT_KM_POINTER(_x) \ #define ASSERT_KM_POINTER(_x) \
ASSERT(((PVOID)_x) != (PVOID)0xcccccccc); \ ASSERT(((ULONG_PTR)(_x)) != (ULONG_PTR)0xccccccccccccccccULL); \
ASSERT(((PVOID)_x) >= (PVOID)0x80000000); ASSERT(((PVOID)(_x)) >= MmSystemRangeStart);
/* EOF */ /* EOF */

View file

@ -121,7 +121,7 @@ PdoWrite(IN PDEVICE_OBJECT DeviceObject,
do do
{ {
KeStallExecutionProcessor(10); KeStallExecutionProcessor(10);
PortStatus = READ_PORT_UCHAR((PUCHAR)(FdoDeviceExtension->BaseAddress + 1)); PortStatus = READ_PORT_UCHAR(UlongToPtr(FdoDeviceExtension->BaseAddress + 1));
ulCount++; ulCount++;
} }
while (ulCount < 500000 && !(PortStatus & LP_PBUSY)); while (ulCount < 500000 && !(PortStatus & LP_PBUSY));
@ -138,15 +138,15 @@ PdoWrite(IN PDEVICE_OBJECT DeviceObject,
} }
/* Write character */ /* Write character */
WRITE_PORT_UCHAR((PUCHAR)FdoDeviceExtension->BaseAddress, Buffer[i]); WRITE_PORT_UCHAR(UlongToPtr(FdoDeviceExtension->BaseAddress), Buffer[i]);
KeStallExecutionProcessor(10); 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); 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; Irp->IoStatus.Information = 0;

View file

@ -393,7 +393,7 @@ ChanMgrCreateChannel(OUT PSAC_CHANNEL *Channel,
{ {
/* Free slot found, attempt to use it */ /* Free slot found, attempt to use it */
ASSERT(!CHANNEL_SLOT_IS_IN_USE(i)); 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; if (ChannelArray[i] == NewChannel) break;
} }
} }

View file

@ -64,7 +64,7 @@ TimerDpcRoutine(IN PKDPC Dpc,
IN PVOID SystemArgument2) IN PVOID SystemArgument2)
{ {
HEADLESS_RSP_GET_BYTE ByteValue; HEADLESS_RSP_GET_BYTE ByteValue;
ULONG ValueSize; SIZE_T ValueSize;
BOOLEAN GotChar; BOOLEAN GotChar;
NTSTATUS Status; NTSTATUS Status;
PSAC_DEVICE_EXTENSION SacExtension; PSAC_DEVICE_EXTENSION SacExtension;

View file

@ -397,7 +397,7 @@ GetRegistryValueBuffer(IN PCWSTR KeyName,
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING DestinationString; UNICODE_STRING DestinationString;
HANDLE Handle; HANDLE Handle;
SIZE_T ResultLength = 0; ULONG ResultLength = 0;
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC GetRegistryValueBuffer: Entering.\n"); SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC GetRegistryValueBuffer: Entering.\n");
CHECK_PARAMETER1(KeyName); CHECK_PARAMETER1(KeyName);
CHECK_PARAMETER2(ValueName); CHECK_PARAMETER2(ValueName);
@ -539,7 +539,7 @@ TranslateMachineInformationXML(IN PWCHAR *Buffer,
IN PWCHAR ExtraData) IN PWCHAR ExtraData)
{ {
NTSTATUS Status; NTSTATUS Status;
ULONG Size; SIZE_T Size;
PWCHAR p; PWCHAR p;
CHECK_PARAMETER1(Buffer); CHECK_PARAMETER1(Buffer);
@ -694,7 +694,7 @@ InitializeMachineInformation(VOID)
ULONG SuiteTypeMessage; ULONG SuiteTypeMessage;
BOOLEAN SetupInProgress = FALSE; BOOLEAN SetupInProgress = FALSE;
GUID SystemGuid; GUID SystemGuid;
ULONG RealSize, Size, OutputSize; SIZE_T RealSize, Size, OutputSize;
PKEY_VALUE_PARTIAL_INFORMATION PartialInfo; PKEY_VALUE_PARTIAL_INFORMATION PartialInfo;
RTL_OSVERSIONINFOEXW VersionInformation; RTL_OSVERSIONINFOEXW VersionInformation;
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC Initialize Machine Information : Entering.\n"); SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC Initialize Machine Information : Entering.\n");
@ -1102,7 +1102,7 @@ RegisterBlueScreenMachineInformation(VOID)
{ {
PWCHAR XmlBuffer; PWCHAR XmlBuffer;
PHEADLESS_CMD_SET_BLUE_SCREEN_DATA BsBuffer; PHEADLESS_CMD_SET_BLUE_SCREEN_DATA BsBuffer;
ULONG Length, HeaderLength, TotalLength; SIZE_T Length, HeaderLength, TotalLength;
NTSTATUS Status; NTSTATUS Status;
ULONG i; ULONG i;

View file

@ -134,7 +134,7 @@ FdcFdoStartDevice(
PartialDescriptor->u.Port.Start.u.LowPart, PartialDescriptor->u.Port.Start.u.LowPart,
PartialDescriptor->u.Port.Length); PartialDescriptor->u.Port.Length);
if (PartialDescriptor->u.Port.Length >= 6) 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; break;
case CmResourceTypeInterrupt: case CmResourceTypeInterrupt:
@ -206,7 +206,7 @@ FdcFdoConfigCallback(
if (PartialDescriptor->Type == CmResourceTypePort) 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; ControllerFound = TRUE;
} }
} }

View file

@ -221,7 +221,7 @@ CUSBHardwareDevice::SetCommandRegister(PEHCI_USBCMD_CONTENT UsbCmd)
{ {
PULONG Register; PULONG Register;
Register = (PULONG)UsbCmd; Register = (PULONG)UsbCmd;
WRITE_REGISTER_ULONG((PULONG)((ULONG)m_Base + EHCI_USBCMD), *Register); WRITE_REGISTER_ULONG((PULONG)((PUCHAR)m_Base + EHCI_USBCMD), *Register);
} }
VOID VOID
@ -230,19 +230,19 @@ CUSBHardwareDevice::GetCommandRegister(PEHCI_USBCMD_CONTENT UsbCmd)
{ {
PULONG Register; PULONG Register;
Register = (PULONG)UsbCmd; Register = (PULONG)UsbCmd;
*Register = READ_REGISTER_ULONG((PULONG)((ULONG)m_Base + EHCI_USBCMD)); *Register = READ_REGISTER_ULONG((PULONG)((PUCHAR)m_Base + EHCI_USBCMD));
} }
ULONG ULONG
CUSBHardwareDevice::EHCI_READ_REGISTER_ULONG(ULONG Offset) 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 VOID
CUSBHardwareDevice::EHCI_WRITE_REGISTER_ULONG(ULONG Offset, ULONG Value) 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 VOID
@ -384,7 +384,7 @@ CUSBHardwareDevice::PnpStart(
// //
// each entry is a 4 bit field EHCI 2.2.5 // 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); m_Capabilities.PortRoute[Count*2] = (Value & 0xF0);
if ((Count*2) + 1 < m_Capabilities.HCSParams.PortCount) if ((Count*2) + 1 < m_Capabilities.HCSParams.PortCount)
@ -397,7 +397,7 @@ CUSBHardwareDevice::PnpStart(
// //
// Set m_Base to the address of Operational Register Space // 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; break;
} }
} }
@ -1282,7 +1282,7 @@ InterruptServiceRoutine(
return TRUE; return TRUE;
} }
KeInsertQueueDpc(&This->m_IntDpcObject, This, (PVOID)CStatus); KeInsertQueueDpc(&This->m_IntDpcObject, This, UlongToPtr(CStatus));
return TRUE; return TRUE;
} }
@ -1299,7 +1299,7 @@ EhciDeferredRoutine(
EHCI_USBCMD_CONTENT UsbCmd; EHCI_USBCMD_CONTENT UsbCmd;
This = (CUSBHardwareDevice*) SystemArgument1; This = (CUSBHardwareDevice*) SystemArgument1;
CStatus = (ULONG) SystemArgument2; CStatus = PtrToUlong(SystemArgument2);
DPRINT("EhciDeferredRoutine CStatus %lx\n", CStatus); DPRINT("EhciDeferredRoutine CStatus %lx\n", CStatus);

View file

@ -1412,7 +1412,7 @@ InterruptServiceRoutine(
// defer processing // defer processing
// //
DPRINT("Status %x Acknowledge %x FrameNumber %x\n", Status, Acknowledge, This->m_HCCA->CurrentFrameNumber); 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 // interrupt handled
@ -1436,8 +1436,8 @@ OhciDeferredRoutine(
// get parameters // get parameters
// //
This = (CUSBHardwareDevice*)DeferredContext; This = (CUSBHardwareDevice*)DeferredContext;
CStatus = (ULONG) SystemArgument1; CStatus = PtrToUlong(SystemArgument1);
DoneHead = (ULONG)SystemArgument2; DoneHead = PtrToUlong(SystemArgument2);
DPRINT("OhciDeferredRoutine Status %x DoneHead %x\n", CStatus, DoneHead); DPRINT("OhciDeferredRoutine Status %x DoneHead %x\n", CStatus, DoneHead);

View file

@ -99,9 +99,9 @@ USBSTOR_IsCSWValid(
return FALSE; 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; return FALSE;
} }
@ -660,7 +660,7 @@ USBSTOR_SendRequest(
// //
// now build the cbw // now build the cbw
// //
USBSTOR_BuildCBW((ULONG)Context->cbw, USBSTOR_BuildCBW(PtrToUlong(Context->cbw),
TransferDataLength, TransferDataLength,
PDODeviceExtension->LUN, PDODeviceExtension->LUN,
CommandLength, CommandLength,

View file

@ -295,7 +295,7 @@ CUSBHardwareDevice::PnpStart(
// //
// Store Resource base // 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); DPRINT("UHCI Base %p Length %x\n", m_Base, ResourceDescriptor->u.Port.Length);
break; break;
} }
@ -559,7 +559,7 @@ CUSBHardwareDevice::GlobalReset()
// back up start of modify register // back up start of modify register
// //
ASSERT(m_Base); 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 // perform global reset
@ -592,7 +592,7 @@ CUSBHardwareDevice::GlobalReset()
// //
// restore start of modify register // 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 NTSTATUS
@ -1340,7 +1340,7 @@ CUSBHardwareDevice::WriteRegister8(
IN ULONG Register, IN ULONG Register,
IN UCHAR Value) 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, ULONG Register,
USHORT Value) 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 Register,
ULONG Value) 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( CUSBHardwareDevice::ReadRegister8(
ULONG Register) 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( CUSBHardwareDevice::ReadRegister16(
ULONG Register) 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( CUSBHardwareDevice::ReadRegister32(
ULONG Register) ULONG Register)
{ {
return READ_PORT_ULONG((PULONG)((ULONG)m_Base + Register)); return READ_PORT_ULONG((PULONG)((PUCHAR)m_Base + Register));
} }
VOID VOID

View file

@ -408,7 +408,8 @@ CHubController::HandlePnp(
PPNP_BUS_INFORMATION BusInformation; PPNP_BUS_INFORMATION BusInformation;
PDEVICE_RELATIONS DeviceRelations; PDEVICE_RELATIONS DeviceRelations;
NTSTATUS Status; NTSTATUS Status;
ULONG Index = 0, Length; ULONG Index = 0;
SIZE_T Length;
USHORT VendorID, DeviceID; USHORT VendorID, DeviceID;
ULONG HiSpeed, NumPorts; ULONG HiSpeed, NumPorts;
WCHAR Buffer[300]; WCHAR Buffer[300];

View file

@ -22,6 +22,6 @@ KeQueryActiveProcessorCount(OUT PKAFFINITY ActiveProcessors OPTIONAL)
*ActiveProcessors = ActiveMap; *ActiveProcessors = ActiveMap;
} }
RtlInitializeBitMap(&Bitmap, &ActiveMap, sizeof(ActiveMap) * 8); RtlInitializeBitMap(&Bitmap, (PULONG)&ActiveMap, sizeof(ActiveMap) * 8);
return RtlNumberOfSetBits(&Bitmap); return RtlNumberOfSetBits(&Bitmap);
} }

View file

@ -2312,7 +2312,7 @@ RxDereferenceAndDeleteRxContext_Real(
/* Is ShadowCrit still owned? Shouldn't happen! */ /* Is ShadowCrit still owned? Shouldn't happen! */
if (RxContext->ShadowCritOwner != 0) if (RxContext->ShadowCritOwner != 0)
{ {
DPRINT1("ShadowCritOwner not null! %p\n", (PVOID)RxContext->ShadowCritOwner); DPRINT1("ShadowCritOwner not null! %lx\n", RxContext->ShadowCritOwner);
ASSERT(FALSE); ASSERT(FALSE);
} }
#endif #endif

View file

@ -108,7 +108,7 @@ mxdMessage(
DeviceId, DeviceId,
(LPWAVEOPENDESC) Parameter1, /* unused */ (LPWAVEOPENDESC) Parameter1, /* unused */
Parameter2, Parameter2,
(DWORD*) PrivateHandle); (DWORD_PTR*) PrivateHandle);
VALIDATE_MMSYS_PARAMETER(*(DWORD_PTR*)PrivateHandle); VALIDATE_MMSYS_PARAMETER(*(DWORD_PTR*)PrivateHandle);
break; break;
} }

View file

@ -153,7 +153,7 @@ DetectNt4SoundDevices(
IN PWSTR BaseDeviceName, IN PWSTR BaseDeviceName,
IN SOUND_DEVICE_DETECTED_PROC SoundDeviceDetectedProc) IN SOUND_DEVICE_DETECTED_PROC SoundDeviceDetectedProc)
{ {
ULONG DeviceNameLength = 0; SIZE_T DeviceNameLength = 0;
PWSTR DeviceName = NULL; PWSTR DeviceName = NULL;
ULONG Index = 0; ULONG Index = 0;
HANDLE DeviceHandle; HANDLE DeviceHandle;

View file

@ -21,7 +21,7 @@ OpenSoundDriverParametersRegKey(
IN LPWSTR ServiceName, IN LPWSTR ServiceName,
OUT PHKEY KeyHandle) OUT PHKEY KeyHandle)
{ {
ULONG KeyLength; SIZE_T KeyLength;
PWCHAR ParametersKeyName; PWCHAR ParametersKeyName;
VALIDATE_MMSYS_PARAMETER( ServiceName ); VALIDATE_MMSYS_PARAMETER( ServiceName );
@ -75,7 +75,7 @@ OpenSoundDeviceRegKey(
IN DWORD DeviceIndex, IN DWORD DeviceIndex,
OUT PHKEY KeyHandle) OUT PHKEY KeyHandle)
{ {
DWORD PathLength; SIZE_T PathLength;
PWCHAR RegPath; PWCHAR RegPath;
VALIDATE_MMSYS_PARAMETER( ServiceName ); VALIDATE_MMSYS_PARAMETER( ServiceName );

View file

@ -386,7 +386,7 @@ MMixerGetMidiDevicePath(
PMIXER_LIST MixerList; PMIXER_LIST MixerList;
LPMIXER_DATA MixerData; LPMIXER_DATA MixerData;
LPMIDI_INFO MidiInfo; LPMIDI_INFO MidiInfo;
ULONG Length; SIZE_T Length;
MIXER_STATUS Status; MIXER_STATUS Status;
/* verify mixer context */ /* verify mixer context */

View file

@ -665,7 +665,7 @@ MMixerGetWaveDevicePath(
PMIXER_LIST MixerList; PMIXER_LIST MixerList;
LPMIXER_DATA MixerData; LPMIXER_DATA MixerData;
LPWAVE_INFO WaveInfo; LPWAVE_INFO WaveInfo;
ULONG Length; SIZE_T Length;
MIXER_STATUS Status; MIXER_STATUS Status;
/* verify mixer context */ /* verify mixer context */