[NTOS] Fix 64 bit warnings

This commit is contained in:
Timo Kreuzer 2018-01-01 15:24:05 +01:00
parent 9078c335f7
commit 2dade10d54
12 changed files with 26 additions and 24 deletions

View file

@ -254,7 +254,7 @@ MmFinalizeSectionPageOut(PMM_SECTION_SEGMENT Segment,
}
/* Note: Writing may evict the segment... Nothing is guaranteed from here down */
MiSetPageEvent(Segment, FileOffset->LowPart);
MiSetPageEvent(Segment, (ULONG_PTR)FileOffset->QuadPart);
DPRINT("Status %x\n", Status);
return Status;

View file

@ -184,8 +184,8 @@ ExInterlockedRemoveHeadList(
/* Remove the first entry from the list head */
ListEntry = RemoveHeadList(ListHead);
#if DBG
ListEntry->Flink = (PLIST_ENTRY)0xBADDD0FF;
ListEntry->Blink = (PLIST_ENTRY)0xBADDD0FF;
ListEntry->Flink = (PLIST_ENTRY)(ULONG_PTR)0xBADDD0FFBADDD0FFULL;
ListEntry->Blink = (PLIST_ENTRY)(ULONG_PTR)0xBADDD0FFBADDD0FFULL;
#endif
}
@ -212,7 +212,7 @@ ExInterlockedPopEntryList(
ListEntry = PopEntryList(ListHead);
#if DBG
if (ListEntry)
ListEntry->Next = (PSINGLE_LIST_ENTRY)0xBADDD0FF;
ListEntry->Next = (PSINGLE_LIST_ENTRY)(ULONG_PTR)0xBADDD0FFBADDD0FFULL;
#endif
/* Release the spinlock and restore interrupts */
@ -418,7 +418,7 @@ ExfInterlockedPopEntryList(
ListEntry = PopEntryList(ListHead);
#if DBG
if (ListEntry)
ListEntry->Next = (PSINGLE_LIST_ENTRY)0xBADDD0FF;
ListEntry->Next = (PSINGLE_LIST_ENTRY)(ULONG_PTR)0xBADDD0FFBADDD0FFULL;
#endif
/* Release the spinlock and restore interrupts */

View file

@ -176,7 +176,7 @@ xHalGetInterruptTranslator(IN INTERFACE_TYPE ParentInterfaceType,
Translator->Size = sizeof(TRANSLATOR_INTERFACE);
Translator->Version = HAL_IRQ_TRANSLATOR_VERSION;
/* In case caller set interface to undefined, faulty it to ISA */
Translator->Context = (PVOID)((BridgeInterfaceType == InterfaceTypeUndefined) ? Isa : BridgeInterfaceType);
Translator->Context = UlongToPtr((BridgeInterfaceType == InterfaceTypeUndefined) ? Isa : BridgeInterfaceType);
Translator->InterfaceReference = FstubTranslatorNull;
Translator->InterfaceDereference = FstubTranslatorNull;
Translator->TranslateResources = FstubTranslateResource;

View file

@ -63,7 +63,7 @@ PiInitCacheGroupInformation(VOID)
/* Bogus data */
PiInitGroupOrderTableCount = 0;
PiInitGroupOrderTable = (PVOID)0xBABEB00B;
PiInitGroupOrderTable = (PVOID)(ULONG_PTR)0xBABEB00BBABEB00BULL;
return STATUS_SUCCESS;
}

View file

@ -146,7 +146,7 @@ MiFindContiguousPages(IN PFN_NUMBER LowestPfn,
Pfn1->u3.e1.EndOfAllocation = 0;
Pfn1->u3.e1.PrototypePte = 0;
Pfn1->u4.VerifierAllocation = 0;
Pfn1->PteAddress = (PVOID)0xBAADF00D;
Pfn1->PteAddress = (PVOID)(ULONG_PTR)0xBAADF00DBAADF00DULL;
//
// Check if this is the last PFN, otherwise go on

View file

@ -1194,7 +1194,7 @@ MmProbeAndLockPages(IN PMDL Mdl,
Address = MiPteToAddress(PointerPte);
//HACK: Pass a placeholder TrapInformation so the fault handler knows we're unlocked
Status = MmAccessFault(FALSE, Address, KernelMode, (PVOID)0xBADBADA3);
Status = MmAccessFault(FALSE, Address, KernelMode, (PVOID)(ULONG_PTR)0xBADBADA3BADBADA3ULL);
if (!NT_SUCCESS(Status))
{
//
@ -1263,7 +1263,7 @@ MmProbeAndLockPages(IN PMDL Mdl,
//
//HACK: Pass a placeholder TrapInformation so the fault handler knows we're unlocked
Status = MmAccessFault(TRUE, Address, KernelMode, (PVOID)0xBADBADA3);
Status = MmAccessFault(TRUE, Address, KernelMode, (PVOID)(ULONG_PTR)0xBADBADA3BADBADA3ULL);
if (!NT_SUCCESS(Status))
{
//

View file

@ -855,10 +855,10 @@ MiInitializeWorkingSetList(IN PEPROCESS CurrentProcess)
MmWorkingSetList->HashTable = NULL;
MmWorkingSetList->HashTableSize = 0;
MmWorkingSetList->NumberOfImageWaiters = 0;
MmWorkingSetList->Wsle = (PVOID)0xDEADBABE;
MmWorkingSetList->Wsle = (PVOID)(ULONG_PTR)0xDEADBABEDEADBABEULL;
MmWorkingSetList->VadBitMapHint = 1;
MmWorkingSetList->HashTableStart = (PVOID)0xBADAB00B;
MmWorkingSetList->HighestPermittedHashAddress = (PVOID)0xCAFEBABE;
MmWorkingSetList->HashTableStart = (PVOID)(ULONG_PTR)0xBADAB00BBADAB00BULL;
MmWorkingSetList->HighestPermittedHashAddress = (PVOID)(ULONG_PTR)0xCAFEBABECAFEBABEULL;
MmWorkingSetList->FirstFree = 1;
MmWorkingSetList->FirstDynamic = 2;
MmWorkingSetList->NextSlot = 3;

View file

@ -1370,7 +1370,7 @@ MiMapViewOfDataSection(IN PCONTROL_AREA ControlArea,
}
RtlZeroMemory(Vad, sizeof(MMVAD_LONG));
Vad->u4.Banked = (PVOID)0xDEADBABE;
Vad->u4.Banked = (PVOID)(ULONG_PTR)0xDEADBABEDEADBABEULL;
/* Write all the data required in the VAD for handling a fault */
Vad->ControlArea = ControlArea;

View file

@ -172,7 +172,7 @@ MiInsertNode(IN PMM_AVL_TABLE Table,
else
{
/* This is a section VAD. Store the MAREA here for now */
ASSERT(Vad->u4.Banked == (PVOID)0xDEADBABE);
ASSERT(Vad->u4.Banked == (PVOID)(ULONG_PTR)0xDEADBABEDEADBABEULL);
Vad->u4.Banked = (PVOID)MemoryArea;
}
}
@ -399,7 +399,7 @@ MiRemoveNode(IN PMMADDRESS_NODE Node,
if (MemoryArea)
{
/* Make sure we have not already freed it */
ASSERT(MemoryArea != (PVOID)0xDEADBAB1);
ASSERT(MemoryArea != (PVOID)(ULONG_PTR)0xDEADBAB1DEADBAB1ULL);
/* Get the process */
Process = CONTAINING_RECORD(Table, EPROCESS, VadRoot);
@ -415,12 +415,12 @@ MiRemoveNode(IN PMMADDRESS_NODE Node,
if (Vad->ControlArea == NULL)
{
/* Delete the pointer to it */
Vad->FirstPrototypePte = (PVOID)0xDEADBAB1;
Vad->FirstPrototypePte = (PVOID)(ULONG_PTR)0xDEADBAB1DEADBAB1ULL;
}
else
{
/* Delete the pointer to it */
Vad->u4.Banked = (PVOID)0xDEADBAB1;
Vad->u4.Banked = (PVOID)(ULONG_PTR)0xDEADBAB1DEADBAB1ULL;
}
}
}

View file

@ -3350,7 +3350,7 @@ MiLockVirtualMemory(
CurrentVa = MiPteToAddress(PointerPte);
//HACK: Pass a placeholder TrapInformation so the fault handler knows we're unlocked
TempStatus = MmAccessFault(TRUE, CurrentVa, KernelMode, (PVOID)0xBADBADA3);
TempStatus = MmAccessFault(TRUE, CurrentVa, KernelMode, (PVOID)(ULONG_PTR)0xBADBADA3BADBADA3ULL);
if (!NT_SUCCESS(TempStatus))
{
// This should only happen, when remote backing storage is not accessible

View file

@ -570,8 +570,10 @@ NTSTATUS
NTAPI
MmDeleteProcessAddressSpace(PEPROCESS Process)
{
#ifndef _M_AMD64
KIRQL OldIrql;
PVOID Address;
#endif
DPRINT("MmDeleteProcessAddressSpace(Process %p (%s))\n", Process,
Process->ImageFileName);

View file

@ -137,7 +137,7 @@ ObpDeallocateObject(IN PVOID Object)
}
/* Catch invalid access */
Header->Type = (POBJECT_TYPE)0xBAADB0B0;
Header->Type = (POBJECT_TYPE)(ULONG_PTR)0xBAADB0B0BAADB0B0ULL;
/* Free the object using the same allocation tag */
ExFreePoolWithTag(HeaderLocation, ObjectType->Key);
@ -1215,14 +1215,14 @@ ObCreateObjectType(IN PUNICODE_STRING TypeName,
else if ((TypeName->Length == 8) && !(wcscmp(TypeName->Buffer, L"File")))
{
/* Wait on the File Object's event directly */
LocalObjectType->DefaultObject = (PVOID)FIELD_OFFSET(FILE_OBJECT,
Event);
LocalObjectType->DefaultObject = UlongToPtr(FIELD_OFFSET(FILE_OBJECT,
Event));
}
else if ((TypeName->Length == 24) && !(wcscmp(TypeName->Buffer, L"WaitablePort")))
{
/* Wait on the LPC Port's object directly */
LocalObjectType->DefaultObject = (PVOID)FIELD_OFFSET(LPCP_PORT_OBJECT,
WaitEvent);
LocalObjectType->DefaultObject = UlongToPtr(FIELD_OFFSET(LPCP_PORT_OBJECT,
WaitEvent));
}
else
{