Retrieves either a subset or all of the names of the properties of an object.
This API is for internal use only. It's not intended for use from developer code.
HRESULT GetNames ( [in] int vFunc, [in] IWbemClassObject* ptr, [in] LPCWSTR wszQualifierName, [in] LONG lFlags, [in] VARIANT* pQualifierValue, [out] SAFEARRAY (BSTR)** pstrNames );
[in] This parameter is unused.
[in] A pointer to an IWbemClassObject instance.
[in] A pointer to a valid
LPCWSTR that specifies a qualifier name that operates as part of a filter. For more information, see the Remarks section. This parameter can be
[in] A combination of bit fields. For more information, see the Remarks section.
[in] A pointer to a valid
VARIANT structure initialized to a filter value. This parameter can be
SAFEARRAY structure that contains property names. On entry, this parameter must always be a pointer to
null. See the Remarks section for more information.
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:
||0x80041001||There has been a general failure.|
||0x80041008||One or more parameters are not valid, or an incorrect combination of flags and parameters was specified.|
||0x80041006||Not enough memory is available to complete the operation.|
||0||The function call was successful.|
This function wraps a call to the IWbemClassObject::GetNames method.
The named returned are controlled by a combination of flags and parameters. For example, the function can return the names of all properties or only the names of the key properties. The primary filter is specified in the
lFlags parameter, and the other parameters vary depending on it.
The flag values in
lFlags are bit fields
The flags that can be passed as the
lEnumFlags argument are bit fields that are defined in the WbemCli.h header file, or you can define them as constants in your code. You can combine one flag from each group with any flag from any other group. However, flags from the same group are mutually exclusive.
|Group 1 flags||Value||Description|
||0||Return all property names.
||1||Return only properties that have a qualifier of the name specified by the
||2||Return only properties that do not have a qualifier of the name specified by the
||3||Return only properties that have a qualifier of the name specified by the
|Group 2 flags||Value||Description|
||0x4||Return only the names of properties that define the keys.|
||0x8||Return only property names that are object references.|
|Group 3 flags||Value||Description|
||0x10||Return only property names that belong to the most derived class. Exclude properties from the parent classes.|
||0x20||Return only property names that belong to the parent classes.|
||0x30||Return only the names of system properties.|
||0x40||Return only the names of non-system properties.|
The function always allocates a new
SAFEARRAY if it returns
pstrNames is always set to point to it. The returned array can have 0 elements if no properties match the specified filters. If the function returns an value other than
WBM_S_NO_ERROR, a new
SAFEARRAY structure is not returned.
Platforms: See System Requirements.
.NET Framework Versions: Available since 4.7.2
Submit and view feedback for