mmdevapi: Return E_INVALIDARG for invalid share mode argument.
Matches Windows 10 behavior. Signed-off-by: Andrew Eikum <aeikum@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
3c1ee2f80d
commit
227c47e7a0
|
@ -491,7 +491,8 @@ static void test_audioclient(void)
|
|||
test_uninitialized(ac);
|
||||
|
||||
hr = IAudioClient_Initialize(ac, 3, 0, 5000000, 0, pwfx, NULL);
|
||||
ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Initialize with invalid sharemode returns %08x\n", hr);
|
||||
ok(broken(hr == AUDCLNT_E_NOT_INITIALIZED) || /* <= win8 */
|
||||
hr == E_INVALIDARG, "Initialize with invalid sharemode returns %08x\n", hr);
|
||||
|
||||
hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0xffffffff, 5000000, 0, pwfx, NULL);
|
||||
ok(hr == E_INVALIDARG || hr == AUDCLNT_E_INVALID_STREAM_FLAG, "Initialize with invalid flags returns %08x\n", hr);
|
||||
|
|
|
@ -247,7 +247,8 @@ static void test_audioclient(void)
|
|||
test_uninitialized(ac);
|
||||
|
||||
hr = IAudioClient_Initialize(ac, 3, 0, 5000000, 0, pwfx, NULL);
|
||||
ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Initialize with invalid sharemode returns %08x\n", hr);
|
||||
ok(broken(hr == AUDCLNT_E_NOT_INITIALIZED) || /* <= win8 */
|
||||
hr == E_INVALIDARG, "Initialize with invalid sharemode returns %08x\n", hr);
|
||||
|
||||
hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0xffffffff, 5000000, 0, pwfx, NULL);
|
||||
ok(hr == E_INVALIDARG ||
|
||||
|
|
|
@ -1255,7 +1255,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface,
|
|||
return E_POINTER;
|
||||
|
||||
if(mode != AUDCLNT_SHAREMODE_SHARED && mode != AUDCLNT_SHAREMODE_EXCLUSIVE)
|
||||
return AUDCLNT_E_NOT_INITIALIZED;
|
||||
return E_INVALIDARG;
|
||||
|
||||
if(flags & ~(AUDCLNT_STREAMFLAGS_CROSSPROCESS |
|
||||
AUDCLNT_STREAMFLAGS_LOOPBACK |
|
||||
|
|
|
@ -806,7 +806,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface,
|
|||
dump_fmt(fmt);
|
||||
|
||||
if(mode != AUDCLNT_SHAREMODE_SHARED && mode != AUDCLNT_SHAREMODE_EXCLUSIVE)
|
||||
return AUDCLNT_E_NOT_INITIALIZED;
|
||||
return E_INVALIDARG;
|
||||
|
||||
if(flags & ~(AUDCLNT_STREAMFLAGS_CROSSPROCESS |
|
||||
AUDCLNT_STREAMFLAGS_LOOPBACK |
|
||||
|
|
|
@ -1314,7 +1314,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface,
|
|||
dump_fmt(fmt);
|
||||
|
||||
if(mode != AUDCLNT_SHAREMODE_SHARED && mode != AUDCLNT_SHAREMODE_EXCLUSIVE)
|
||||
return AUDCLNT_E_NOT_INITIALIZED;
|
||||
return E_INVALIDARG;
|
||||
|
||||
if(flags & ~(AUDCLNT_STREAMFLAGS_CROSSPROCESS |
|
||||
AUDCLNT_STREAMFLAGS_LOOPBACK |
|
||||
|
|
|
@ -1046,7 +1046,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface,
|
|||
dump_fmt(fmt);
|
||||
|
||||
if(mode != AUDCLNT_SHAREMODE_SHARED && mode != AUDCLNT_SHAREMODE_EXCLUSIVE)
|
||||
return AUDCLNT_E_NOT_INITIALIZED;
|
||||
return E_INVALIDARG;
|
||||
|
||||
if(flags & ~(AUDCLNT_STREAMFLAGS_CROSSPROCESS |
|
||||
AUDCLNT_STREAMFLAGS_LOOPBACK |
|
||||
|
|
|
@ -1579,7 +1579,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface,
|
|||
return E_POINTER;
|
||||
|
||||
if (mode != AUDCLNT_SHAREMODE_SHARED && mode != AUDCLNT_SHAREMODE_EXCLUSIVE)
|
||||
return AUDCLNT_E_NOT_INITIALIZED;
|
||||
return E_INVALIDARG;
|
||||
if (mode == AUDCLNT_SHAREMODE_EXCLUSIVE)
|
||||
return AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED;
|
||||
|
||||
|
|
Loading…
Reference in New Issue