// wdm.h
NTSTATUS IoWMISetNotificationCallback(
[in, out] PVOID Object,
[in] WMI_NOTIFICATION_CALLBACK Callback,
[in, optional] PVOID Context
);
View the official Windows Driver Kit DDI referenceNo description available.
The IoWMISetNotificationCallback routine registers a notification callback for a WMI event.
Object [in, out]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.
Callback [in]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.
Context [in, optional]Specifies the value that WMI passes to the callback routine when the event occurs.
This routine returns STATUS_SUCCESS on success, and the appropriate NTSTATUS error code on failure.