Export (0) Print
Expand All
Expand Minimize

IoWMIOpenBlock routine

The IoWMIOpenBlock routine opens the WMI data block object for the specified WMI class.

Syntax


NTSTATUS IoWMIOpenBlock(
  _In_   GUID *DataBlockGuid,
  _In_   ULONG DesiredAccess,
  _Out_  PVOID *DataBlockObject
);

Parameters

DataBlockGuid [in]

Specifies the GUID for WMI class.

DesiredAccess [in]

Specifies the desired access rights to the data block object. The caller must have particular access rights to perform certain operations.

The following is a description of each access right bit and the operations it allows:

WMIGUID_EXECUTE

The data block object can be used to run WMI class methods. This flag must be set to use IoWMIExecuteMethod on the data block object.

WMIGUID_NOTIFICATION

The data block object can be used to register event notification callbacks. This flag must be set to use IoWMISetNotificationCallback, and can only be used for WMI event blocks. Callers that specify this flag must also specify the SYNCHRONIZE flag.

WMIGUID_QUERY

The data block object can be used to query WMI class properties. This flag must be set to use any of the IoWMIQueryXxx routines on the data block object.

WMIGUID_SET

The data block object can be used to set WMI class properties. This flag must be set to use any of the IoWMISetXxx routines on the data block object.

DataBlockObject [out]

Pointer to a memory location where the routine returns a pointer to the data block object.

Return value

Returns STATUS_SUCCESS on success, or the appropriate NTSTATUS error code on failure.

Remarks

The caller uses IoWMIOpenBlock to create a data block object for the specified WMI class GUID. Subsequently, the caller can use the data block object to read or write WMI class properties, run WMI class methods, and register callbacks for WMI events.

Use the IoWMIQueryXxx and IoWMISetXxx routines to read and write WMI class properties. Use IoWMIExecuteMethod to run WMI class methods, and use IoWMISetNotificationCallback to register a WMI event notification callback.

Use ObDereferenceObject to close the data block object once it is no longer needed.

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. The WMIGUID_XXX values are declared in Wmistr.h. To use them, include Wmistr.h.)

Library

Ntoskrnl.lib

IRQL

<= APC_LEVEL

See also

IoWMIExecuteMethod
IoWMIQueryAllData
IoWMIQueryAllDataMultiple
IoWMIQuerySingleInstance
IoWMIQuerySingleInstanceMultiple
IoWMISetNotificationCallback
IoWMISetSingleInstance
IoWMISetSingleItem
ZwClose

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft