Partager via


PsSetCreateThreadNotifyRoutine, fonction (ntddk.h)

Le PsSetCreateThreadNotifyRoutine routine inscrit un rappel fourni par le pilote qui est ensuite averti lorsqu’un nouveau thread est créé et lorsqu’un tel thread est supprimé.

Syntaxe

NTSTATUS PsSetCreateThreadNotifyRoutine(
  [in] PCREATE_THREAD_NOTIFY_ROUTINE NotifyRoutine
);

Paramètres

[in] NotifyRoutine

Pointeur vers l’implémentation du pilote de PCREATE_THREAD_NOTIFY_ROUTINE routine.

Valeur de retour

PsSetCreateThreadNotifyRoutine retourne STATUS_SUCCESS ou retourne STATUS_INSUFFICIENT_RESOURCES si l’inscription de rappel a échoué.

Remarques

Les pilotes de niveau supérieur peuvent appeler PsSetCreateThreadNotifyRoutine pour configurer leurs routines de notification de création de threads, déclarées comme suit :

VOID
(*PCREATE_THREAD_NOTIFY_ROUTINE) (
    IN HANDLE  ProcessId,
    IN HANDLE  ThreadId,
    IN BOOLEAN  Create
    );

Par exemple, un pilote de profilage système de niveau supérieur ou IFS peut inscrire un rappel de création de thread de ce type pour suivre la création et la suppression à l’échelle du système des threads par rapport à l’état interne du pilote.

Un pilote doit supprimer les rappels qu’il inscrit avant de décharger. Vous pouvez supprimer le rappel en appelant la routine PsRemoveCreateThreadNotifyRoutine.

Exigences

Exigence Valeur
plateforme cible Universel
d’en-tête ntddk.h (include Ntddk.h)
bibliothèque NtosKrnl.lib
DLL NtosKrnl.exe
IRQL PASSIVE_LEVEL
règles de conformité DDI HwStorPortProhibitedDDIs(storport), IrqlPsPassive(wdm), PowerIrpDDis(wdm)

Voir aussi

PsGetCurrentProcessId

PsGetCurrentThreadId

psIsSystemThread

PsRemoveCreateThreadNotifyRoutine

PsSetCreateProcessNotifyRoutine

PsSetLoadImageNotifyRoutine