IoWMISetNotificationCallback function (wdm.h)

The IoWMISetNotificationCallback routine registers a notification callback for a WMI event.

Syntax

NTSTATUS IoWMISetNotificationCallback(
  [in, out]      PVOID                     Object,
  [in]           WMI_NOTIFICATION_CALLBACK Callback,
  [in, optional] PVOID                     Context
);

Parameters

[in, out] Object

Pointer to a WMI data block object. The caller opens the data block object for the WMI event with the IoWMIOpenBlock routine. The object must be opened with the WMIGUID_NOTIFICATION access right.

[in] Callback

Pointer to a function of the form:

 XxxWmiNotificationCallback(PVOID Wnode, PVOID Context);

WMI calls this function to notify the caller that the specified event has occurred. The Wnode parameter of the callback routine points to the WNODE_EVENT_ITEM structure returned by the driver triggering the event. The Context parameter of the callback routine points to the value specified in the Context parameter of the IoWMISetNotificationCallback routine.

[in, optional] Context

Specifies the value that WMI passes to the callback routine when the event occurs.

Return value

This routine returns STATUS_SUCCESS on success, and the appropriate NTSTATUS error code on failure.

Requirements

Requirement Value
Target Platform Universal
Header wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL <= APC_LEVEL

See also

IoWMIOpenBlock

WNODE_EVENT_ITEM