PCREATE_THREAD_NOTIFY_ROUTINE callback function

A callback routine implemented by a driver to notify the caller when a thread is created or deleted.

Warning  The actions that you can perform in this routine are restricted for safe calls. See Best Practices.
 

Syntax

PCREATE_THREAD_NOTIFY_ROUTINE PcreateThreadNotifyRoutine;

void PcreateThreadNotifyRoutine(
  HANDLE ProcessId,
  HANDLE ThreadId,
  BOOLEAN Create
)
{...}

Parameters

ProcessId

The process ID of the process.

ThreadId

The thread ID of the thread.

Create

Indicates whether the thread was created (TRUE) or deleted (FALSE).

Return Value

This callback function does not return a value.

Remarks

Highest-level drivers can call PsSetCreateThreadNotifyRoutine or PsSetCreateThreadNotifyRoutineEx to register their thread-creation notify routine.

The driver's thread-notify routine runs at IRQL = PASSIVE_LEVEL or APC_LEVEL. When a thread is created, the thread-notify routine runs in the context of the thread that created the new thread. When a thread is deleted, the thread-notify routine runs in the context of this thread when the thread exits.

Requirements

   
Minimum supported client Available starting with Windows 2000.
Target Platform Universal
Header ntddk.h (include Ntddk.h)
IRQL "<=APC_LEVEL"

See Also

PsSetCreateThreadNotifyRoutine

PsSetCreateThreadNotifyRoutineEx