Freigeben über


LdrDllNotification-Rückruffunktion

[Diese Funktion kann ohne weitere Ankündigung von Windows geändert oder aus Windows entfernt werden.]

Eine mit der funktion LdrRegisterDllNotification angegebene Benachrichtigungsrückruffunktion. Das Ladeprogramm ruft diese Funktion auf, wenn eine DLL zum ersten Mal geladen wird.

Warnung

Es ist für den Benachrichtigungsrückruf unsicher, um Funktionen in einem anderen Modul als sich selbst aufzurufen.

Syntax

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

Parameter

NotificationReason [in]

Der Grund, warum die Rückruffunktion der Benachrichtigung aufgerufen wurde. Dieser Parameter kann einer der folgenden Werte sein:

Wert Bedeutung
LDR_DLL_NOTIFICATION_REASON_LOADED
1
Die DLL wurde geladen. Der parameter NotificationData verweist auf eine LDR_DLL_LOADED_NOTIFICATION_DATA Struktur.
LDR_DLL_NOTIFICATION_REASON_UNLOADED
2
Die DLL wurde entladen. Der parameter NotificationData verweist auf eine LDR_DLL_UNLOADED_NOTIFICATION_DATA Struktur.

 

NotificationData- [in]

Ein Zeiger auf eine Konstante LDR_DLL_NOTIFICATION Union, die Benachrichtigungsdaten enthält. Diese Vereinigung hat die folgende Definition:

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;

Die LDR_DLL_LOADED_NOTIFICATION_DATA-Struktur weist die folgende Definition auf:

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;

Die LDR_DLL_UNLOADED_NOTIFICATION_DATA-Struktur weist die folgende Definition auf:

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;

Kontext- [in, optional]

Ein Zeiger auf Kontextdaten für die Rückruffunktion.

Rückgabewert

Diese Rückruffunktion gibt keinen Wert zurück.

Bemerkungen

Die Rückruffunktion für Benachrichtigungen wird aufgerufen, bevor die dynamische Verknüpfung stattfindet.

Anforderungen

Anforderung Wert
Mindestens unterstützter Client
Windows Vista [nur Desktop-Apps]
Mindestens unterstützter Server
Windows Server 2008 [Nur Desktop-Apps]

Siehe auch

LdrRegisterDllNotification

LdrUnregisterDllNotification