WdfWmiInstanceFireEvent - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdfwmi.h

NTSTATUS WdfWmiInstanceFireEvent(
  [in]           WDFWMIINSTANCE WmiInstance,
  [in, optional] ULONG          EventDataSize,
  [in, optional] PVOID          EventData
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdfwmi-wdfwmiinstancefireevent)

WdfWmiInstanceFireEvent function

Description

[Applies to KMDF only]

The WdfWmiInstanceFireEvent method sends a WMI event to WMI clients that have registered to receive event notification.

Parameters

WmiInstance [in]

A handle to a WMI instance object that the driver obtained from a previous call to WdfWmiInstanceCreate.

EventDataSize [in, optional]

The size, in bytes, of the event data that EventData points to.

EventData [in, optional]

A pointer to the event data, or NULL if there is no event data.

Return value

WdfWmiInstanceFireEvent returns STATUS_SUCCESS if the operation succeeds. Otherwise, this method might return one of the following values:

Return code Description
STATUS_INSUFFICIENT_RESOURCES There was insufficient memory.
STATUS_UNSUCCESSFUL The framework's attempt to communicate with WMI failed.
STATUS_BUFFER_OVERFLOW The event data buffer was too large.

This method also might return other NTSTATUS values.

A bug check occurs if the driver supplies an invalid object handle.

Remarks

Your driver should call WdfWmiInstanceFireEvent only if a WMI client has registered for event notification. The driver can determine if it should call WdfWmiInstanceFireEvent by providing an EvtWmiProviderFunctionControl callback function or calling WdfWmiProviderIsEnabled.

The driver should place its event-specific data, if any, in the buffer that the EventData parameter points to. The framework adds all of the necessary WMI header information.

For more information about the WdfWmiInstanceFireEvent method, see Supporting WMI in Framework-Based Drivers.

Examples

The following code example sends a WMI event to WMI clients.

MY_WMI_EVENT_DATA eventData;
NTSTATUS  status;

status = WdfWmiInstanceFireEvent(
                                 WmiInstance,
                                 sizeof(eventData),
                                 (PVOID)&eventData
                                 );

See also

EvtWmiProviderFunctionControl

WdfWmiInstanceCreate

WdfWmiProviderIsEnabled