IKsFormatSupport::GetDevicePreferredFormat method (devicetopology.h)

The GetDevicePreferredFormat method gets the preferred audio stream format for the connection.

Syntax

HRESULT GetDevicePreferredFormat(
  [out] PKSDATAFORMAT *ppKsFormat
);

Parameters

[out] ppKsFormat

Pointer to a pointer variable into which the method writes the address of a buffer that contains the format specifier for the preferred format. The specifier begins with a KSDATAFORMAT structure that might be followed by additional format information. The method allocates the storage for the format specifier. The caller is responsible for freeing the storage, when it is no longer needed, by calling the CoTaskMemFree function. If the method fails, *ppKsFormat is NULL. For more information about KSDATAFORMAT, format specifiers, and CoTaskMemFree, see the Windows DDK 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
Pointer ppKsFormat is NULL.
E_OUTOFMEMORY
Out of memory.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header devicetopology.h

See also

IKsFormatSupport Interface