GetObjectText function
Returns a textual rendering of the object in the Managed Object Format (MOF) syntax.
Note
This API is for internal use only. It's not intended for use from developer code.
Syntax
HRESULT GetObjectText (
[in] int vFunc,
[in] IWbemClassObject* ptr,
[in] LONG lFlags,
[out] BSTR* pstrObjectText
);
Parameters
vFunc
[in] This parameter is unused.
ptr
[in] A pointer to an IWbemClassObject instance.
lFlags
[in] Normally 0. If WBEM_FLAG_NO_FLAVORS
(or 0x1) is specified, qualifiers are included without propagation or flavor information.
pstrObjectText
[out] A pointer to a null
on entry. On return, a newly allocated BSTR
that contains a MOF syntax rendering of the object.
Return value
The following values returned by this function are defined in the WbemCli.h header file, or you can define them as constants in your code:
Constant | Value | Description |
---|---|---|
WBEM_E_FAILED |
0x80041001 | There has been a general failure. |
WBEM_E_INVALID_PARAMETER |
0x80041008 | A parameter is not valid. |
WBEM_E_OUT_OF_MEMORY |
0x80041006 | Not enough memory is available to complete the operation. |
WBEM_S_NO_ERROR |
0 | The function call was successful. |
Remarks
This function wraps a call to the IWbemClassObject::GetObjectText method.
The MOF text returned does not contain all the information about the object, but only enough information for the MOF compiler to be able to recreate the original object. For instance, no propagated qualifiers or parent class properties are included.
The following algorithm is used to reconstruct the text of the parameters of a method:
- Parameters are resequenced in the order of their identifier values.
- Parameters that are specified as
[in]
and[out]
are combined into a single parameter.
pstrObjectText
must be a pointer to a null
when the function is called; it must not point to a string that is valid before the method call, because the pointer will not be deallocated.
Requirements
Platforms: See System Requirements.
Header: WMINet_Utils.idl
.NET Framework Versions: Available since 4.7.2