IAudioSessionControl::GetDisplayName method (audiopolicy.h)

The GetDisplayName method retrieves the display name for the audio session.

Syntax

HRESULT GetDisplayName(
  [out] LPWSTR *pRetVal
);

Parameters

[out] pRetVal

Pointer to a pointer variable into which the method writes the address of a null-terminated, wide-character string that contains the display name. The method allocates the storage for the string. The caller is responsible for freeing the storage, when it is no longer needed, by calling the CoTaskMemFree function. For information about CoTaskMemFree, see the Windows SDK documentation.

Return value

If the method succeeds, it returns S_OK. If it fails, possible return codes include, but are not limited to, the values shown in the following table.

Return code Description
E_POINTER
Parameter pRetVal is NULL.
E_OUTOFMEMORY
Out of memory.
AUDCLNT_E_DEVICE_INVALIDATED
The audio endpoint device has been unplugged, or the audio hardware or associated hardware resources have been reconfigured, disabled, removed, or otherwise made unavailable for use.
AUDCLNT_E_SERVICE_NOT_RUNNING
The Windows audio service is not running.

Remarks

If the client has not called IAudioSessionControl::SetDisplayName to set the display name, the string will be empty. Rather than display an empty name string, the Sndvol program uses a default, automatically generated name to label the volume control for the audio session.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header audiopolicy.h

See also

IAudioSessionControl Interface

IAudioSessionControl::SetDisplayName