WdfWmiInstanceFireEvent method

[Applies to KMDF only]

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

Syntax


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

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 codeDescription
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
                                 );

Requirements

Target platform

Universal

Minimum KMDF version

1.0

Header

Wdfwmi.h (include Wdf.h)

Library

Wdf01000.sys (see Framework Library Versioning.)

IRQL

<= APC_LEVEL

DDI compliance rules

DriverCreate, KmdfIrql, KmdfIrql2

See also

EvtWmiProviderFunctionControl
WdfWmiInstanceCreate
WdfWmiProviderIsEnabled

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft