Skip to content

Commit 6a5006b

Browse files
committed
Rename pool tag
1 parent df10b2f commit 6a5006b

File tree

6 files changed

+25
-25
lines changed

6 files changed

+25
-25
lines changed

SimpleSvmHook/Common.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
//
3434
// The pool tag.
3535
//
36-
static const ULONG k_PerformancePoolTag = 'MVSS';
36+
static const ULONG k_PoolTag = 'MVSS';
3737

3838
//
3939
// The handy macros to specify at which section the code placed.

SimpleSvmHook/HookCommon.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ AllocateNptEntry (
8080
}
8181
else
8282
{
83-
entry = ExAllocatePoolWithTag(NonPagedPool, PAGE_SIZE, k_PerformancePoolTag);
83+
entry = ExAllocatePoolWithTag(NonPagedPool, PAGE_SIZE, k_PoolTag);
8484
if (entry == nullptr)
8585
{
8686
goto Exit;

SimpleSvmHook/HookKernelProcessorData.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ DestructNestedPageTablesInternal (
6060
//
6161
// Table == PDT, subTable == PT
6262
//
63-
ExFreePoolWithTag(subTable, k_PerformancePoolTag);
63+
ExFreePoolWithTag(subTable, k_PoolTag);
6464
break;
6565

6666
default:
6767
NT_ASSERT(false);
6868
}
6969
}
70-
ExFreePoolWithTag(Table, k_PerformancePoolTag);
70+
ExFreePoolWithTag(Table, k_PoolTag);
7171
}
7272

