I'm having trouble understanding the documentation for the IAudioClient::Initialize() function.
It's about the different return values E_INVALIDARG and AUDCLNT_E_UNSUPPORTED_FORMAT.
The E_INVALIDARG description says:
Parameter pFormat points to an invalid format description.
However, in the description for AUDCLNT_E_UNSUPPORTED_FORMAT:
The audio engine (shared mode) or audio endpoint device (exclusive mode) does not support the specified format.
What does it mean in E_INVALIDARG that the description format is "invalid"? I guess it's not that it doesn't fit the device, since that's already handled by AUDCLNT_E_UNSUPPORTED_FORMAT?
And, it's also not that it is pFormat == NULL, since that's already handled by E_POINTER.
So, what specific cases is pFormat incorrectness covered by E_INVALIDARG?
AUDCLNT_E_UNSUPPORTED_FORMAT. Before calling Initialize to set up a shared-mode or exclusive-mode connection, the client can call the IAudioClient::IsFormatSupported method to discover whether the audio engine or audio endpoint device supports a particular format in that mode.