Previous Next

IoWMIWriteEvent

The IoWMIWriteEvent routine delivers a given event to the user-mode WMI components for notification.

NTSTATUS
  IoWMIWriteEvent(
    IN PVOID  WnodeEventItem
    );

Parameters

WnodeEventItem
Pointer to a WNODE_EVENT_ITEM structure to be delivered to the user-mode WMI components that requested notification of the event.

Return Value

IoWMIWriteEvent returns a status code from the following list:

STATUS_SUCCESS
Indicates that WMI has successfully queued the event for delivery to the user-mode WMI components.
STATUS_UNSUCCESSFUL
Indicates that WMI services are unavailable.
STATUS_BUFFER_OVERFLOW
Indicates that the event item specified exceeds the maximum allowed size.
STATUS_INSUFFICENT_RESOURCES
Indicates that insufficient resources were available for WMI to queue the event for delivery.

Headers

Declared in wdm.h and ntddk.h. Include wdm.h or ntddk.h.

Comments

The WNODE_EVENT_ITEM structure that is allocated by the caller and passed in WnodeEventItem must be allocated from nonpaged pool. If IoWMIWriteEvent returns STATUS_SUCCESS, the memory for the event item will automatically be freed by the system. If IoWMIWriteEvent returns anything other than STATUS_SUCCESS, it is the caller's responsibility to free the buffer.

Drivers should only call IoWMIWriteEvent for events that have been enabled for WMI. This ensures that there is an event consumer waiting for indication on that event.

Callers of this routine must be running at IRQL < DISPATCH_LEVEL.

See Also

WNODE_EVENT_ITEM, IoWmiDeviceObjectToProviderId