IWMDMDevice::GetName method (mswmdm.h)

The GetName method retrieves the human-readable name of the media device.


  [out] LPWSTR pwszName,
  [in]  UINT   nMaxChars


[out] pwszName

Pointer to a (Unicode) wide-character, null-terminated string specifying the device name. The buffer is allocated and released by the caller.

[in] nMaxChars

Integer specifying the maximum number of characters that can be placed in pwszName, including the termination character.

Return value

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.


Target Platform Windows
Header mswmdm.h
Library Mssachlp.lib

See also

Exploring a Device

IWMDMDevice Interface