信息
您所需的主题如下所示。但此主题未包含在此库中。

EvtWmiInstanceSetInstance

A driver's EvtWmiInstanceSetInstance callback function sets all of a WMI data provider's instance data to values that a WMI client supplies.

语法

EVT_WDF_WMI_INSTANCE_SET_INSTANCE EvtWmiInstanceSetInstance;

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

参数

WmiInstance [in]

A handle to a WMI instance object.

InBufferSize [in]

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

InBuffer [in]

A pointer to the input buffer.

返回值

The EvtWmiInstanceSetInstance 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 EvtWmiInstanceSetInstance 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 EvtWmiInstanceSetInstance 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 EvtWmiInstanceSetInstance 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_INSTANCE)(
    IN WDFWMIINSTANCE  WmiInstance,
    IN ULONG  InBufferSize,
    IN PVOID  InBuffer
    );

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

EVT_WDF_WMI_INSTANCE_SET_INSTANCE  MyWmiInstanceSetInstance;

Then, implement your callback function as follows:

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

要求

版本

Supported by version 1.0 and later versions of KMDF.

标头

WdfWMI.h (包括Wdf.h)

IRQL

PASSIVE_LEVEL

另请参见

EvtWmiInstanceQueryInstance
EvtWmiInstanceSetItem
EvtWmiInstanceExecuteMethod
EvtWmiProviderFunctionControl
WDF_WMI_INSTANCE_CONFIG
WdfWmiInstanceCreate

 

 

社区附加资源

显示:
© 2014 Microsoft