IoWMIDeviceObjectToInstanceName function

The IoWMIDeviceObjectToInstanceName routine determines the instance name for the WMI class instance implemented by the driver that is specified by a device object.

Syntax

NTKERNELAPI NTSTATUS IoWMIDeviceObjectToInstanceName(
  PVOID           DataBlockObject,
  PDEVICE_OBJECT  DeviceObject,
  PUNICODE_STRING InstanceName
);

Parameters

DataBlockObject

Pointer to a WMI data block object. The caller opens the data block object for the WMI class with IoWMIOpenBlock.

DeviceObject

Specifies a device object. The routine returns the instance name for the driver corresponding to the device object.

InstanceName

Pointer to the UNICODE_STRING structure that the routine uses to return the instance name. The caller frees the returned buffer within UNICODE_STRING.

Return Value

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

Return code Description
STATUS_SUCCESS
The operation succeeded. The routine stores the instance name in the UNICODE_STRING specified by the InstanceName parameter.
STATUS_WMI_INSTANCE_NOT_FOUND
The driver does not implement any instances of the WMI class specified by DataBlockObject.

Requirements

   
Windows version Available in Windows XP and later versions of the Windows operating system.
Target Platform Universal
Header wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL "<= APC_LEVEL"

See Also

DEVICE_OBJECT

IoWMIHandleToInstanceName

IoWMIOpenBlock