Export (0) Print
Expand All

WmiFireEvent routine

The WmiFireEvent routine sends an event to WMI for delivery to data consumers that have requested notification of the event.

Syntax


NTSTATUS WmiFireEvent(
  _In_      PDEVICE_OBJECT DeviceObject,
  _In_      LPCGUID Guid,
  _In_      ULONG InstanceIndex,
  _In_      ULONG EventDataSize,
  _In_opt_  PVOID EventData
);

Parameters

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.

Return value

WmiFireEvent propagates the status returned by IoWmiWriteEvent, or returns STATUS_INSUFFICIENT_RESOURCES if it could not allocate memory for the event.

Remarks

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.

Requirements

Version

Available starting with Windows 2000.

Header

Wmilib.h (include Wmilib.h)

Library

Wmilib.lib

IRQL

<= DISPATCH_LEVEL

See also

DpWmiFunctionControl
IRP_MN_ENABLE_EVENTS
WmiSystemControl

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft