// wdm.h
NTSTATUS IoWMIOpenBlock(
[in] LPCGUID Guid,
[in] ULONG DesiredAccess,
[out] PVOID *DataBlockObject
);
View the official Windows Driver Kit DDI referenceNo description available.
The IoWMIOpenBlock routine opens the WMI data block object for the specified WMI class.
Guid [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:
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.
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.
The data block object can be used to query WMI class properties. This flag must be set to use any of the IoWMIQuery*Xxx* routines on the data block object.
The data block object can be used to set WMI class properties. This flag must be set to use any of the IoWMISet*Xxx* routines on the data block object.
DataBlockObject [out]Pointer to a memory location where the routine returns a pointer to the data block object.
Returns STATUS_SUCCESS on success, or the appropriate NTSTATUS error code on failure.
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 IoWMIQuery*Xxx* and IoWMISet*Xxx* 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.
IoWMIQuerySingleInstanceMultiple