[NTOS] Fix 64 bit warnings
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Mon, 1 Jan 2018 14:24:05 +0000 (15:24 +0100)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 14 Jan 2018 12:54:14 +0000 (13:54 +0100)
12 files changed:
ntoskrnl/cache/section/swapout.c
ntoskrnl/ex/interlocked.c
ntoskrnl/fstub/translate.c
ntoskrnl/io/pnpmgr/pnpinit.c
ntoskrnl/mm/ARM3/contmem.c
ntoskrnl/mm/ARM3/mdlsup.c
ntoskrnl/mm/ARM3/procsup.c
ntoskrnl/mm/ARM3/section.c
ntoskrnl/mm/ARM3/vadnode.c
ntoskrnl/mm/ARM3/virtual.c
ntoskrnl/mm/marea.c
ntoskrnl/ob/oblife.c

index 35805a1..4c6f100 100644 (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;
index 80a123b..17f20cb 100644 (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 */
index 3fa15e0..fdb27be 100644 (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;
index 7153cd2..7545f84 100644 (file)
@@ -63,7 +63,7 @@ PiInitCacheGroupInformation(VOID)
 
         /* Bogus data */
         PiInitGroupOrderTableCount = 0;
-        PiInitGroupOrderTable = (PVOID)0xBABEB00B;
+        PiInitGroupOrderTable = (PVOID)(ULONG_PTR)0xBABEB00BBABEB00BULL;
         return STATUS_SUCCESS;
     }
 
index 6a7fe01..506f988 100644 (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
index 7317a9a..4675fe2 100644 (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))
                         {
                             //
index 7522e35..95e760a 100644 (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;
index 6a2710e..689f6cd 100644 (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;
index b20839a..5464e9f 100644 (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;
             }
         }
     }
index fc4ea2e..bbc773a 100644 (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
index 1dc4d61..9cf006f 100644 (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);
index d3c9599..2bfc35a 100644 (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
     {