// wmilib.h
NTSTATUS WmiFireEvent(
[in] PDEVICE_OBJECT DeviceObject,
[in] LPCGUID Guid,
[in] ULONG InstanceIndex,
[in] ULONG EventDataSize,
[in, optional] PVOID EventData
);
View the official Windows Driver Kit DDI reference
No description available.
The WmiFireEvent routine sends an event to WMI for delivery to data consumers that have requested notification of the event.
DeviceObject
[in]A pointer to the driver's DEVICE_OBJECT.
Guid
[in]A pointer to the GUID that represents the event block.
InstanceIndex
[in]If the event block has multiple instances, specifies the index of the instance.
EventDataSize
[in]Specifies the number of bytes of data at EventData. If no data is generated for an event, EventData must be zero.
EventData
[in, optional]A pointer to a driver-allocated nonpaged buffer containing data generated by the driver for the event. If no data is generated for an event, EventData must be NULL. WMI frees the buffer without further intervention by the driver.
WmiFireEvent propagates the status returned by IoWmiWriteEvent, or returns STATUS_INSUFFICIENT_RESOURCES if it could not allocate memory for the event.
A driver calls WmiFireEvent to send an event to WMI for delivery to all data consumers that have requested notification of the event. All pointers passed to WmiFireEvent must point to nonpagable memory, such as nonpaged pool.
The driver sends an event only if it has been previously enabled by the driver's DpWmiFunctionControl routine, which WMI calls to process an IRP_MN_ENABLE_EVENT request.
The driver writes any data associated with the event to the buffer at EventData. WMI fills in a WNODE_SINGLE_INSTANCE structure with the data and calls IoWmiWriteEvent to deliver the event.
For more information about event tracing, see WMI Event Tracing.