diff --git a/reactos/ntoskrnl/include/internal/ke.h b/reactos/ntoskrnl/include/internal/ke.h index c7aa3038e8e..a5ff85a1017 100644 --- a/reactos/ntoskrnl/include/internal/ke.h +++ b/reactos/ntoskrnl/include/internal/ke.h @@ -889,7 +889,7 @@ KeInvalidAccessAllowed(IN PVOID TrapInformation OPTIONAL); VOID NTAPI KeRosDumpStackFrames( - PULONG Frame, + PULONG_PTR Frame, ULONG FrameCount ); diff --git a/reactos/ntoskrnl/include/internal/mm.h b/reactos/ntoskrnl/include/internal/mm.h index 9fb1c9133dd..a1fb21bef3b 100644 --- a/reactos/ntoskrnl/include/internal/mm.h +++ b/reactos/ntoskrnl/include/internal/mm.h @@ -6,21 +6,21 @@ struct _EPROCESS; -extern ULONG MiFreeSwapPages; -extern ULONG MiUsedSwapPages; -extern ULONG MmPagedPoolSize; -extern ULONG MmTotalPagedPoolQuota; -extern ULONG MmTotalNonPagedPoolQuota; +extern PFN_NUMBER MiFreeSwapPages; +extern PFN_NUMBER MiUsedSwapPages; +extern SIZE_T MmPagedPoolSize; +extern SIZE_T MmTotalPagedPoolQuota; +extern SIZE_T MmTotalNonPagedPoolQuota; extern PHYSICAL_ADDRESS MmSharedDataPagePhysicalAddress; -extern ULONG MmNumberOfPhysicalPages; +extern PFN_NUMBER MmNumberOfPhysicalPages; extern UCHAR MmDisablePagingExecutive; -extern ULONG MmLowestPhysicalPage; -extern ULONG MmHighestPhysicalPage; -extern ULONG MmAvailablePages; +extern PFN_NUMBER MmLowestPhysicalPage; +extern PFN_NUMBER MmHighestPhysicalPage; +extern PFN_NUMBER MmAvailablePages; extern PFN_NUMBER MmResidentAvailablePages; extern PVOID MmPagedPoolBase; -extern ULONG MmPagedPoolSize; +extern SIZE_T MmPagedPoolSize; extern PMEMORY_ALLOCATION_DESCRIPTOR MiFreeDescriptor; extern MEMORY_ALLOCATION_DESCRIPTOR MiFreeDescriptorOrg; @@ -874,7 +874,7 @@ MmQueryAnonMem( PMEMORY_AREA MemoryArea, PVOID Address, PMEMORY_BASIC_INFORMATION Info, - PULONG ResultLength + PSIZE_T ResultLength ); VOID @@ -1548,7 +1548,7 @@ MmQuerySectionView( PMEMORY_AREA MemoryArea, PVOID Address, PMEMORY_BASIC_INFORMATION Info, - PULONG ResultLength + PSIZE_T ResultLength ); NTSTATUS @@ -1641,8 +1641,8 @@ MiQueryVirtualMemory( IN PVOID Address, IN MEMORY_INFORMATION_CLASS VirtualMemoryInformationClass, OUT PVOID VirtualMemoryInformation, - IN ULONG Length, - OUT PULONG ResultLength + IN SIZE_T Length, + OUT PSIZE_T ResultLength ); /* sysldr.c ******************************************************************/ diff --git a/reactos/ntoskrnl/io/iomgr/iocomp.c b/reactos/ntoskrnl/io/iomgr/iocomp.c index f695ea01c55..dfb771394fa 100644 --- a/reactos/ntoskrnl/io/iomgr/iocomp.c +++ b/reactos/ntoskrnl/io/iomgr/iocomp.c @@ -92,7 +92,7 @@ IopFreeMiniPacket(PIOP_MINI_COMPLETION_PACKET Packet) } /* The free was within dhe Depth */ - InterlockedPushEntrySList(&List->L.ListHead, (PSINGLE_LIST_ENTRY)Packet); + InterlockedPushEntrySList(&List->L.ListHead, (PSLIST_ENTRY)Packet); } VOID diff --git a/reactos/ntoskrnl/io/iomgr/irp.c b/reactos/ntoskrnl/io/iomgr/irp.c index d7e4ed2741f..a578e89731a 100644 --- a/reactos/ntoskrnl/io/iomgr/irp.c +++ b/reactos/ntoskrnl/io/iomgr/irp.c @@ -1557,7 +1557,7 @@ IoFreeIrp(IN PIRP Irp) if (Irp) { InterlockedPushEntrySList(&List->L.ListHead, - (PSINGLE_LIST_ENTRY)Irp); + (PSLIST_ENTRY)Irp); } } } diff --git a/reactos/ntoskrnl/ke/bug.c b/reactos/ntoskrnl/ke/bug.c index 642c9a2c4a1..04840938dba 100644 --- a/reactos/ntoskrnl/ke/bug.c +++ b/reactos/ntoskrnl/ke/bug.c @@ -232,7 +232,7 @@ KeRosCaptureUserStackBackTrace(IN ULONG FramesToSkip, VOID FASTCALL -KeRosDumpStackFrameArray(IN PULONG Frames, +KeRosDumpStackFrameArray(IN PULONG_PTR Frames, IN ULONG FrameCount) { ULONG i, Addr; @@ -271,13 +271,13 @@ KeRosDumpStackFrameArray(IN PULONG Frames, { /* Print out the module name */ Addr -= (ULONG_PTR)LdrEntry->DllBase; - DbgPrint("<%wZ: %x>\n", &LdrEntry->FullDllName, Addr); + DbgPrint("<%wZ: %p>", &LdrEntry->FullDllName, (PVOID)Addr); } } else { /* Print only the address */ - DbgPrint("<%x>\n", Addr); + DbgPrint("<%p>", (PVOID)Addr); } /* Go to the next frame */ @@ -287,10 +287,10 @@ KeRosDumpStackFrameArray(IN PULONG Frames, VOID NTAPI -KeRosDumpStackFrames(IN PULONG Frame OPTIONAL, +KeRosDumpStackFrames(IN PULONG_PTR Frame OPTIONAL, IN ULONG FrameCount OPTIONAL) { - ULONG Frames[32]; + ULONG_PTR Frames[32]; ULONG RealFrameCount; /* If the caller didn't ask, assume 32 frames */ @@ -1410,7 +1410,7 @@ KeRegisterNmiCallback(IN PNMI_CALLBACK CallbackRoutine, // KiAcquireNmiListLock(&OldIrql); NmiData->Next = KiNmiCallbackListHead; - Next = InterlockedCompareExchangePointer(&KiNmiCallbackListHead, + Next = InterlockedCompareExchangePointer((PVOID*)&KiNmiCallbackListHead, NmiData, NmiData->Next); ASSERT(Next == NmiData->Next); diff --git a/reactos/ntoskrnl/mm/ARM3/miarm.h b/reactos/ntoskrnl/mm/ARM3/miarm.h index b0240a13364..bf186ccc8e6 100644 --- a/reactos/ntoskrnl/mm/ARM3/miarm.h +++ b/reactos/ntoskrnl/mm/ARM3/miarm.h @@ -379,24 +379,24 @@ extern LIST_ENTRY MiLargePageDriverList; extern BOOLEAN MiLargePageAllDrivers; extern ULONG MmVerifyDriverBufferLength; extern ULONG MmLargePageDriverBufferLength; -extern ULONG MmSizeOfNonPagedPoolInBytes; -extern ULONG MmMaximumNonPagedPoolInBytes; +extern SIZE_T MmSizeOfNonPagedPoolInBytes; +extern SIZE_T MmMaximumNonPagedPoolInBytes; extern PFN_NUMBER MmMaximumNonPagedPoolInPages; extern PFN_NUMBER MmSizeOfPagedPoolInPages; extern PVOID MmNonPagedSystemStart; extern PVOID MmNonPagedPoolStart; extern PVOID MmNonPagedPoolExpansionStart; extern PVOID MmNonPagedPoolEnd; -extern ULONG MmSizeOfPagedPoolInBytes; +extern SIZE_T MmSizeOfPagedPoolInBytes; extern PVOID MmPagedPoolStart; extern PVOID MmPagedPoolEnd; extern PVOID MmSessionBase; -extern ULONG MmSessionSize; +extern SIZE_T MmSessionSize; extern PMMPTE MmFirstReservedMappingPte, MmLastReservedMappingPte; extern PMMPTE MiFirstReservedZeroingPte; extern MI_PFN_CACHE_ATTRIBUTE MiPlatformCacheAttributes[2][MmMaximumCacheType]; extern PPHYSICAL_MEMORY_DESCRIPTOR MmPhysicalMemoryBlock; -extern ULONG MmBootImageSize; +extern SIZE_T MmBootImageSize; extern PMMPTE MmSystemPtesStart[MaximumPtePoolTypes]; extern PMMPTE MmSystemPtesEnd[MaximumPtePoolTypes]; extern PMEMORY_ALLOCATION_DESCRIPTOR MxFreeDescriptor; @@ -409,14 +409,14 @@ extern PVOID MmPagedPoolStart; extern PVOID MmPagedPoolEnd; extern PVOID MmNonPagedSystemStart; extern PVOID MiSystemViewStart; -extern ULONG MmSystemViewSize; +extern SIZE_T MmSystemViewSize; extern PVOID MmSessionBase; extern PVOID MiSessionSpaceEnd; extern PMMPTE MiSessionImagePteStart; extern PMMPTE MiSessionImagePteEnd; extern PMMPTE MiSessionBasePte; extern PMMPTE MiSessionLastPte; -extern ULONG MmSizeOfPagedPoolInBytes; +extern SIZE_T MmSizeOfPagedPoolInBytes; extern PMMPTE MmSystemPagePtes; extern PVOID MmSystemCacheStart; extern PVOID MmSystemCacheEnd; @@ -426,9 +426,9 @@ extern ULONG_PTR MmSubsectionBase; extern ULONG MmSpecialPoolTag; extern PVOID MmHyperSpaceEnd; extern PMMWSL MmSystemCacheWorkingSetList; -extern ULONG MmMinimumNonPagedPoolSize; +extern SIZE_T MmMinimumNonPagedPoolSize; extern ULONG MmMinAdditionNonPagedPoolPerMb; -extern ULONG MmDefaultMaximumNonPagedPool; +extern SIZE_T MmDefaultMaximumNonPagedPool; extern ULONG MmMaxAdditionNonPagedPoolPerMb; extern ULONG MmSecondaryColors; extern ULONG MmSecondaryColorMask; diff --git a/reactos/ntoskrnl/mm/ARM3/mminit.c b/reactos/ntoskrnl/mm/ARM3/mminit.c index 1e79a23c6cf..3121162615c 100644 --- a/reactos/ntoskrnl/mm/ARM3/mminit.c +++ b/reactos/ntoskrnl/mm/ARM3/mminit.c @@ -23,8 +23,8 @@ // figure out the most appropriate values. // ULONG MmMaximumNonPagedPoolPercent; -ULONG MmSizeOfNonPagedPoolInBytes; -ULONG MmMaximumNonPagedPoolInBytes; +SIZE_T MmSizeOfNonPagedPoolInBytes; +SIZE_T MmMaximumNonPagedPoolInBytes; /* Some of the same values, in pages */ PFN_NUMBER MmMaximumNonPagedPoolInPages; @@ -36,9 +36,9 @@ PFN_NUMBER MmMaximumNonPagedPoolInPages; // They are described on http://support.microsoft.com/default.aspx/kb/126402/ja // along with the algorithm that uses them, which is implemented later below. // -ULONG MmMinimumNonPagedPoolSize = 256 * 1024; +SIZE_T MmMinimumNonPagedPoolSize = 256 * 1024; ULONG MmMinAdditionNonPagedPoolPerMb = 32 * 1024; -ULONG MmDefaultMaximumNonPagedPool = 1024 * 1024; +SIZE_T MmDefaultMaximumNonPagedPool = 1024 * 1024; ULONG MmMaxAdditionNonPagedPoolPerMb = 400 * 1024; // @@ -107,7 +107,7 @@ PVOID MmPagedPoolEnd; // // And this is its default size // -ULONG MmSizeOfPagedPoolInBytes = MI_MIN_INIT_PAGED_POOLSIZE; +SIZE_T MmSizeOfPagedPoolInBytes = MI_MIN_INIT_PAGED_POOLSIZE; PFN_NUMBER MmSizeOfPagedPoolInPages = MI_MIN_INIT_PAGED_POOLSIZE / PAGE_SIZE; // @@ -131,10 +131,10 @@ PVOID MiSessionViewStart; // 0xBE000000 PVOID MiSessionPoolEnd; // 0xBE000000 PVOID MiSessionPoolStart; // 0xBD000000 PVOID MmSessionBase; // 0xBD000000 -ULONG MmSessionSize; -ULONG MmSessionViewSize; -ULONG MmSessionPoolSize; -ULONG MmSessionImageSize; +SIZE_T MmSessionSize; +SIZE_T MmSessionViewSize; +SIZE_T MmSessionPoolSize; +SIZE_T MmSessionImageSize; /* * These are the PTE addresses of the boundaries carved out above @@ -151,7 +151,7 @@ PMMPTE MiSessionLastPte; // By default, it is a 16MB region. // PVOID MiSystemViewStart; -ULONG MmSystemViewSize; +SIZE_T MmSystemViewSize; // // A copy of the system page directory (the page directory associated with the @@ -175,13 +175,13 @@ PMMWSL MmSystemCacheWorkingSetList = MI_SYSTEM_CACHE_WS_START; // On systems with more than 32MB, this number is then doubled, and further // aligned up to a PDE boundary (4MB). // -ULONG MmNumberOfSystemPtes; +ULONG_PTR MmNumberOfSystemPtes; // // This is how many pages the PFN database will take up // In Windows, this includes the Quark Color Table, but not in ARMĀ³ // -ULONG MxPfnAllocation; +PFN_NUMBER MxPfnAllocation; // // Unlike the old ReactOS Memory Manager, ARMĀ³ (and Windows) does not keep track @@ -205,7 +205,7 @@ PPHYSICAL_MEMORY_DESCRIPTOR MmPhysicalMemoryBlock; // // This is where we keep track of the most basic physical layout markers // -ULONG MmNumberOfPhysicalPages, MmHighestPhysicalPage, MmLowestPhysicalPage = -1; +PFN_NUMBER MmNumberOfPhysicalPages, MmHighestPhysicalPage, MmLowestPhysicalPage = -1; // // The total number of pages mapped by the boot loader, which include the kernel @@ -215,13 +215,13 @@ ULONG MmNumberOfPhysicalPages, MmHighestPhysicalPage, MmLowestPhysicalPage = -1; // // This number is later aligned up to a PDE boundary. // -ULONG MmBootImageSize; +SIZE_T MmBootImageSize; // // These three variables keep track of the core separation of address space that // exists between kernel mode and user mode. // -ULONG MmUserProbeAddress; +ULONG_PTR MmUserProbeAddress; PVOID MmHighestUserAddress; PVOID MmSystemRangeStart; diff --git a/reactos/ntoskrnl/mm/ARM3/ncache.c b/reactos/ntoskrnl/mm/ARM3/ncache.c index d49d72f3054..348ba557d94 100644 --- a/reactos/ntoskrnl/mm/ARM3/ncache.c +++ b/reactos/ntoskrnl/mm/ARM3/ncache.c @@ -23,7 +23,7 @@ */ PVOID NTAPI -MmAllocateNonCachedMemory(IN ULONG NumberOfBytes) +MmAllocateNonCachedMemory(IN SIZE_T NumberOfBytes) { PFN_NUMBER PageCount, MdlPageCount, PageFrameIndex; PHYSICAL_ADDRESS LowAddress, HighAddress, SkipBytes; diff --git a/reactos/ntoskrnl/mm/ARM3/procsup.c b/reactos/ntoskrnl/mm/ARM3/procsup.c index eb577050a7d..4410624c387 100644 --- a/reactos/ntoskrnl/mm/ARM3/procsup.c +++ b/reactos/ntoskrnl/mm/ARM3/procsup.c @@ -513,7 +513,7 @@ MmCreatePeb(IN PEPROCESS Process, ImageConfigData = RtlImageDirectoryEntryToData(Peb->ImageBaseAddress, TRUE, IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG, - &ViewSize); + (PULONG)&ViewSize); if (ImageConfigData) { // diff --git a/reactos/ntoskrnl/mm/ARM3/virtual.c b/reactos/ntoskrnl/mm/ARM3/virtual.c index 2e9dbd25671..fd7f0e176be 100644 --- a/reactos/ntoskrnl/mm/ARM3/virtual.c +++ b/reactos/ntoskrnl/mm/ARM3/virtual.c @@ -883,7 +883,7 @@ NtWriteVirtualMemory(IN HANDLE ProcessHandle, KPROCESSOR_MODE PreviousMode = ExGetPreviousMode(); PEPROCESS Process; NTSTATUS Status = STATUS_SUCCESS; - ULONG BytesWritten = 0; + SIZE_T BytesWritten = 0; PAGED_CODE(); // diff --git a/reactos/ntoskrnl/mm/anonmem.c b/reactos/ntoskrnl/mm/anonmem.c index 327a9a694ee..56453521d3a 100644 --- a/reactos/ntoskrnl/mm/anonmem.c +++ b/reactos/ntoskrnl/mm/anonmem.c @@ -718,10 +718,10 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, MemoryAreaLength = (ULONG_PTR)MemoryArea->EndingAddress - (ULONG_PTR)MemoryArea->StartingAddress; - if (((ULONG)BaseAddress + RegionSize) > (ULONG)MemoryArea->EndingAddress) + if (((ULONG_PTR)BaseAddress + RegionSize) > (ULONG_PTR)MemoryArea->EndingAddress) { DPRINT("BaseAddress + RegionSize %x is larger than MemoryArea's EndingAddress %x\n", - (ULONG)BaseAddress + RegionSize, MemoryArea->EndingAddress); + (ULONG_PTR)BaseAddress + RegionSize, MemoryArea->EndingAddress); MmUnlockAddressSpace(AddressSpace); ObDereferenceObject(Process); @@ -1123,7 +1123,7 @@ NTSTATUS NTAPI MmQueryAnonMem(PMEMORY_AREA MemoryArea, PVOID Address, PMEMORY_BASIC_INFORMATION Info, - PULONG ResultLength) + PSIZE_T ResultLength) { PMM_REGION Region; PVOID RegionBase = NULL; diff --git a/reactos/ntoskrnl/mm/pagefile.c b/reactos/ntoskrnl/mm/pagefile.c index f5b209c7277..a9c1c6ab0f9 100644 --- a/reactos/ntoskrnl/mm/pagefile.c +++ b/reactos/ntoskrnl/mm/pagefile.c @@ -81,17 +81,17 @@ static ULONG MiPagingFileCount; ULONG MmNumberOfPagingFiles; /* Number of pages that are available for swapping */ -ULONG MiFreeSwapPages; +PFN_NUMBER MiFreeSwapPages; /* Number of pages that have been allocated for swapping */ -ULONG MiUsedSwapPages; +PFN_NUMBER MiUsedSwapPages; BOOLEAN MmZeroPageFile; /* * Number of pages that have been reserved for swapping but not yet allocated */ -static ULONG MiReservedSwapPages; +static PFN_NUMBER MiReservedSwapPages; /* * Ratio between reserved and available swap pages, e.g. setting this to five diff --git a/reactos/ntoskrnl/mm/ppool.c b/reactos/ntoskrnl/mm/ppool.c index 973736d759a..bfeb42ba6e2 100644 --- a/reactos/ntoskrnl/mm/ppool.c +++ b/reactos/ntoskrnl/mm/ppool.c @@ -159,8 +159,8 @@ typedef struct _R_POOL R_POOL, *PR_POOL; PVOID MmPagedPoolBase; -ULONG MmPagedPoolSize; -ULONG MmTotalPagedPoolQuota = 0; // TODO FIXME commented out until we use it +SIZE_T MmPagedPoolSize; +SIZE_T MmTotalPagedPoolQuota = 0; // TODO FIXME commented out until we use it static PR_POOL MmPagedPool = NULL; /* FUNCTIONS*******************************************************************/ diff --git a/reactos/ntoskrnl/mm/section.c b/reactos/ntoskrnl/mm/section.c index 85155e9bcd5..8761620434d 100644 --- a/reactos/ntoskrnl/mm/section.c +++ b/reactos/ntoskrnl/mm/section.c @@ -2083,7 +2083,7 @@ NTSTATUS NTAPI MmQuerySectionView(PMEMORY_AREA MemoryArea, PVOID Address, PMEMORY_BASIC_INFORMATION Info, - PULONG ResultLength) + PSIZE_T ResultLength) { PMM_REGION Region; PVOID RegionBaseAddress;