PsSetCreateThreadNotifyRoutineEx, fonction (ntddk.h)

La routine PsSetCreateThreadNotifyRoutineEx 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 PsSetCreateThreadNotifyRoutineEx(
  [in] PSCREATETHREADNOTIFYTYPE NotifyType,
  [in] PVOID                    NotifyInformation
);

Paramètres

[in] NotifyType

Valeur PSCREATETHREADNOTIFYTYPE qui indique le type de notification de thread.

[in] NotifyInformation

Fournit l’adresse des informations de notification pour le type spécifié de notification de thread. Si NotifyType a la valeur PsCreateThreadNotifyNonSystem ou PsCreateThreadNotifySubsystems , NotifyInformation doit être un pointeur vers l’implémentation du pilote de PCREATE_THREAD_NOTIFY_ROUTINE.

Valeur retournée

PsSetCreateThreadNotifyRoutineEx retourne STATUS_SUCCESS ou STATUS_INSUFFICIENT_RESOURCES si l’inscription du rappel a échoué.

Remarques

Les pilotes de niveau supérieur peuvent appeler PsSetCreateThreadNotifyRoutineEx pour configurer leurs routines de notification de création de threads.

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

Si NotifyType a la valeur PsCreateThreadNotifyNonSystem, la routine PsSetCreateThreadNotifyRoutineEx diffère de PsSetCreateThreadNotifyRoutine dans le contexte dans lequel le rappel est exécuté. Avec PsSetCreateThreadNotifyRoutine, le rappel est exécuté sur le thread du créateur. Avec PsSetCreateThreadNotifyRoutineEx, le rappel est exécuté sur le thread nouvellement créé.

Un pilote doit supprimer toute fonction de rappel qu’il inscrit avant son déchargement. Vous pouvez supprimer le rappel en appelant la routine PsRemoveCreateThreadNotifyRoutine .

Configuration requise

Condition requise Valeur
Client minimal pris en charge Disponible à partir de Windows 10.
Plateforme cible Universal
En-tête ntddk.h (incluez Ntddk.h)
Bibliothèque NtosKrnl.lib
DLL NtosKrnl.exe
IRQL PASSIVE_LEVEL

Voir aussi

PsGetCurrentProcessId

PsGetCurrentThreadId

PsIsSystemThread

PsRemoveCreateThreadNotifyRoutine

PsSetCreateProcessNotifyRoutine

PsSetCreateThreadNotifyRoutine

PsSetLoadImageNotifyRoutine