Export (0) Print
Expand All
Expand Minimize

IoWMISetSingleItem routine

The IoWMISetSingleItem routine sets a single property in the data block instance that matches the specified WMI class and instance name.

Syntax


NTSTATUS IoWMISetSingleItem(
  _In_  PVOID DataBlockObject,
  _In_  PUNICODE_STRING InstanceName,
  _In_  ULONG DataItemId,
  _In_  ULONG Version,
  _In_  ULONG ValueBufferSize,
  _In_  PVOID ValueBuffer
);

Parameters

DataBlockObject [in]

Pointer to a WMI data block object. The caller opens the data block object for the WMI class with the IoWMIOpenBlock routine. The object must be opened with the WMIGUID_SET access right.

InstanceName [in]

Specifies the name of the instance of the data block. This value corresponds to the value of the InstanceName property for the block.

DataItemId [in]

Specifies the data item ID for the property to be set. The value of this parameter corresponds to the value declared in the WmiDataId qualifier for the property.

Version [in]

Reserved for future use. Callers must set this parameter to zero.

ValueBufferSize [in]

Specifies the size, in bytes, of the buffer passed in the ValueBuffer parameter.

ValueBuffer [in]

Pointer to the buffer that contains the new value for the property specified by the DataItemId parameter.

Return value

The routine returns an NTSTATUS code. Possible return values include:

Return codeDescription
STATUS_SUCCESS

The operation succeeded. The value of the property within WMI data block instance is updated to the contents of the buffer pointed to by the ValueBuffer parameter.

STATUS_WMI_GUID_NOT_FOUND

No drivers implement the WMI class.

STATUS_WMI_INSTANCE_NOT_FOUND

No driver implements an instance of the WMI data block with InstanceName property equal to the value specified in the InstanceName parameter.

STATUS_WMI_ITEMID_NOT_FOUND

The WMI class does not contain a property with data item ID equal to the value of DataItemId.

STATUS_WMI_READ_ONLY

The data item ID in the data block is read-only.

STATUS_WMI_SET_FAILURE

The driver that implements the WMI data block instance is unable to update the property specified by DataItemId.

 

Remarks

IoWMISetSingleItem determines which drivers might support the specified WMI class and instance name. It issues an IRP_MN_CHANGE_SINGLE_ITEM request to each such driver. The driver that exports the data block instance with matching InstanceName property updates the specified property in the data block instance.

Drivers can also use IoWMISetSingleInstance to update every property of the WMI class instance simultaneously.

Requirements

Version

Available in Windows XP and later versions of the Windows operating system.

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

Library

Ntoskrnl.lib

IRQL

<= APC_LEVEL

See also

IoWMIOpenBlock
IoWMIQuerySingleInstance
IoWMISetSingleInstance
IRP_MN_CHANGE_SINGLE_ITEM

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft