Skip to content

Latest commit

 

History

History
149 lines (105 loc) · 5.11 KB

nf-mswmdm-iwmdmdevice3-getproperty.md

File metadata and controls

149 lines (105 loc) · 5.11 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:mswmdm.IWMDMDevice3.GetProperty
IWMDMDevice3::GetProperty (mswmdm.h)
The GetProperty method retrieves a specific device metadata property.
GetProperty
GetProperty method [windows Media Device Manager]
GetProperty method [windows Media Device Manager]
IWMDMDevice3 interface
IWMDMDevice3 interface [windows Media Device Manager]
GetProperty method
IWMDMDevice3.GetProperty
IWMDMDevice3::GetProperty
IWMDMDevice3GetProperty
mswmdm/IWMDMDevice3::GetProperty
wmdm.iwmdmdevice3_getproperty
wmdm\iwmdmdevice3_getproperty.htm
WMDM
f1c8406f-f0cb-4def-bc26-399908ecbf83
12/05/2018
GetProperty, GetProperty method [windows Media Device Manager], GetProperty method [windows Media Device Manager],IWMDMDevice3 interface, IWMDMDevice3 interface [windows Media Device Manager],GetProperty method, IWMDMDevice3.GetProperty, IWMDMDevice3::GetProperty, IWMDMDevice3GetProperty, mswmdm/IWMDMDevice3::GetProperty, wmdm.iwmdmdevice3_getproperty
mswmdm.h
Windows
Mssachlp.lib
Windows
19H1
IWMDMDevice3::GetProperty
mswmdm/IWMDMDevice3::GetProperty
c++
APIRef
kbSyntax
COM
mssachlp.lib
mssachlp.dll
IWMDMDevice3.GetProperty

IWMDMDevice3::GetProperty

-description

The GetProperty method retrieves a specific device metadata property.

-parameters

-param pwszPropName [in]

A wide character, null-terminated string name of the property to retrieve. A list of standard property name constants is given in Metadata Constants.

-param pValue [out]

Returned value for the property. The application must free this memory using PropVariantClear.

-returns

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 extensive list of possible error codes, see Error Codes.

-remarks

To obtain the list of supported device properties, the client call this function and specify g_wszWMDMSupportedDeviceProperties. For the list of standard device property names, see Metadata Constants.

The client should pass in a pointer to an empty PROPVARIANT in the pValue parameter. On return, pValue will contain the value of the property.

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

Examples

The following C++ code queries for the g_wszWMDMFormatsSupported property, which returns a SAFEARRAY list of formats supported by a device.

// Query a device for supported configurations for each media or format type. 
HRESULT GetCaps(IWMDMDevice3* pDevice)
{
    HRESULT hr = S_OK;

    // Request the "formats supported" property to get a list of supported formats.
    PROPVARIANT pvFormatsSupported;
    PropVariantInit(&pvFormatsSupported);
    hr = pDevice->GetProperty(g_wszWMDMFormatsSupported, &pvFormatsSupported);
    HANDLE_HR(hr, "Got a property list in GetCaps", "Couldn't get a property list in GetCaps.");

    // Loop through the retrieved format list.
    // For each format, get a list of format configurations.
    SAFEARRAY* formatList = pvFormatsSupported.parray;
    WMDM_FORMATCODE formatCode = WMDM_FORMATCODE_NOTUSED;
    for(LONG iCap = 0; iCap < formatList->rgsabound[0].cElements; iCap++)
    { 
        // Get a format from the SAFEARRAY of retrieved formats.
        SafeArrayGetElement(formatList, &iCap, &formatCode);

        // Call a custom function to see the specifics of device support for 
       // each format.
        if (formatCode != WMDM_FORMATCODE_NOTUSED)
            myGetFormatCaps(formatCode, pDevice);
    }

e_Exit:
    // Clear out the memory we used.
    PropVariantClear(&pvFormatsSupported);
    return hr;
}

-see-also

Enumerating Devices

IWMDMDevice3 Interface

IWMDMDevice3::SetProperty

IWMDMStorage3::GetMetadata

IWMDMStorage4::GetSpecifiedMetadata

Setting Metadata on a File