Skip to content

Commit

Permalink
kph defer delete proc and thrd contexts
Browse files Browse the repository at this point in the history
  • Loading branch information
jxy-s committed Oct 17, 2024
1 parent f66183a commit b56dcf2
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions KSystemInformer/cid_tracking.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,14 +610,14 @@ NTSTATUS KSIAPI KphpInitializeProcessContext(
* \param[in] Object The process context object to delete.
*/
_Function_class_(KPH_TYPE_DELETE_PROCEDURE)
_IRQL_requires_max_(APC_LEVEL)
_IRQL_requires_max_(PASSIVE_LEVEL)
VOID KSIAPI KphpDeleteProcessContext(
_Inout_ PVOID Object
)
{
PKPH_PROCESS_CONTEXT process;

KPH_PAGED_CODE();
KPH_PAGED_CODE_PASSIVE();

process = Object;

Expand Down Expand Up @@ -660,12 +660,12 @@ VOID KSIAPI KphpDeleteProcessContext(
* \param[in] Object The process context object to free.
*/
_Function_class_(KPH_TYPE_FREE_PROCEDURE)
_IRQL_requires_max_(APC_LEVEL)
_IRQL_requires_max_(PASSIVE_LEVEL)
VOID KSIAPI KphpFreeProcessContext(
_In_freesMem_ PVOID Object
)
{
KPH_PAGED_CODE();
KPH_PAGED_CODE_PASSIVE();

NT_ASSERT(KphpProcessContextLookaside);

Expand Down Expand Up @@ -1044,14 +1044,14 @@ NTSTATUS KSIAPI KphpInitializeThreadContext(
* \param[in] Object The thread context object to delete.
*/
_Function_class_(KPH_TYPE_DELETE_PROCEDURE)
_IRQL_requires_max_(APC_LEVEL)
_IRQL_requires_max_(PASSIVE_LEVEL)
VOID KSIAPI KphpDeleteThreadContext(
_Inout_ PVOID Object
)
{
PKPH_THREAD_CONTEXT thread;

KPH_PAGED_CODE();
KPH_PAGED_CODE_PASSIVE();

thread = Object;

Expand All @@ -1075,12 +1075,12 @@ VOID KSIAPI KphpDeleteThreadContext(
* \param[in] Object The thread context object to free.
*/
_Function_class_(KPH_TYPE_FREE_PROCEDURE)
_IRQL_requires_max_(APC_LEVEL)
_IRQL_requires_max_(PASSIVE_LEVEL)
VOID KSIAPI KphpFreeThreadContext(
_In_freesMem_ PVOID Object
)
{
KPH_PAGED_CODE();
KPH_PAGED_CODE_PASSIVE();

NT_ASSERT(KphpThreadContextLookaside);

Expand Down Expand Up @@ -1159,6 +1159,7 @@ NTSTATUS KphCidInitialize(
typeInfo.Delete = KphpDeleteProcessContext;
typeInfo.Free = KphpFreeProcessContext;
typeInfo.Flags = 0;
typeInfo.DeferDelete = TRUE;

KphCreateObjectType(&KphpProcessContextTypeName,
&typeInfo,
Expand All @@ -1169,6 +1170,7 @@ NTSTATUS KphCidInitialize(
typeInfo.Delete = KphpDeleteThreadContext;
typeInfo.Free = KphpFreeThreadContext;
typeInfo.Flags = 0;
typeInfo.DeferDelete = TRUE;

KphCreateObjectType(&KphpThreadContextTypeName,
&typeInfo,
Expand Down

0 comments on commit b56dcf2

Please sign in to comment.