forked from pig4210/xlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxlib_base.cpp
More file actions
44 lines (35 loc) · 831 Bytes
/
xlib_base.cpp
File metadata and controls
44 lines (35 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "xlib_base.h"
#ifdef FOR_RING0
//注意#undef POOL_TAGGING无效
# ifdef POOL_TAGGING
# undef ExAllocatePool
# undef ExAllocatePoolWithQuota
# undef ExFreePool
# endif
void* __cdecl operator new(size_t size)
{
return ExAllocatePool(NonPagedPool,size);
}
void* __cdecl operator new(size_t size,POOL_TYPE pooltype)
{
return ExAllocatePool(pooltype,size);
}
void* __cdecl operator new[](size_t size)
{
return ExAllocatePool(NonPagedPool,size);
}
void* __cdecl operator new[](size_t size,POOL_TYPE pooltype)
{
return ExAllocatePool(pooltype,size);
}
void __cdecl operator delete(void* mem)
{
if(mem == nullptr) return;
ExFreePool(mem);
}
void __cdecl operator delete[](void* mem)
{
if(mem == nullptr) return;
ExFreePool(mem);
}
#endif //#ifdef FOR_RING0