diff --git a/sdk/xtdk/mmtypes.h b/sdk/xtdk/mmtypes.h index 786d9b3..eea5ccf 100644 --- a/sdk/xtdk/mmtypes.h +++ b/sdk/xtdk/mmtypes.h @@ -224,13 +224,13 @@ typedef struct _POOL_HEADER } POOL_HEADER, *PPOOL_HEADER; /* Pool descriptor structure definition */ -typedef struct _POOL_TRACKER_BIG_ALLOCATIONS +typedef struct _POOL_TRACKING_BIG_ALLOCATIONS { ULONG NumberOfPages; PVOID QuotaObject; ULONG Tag; PVOID VirtualAddress; -} POOL_TRACKER_BIG_ALLOCATIONS, *PPOOL_TRACKER_BIG_ALLOCATIONS; +} POOL_TRACKING_BIG_ALLOCATIONS, *PPOOL_TRACKING_BIG_ALLOCATIONS; /* Pool tracking table structure definition */ typedef struct _POOL_TRACKING_TABLE diff --git a/sdk/xtdk/xtstruct.h b/sdk/xtdk/xtstruct.h index dd4902d..3e3e172 100644 --- a/sdk/xtdk/xtstruct.h +++ b/sdk/xtdk/xtstruct.h @@ -313,7 +313,7 @@ typedef struct _PECOFF_IMAGE_VXD_HEADER PECOFF_IMAGE_VXD_HEADER, *PPECOFF_IMAGE_ typedef struct _PHYSICAL_MEMORY_DESCRIPTOR PHYSICAL_MEMORY_DESCRIPTOR, *PPHYSICAL_MEMORY_DESCRIPTOR; typedef struct _PHYSICAL_MEMORY_RUN PHYSICAL_MEMORY_RUN, *PPHYSICAL_MEMORY_RUN; typedef struct _POOL_HEADER POOL_HEADER, *PPOOL_HEADER; -typedef struct _POOL_TRACKER_BIG_ALLOCATIONS POOL_TRACKER_BIG_ALLOCATIONS, *PPOOL_TRACKER_BIG_ALLOCATIONS; +typedef struct _POOL_TRACKING_BIG_ALLOCATIONS POOL_TRACKING_BIG_ALLOCATIONS, *PPOOL_TRACKING_BIG_ALLOCATIONS; typedef struct _POOL_TRACKING_TABLE POOL_TRACKING_TABLE, *PPOOL_TRACKING_TABLE; typedef struct _PROCESSOR_IDENTITY PROCESSOR_IDENTITY, *PPROCESSOR_IDENTITY; typedef struct _PROCESSOR_POWER_STATE PROCESSOR_POWER_STATE, *PPROCESSOR_POWER_STATE; diff --git a/xtoskrnl/includes/mm/alloc.hh b/xtoskrnl/includes/mm/alloc.hh index e3d24d5..4b95134 100644 --- a/xtoskrnl/includes/mm/alloc.hh +++ b/xtoskrnl/includes/mm/alloc.hh @@ -24,7 +24,7 @@ namespace MM STATIC SIZE_T AllocationsTrackingTableMask; STATIC SIZE_T AllocationsTrackingTableSize; STATIC ULONG BigAllocationsInUse; - STATIC PPOOL_TRACKER_BIG_ALLOCATIONS BigAllocationsTrackingTable; + STATIC PPOOL_TRACKING_BIG_ALLOCATIONS BigAllocationsTrackingTable; STATIC SIZE_T BigAllocationsTrackingTableHash; STATIC KSPIN_LOCK BigAllocationsTrackingTableLock; STATIC SIZE_T BigAllocationsTrackingTableSize; diff --git a/xtoskrnl/mm/alloc.cc b/xtoskrnl/mm/alloc.cc index 4590327..3e5c473 100644 --- a/xtoskrnl/mm/alloc.cc +++ b/xtoskrnl/mm/alloc.cc @@ -603,7 +603,7 @@ XTAPI BOOLEAN MM::Allocator::ExpandBigAllocationsTable(VOID) { - PPOOL_TRACKER_BIG_ALLOCATIONS NewTable, OldTable; + PPOOL_TRACKING_BIG_ALLOCATIONS NewTable, OldTable; SIZE_T AllocationBytes, OldSize, NewSize; ULONG Hash, HashMask, Index; XTSTATUS Status; @@ -624,17 +624,17 @@ MM::Allocator::ExpandBigAllocationsTable(VOID) NewSize = OldSize * 2; /* Ensure the new capacity does not result in fractional memory pages */ - NewSize = ROUND_DOWN(NewSize, MM_PAGE_SIZE / sizeof(POOL_TRACKER_BIG_ALLOCATIONS)); + NewSize = ROUND_DOWN(NewSize, MM_PAGE_SIZE / sizeof(POOL_TRACKING_BIG_ALLOCATIONS)); /* Check if calculating the total byte size would cause an integer overflow */ - if(NewSize > ((~(SIZE_T)0) / sizeof(POOL_TRACKER_BIG_ALLOCATIONS))) + if(NewSize > ((~(SIZE_T)0) / sizeof(POOL_TRACKING_BIG_ALLOCATIONS))) { /* Abort expansion to prevent allocating a truncated memory block */ return FALSE; } /* Compute the size required for the newly expanded tracking table */ - AllocationBytes = NewSize * sizeof(POOL_TRACKER_BIG_ALLOCATIONS); + AllocationBytes = NewSize * sizeof(POOL_TRACKING_BIG_ALLOCATIONS); /* Allocate the required memory */ Status = AllocatePages(NonPagedPool, AllocationBytes, (PVOID*)&NewTable); @@ -1379,7 +1379,7 @@ MM::Allocator::InitializeBigAllocationsTracking(VOID) while(TRUE) { /* Prevent integer overflow when calculating the required byte size for the table */ - if((BigAllocationsTrackingTableSize + 1) > (MAXULONG_PTR / sizeof(POOL_TRACKER_BIG_ALLOCATIONS))) + if((BigAllocationsTrackingTableSize + 1) > (MAXULONG_PTR / sizeof(POOL_TRACKING_BIG_ALLOCATIONS))) { /* Halve the requested entry count and restart the evaluation */ BigAllocationsTrackingTableSize >>= 1; @@ -1388,7 +1388,7 @@ MM::Allocator::InitializeBigAllocationsTracking(VOID) /* Attempt to allocate physical memory for the table */ Status = AllocatePages(NonPagedPool, - BigAllocationsTrackingTableSize * sizeof(POOL_TRACKER_BIG_ALLOCATIONS), + BigAllocationsTrackingTableSize * sizeof(POOL_TRACKING_BIG_ALLOCATIONS), (PVOID*)&BigAllocationsTrackingTable); /* Check if the allocation succeeded */ @@ -1412,7 +1412,7 @@ MM::Allocator::InitializeBigAllocationsTracking(VOID) } /* Zero the entire memory used by the table */ - RtlZeroMemory(BigAllocationsTrackingTable, BigAllocationsTrackingTableSize * sizeof(POOL_TRACKER_BIG_ALLOCATIONS)); + RtlZeroMemory(BigAllocationsTrackingTable, BigAllocationsTrackingTableSize * sizeof(POOL_TRACKING_BIG_ALLOCATIONS)); /* Iterate through the newly allocated table */ for(Index = 0; Index < BigAllocationsTrackingTableSize; Index++) @@ -1429,7 +1429,7 @@ MM::Allocator::InitializeBigAllocationsTracking(VOID) /* Register the allocation in the tracking table */ RegisterAllocationTag(SIGNATURE32('M', 'M', 'g', 'r'), - SIZE_TO_PAGES(BigAllocationsTrackingTableSize * sizeof(POOL_TRACKER_BIG_ALLOCATIONS)), + SIZE_TO_PAGES(BigAllocationsTrackingTableSize * sizeof(POOL_TRACKING_BIG_ALLOCATIONS)), NonPagedPool); } @@ -1560,7 +1560,7 @@ MM::Allocator::RegisterBigAllocationTag(IN PVOID VirtualAddress, IN ULONG Pages, IN MMPOOL_TYPE PoolType) { - PPOOL_TRACKER_BIG_ALLOCATIONS Entry; + PPOOL_TRACKING_BIG_ALLOCATIONS Entry; BOOLEAN Inserted, RequiresExpansion; ULONG Hash, StartHash; @@ -1766,7 +1766,7 @@ MM::Allocator::UnregisterBigAllocationTag(IN PVOID VirtualAddress, ULONG Hash, StartHash; ULONG PoolTag; BOOLEAN Found; - PPOOL_TRACKER_BIG_ALLOCATIONS Entry; + PPOOL_TRACKING_BIG_ALLOCATIONS Entry; /* Initialize default state */ Found = FALSE; diff --git a/xtoskrnl/mm/data.cc b/xtoskrnl/mm/data.cc index 5cb3079..412f470 100644 --- a/xtoskrnl/mm/data.cc +++ b/xtoskrnl/mm/data.cc @@ -25,7 +25,7 @@ SIZE_T MM::Allocator::AllocationsTrackingTableSize; ULONG MM::Allocator::BigAllocationsInUse; /* Pointer to the hash table for tracking page-aligned memory */ -PPOOL_TRACKER_BIG_ALLOCATIONS MM::Allocator::BigAllocationsTrackingTable; +PPOOL_TRACKING_BIG_ALLOCATIONS MM::Allocator::BigAllocationsTrackingTable; /* Bitmask used for fast modulo arithmetic during hash bucket lookups */ SIZE_T MM::Allocator::BigAllocationsTrackingTableHash;