WMI_SET_DATAITEM_CALLBACK - NtDoc

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

WMI_SET_DATAITEM_CALLBACK WmiSetDataitemCallback;

NTSTATUS WmiSetDataitemCallback(
  [in] PDEVICE_OBJECT DeviceObject,
  [in] PIRP Irp,
  [in] ULONG GuidIndex,
  [in] ULONG InstanceIndex,
  [in] ULONG DataItemId,
  [in] ULONG BufferSize,
  [in] PUCHAR Buffer
)
{...}
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nc-wmilib-wmi_set_dataitem_callback)

WMI_SET_DATAITEM_CALLBACK callback function

Description

The DpWmiSetDataItem routine changes a single data item in an instance of a data block. This routine is optional.

Parameters

DeviceObject [in]

Pointer to the driver's WDM DEVICE_OBJECT structure.

Irp [in]

Pointer to the IRP.

GuidIndex [in]

Specifies the data block by supplying a zero-based index into the list of GUIDs that the driver provided in the WMILIB_CONTEXT structure it passed to WmiSystemControl.

InstanceIndex [in]

If the block specified by GuidIndex has multiple instances, InstanceIndex is a zero-based value that specifies the instance.

DataItemId [in]

Specifies the ID of the data item to set.

BufferSize [in]

Specifies the size in bytes of the buffer at Buffer.

Buffer [in]

Pointer to a buffer that contains the new value for the data item.

Return value

DpWmiSetDataItem returns STATUS_SUCCESS or an appropriate error code such as the following:

Remarks

WMI calls a driver's DpWmiSetDataItem routine after the driver calls WmiSystemControl in response to an IRP_MN_CHANGE_SINGLE_ITEM request.

Do not implement DpWmiSetDataItem unless you are sure that a system-supplied user-mode component requires this capability. If you implement a DpWmiSetDataItem routine, the driver must place the routine's address in the SetWmiDataItem member of the WMILIB_CONTEXT structure that it passes to WmiSystemControl. If you do not implement a DpWmiSetDataItem routine, the driver must set SetWmiDataItem to NULL. In the latter case, WMI returns STATUS_READ_ONLY to the caller.

The driver is responsible for validating all input arguments. Specifically, the driver must do the following:

Do not assume the thread context is that of the initiating user-mode application—a higher-level driver might have changed it.

This routine can be pageable.

For more information about implementing this routine, see Calling WmiSystemControl to Handle WMI IRPs.

See also

IRP_MN_CHANGE_SINGLE_ITEM

WMILIB_CONTEXT

WmiSystemControl