Partager via


Fonction de rappel LdrDllNotification

[Cette fonction peut être modifiée ou supprimée de Windows sans préavis.]

Fonction de rappel de notification spécifiée avec la fonction LdrRegisterDllNotification. Le chargeur appelle cette fonction lorsqu’une DLL est chargée pour la première fois.

Avertissement

Il est dangereux pour le rappel de notification d’appeler des fonctions dans n’importe quel autre module autre que lui-même.

Syntaxe

VOID CALLBACK LdrDllNotification(
  _In_     ULONG                       NotificationReason,
  _In_     PCLDR_DLL_NOTIFICATION_DATA NotificationData,
  _In_opt_ PVOID                       Context
);

Paramètres

NotificationReason [in]

Raison pour laquelle la fonction de rappel de notification a été appelée. Ce paramètre peut être l’une des valeurs suivantes.

Valeur Signification
LDR_DLL_NOTIFICATION_REASON_LOADED
1
La DLL a été chargée. Le paramètre NotificationData pointe vers une structure LDR_DLL_LOADED_NOTIFICATION_DATA.
LDR_DLL_NOTIFICATION_REASON_UNLOADED
2
La DLL a été déchargée. Le paramètre NotificationData pointe vers une structure LDR_DLL_UNLOADED_NOTIFICATION_DATA.

 

NotificationData [in]

Pointeur vers une constante LDR_DLL_NOTIFICATION union qui contient des données de notification. Cette union a la définition suivante :

typedef union _LDR_DLL_NOTIFICATION_DATA {
    LDR_DLL_LOADED_NOTIFICATION_DATA Loaded;
    LDR_DLL_UNLOADED_NOTIFICATION_DATA Unloaded;
} LDR_DLL_NOTIFICATION_DATA, *PLDR_DLL_NOTIFICATION_DATA;

La structure LDR_DLL_LOADED_NOTIFICATION_DATA a la définition suivante :

typedef struct _LDR_DLL_LOADED_NOTIFICATION_DATA {
    ULONG Flags;                    //Reserved.
    PCUNICODE_STRING FullDllName;   //The full path name of the DLL module.
    PCUNICODE_STRING BaseDllName;   //The base file name of the DLL module.
    PVOID DllBase;                  //A pointer to the base address for the DLL in memory.
    ULONG SizeOfImage;              //The size of the DLL image, in bytes.
} LDR_DLL_LOADED_NOTIFICATION_DATA, *PLDR_DLL_LOADED_NOTIFICATION_DATA;

La structure LDR_DLL_UNLOADED_NOTIFICATION_DATA a la définition suivante :

typedef struct _LDR_DLL_UNLOADED_NOTIFICATION_DATA {
    ULONG Flags;                    //Reserved.
    PCUNICODE_STRING FullDllName;   //The full path name of the DLL module.
    PCUNICODE_STRING BaseDllName;   //The base file name of the DLL module.
    PVOID DllBase;                  //A pointer to the base address for the DLL in memory.
    ULONG SizeOfImage;              //The size of the DLL image, in bytes.
} LDR_DLL_UNLOADED_NOTIFICATION_DATA, *PLDR_DLL_UNLOADED_NOTIFICATION_DATA;

de contexte [in, facultatif]

Pointeur vers les données de contexte pour la fonction de rappel.

Valeur de retour

Cette fonction de rappel ne retourne pas de valeur.

Remarques

La fonction de rappel de notification est appelée avant la liaison dynamique.

Exigences

Exigence Valeur
Client minimum pris en charge
Windows Vista [applications de bureau uniquement]
Serveur minimum pris en charge
Windows Server 2008 [applications de bureau uniquement]

Voir aussi

LdrRegisterDllNotification

LdrUnregisterDllNotification