WMI_SET_DATABLOCK_CALLBACK - NtDoc

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

WMI_SET_DATABLOCK_CALLBACK WmiSetDatablockCallback;

NTSTATUS WmiSetDatablockCallback(
  [in] PDEVICE_OBJECT DeviceObject,
  [in] PIRP Irp,
  [in] ULONG GuidIndex,
  [in] ULONG InstanceIndex,
  [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_datablock_callback)

WMI_SET_DATABLOCK_CALLBACK callback function

Description

The DpWmiSetDataBlock routine changes all data items in a single 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 its zero-based index into the list of GUIDs provided by the driver in the WMILIB_CONTEXT structure it passed to WmiSystemControl.

InstanceIndex [in]

If the block specified by GuidIndex has multiple instances, InstanceIndex specifies the instance.

BufferSize [in]

Specifies the size in bytes of the buffer at Buffer.

Buffer [in]

Pointer to a buffer that contains new values for the instance.

Return value

DpWmiSetDataBlock returns STATUS_SUCCESS or an appropriate error status such as the following:

If the driver cannot complete the request immediately, it can return STATUS_PENDING.

Remarks

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

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.

If a driver implements a DpWmiSetDataBlock routine, the driver must place the routine's address in the SetWmiDataBlock member of the WMILIB_CONTEXT structure that it passes to WmiSystemControl. If a driver does not implement a DpWmiSetDataBlock routine, it must set SetWmiDataBlock to NULL. In the latter case, WMI returns STATUS_READ_ONLY to the caller.

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_INSTANCE

WMILIB_CONTEXT

WmiSystemControl