ReactOS 0.4.17-dev-1164-g974a446
ignorepooltag.c File Reference
#include <ntoskrnl.h>
#include <initguid.h>
#include <debug.h>
Include dependency graph for ignorepooltag.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

 DEFINE_GUID (KseIgnoreFreePoolTagGuid, 0x8d0ed225, 0x0892, 0x4efc, 0x9e, 0x72, 0x50, 0x89, 0x12, 0x42, 0x74, 0x53)
 
static VOID NTAPI ShimExFreePoolWithTag (_In_ PVOID P, _In_ ULONG Tag)
 
NTSTATUS NTAPI KseIgnoreFreePoolTagInitialize (VOID)
 

Variables

KSE_SHIM KseIgnoreFreePoolTagShim = { sizeof(KSE_SHIM), &KseIgnoreFreePoolTagGuid, L"IgnoreFreePoolTag", NULL, NULL, NULL, KseIgnoreFreePoolTagCollections }
 
static KSE_HOOK KseIgnoreFreePoolTagHooksNT []
 
static KSE_HOOK_COLLECTION KseIgnoreFreePoolTagCollections []
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 21 of file ignorepooltag.c.

Function Documentation

◆ DEFINE_GUID()

DEFINE_GUID ( KseIgnoreFreePoolTagGuid  ,
0x8d0ed225  ,
0x0892  ,
0x4efc  ,
0x9e  ,
0x72  ,
0x50  ,
0x89  ,
0x12  ,
0x42  ,
0x74  ,
0x53   
)

◆ KseIgnoreFreePoolTagInitialize()

NTSTATUS NTAPI KseIgnoreFreePoolTagInitialize ( VOID  )

Definition at line 59 of file ignorepooltag.c.

60{
62
64 if (!NT_SUCCESS(Status))
65 DPRINT1("KSE: Unable to register IgnoreFreePoolTag shim (0x%lx)\n", Status);
66
67 return Status;
68}
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
Status
Definition: gdiplustypes.h:24
KSE_SHIM KseIgnoreFreePoolTagShim
Definition: ignorepooltag.c:54
NTSTATUS NTAPI KseRegisterShim(_In_ PKSE_SHIM Shim, _In_ PVOID Ignored, _In_ ULONG Flags)
Definition: kse.c:464

Referenced by KseInitialize().

◆ ShimExFreePoolWithTag()

static VOID NTAPI ShimExFreePoolWithTag ( _In_ PVOID  P,
_In_ ULONG  Tag 
)
static

Definition at line 29 of file ignorepooltag.c.

32{
33 VOID (NTAPI *OriginalFunction)(PVOID, ULONG);
34
36
37 /* Keep validating explicit frees of protected pool, like Windows does */
38 if (!(Tag & PROTECTED_POOL))
39 Tag = 0;
40
41 OriginalFunction(P, Tag);
42}
#define VOID
Definition: acefi.h:82
#define P(row, col)
PKSE_HOOK HookArray
Definition: kse.h:44
PVOID OriginalFunction
Definition: kse.h:30
PKSE_HOOK_COLLECTION HookCollectionsArray
Definition: kse.h:99
#define NTAPI
Definition: typedefs.h:36
void * PVOID
Definition: typedefs.h:50
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ UCXENDPOINT _In_ PVOID Tag
Definition: ucxendpoint.h:325
#define PROTECTED_POOL
Definition: extypes.h:349

Variable Documentation

◆ KseIgnoreFreePoolTagCollections

KSE_HOOK_COLLECTION KseIgnoreFreePoolTagCollections[]
static
Initial value:
= {
}
static KSE_HOOK KseIgnoreFreePoolTagHooksNT[]
Definition: ignorepooltag.c:44
#define KseCollectionInvalid
Definition: kse.h:38
#define KseCollectionNtExport
Definition: kse.h:34

Definition at line 49 of file ignorepooltag.c.

◆ KseIgnoreFreePoolTagHooksNT

KSE_HOOK KseIgnoreFreePoolTagHooksNT[]
static
Initial value:
= {
{ KseHookFunction, { "ExFreePoolWithTag" }, (PVOID)(ULONG_PTR)ShimExFreePoolWithTag },
}
static VOID NTAPI ShimExFreePoolWithTag(_In_ PVOID P, _In_ ULONG Tag)
Definition: ignorepooltag.c:29
#define KseHookInvalid
Definition: kse.h:13
#define KseHookFunction
Definition: kse.h:11
uint32_t ULONG_PTR
Definition: typedefs.h:65

Definition at line 44 of file ignorepooltag.c.

◆ KseIgnoreFreePoolTagShim

KSE_SHIM KseIgnoreFreePoolTagShim = { sizeof(KSE_SHIM), &KseIgnoreFreePoolTagGuid, L"IgnoreFreePoolTag", NULL, NULL, NULL, KseIgnoreFreePoolTagCollections }

Definition at line 54 of file ignorepooltag.c.

Referenced by KseIgnoreFreePoolTagInitialize(), and ShimExFreePoolWithTag().