7373
/*!
@@ -135,7 +135,7 @@ BuildNestedPageTables (
135135
pml4Table = reinterpret_cast<PPML4_ENTRY_4KB>(ExAllocatePoolWithTag(
136136
NonPagedPool,
137137
PAGE_SIZE,
138-
k_PerformancePoolTag));
138+
k_PoolTag));
139139
if (pml4Table == nullptr)
140140
{
141141
status = STATUS_INSUFFICIENT_RESOURCES;
@@ -230,7 +230,7 @@ CleanupPreAllocateEntries (
230230
{
231231
break;
232232
}
233-
ExFreePoolWithTag(Entries[i], k_PerformancePoolTag);
233+
ExFreePoolWithTag(Entries[i], k_PoolTag);
234234
}
235235
}
236236

@@ -305,7 +305,7 @@ InitializeHookData (
305305
#pragma prefast(suppress : 28118, "DISPATCH_LEVEL is ok as this always allocates NonPagedPool")
306306
hookData = reinterpret_cast<PHOOK_DATA>(ExAllocatePoolWithTag(NonPagedPool,
307307
sizeof(*hookData),
308-
k_PerformancePoolTag));
308+
k_PoolTag));
309309
if (hookData == nullptr)
310310
{
311311
status = STATUS_INSUFFICIENT_RESOURCES;
@@ -346,7 +346,7 @@ InitializeHookData (
346346
{
347347
DestructNestedPageTables(hookData->Pml4Table);
348348
}
349-
ExFreePoolWithTag(hookData, k_PerformancePoolTag);
349+
ExFreePoolWithTag(hookData, k_PoolTag);
350350
}
351351
}
352352
return status;
@@ -371,7 +371,7 @@ CleanupHookData (
371371
RTL_NUMBER_OF(HookData->PreAllocatedNptEntries),
372372
HookData->UsedPreAllocatedEntriesCount);
373373
DestructNestedPageTables(HookData->Pml4Table);
374-
ExFreePoolWithTag(HookData, k_PerformancePoolTag);
374+
ExFreePoolWithTag(HookData, k_PoolTag);
375375
}
376376

377377
/*!

SimpleSvmHook/HookKernelRegistration.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ GetSharedMemoryEntry (
128128
// original contents.
129129
//
130130
#pragma prefast(suppress : 28118, "DISPATCH_LEVEL is ok as this always allocates NonPagedPool")
131-
execPage = ExAllocatePoolWithTag(NonPagedPool, PAGE_SIZE, k_PerformancePoolTag);
131+
execPage = ExAllocatePoolWithTag(NonPagedPool, PAGE_SIZE, k_PoolTag);
132132
if (execPage == nullptr)
133133
{
134134
LOGGING_LOG_ERROR("ExAllocatePoolWithTag failed : %lu", PAGE_SIZE);
@@ -176,7 +176,7 @@ GetSharedMemoryEntry (
176176
{
177177
if (execPage != nullptr)
178178
{
179-
ExFreePoolWithTag(execPage, k_PerformancePoolTag);
179+
ExFreePoolWithTag(execPage, k_PoolTag);
180180
}
181181
}
182182
return status;
@@ -377,7 +377,7 @@ InstallHookOnExecPage (
377377
#pragma prefast(suppress : 30030, "Intentionally executable")
378378
originalCallStub = ExAllocatePoolWithTag(NonPagedPoolExecute,
379379
instrLength + sizeof(jmpCode),
380-
k_PerformancePoolTag);
380+
k_PoolTag);
381381
if (originalCallStub == nullptr)
382382
{
383383
LOGGING_LOG_ERROR("ExAllocatePoolWithTag failed : %Iu",
@@ -491,7 +491,7 @@ InitializeHookEntry (
491491
{
492492
if (originalCallStub != nullptr)
493493
{
494-
ExFreePoolWithTag(originalCallStub, k_PerformancePoolTag);
494+
ExFreePoolWithTag(originalCallStub, k_PoolTag);
495495
}
496496
}
497497
return status;
@@ -561,7 +561,7 @@ InitializeHookRegistrationEntries (
561561
if (registration.HookEntry.OriginalCallStub != nullptr)
562562
{
563563
ExFreePoolWithTag(registration.HookEntry.OriginalCallStub,
564-
k_PerformancePoolTag);
564+
k_PoolTag);
565565
}
566566
}
567567
for (auto& sharedMemoryEntry : g_HookSharedMemoryEntries)
@@ -570,7 +570,7 @@ InitializeHookRegistrationEntries (
570570
{
571571
MmUnlockPages(sharedMemoryEntry.HookAddressMdl);
572572
IoFreeMdl(sharedMemoryEntry.HookAddressMdl);
573-
ExFreePoolWithTag(sharedMemoryEntry.ExecPage, k_PerformancePoolTag);
573+
ExFreePoolWithTag(sharedMemoryEntry.ExecPage, k_PoolTag);
574574
}
575575
}
576576
}
@@ -590,13 +590,13 @@ CleanupHookRegistrationEntries (
590590
for (auto& registration : g_HookRegistrationEntries)
591591
{
592592
ExFreePoolWithTag(registration.HookEntry.OriginalCallStub,
593-
k_PerformancePoolTag);
593+
k_PoolTag);
594594
}
595595
for (auto& sharedMemoryEntry : g_HookSharedMemoryEntries)
596596
{
597597
MmUnlockPages(sharedMemoryEntry.HookAddressMdl);
598598
IoFreeMdl(sharedMemoryEntry.HookAddressMdl);
599-
ExFreePoolWithTag(sharedMemoryEntry.ExecPage, k_PerformancePoolTag);
599+
ExFreePoolWithTag(sharedMemoryEntry.ExecPage, k_PoolTag);
600600
}
601601
}
602602

SimpleSvmHook/PhysicalMemoryDescriptor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ DuplicatePhysicalMemoryDescriptor (
7676
descriptorSize = sizeof(PHYSICAL_MEMORY_DESCRIPTOR) +
7777
sizeof(PHYSICAL_MEMORY_RUN) * (numberOfRuns - 1);
7878
descriptor = reinterpret_cast<PPHYSICAL_MEMORY_DESCRIPTOR>(
79-
ExAllocatePoolWithTag(NonPagedPool, descriptorSize, k_PerformancePoolTag));
79+
ExAllocatePoolWithTag(NonPagedPool, descriptorSize, k_PoolTag));
8080
if (descriptor == nullptr)
8181
{
8282
goto Exit;
@@ -120,7 +120,7 @@ FreePhysicalMemoryDescriptor (
120120
PPHYSICAL_MEMORY_DESCRIPTOR Descriptor
121121
)
122122
{
123-
ExFreePoolWithTag(Descriptor, k_PerformancePoolTag);
123+
ExFreePoolWithTag(Descriptor, k_PoolTag);
124124
}
125125

126126
/*!

SimpleSvmHook/Virtualization.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ AllocatePageAlingedPhysicalMemory (
6363
NT_ASSERT(NumberOfBytes >= PAGE_SIZE);
6464

6565
#pragma prefast(suppress : 28118, "DISPATCH_LEVEL is ok as this always allocates NonPagedPool")
66-
memory = ExAllocatePoolWithTag(NonPagedPool, NumberOfBytes, k_PerformancePoolTag);
66+
memory = ExAllocatePoolWithTag(NonPagedPool, NumberOfBytes, k_PoolTag);
6767
if (memory != nullptr)
6868
{
6969
NT_ASSERT(PAGE_ALIGN(memory) == memory);
@@ -85,7 +85,7 @@ FreePageAlingedPhysicalMemory (
8585
_Frees_ptr_ PVOID BaseAddress
8686
)
8787
{
88-
ExFreePoolWithTag(BaseAddress, k_PerformancePoolTag);
88+
ExFreePoolWithTag(BaseAddress, k_PoolTag);
8989
}
9090

9191
/*!
@@ -290,7 +290,7 @@ DevirtualizeProcessor (
290290
// of per processor data to be freed.
291291
//
292292
__cpuidex(registers, CPUID_LEAF_SIMPLE_SVM_CALL, CPUID_SUBLEAF_UNLOAD_SIMPLE_SVM);
293-
NT_ASSERT(registers[2] == k_PerformancePoolTag);
293+
NT_ASSERT(registers[2] == k_PoolTag);
294294
LOGGING_LOG_INFO("The processor has been de-virtualized.");
295295

296296
//
@@ -635,7 +635,7 @@ VirtualizeProcessor (
635635
contextRecord = reinterpret_cast<PCONTEXT>(ExAllocatePoolWithTag(
636636
NonPagedPool,
637637
sizeof(*contextRecord),
638-
k_PerformancePoolTag));
638+
k_PoolTag));
639639
if (contextRecord == nullptr)
640640
{
641641
LOGGING_LOG_ERROR("ExAllocatePoolWithTag failed : %Iu",
@@ -721,7 +721,7 @@ VirtualizeProcessor (
721721
Exit:
722722
if (contextRecord != nullptr)
723723
{
724-
ExFreePoolWithTag(contextRecord, k_PerformancePoolTag);
724+
ExFreePoolWithTag(contextRecord, k_PoolTag);
725725
}
726726
if (!NT_SUCCESS(status))
727727
{
@@ -915,7 +915,7 @@ VirtualizeAllProcessors (
915915
sharedVpData = reinterpret_cast<PSHARED_VIRTUAL_PROCESSOR_DATA>(ExAllocatePoolWithTag(
916916
NonPagedPool,
917917
sizeof(SHARED_VIRTUAL_PROCESSOR_DATA),
918-
k_PerformancePoolTag));
918+
k_PoolTag));
919919
if (sharedVpData == nullptr)
920920
{
921921
LOGGING_LOG_ERROR("ExAllocatePoolWithTag failed : %Iu",

0 commit comments

Comments
 (0)