Partager via


IMDSPDevice3::GetProperty

banner art

The GetProperty method retrieves a specific device property.

Syntax

HRESULT GetProperty(LPCWSTRpwszPropName,PROPVARIANT*pValue);

Parameters

pwszPropName

[in]  Name of property being retrieved from the device.

pValue

[out]  Returned value for the property.

Return Values

The method returns an HRESULT. All the interface methods in Windows Media Device Manager can return any of the following classes of error codes:

  • Standard COM error codes
  • Windows error codes converted to HRESULT values
  • Windows Media Device Manager error codes

For an extenstive list of possible error codes, see Error Codes.

Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK The method succeeded.
E_INVALIDARG A parameter is an invalid or NULL pointer.
WMDM_E_NOTSUPPORTED The property is not supported by the device or the device returned an error.

Remarks

The variant that pValue points to is set to an empty PROPVARIANT, that is, its VT is set to VT_EMPTY.

Service provider should set this variant to the appropriate property value for the property pwszPropName.

If pwszPropName is g_wszWMDMSupportedDeviceProperties, service provider should return an array of the supported device properties. In such case, the VT of variant should be VT_BSTR | VT_ARRAY.

For a list of standard device property names, see Metadata Constants.

This method is similar to the IMDSPStorage3::GetMetadata and IMDSPStorage4::GetSpecifiedMetadata methods for storages, but this method can get only one property at a time.

Requirements

Header: Defined in mswmdm.h.

Library: mssachlp.lib

See Also