Skip to content

Commit e23f9bb

Browse files
committed
upgrade toolset
change ExAllocatePoolWithTag(Priority) to ExAllocatePool2/3
1 parent e4db201 commit e23f9bb

4 files changed

Lines changed: 13 additions & 10 deletions

File tree

Chapter08/EnumProc/EnumProc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void EnumProcesses() {
4444
ZwQuerySystemInformation(SystemProcessInformation, nullptr, 0, &size);
4545
size += 1 << 12;
4646

47-
auto buffer = ExAllocatePoolWithTag(PagedPool, size, 'cprP');
47+
auto buffer = ExAllocatePool2(POOL_FLAG_PAGED, size, 'cprP');
4848
if (!buffer)
4949
return;
5050

Chapter08/KMelody/Memory.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22
#include "KMelody.h"
33
#include "Memory.h"
44

5-
void* __cdecl operator new(size_t size, POOL_TYPE pool, ULONG tag) {
6-
void* p = ExAllocatePoolWithTag(pool, size, tag);
5+
void* __cdecl operator new(size_t size, POOL_FLAGS pool, ULONG tag) {
6+
void* p = ExAllocatePool2(pool, size, tag);
77
return p;
88
}
99

10-
void* __cdecl operator new(size_t size, POOL_TYPE pool, EX_POOL_PRIORITY priority, ULONG tag) {
11-
return ExAllocatePoolWithTagPriority(pool, size, tag, priority);
10+
void* __cdecl operator new(size_t size, POOL_FLAGS pool, EX_POOL_PRIORITY priority, ULONG tag) {
11+
POOL_EXTENDED_PARAMETER pp;
12+
pp.Priority = priority;
13+
pp.Type = PoolExtendedParameterPriority;
14+
return ExAllocatePool3(pool, size, tag, &pp, 1);
1215
}
1316

1417
void __cdecl operator delete(void* p, size_t) {

Chapter08/KMelody/Memory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
void* __cdecl operator new(size_t size, POOL_TYPE pool, ULONG tag = DRIVER_TAG);
3+
void* __cdecl operator new(size_t size, POOL_FLAGS pool, ULONG tag = DRIVER_TAG);
44
void* __cdecl operator new(size_t size, POOL_TYPE pool, EX_POOL_PRIORITY priority, ULONG tag = DRIVER_TAG);
55
void __cdecl operator delete(void* p, size_t);
66
void __cdecl operator delete(void* p, size_t, std::align_val_t);

Chapter08/Melody/Melody.vcxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,26 +29,26 @@
2929
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
3030
<ConfigurationType>Application</ConfigurationType>
3131
<UseDebugLibraries>true</UseDebugLibraries>
32-
<PlatformToolset>v142</PlatformToolset>
32+
<PlatformToolset>v143</PlatformToolset>
3333
<CharacterSet>Unicode</CharacterSet>
3434
</PropertyGroup>
3535
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
3636
<ConfigurationType>Application</ConfigurationType>
3737
<UseDebugLibraries>false</UseDebugLibraries>
38-
<PlatformToolset>v142</PlatformToolset>
38+
<PlatformToolset>v143</PlatformToolset>
3939
<WholeProgramOptimization>true</WholeProgramOptimization>
4040
<CharacterSet>Unicode</CharacterSet>
4141
</PropertyGroup>
4242
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
4343
<ConfigurationType>Application</ConfigurationType>
4444
<UseDebugLibraries>true</UseDebugLibraries>
45-
<PlatformToolset>v142</PlatformToolset>
45+
<PlatformToolset>v143</PlatformToolset>
4646
<CharacterSet>Unicode</CharacterSet>
4747
</PropertyGroup>
4848
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
4949
<ConfigurationType>Application</ConfigurationType>
5050
<UseDebugLibraries>false</UseDebugLibraries>
51-
<PlatformToolset>v142</PlatformToolset>
51+
<PlatformToolset>v143</PlatformToolset>
5252
<WholeProgramOptimization>true</WholeProgramOptimization>
5353
<CharacterSet>Unicode</CharacterSet>
5454
</PropertyGroup>

0 commit comments

Comments
 (0)