EvtWmiInstanceSetItem

EvtWmiInstanceSetItem

A driver's EvtWmiInstanceSetItem callback function sets a single item of a WMI data provider's instance data to a value that a WMI client supplies.

構文

EVT_WDF_WMI_INSTANCE_SET_ITEM EvtWmiInstanceSetItem;

NTSTATUS EvtWmiInstanceSetItem(
  __in  WDFWMIINSTANCE WmiInstance,
  __in  ULONG DataItemId,
  __in  ULONG InBufferSize,
  __in  PVOID InBuffer
)
{ ... }

パラメーター

WmiInstance [in]

A handle to a WMI instance object.

DataItemId [in]

A value that identifies an item of data for a provider instance. This value corresponds to the WmiDataId value that is specified in the provider's MOF file.

InBufferSize [in]

The size, in bytes, of the input buffer that InBuffer points to.

InBuffer [in]

A pointer to the input buffer.

戻り値

The EvtWmiInstanceSetItem callback function must return STATUS_SUCCESS if the operation succeeds. Otherwise, this function must return a status value for which NT_SUCCESS(status) equals FALSE. If the input buffer that the InBuffer parameter points to is too small to contain all of the data that the driver expects, the callback function must return STATUS_WMI_SET_FAILURE.

解説

To register an EvtWmiInstanceSetItem callback function, your driver must place the function's address in a WDF_WMI_INSTANCE_CONFIG structure before calling WdfWmiInstanceCreate.

The framework does not synchronize calls to a driver's WMI event callback functions with each other or with any of the driver's other event callback functions. If an EvtWmiInstanceSetItem callback function's data is dynamic and shared with other callback functions, your driver can use the framework's wait locks or spin locks to synchronize access to the data.

For more information about the EvtWmiInstanceSetItem callback function, see Supporting WMI in Framework-Based Drivers.

The function type is declared in WdfWMI.h, as follows.

typedef NTSTATUS
  (EVT_WDF_WMI_INSTANCE_SET_ITEM)(
    IN WDFWMIINSTANCE  WmiInstance,
    IN ULONG  DataItemId,
    IN ULONG  InBufferSize,
    IN PVOID  InBuffer
    );

To define an EvtWmiInstanceSetItem callback function that is named MyWmiInstanceSetItem, you must first provide a function declaration that SDV and other verification tools require, as follows:

EVT_WDF_WMI_INSTANCE_SET_ITEM  MyWmiInstanceSetItem;

Then, implement your callback function as follows:

NTSTATUS
 MyWmiInstanceSetItem (
    IN WDFWMIINSTANCE  WmiInstance,
    IN ULONG  DataItemId,
    IN ULONG  InBufferSize,
    IN PVOID  InBuffer
    )
  {...}

要件

バージョン

Supported by version 1.0 and later versions of KMDF.

ヘッダー

WdfWMI.h (includeWdf.h)

IRQL

PASSIVE_LEVEL

参照

EvtWmiInstanceQueryInstance
EvtWmiInstanceSetInstance
EvtWmiInstanceExecuteMethod
EvtWmiProviderFunctionControl
WDF_WMI_INSTANCE_CONFIG
WdfWmiInstanceCreate

 

 

コミュニティの追加

追加
表示:
© 2016 Microsoft