Get function

Retrieves the specified property value if it exists.

Note

This API is for internal use only. It's not intended for use from developer code.

Syntax

HRESULT Get (
   [in] int               vFunc,
   [in] IWbemClassObject* ptr,
   [in] LPCWSTR           wszName,
   [in] LONG              lFlags,
   [out] VARIANT*         pVal,
   [out] CIMTYPE*         pvtType,
   [out] LONG*            plFlavor
);

Parameters

vFunc
[in] This parameter is unused.

ptr
[in] A pointer to an IWbemClassObject instance.

wszName
[in] The name of the property.

lFlags
[in] Reserved. This parameter must be 0.

pVal
[out] If the function returns successfully, contains the value of the wszName property. The pval argument is assigned the correct type and value for the qualifier.

pvtType
[out] If the function returns successfully, contains a CIM-type constant that indicates the property type. Its value can also be null.

plFlavor
[out] If the function returns successfully, receives information about the origin of the property. Its value can be null, or one of the following WBEM_FLAVOR_TYPE constants defined in the WbemCli.h header file:

Constant Value Description
WBEM_FLAVOR_ORIGIN_SYSTEM 0x40 The property is a standard system property.
WBEM_FLAVOR_ORIGIN_PROPAGATED 0x20 For a class: The property is inherited from the parent class.
For an instance: The property, while inherited from the parent class, has not been modified by the instance.
WBEM_FLAVOR_ORIGIN_LOCAL 0 For a class: The property belongs to the derived class.
For an instance: The property is modified by the instance; that is, a value was supplied, or a qualifier was added or modified.

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 One or more parameters are not valid.
WBEM_E_NOT_FOUND 0x80041002 The specified property was not found.
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::Get method.

The Get function can also return system properties.

The pVal argument is assigned the correct type and value for the qualifier and the COM VariantInit function

Requirements

Platforms: See System Requirements.

Header: WMINet_Utils.idl

.NET Framework Versions: Available since 4.7.2

See also