for (i = 0; i < MAX_COM_PORTS; i++, BasePtr++)
{
Base = (ULONG) * BasePtr;
- if (Base == 0 || !CpDoesPortExist((PUCHAR)Base))
+ if ((Base == 0) || !CpDoesPortExist(UlongToPtr(Base)))
continue;
TRACE("Found COM%u port at 0x%x\n", i + 1, Base);
return TRUE;
}
+#ifndef _M_AMD64
NTSTATUS
NTAPI
IopReadBootRecord(
IN ULONG SectorSize,
OUT PMASTER_BOOT_RECORD BootRecord)
{
- ULONG FileId = (ULONG)DeviceObject;
+ ULONG_PTR FileId = (ULONG_PTR)DeviceObject;
LARGE_INTEGER Position;
ULONG BytesRead;
ARC_STATUS Status;
*PartitionBuffer = Partitions;
return STATUS_SUCCESS;
}
-
+#endif // _M_AMD64
#endif
FORCEINLINE
PVOID
FrLdrTempAlloc(
- ULONG Size, ULONG Tag)
+ _In_ SIZE_T Size,
+ _In_ ULONG Tag)
{
return FrLdrHeapAllocateEx(FrLdrTempHeap, Size, Tag);
}
return 0;
}
-// DECLSPEC_NORETURN
+DECLSPEC_NORETURN
VOID
NTAPI
KeBugCheckEx(
IN ULONG_PTR BugCheckParameter4)
{
char Buffer[70];
- sprintf(Buffer, "*** STOP: 0x%08lX (0x%08lX, 0x%08lX, 0x%08lX, 0x%08lX)",
- BugCheckCode, BugCheckParameter1, BugCheckParameter2,
- BugCheckParameter3, BugCheckParameter4);
+
+ sprintf(Buffer,
+ "*** STOP: 0x%08lX (0x%p,0x%p,0x%p,0x%p)",
+ BugCheckCode,
+ (PVOID)BugCheckParameter1,
+ (PVOID)BugCheckParameter2,
+ (PVOID)BugCheckParameter3,
+ (PVOID)BugCheckParameter4);
+
UiMessageBoxCritical(Buffer);
ASSERT(FALSE);
for (;;);
/* Find the '!PXE' structure */
Ptr = (PPXE)0xA0000;
- while ((ULONG)Ptr > 0x10000)
+ while ((ULONG_PTR)Ptr > 0x10000)
{
- Ptr = (PPXE)((ULONG)Ptr - 0x10);
+ Ptr = (PPXE)((ULONG_PTR)Ptr - 0x10);
/* Look for signature */
if (memcmp(Ptr, "!PXE", 4) != 0)
return EBADF;
RtlZeroMemory(&readData, sizeof(readData));
- readData.Buffer.segment = ((UINT32)_Packet & 0xf0000) / 16;
- readData.Buffer.offset = (UINT32)_Packet & 0xffff;
+ readData.Buffer.segment = ((ULONG_PTR)_Packet & 0xf0000) / 16;
+ readData.Buffer.offset = (ULONG_PTR)_Packet & 0xffff;
// Get new packets as required
while (N > 0)
}
RtlZeroMemory(&readData, sizeof(readData));
- readData.Buffer.segment = ((UINT32)_Packet & 0xf0000) / 16;
- readData.Buffer.offset = (UINT32)_Packet & 0xffff;
+ readData.Buffer.segment = ((ULONG_PTR)_Packet & 0xf0000) / 16;
+ readData.Buffer.offset = (ULONG_PTR)_Packet & 0xffff;
// Get new packets as required
while (Position->LowPart > _CachedLength)
return FALSE;
if (Data.BufferSize < 36)
return FALSE;
- Packet = (UCHAR*)((UINT32)(Data.Buffer.segment << 4) + Data.Buffer.offset);
+ Packet = (UCHAR*)((ULONG_PTR)(Data.Buffer.segment << 4) + Data.Buffer.offset);
RtlCopyMemory(&_ServerIP, Packet + 20, sizeof(IP4));
return TRUE;
}
RemainingPath->Length -= sizeof(WCHAR);
}
- NextElement->Length = (RemainingPath->Buffer - NextElement->Buffer) * sizeof(WCHAR);
+ NextElement->Length = (USHORT)(RemainingPath->Buffer - NextElement->Buffer) * sizeof(WCHAR);
NextElement->MaximumLength = NextElement->Length;
/* Check if the path element ended with a path separator */