Signed-off-by: Andrew Eikum aeikum@codeweavers.com
On Tue, Mar 01, 2022 at 08:33:07AM +0100, Eric Pouech wrote:
Signed-off-by: Eric Pouech eric.pouech@gmail.com
dlls/mmdevapi/tests/Makefile.in | 1 dlls/mmdevapi/tests/capture.c | 398 +++++++++-------- dlls/mmdevapi/tests/dependency.c | 12 - dlls/mmdevapi/tests/mmdevenum.c | 86 ++-- dlls/mmdevapi/tests/propstore.c | 52 +- dlls/mmdevapi/tests/render.c | 820 ++++++++++++++++++------------------ dlls/mmdevapi/tests/spatialaudio.c | 108 ++--- 7 files changed, 738 insertions(+), 739 deletions(-)
diff --git a/dlls/mmdevapi/tests/Makefile.in b/dlls/mmdevapi/tests/Makefile.in index 183c9f36588..dd180a253b9 100644 --- a/dlls/mmdevapi/tests/Makefile.in +++ b/dlls/mmdevapi/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = mmdevapi.dll IMPORTS = ole32 version user32 advapi32 winmm
diff --git a/dlls/mmdevapi/tests/capture.c b/dlls/mmdevapi/tests/capture.c index 6c65128f2d2..5fbb62e4403 100644 --- a/dlls/mmdevapi/tests/capture.c +++ b/dlls/mmdevapi/tests/capture.c @@ -54,28 +54,28 @@ static void test_uninitialized(IAudioClient *ac) IUnknown *unk;
hr = IAudioClient_GetBufferSize(ac, &num);
- ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized GetBufferSize call returns %08x\n", hr);
ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized GetBufferSize call returns %08lx\n", hr);
hr = IAudioClient_GetStreamLatency(ac, &t1);
- ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized GetStreamLatency call returns %08x\n", hr);
ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized GetStreamLatency call returns %08lx\n", hr);
hr = IAudioClient_GetCurrentPadding(ac, &num);
- ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized GetCurrentPadding call returns %08x\n", hr);
ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized GetCurrentPadding call returns %08lx\n", hr);
hr = IAudioClient_Start(ac);
- ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized Start call returns %08x\n", hr);
ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized Start call returns %08lx\n", hr);
hr = IAudioClient_Stop(ac);
- ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized Stop call returns %08x\n", hr);
ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized Stop call returns %08lx\n", hr);
hr = IAudioClient_Reset(ac);
- ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized Reset call returns %08x\n", hr);
ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized Reset call returns %08lx\n", hr);
hr = IAudioClient_SetEventHandle(ac, handle);
- ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized SetEventHandle call returns %08x\n", hr);
ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized SetEventHandle call returns %08lx\n", hr);
hr = IAudioClient_GetService(ac, &IID_IAudioStreamVolume, (void**)&unk);
- ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized GetService call returns %08x\n", hr);
ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized GetService call returns %08lx\n", hr);
CloseHandle(handle);
} @@ -91,54 +91,54 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx) REFERENCE_TIME period;
hr = IAudioClient_GetService(ac, &IID_IAudioCaptureClient, (void**)&acc);
- ok(hr == S_OK, "IAudioClient_GetService(IID_IAudioCaptureClient) returns %08x\n", hr);
ok(hr == S_OK, "IAudioClient_GetService(IID_IAudioCaptureClient) returns %08lx\n", hr); if (hr != S_OK) return;
ok(ResetEvent(handle), "ResetEvent\n");
hr = IAudioCaptureClient_GetNextPacketSize(acc, &next);
- ok(hr == S_OK, "IAudioCaptureClient_GetNextPacketSize returns %08x\n", hr);
ok(hr == S_OK, "IAudioCaptureClient_GetNextPacketSize returns %08lx\n", hr);
hr = IAudioClient_GetCurrentPadding(ac, &pad);
- ok(hr == S_OK, "GetCurrentPadding call returns %08x\n", hr);
ok(hr == S_OK, "GetCurrentPadding call returns %08lx\n", hr); ok(next == pad, "GetNextPacketSize %u vs. GCP %u\n", next, pad); /* later GCP will grow, while GNPS is 0 or period size */
hr = IAudioCaptureClient_GetNextPacketSize(acc, NULL);
- ok(hr == E_POINTER, "IAudioCaptureClient_GetNextPacketSize(NULL) returns %08x\n", hr);
ok(hr == E_POINTER, "IAudioCaptureClient_GetNextPacketSize(NULL) returns %08lx\n", hr);
data = (void*)0xdeadf00d; frames = 0xdeadbeef; flags = 0xabadcafe; hr = IAudioCaptureClient_GetBuffer(acc, &data, NULL, NULL, NULL, NULL);
- ok(hr == E_POINTER, "IAudioCaptureClient_GetBuffer(data, NULL, NULL) returns %08x\n", hr);
ok(hr == E_POINTER, "IAudioCaptureClient_GetBuffer(data, NULL, NULL) returns %08lx\n", hr);
hr = IAudioCaptureClient_GetBuffer(acc, NULL, &frames, NULL, NULL, NULL);
- ok(hr == E_POINTER, "IAudioCaptureClient_GetBuffer(NULL, &frames, NULL) returns %08x\n", hr);
ok(hr == E_POINTER, "IAudioCaptureClient_GetBuffer(NULL, &frames, NULL) returns %08lx\n", hr);
hr = IAudioCaptureClient_GetBuffer(acc, NULL, NULL, &flags, NULL, NULL);
- ok(hr == E_POINTER, "IAudioCaptureClient_GetBuffer(NULL, NULL, &flags) returns %08x\n", hr);
ok(hr == E_POINTER, "IAudioCaptureClient_GetBuffer(NULL, NULL, &flags) returns %08lx\n", hr);
hr = IAudioCaptureClient_GetBuffer(acc, &data, &frames, NULL, NULL, NULL);
- ok(hr == E_POINTER, "IAudioCaptureClient_GetBuffer(&ata, &frames, NULL) returns %08x\n", hr);
- ok(hr == E_POINTER, "IAudioCaptureClient_GetBuffer(&ata, &frames, NULL) returns %08lx\n", hr); ok(broken((DWORD_PTR)data == 0xdeadf00d) || /* <= win8 */ data == NULL, "data is reset to %p\n", data); ok(frames == 0xdeadbeef, "frames is reset to %08x\n", frames);
- ok(flags == 0xabadcafe, "flags is reset to %08x\n", flags);
ok(flags == 0xabadcafe, "flags is reset to %08lx\n", flags);
hr = IAudioClient_GetDevicePeriod(ac, &period, NULL);
- ok(hr == S_OK, "GetDevicePeriod failed: %08x\n", hr);
ok(hr == S_OK, "GetDevicePeriod failed: %08lx\n", hr); period = MulDiv(period, wfx->nSamplesPerSec, 10000000); /* as in render.c */
hr = IAudioClient_Start(ac);
- ok(hr == S_OK, "Start on a stopped stream returns %08x\n", hr);
ok(hr == S_OK, "Start on a stopped stream returns %08lx\n", hr);
ok(WaitForSingleObject(handle, 1000) == WAIT_OBJECT_0, "Waiting on event handle failed!\n");
data = (void*)0xdeadf00d; hr = IAudioCaptureClient_GetBuffer(acc, &data, &frames, &flags, &pos, &qpc);
- ok(hr == S_OK || hr == AUDCLNT_S_BUFFER_EMPTY, "Valid IAudioCaptureClient_GetBuffer returns %08x\n", hr);
- ok(hr == S_OK || hr == AUDCLNT_S_BUFFER_EMPTY, "Valid IAudioCaptureClient_GetBuffer returns %08lx\n", hr); if (hr == S_OK){ ok(frames, "Amount of frames locked is 0!\n"); /* broken: some w7 machines return pad == 0 and DATA_DISCONTINUITY here,
@@ -152,42 +152,42 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx) data == NULL, "No data changed to %p\n", data); }
- trace("Wait'ed position %d pad %u flags %x, amount of frames locked: %u\n",
trace("Wait'ed position %d pad %u flags %lx, amount of frames locked: %u\n", hr==S_OK ? (UINT)pos : -1, pad, flags, frames);
hr = IAudioCaptureClient_GetNextPacketSize(acc, &next);
- ok(hr == S_OK, "IAudioCaptureClient_GetNextPacketSize returns %08x\n", hr);
ok(hr == S_OK, "IAudioCaptureClient_GetNextPacketSize returns %08lx\n", hr); ok(next == frames, "GetNextPacketSize %u vs. GetBuffer %u\n", next, frames);
hr = IAudioCaptureClient_ReleaseBuffer(acc, frames);
- ok(hr == S_OK, "Releasing buffer returns %08x\n", hr);
ok(hr == S_OK, "Releasing buffer returns %08lx\n", hr);
hr = IAudioCaptureClient_ReleaseBuffer(acc, 0);
- ok(hr == S_OK, "Releasing 0 returns %08x\n", hr);
ok(hr == S_OK, "Releasing 0 returns %08lx\n", hr);
hr = IAudioCaptureClient_GetNextPacketSize(acc, &next);
- ok(hr == S_OK, "IAudioCaptureClient_GetNextPacketSize returns %08x\n", hr);
ok(hr == S_OK, "IAudioCaptureClient_GetNextPacketSize returns %08lx\n", hr);
if (frames) { hr = IAudioCaptureClient_ReleaseBuffer(acc, frames);
ok(hr == AUDCLNT_E_OUT_OF_ORDER, "Releasing buffer twice returns %08x\n", hr);
ok(hr == AUDCLNT_E_OUT_OF_ORDER, "Releasing buffer twice returns %08lx\n", hr); sum += frames;
}
Sleep(350); /* for sure there's data now */
hr = IAudioClient_GetCurrentPadding(ac, &pad);
- ok(hr == S_OK, "GetCurrentPadding call returns %08x\n", hr);
ok(hr == S_OK, "GetCurrentPadding call returns %08lx\n", hr);
/** GetNextPacketSize
- returns either 0 or one period worth of frames
- whereas GetCurrentPadding grows when input is not consumed. */
hr = IAudioCaptureClient_GetNextPacketSize(acc, &next);
- ok(hr == S_OK, "IAudioCaptureClient_GetNextPacketSize returns %08x\n", hr);
ok(hr == S_OK, "IAudioCaptureClient_GetNextPacketSize returns %08lx\n", hr); ok(next < pad, "GetNextPacketSize %u vs. GCP %u\n", next, pad);
hr = IAudioCaptureClient_GetBuffer(acc, &data, &frames, &flags, &pos, &qpc);
- ok(hr == S_OK, "Valid IAudioCaptureClient_GetBuffer returns %08x\n", hr);
ok(hr == S_OK, "Valid IAudioCaptureClient_GetBuffer returns %08lx\n", hr); ok(next == frames, "GetNextPacketSize %u vs. GetBuffer %u\n", next, frames);
if(hr == S_OK){
@@ -197,17 +197,17 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx) ok(pos == sum, "Position %u expected %u\n", (UINT)pos, sum);
hr = IAudioCaptureClient_ReleaseBuffer(acc, 0);
ok(hr == S_OK, "Releasing 0 returns %08x\n", hr);
ok(hr == S_OK, "Releasing 0 returns %08lx\n", hr); /* GCP did not decrement, no data consumed */ hr = IAudioClient_GetCurrentPadding(ac, &frames);
ok(hr == S_OK, "GetCurrentPadding call returns %08x\n", hr);
ok(hr == S_OK, "GetCurrentPadding call returns %08lx\n", hr); ok(frames == pad || frames == pad + next /* concurrent feeder */, "GCP %u past ReleaseBuffer(0) initially %u\n", frames, pad); /* should re-get the same data */ hr = IAudioCaptureClient_GetBuffer(acc, &data, &frames, &flags, &pos2, &qpc2);
ok(hr == S_OK, "Valid IAudioCaptureClient_GetBuffer returns %08x\n", hr);
ok(hr == S_OK, "Valid IAudioCaptureClient_GetBuffer returns %08lx\n", hr); ok(frames2 == frames, "GetBuffer after ReleaseBuffer(0) %u/%u\n", frames2, frames); ok(pos2 == pos, "Position after ReleaseBuffer(0) %u/%u\n", (UINT)pos2, (UINT)pos); todo_wine_if(qpc2 != qpc)
@@ -216,7 +216,7 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx) }
/* trace after the GCP test because log output to MS-DOS console disturbs timing */
- trace("Sleep.1 position %d pad %u flags %x, amount of frames locked: %u\n",
trace("Sleep.1 position %d pad %u flags %lx, amount of frames locked: %u\n", hr==S_OK ? (UINT)pos : -1, pad, flags, frames);
if(hr == S_OK){
@@ -228,31 +228,31 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx)
pos = qpc = 0xdeadbeef; hr = IAudioCaptureClient_GetBuffer(acc, &data2, &frames2, &flags, &pos, &qpc);
ok(hr == AUDCLNT_E_OUT_OF_ORDER, "Out of order IAudioCaptureClient_GetBuffer returns %08x\n", hr);
ok(hr == AUDCLNT_E_OUT_OF_ORDER, "Out of order IAudioCaptureClient_GetBuffer returns %08lx\n", hr); ok(frames2 == 0xabadcafe, "Out of order frames changed to %x\n", frames2); ok(broken(data2 == (void*)0xdeadf00d) /* <= win8 */ || data2 == NULL, "Out of order data changed to %p\n", data2);
ok(flags == 0xabadcafe, "Out of order flags changed to %x\n", flags);
ok(flags == 0xabadcafe, "Out of order flags changed to %lx\n", flags); ok(pos == 0xdeadbeef, "Out of order position changed to %x\n", (UINT)pos); ok(qpc == 0xdeadbeef, "Out of order timer changed to %x\n", (UINT)qpc); hr = IAudioCaptureClient_ReleaseBuffer(acc, frames+1);
ok(hr == AUDCLNT_E_INVALID_SIZE, "Releasing buffer+1 returns %08x\n", hr);
ok(hr == AUDCLNT_E_INVALID_SIZE, "Releasing buffer+1 returns %08lx\n", hr); hr = IAudioCaptureClient_ReleaseBuffer(acc, 1);
ok(hr == AUDCLNT_E_INVALID_SIZE, "Releasing 1 returns %08x\n", hr);
ok(hr == AUDCLNT_E_INVALID_SIZE, "Releasing 1 returns %08lx\n", hr); hr = IAudioClient_Reset(ac);
ok(hr == AUDCLNT_E_NOT_STOPPED, "Reset failed: %08x\n", hr);
ok(hr == AUDCLNT_E_NOT_STOPPED, "Reset failed: %08lx\n", hr);
}
hr = IAudioCaptureClient_ReleaseBuffer(acc, frames);
- ok(hr == S_OK, "Releasing buffer returns %08x\n", hr);
ok(hr == S_OK, "Releasing buffer returns %08lx\n", hr);
if (frames) { sum += frames; hr = IAudioCaptureClient_ReleaseBuffer(acc, frames);
ok(hr == AUDCLNT_E_OUT_OF_ORDER, "Releasing buffer twice returns %08x\n", hr);
ok(hr == AUDCLNT_E_OUT_OF_ORDER, "Releasing buffer twice returns %08lx\n", hr);
}
frames = period;
@@ -260,18 +260,18 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx)
/* GetBufferSize is not a multiple of the period size! */ hr = IAudioClient_GetBufferSize(ac, &next);
- ok(hr == S_OK, "GetBufferSize failed: %08x\n", hr);
ok(hr == S_OK, "GetBufferSize failed: %08lx\n", hr); trace("GetBufferSize %u period size %u\n", next, frames);
Sleep(400); /* overrun */
hr = IAudioClient_GetCurrentPadding(ac, &pad);
- ok(hr == S_OK, "GetCurrentPadding call returns %08x\n", hr);
ok(hr == S_OK, "GetCurrentPadding call returns %08lx\n", hr);
hr = IAudioCaptureClient_GetBuffer(acc, &data, &frames, &flags, &pos, &qpc);
- ok(hr == S_OK, "Valid IAudioCaptureClient_GetBuffer returns %08x\n", hr);
- ok(hr == S_OK, "Valid IAudioCaptureClient_GetBuffer returns %08lx\n", hr);
- trace("Overrun position %d pad %u flags %x, amount of frames locked: %u\n",
trace("Overrun position %d pad %u flags %lx, amount of frames locked: %u\n", hr==S_OK ? (UINT)pos : -1, pad, flags, frames);
if(hr == S_OK){
@@ -289,85 +289,85 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx) }
hr = IAudioCaptureClient_ReleaseBuffer(acc, frames);
- ok(hr == S_OK, "Releasing buffer returns %08x\n", hr);
ok(hr == S_OK, "Releasing buffer returns %08lx\n", hr); sum += frames;
hr = IAudioClient_GetCurrentPadding(ac, &pad);
- ok(hr == S_OK, "GetCurrentPadding call returns %08x\n", hr);
ok(hr == S_OK, "GetCurrentPadding call returns %08lx\n", hr);
hr = IAudioCaptureClient_GetBuffer(acc, &data, &frames, &flags, &pos, &qpc);
- ok(hr == S_OK, "Valid IAudioCaptureClient_GetBuffer returns %08x\n", hr);
- ok(hr == S_OK, "Valid IAudioCaptureClient_GetBuffer returns %08lx\n", hr);
- trace("Cont'ed position %d pad %u flags %x, amount of frames locked: %u\n",
trace("Cont'ed position %d pad %u flags %lx, amount of frames locked: %u\n", hr==S_OK ? (UINT)pos : -1, pad, flags, frames);
if(hr == S_OK){ ok(pos == sum, "Position %u expected %u\n", (UINT)pos, sum);
ok(!flags, "flags %u\n", flags);
ok(!flags, "flags %lu\n", flags); hr = IAudioCaptureClient_ReleaseBuffer(acc, frames);
ok(hr == S_OK, "Releasing buffer returns %08x\n", hr);
ok(hr == S_OK, "Releasing buffer returns %08lx\n", hr); sum += frames;
}
hr = IAudioClient_Stop(ac);
- ok(hr == S_OK, "Stop on a started stream returns %08x\n", hr);
ok(hr == S_OK, "Stop on a started stream returns %08lx\n", hr);
hr = IAudioClient_Start(ac);
- ok(hr == S_OK, "Start on a stopped stream returns %08x\n", hr);
ok(hr == S_OK, "Start on a stopped stream returns %08lx\n", hr);
hr = IAudioCaptureClient_GetBuffer(acc, &data, &frames, &flags, &pos, &qpc);
- ok(hr == S_OK, "Valid IAudioCaptureClient_GetBuffer returns %08x\n", hr);
ok(hr == S_OK, "Valid IAudioCaptureClient_GetBuffer returns %08lx\n", hr);
hr = IAudioClient_GetCurrentPadding(ac, &pad);
- ok(hr == S_OK, "GetCurrentPadding call returns %08x\n", hr);
- ok(hr == S_OK, "GetCurrentPadding call returns %08lx\n", hr);
- trace("Restart position %d pad %u flags %x, amount of frames locked: %u\n",
trace("Restart position %d pad %u flags %lx, amount of frames locked: %u\n", hr==S_OK ? (UINT)pos : -1, pad, flags, frames); ok(pad > sum, "restarted GCP %u\n", pad); /* GCP is still near buffer size */
if(frames){ ok(pos == sum, "Position %u expected %u\n", (UINT)pos, sum);
ok(!flags, "flags %u\n", flags);
ok(!flags, "flags %lu\n", flags); hr = IAudioCaptureClient_ReleaseBuffer(acc, frames);
ok(hr == S_OK, "Releasing buffer returns %08x\n", hr);
ok(hr == S_OK, "Releasing buffer returns %08lx\n", hr); sum += frames;
}
hr = IAudioClient_Stop(ac);
- ok(hr == S_OK, "Stop on a started stream returns %08x\n", hr);
ok(hr == S_OK, "Stop on a started stream returns %08lx\n", hr);
hr = IAudioClient_Reset(ac);
- ok(hr == S_OK, "Reset on a stopped stream returns %08x\n", hr);
ok(hr == S_OK, "Reset on a stopped stream returns %08lx\n", hr); sum += pad - frames;
hr = IAudioClient_GetCurrentPadding(ac, &pad);
- ok(hr == S_OK, "GetCurrentPadding call returns %08x\n", hr);
ok(hr == S_OK, "GetCurrentPadding call returns %08lx\n", hr); ok(!pad, "reset GCP %u\n", pad);
flags = 0xabadcafe; hr = IAudioCaptureClient_GetBuffer(acc, &data, &frames, &flags, &pos, &qpc); ok(hr == AUDCLNT_S_BUFFER_EMPTY,
"Initial IAudioCaptureClient_GetBuffer returns %08x\n", hr);
"Initial IAudioCaptureClient_GetBuffer returns %08lx\n", hr);
- trace("Reset position %d pad %u flags %x, amount of frames locked: %u\n",
trace("Reset position %d pad %u flags %lx, amount of frames locked: %u\n", hr==S_OK ? (UINT)pos : -1, pad, flags, frames);
if(SUCCEEDED(hr)) IAudioCaptureClient_ReleaseBuffer(acc, frames);
hr = IAudioClient_Start(ac);
- ok(hr == S_OK, "Start on a stopped stream returns %08x\n", hr);
ok(hr == S_OK, "Start on a stopped stream returns %08lx\n", hr);
Sleep(180);
hr = IAudioClient_GetCurrentPadding(ac, &pad);
- ok(hr == S_OK, "GetCurrentPadding call returns %08x\n", hr);
ok(hr == S_OK, "GetCurrentPadding call returns %08lx\n", hr);
hr = IAudioCaptureClient_GetBuffer(acc, &data, &frames, &flags, &pos, &qpc);
- ok(hr == S_OK, "Valid IAudioCaptureClient_GetBuffer returns %08x\n", hr);
- trace("Running position %d pad %u flags %x, amount of frames locked: %u\n",
ok(hr == S_OK, "Valid IAudioCaptureClient_GetBuffer returns %08lx\n", hr);
trace("Running position %d pad %u flags %lx, amount of frames locked: %u\n", SUCCEEDED(hr) ? (UINT)pos : -1, pad, flags, frames);
if(SUCCEEDED(hr)){
@@ -392,56 +392,56 @@ static void test_audioclient(void)
hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ac);
- ok(hr == S_OK, "Activation failed with %08x\n", hr);
ok(hr == S_OK, "Activation failed with %08lx\n", hr); if(hr != S_OK) return;
handle = CreateEventW(NULL, FALSE, FALSE, NULL);
hr = IAudioClient_QueryInterface(ac, &IID_IUnknown, NULL);
- ok(hr == E_POINTER, "QueryInterface(NULL) returned %08x\n", hr);
ok(hr == E_POINTER, "QueryInterface(NULL) returned %08lx\n", hr);
unk = (void*)(LONG_PTR)0x12345678; hr = IAudioClient_QueryInterface(ac, &IID_NULL, (void**)&unk);
- ok(hr == E_NOINTERFACE, "QueryInterface(IID_NULL) returned %08x\n", hr);
ok(hr == E_NOINTERFACE, "QueryInterface(IID_NULL) returned %08lx\n", hr); ok(!unk, "QueryInterface(IID_NULL) returned non-null pointer %p\n", unk);
hr = IAudioClient_QueryInterface(ac, &IID_IUnknown, (void**)&unk);
- ok(hr == S_OK, "QueryInterface(IID_IUnknown) returned %08x\n", hr);
- ok(hr == S_OK, "QueryInterface(IID_IUnknown) returned %08lx\n", hr); if (unk) { ref = IUnknown_Release(unk);
ok(ref == 1, "Released count is %u\n", ref);
ok(ref == 1, "Released count is %lu\n", ref);
}
hr = IAudioClient_QueryInterface(ac, &IID_IAudioClient, (void**)&unk);
- ok(hr == S_OK, "QueryInterface(IID_IAudioClient) returned %08x\n", hr);
- ok(hr == S_OK, "QueryInterface(IID_IAudioClient) returned %08lx\n", hr); if (unk) { ref = IUnknown_Release(unk);
ok(ref == 1, "Released count is %u\n", ref);
ok(ref == 1, "Released count is %lu\n", ref);
}
hr = IAudioClient_GetDevicePeriod(ac, NULL, NULL);
- ok(hr == E_POINTER, "Invalid GetDevicePeriod call returns %08x\n", hr);
ok(hr == E_POINTER, "Invalid GetDevicePeriod call returns %08lx\n", hr);
hr = IAudioClient_GetDevicePeriod(ac, &t1, NULL);
- ok(hr == S_OK, "Valid GetDevicePeriod call returns %08x\n", hr);
ok(hr == S_OK, "Valid GetDevicePeriod call returns %08lx\n", hr);
hr = IAudioClient_GetDevicePeriod(ac, NULL, &t2);
- ok(hr == S_OK, "Valid GetDevicePeriod call returns %08x\n", hr);
ok(hr == S_OK, "Valid GetDevicePeriod call returns %08lx\n", hr);
hr = IAudioClient_GetDevicePeriod(ac, &t1, &t2);
- ok(hr == S_OK, "Valid GetDevicePeriod call returns %08x\n", hr);
ok(hr == S_OK, "Valid GetDevicePeriod call returns %08lx\n", hr); trace("Returned periods: %u.%04u ms %u.%04u ms\n", (UINT)(t1/10000), (UINT)(t1 % 10000), (UINT)(t2/10000), (UINT)(t2 % 10000));
hr = IAudioClient_GetMixFormat(ac, NULL);
- ok(hr == E_POINTER, "GetMixFormat returns %08x\n", hr);
ok(hr == E_POINTER, "GetMixFormat returns %08lx\n", hr);
hr = IAudioClient_GetMixFormat(ac, &pwfx);
- ok(hr == S_OK, "Valid GetMixFormat returns %08x\n", hr);
ok(hr == S_OK, "Valid GetMixFormat returns %08lx\n", hr);
if (hr == S_OK) {
@@ -449,7 +449,7 @@ static void test_audioclient(void) trace("Tag: %04x\n", pwfx->wFormatTag); trace("bits: %u\n", pwfx->wBitsPerSample); trace("chan: %u\n", pwfx->nChannels);
trace("rate: %u\n", pwfx->nSamplesPerSec);
trace("rate: %lu\n", pwfx->nSamplesPerSec); trace("align: %u\n", pwfx->nBlockAlign); trace("extra: %u\n", pwfx->cbSize); ok(pwfx->wFormatTag == WAVE_FORMAT_EXTENSIBLE, "wFormatTag is %x\n", pwfx->wFormatTag);
@@ -457,7 +457,7 @@ static void test_audioclient(void) { WAVEFORMATEXTENSIBLE *pwfxe = (void*)pwfx; trace("Res: %u\n", pwfxe->Samples.wReserved);
trace("Mask: %x\n", pwfxe->dwChannelMask);
trace("Mask: %lx\n", pwfxe->dwChannelMask); trace("Alg: %s\n", IsEqualGUID(&pwfxe->SubFormat, &KSDATAFORMAT_SUBTYPE_PCM)?"PCM": (IsEqualGUID(&pwfxe->SubFormat,
@@ -465,79 +465,79 @@ static void test_audioclient(void) }
hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_SHARED, pwfx, &pwfx2);
ok(hr == S_OK, "Valid IsFormatSupported(Shared) call returns %08x\n", hr);
ok(hr == S_OK, "Valid IsFormatSupported(Shared) call returns %08lx\n", hr); ok(pwfx2 == NULL, "pwfx2 is non-null\n"); CoTaskMemFree(pwfx2); hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_SHARED, NULL, NULL);
ok(hr == E_POINTER, "IsFormatSupported(NULL) call returns %08x\n", hr);
ok(hr == E_POINTER, "IsFormatSupported(NULL) call returns %08lx\n", hr); hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_SHARED, pwfx, NULL);
ok(hr == E_POINTER, "IsFormatSupported(Shared,NULL) call returns %08x\n", hr);
ok(hr == E_POINTER, "IsFormatSupported(Shared,NULL) call returns %08lx\n", hr); hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_EXCLUSIVE, pwfx, NULL);
ok(hr == S_OK || hr == AUDCLNT_E_UNSUPPORTED_FORMAT, "IsFormatSupported(Exclusive) call returns %08x\n", hr);
ok(hr == S_OK || hr == AUDCLNT_E_UNSUPPORTED_FORMAT, "IsFormatSupported(Exclusive) call returns %08lx\n", hr); hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_EXCLUSIVE, pwfx, &pwfx2);
ok(hr == S_OK || hr == AUDCLNT_E_UNSUPPORTED_FORMAT, "IsFormatSupported(Exclusive) call returns %08x\n", hr);
ok(hr == S_OK || hr == AUDCLNT_E_UNSUPPORTED_FORMAT, "IsFormatSupported(Exclusive) call returns %08lx\n", hr); ok(pwfx2 == NULL, "pwfx2 non-null on exclusive IsFormatSupported\n"); hr = IAudioClient_IsFormatSupported(ac, 0xffffffff, pwfx, NULL); ok(hr == E_INVALIDARG/*w32*/ || broken(hr == AUDCLNT_E_UNSUPPORTED_FORMAT/*w64 response from exclusive mode driver */),
"IsFormatSupported(0xffffffff) call returns %08x\n", hr);
"IsFormatSupported(0xffffffff) call returns %08lx\n", hr);
}
test_uninitialized(ac);
hr = IAudioClient_Initialize(ac, 3, 0, 5000000, 0, pwfx, NULL); ok(broken(hr == AUDCLNT_E_NOT_INITIALIZED) || /* <= win8 */
hr == E_INVALIDARG, "Initialize with invalid sharemode returns %08x\n", hr);
hr == E_INVALIDARG, "Initialize with invalid sharemode returns %08lx\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);
ok(hr == E_INVALIDARG || hr == AUDCLNT_E_INVALID_STREAM_FLAG, "Initialize with invalid flags returns %08lx\n", hr);
/* A period != 0 is ignored and the call succeeds.
- Since we can only initialize successfully once, skip those tests.
*/ hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, 0, NULL, NULL);
- ok(hr == E_POINTER, "Initialize with null format returns %08x\n", hr);
ok(hr == E_POINTER, "Initialize with null format returns %08lx\n", hr);
hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_EVENTCALLBACK, 4987654, 0, pwfx, NULL);
- ok(hr == S_OK, "Valid Initialize returns %08x\n", hr);
ok(hr == S_OK, "Valid Initialize returns %08lx\n", hr);
if (hr != S_OK) {
skip("Cannot initialize %08x, remainder of tests is useless\n", hr);
skip("Cannot initialize %08lx, remainder of tests is useless\n", hr); goto cleanup;
}
hr = IAudioClient_GetStreamLatency(ac, NULL);
- ok(hr == E_POINTER, "GetStreamLatency(NULL) call returns %08x\n", hr);
ok(hr == E_POINTER, "GetStreamLatency(NULL) call returns %08lx\n", hr);
hr = IAudioClient_GetStreamLatency(ac, &t1);
- ok(hr == S_OK, "Valid GetStreamLatency call returns %08x\n", hr);
ok(hr == S_OK, "Valid GetStreamLatency call returns %08lx\n", hr); trace("Returned latency: %u.%04u ms\n", (UINT)(t1/10000), (UINT)(t1 % 10000));
hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, 0, pwfx, NULL);
- ok(hr == AUDCLNT_E_ALREADY_INITIALIZED, "Calling Initialize twice returns %08x\n", hr);
ok(hr == AUDCLNT_E_ALREADY_INITIALIZED, "Calling Initialize twice returns %08lx\n", hr);
hr = IAudioClient_SetEventHandle(ac, NULL);
- ok(hr == E_INVALIDARG, "SetEventHandle(NULL) returns %08x\n", hr);
ok(hr == E_INVALIDARG, "SetEventHandle(NULL) returns %08lx\n", hr);
hr = IAudioClient_Start(ac); ok(hr == AUDCLNT_E_EVENTHANDLE_NOT_SET ||
hr == D3D11_ERROR_4E /* win10 */, "Start before SetEventHandle returns %08x\n", hr);
hr == D3D11_ERROR_4E /* win10 */, "Start before SetEventHandle returns %08lx\n", hr);
hr = IAudioClient_SetEventHandle(ac, handle);
- ok(hr == S_OK, "SetEventHandle returns %08x\n", hr);
ok(hr == S_OK, "SetEventHandle returns %08lx\n", hr);
hr = IAudioClient_Reset(ac);
- ok(hr == S_OK, "Reset on an already reset stream returns %08x\n", hr);
ok(hr == S_OK, "Reset on an already reset stream returns %08lx\n", hr);
hr = IAudioClient_Stop(ac);
- ok(hr == S_FALSE, "Stop on a stopped stream returns %08x\n", hr);
ok(hr == S_FALSE, "Stop on a stopped stream returns %08lx\n", hr);
test_capture(ac, handle, pwfx);
@@ -558,87 +558,87 @@ static void test_streamvolume(void)
hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ac);
- ok(hr == S_OK, "Activation failed with %08x\n", hr);
ok(hr == S_OK, "Activation failed with %08lx\n", hr); if(hr != S_OK) return;
hr = IAudioClient_GetMixFormat(ac, &fmt);
- ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr);
ok(hr == S_OK, "GetMixFormat failed: %08lx\n", hr);
hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, 0, fmt, NULL);
- ok(hr == S_OK, "Initialize failed: %08x\n", hr);
ok(hr == S_OK, "Initialize failed: %08lx\n", hr); if(hr != S_OK) return;
hr = IAudioClient_GetService(ac, &IID_IAudioStreamVolume, (void**)&asv);
- ok(hr == S_OK, "GetService failed: %08x\n", hr);
ok(hr == S_OK, "GetService failed: %08lx\n", hr);
hr = IAudioStreamVolume_GetChannelCount(asv, NULL);
- ok(hr == E_POINTER, "GetChannelCount gave wrong error: %08x\n", hr);
ok(hr == E_POINTER, "GetChannelCount gave wrong error: %08lx\n", hr);
hr = IAudioStreamVolume_GetChannelCount(asv, &chans);
- ok(hr == S_OK, "GetChannelCount failed: %08x\n", hr);
ok(hr == S_OK, "GetChannelCount failed: %08lx\n", hr); ok(chans == fmt->nChannels, "GetChannelCount gave wrong number of channels: %d\n", chans);
hr = IAudioStreamVolume_GetChannelVolume(asv, fmt->nChannels, NULL);
- ok(hr == E_POINTER, "GetChannelCount gave wrong error: %08x\n", hr);
ok(hr == E_POINTER, "GetChannelCount gave wrong error: %08lx\n", hr);
hr = IAudioStreamVolume_GetChannelVolume(asv, fmt->nChannels, &vol);
- ok(hr == E_INVALIDARG, "GetChannelCount gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "GetChannelCount gave wrong error: %08lx\n", hr);
hr = IAudioStreamVolume_GetChannelVolume(asv, 0, NULL);
- ok(hr == E_POINTER, "GetChannelCount gave wrong error: %08x\n", hr);
ok(hr == E_POINTER, "GetChannelCount gave wrong error: %08lx\n", hr);
hr = IAudioStreamVolume_GetChannelVolume(asv, 0, &vol);
- ok(hr == S_OK, "GetChannelCount failed: %08x\n", hr);
ok(hr == S_OK, "GetChannelCount failed: %08lx\n", hr); ok(vol == 1.f, "Channel volume was not 1: %f\n", vol);
hr = IAudioStreamVolume_SetChannelVolume(asv, fmt->nChannels, -1.f);
- ok(hr == E_INVALIDARG, "SetChannelVolume gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "SetChannelVolume gave wrong error: %08lx\n", hr);
hr = IAudioStreamVolume_SetChannelVolume(asv, 0, -1.f);
- ok(hr == E_INVALIDARG, "SetChannelVolume gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "SetChannelVolume gave wrong error: %08lx\n", hr);
hr = IAudioStreamVolume_SetChannelVolume(asv, 0, 2.f);
- ok(hr == E_INVALIDARG, "SetChannelVolume gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "SetChannelVolume gave wrong error: %08lx\n", hr);
hr = IAudioStreamVolume_SetChannelVolume(asv, 0, 0.2f);
- ok(hr == S_OK, "SetChannelVolume failed: %08x\n", hr);
ok(hr == S_OK, "SetChannelVolume failed: %08lx\n", hr);
hr = IAudioStreamVolume_GetChannelVolume(asv, 0, &vol);
- ok(hr == S_OK, "GetChannelCount failed: %08x\n", hr);
ok(hr == S_OK, "GetChannelCount failed: %08lx\n", hr); ok(fabsf(vol - 0.2f) < 0.05f, "Channel volume wasn't 0.2: %f\n", vol);
hr = IAudioStreamVolume_GetAllVolumes(asv, 0, NULL);
- ok(hr == E_POINTER, "GetAllVolumes gave wrong error: %08x\n", hr);
ok(hr == E_POINTER, "GetAllVolumes gave wrong error: %08lx\n", hr);
hr = IAudioStreamVolume_GetAllVolumes(asv, fmt->nChannels, NULL);
- ok(hr == E_POINTER, "GetAllVolumes gave wrong error: %08x\n", hr);
ok(hr == E_POINTER, "GetAllVolumes gave wrong error: %08lx\n", hr);
vols = HeapAlloc(GetProcessHeap(), 0, fmt->nChannels * sizeof(float)); ok(vols != NULL, "HeapAlloc failed\n");
hr = IAudioStreamVolume_GetAllVolumes(asv, fmt->nChannels - 1, vols);
- ok(hr == E_INVALIDARG, "GetAllVolumes gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "GetAllVolumes gave wrong error: %08lx\n", hr);
hr = IAudioStreamVolume_GetAllVolumes(asv, fmt->nChannels, vols);
- ok(hr == S_OK, "GetAllVolumes failed: %08x\n", hr);
ok(hr == S_OK, "GetAllVolumes failed: %08lx\n", hr); ok(fabsf(vols[0] - 0.2f) < 0.05f, "Channel 0 volume wasn't 0.2: %f\n", vol); for(i = 1; i < fmt->nChannels; ++i) ok(vols[i] == 1.f, "Channel %d volume is not 1: %f\n", i, vols[i]);
hr = IAudioStreamVolume_SetAllVolumes(asv, 0, NULL);
- ok(hr == E_POINTER, "SetAllVolumes gave wrong error: %08x\n", hr);
ok(hr == E_POINTER, "SetAllVolumes gave wrong error: %08lx\n", hr);
hr = IAudioStreamVolume_SetAllVolumes(asv, fmt->nChannels, NULL);
- ok(hr == E_POINTER, "SetAllVolumes gave wrong error: %08x\n", hr);
ok(hr == E_POINTER, "SetAllVolumes gave wrong error: %08lx\n", hr);
hr = IAudioStreamVolume_SetAllVolumes(asv, fmt->nChannels - 1, vols);
- ok(hr == E_INVALIDARG, "SetAllVolumes gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "SetAllVolumes gave wrong error: %08lx\n", hr);
hr = IAudioStreamVolume_SetAllVolumes(asv, fmt->nChannels, vols);
- ok(hr == S_OK, "SetAllVolumes failed: %08x\n", hr);
ok(hr == S_OK, "SetAllVolumes failed: %08lx\n", hr);
HeapFree(GetProcessHeap(), 0, vols); IAudioStreamVolume_Release(asv);
@@ -657,90 +657,90 @@ static void test_channelvolume(void)
hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ac);
- ok(hr == S_OK, "Activation failed with %08x\n", hr);
ok(hr == S_OK, "Activation failed with %08lx\n", hr); if(hr != S_OK) return;
hr = IAudioClient_GetMixFormat(ac, &fmt);
- ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr);
ok(hr == S_OK, "GetMixFormat failed: %08lx\n", hr);
hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_NOPERSIST, 5000000, 0, fmt, NULL);
- ok(hr == S_OK, "Initialize failed: %08x\n", hr);
ok(hr == S_OK, "Initialize failed: %08lx\n", hr);
hr = IAudioClient_GetService(ac, &IID_IChannelAudioVolume, (void**)&acv);
- ok(hr == S_OK, "GetService failed: %08x\n", hr);
ok(hr == S_OK, "GetService failed: %08lx\n", hr); if(hr != S_OK) return;
hr = IChannelAudioVolume_GetChannelCount(acv, NULL);
- ok(hr == NULL_PTR_ERR, "GetChannelCount gave wrong error: %08x\n", hr);
ok(hr == NULL_PTR_ERR, "GetChannelCount gave wrong error: %08lx\n", hr);
hr = IChannelAudioVolume_GetChannelCount(acv, &chans);
- ok(hr == S_OK, "GetChannelCount failed: %08x\n", hr);
ok(hr == S_OK, "GetChannelCount failed: %08lx\n", hr); ok(chans == fmt->nChannels, "GetChannelCount gave wrong number of channels: %d\n", chans);
hr = IChannelAudioVolume_GetChannelVolume(acv, fmt->nChannels, NULL);
- ok(hr == NULL_PTR_ERR, "GetChannelCount gave wrong error: %08x\n", hr);
ok(hr == NULL_PTR_ERR, "GetChannelCount gave wrong error: %08lx\n", hr);
hr = IChannelAudioVolume_GetChannelVolume(acv, fmt->nChannels, &vol);
- ok(hr == E_INVALIDARG, "GetChannelCount gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "GetChannelCount gave wrong error: %08lx\n", hr);
hr = IChannelAudioVolume_GetChannelVolume(acv, 0, NULL);
- ok(hr == NULL_PTR_ERR, "GetChannelCount gave wrong error: %08x\n", hr);
ok(hr == NULL_PTR_ERR, "GetChannelCount gave wrong error: %08lx\n", hr);
hr = IChannelAudioVolume_GetChannelVolume(acv, 0, &vol);
- ok(hr == S_OK, "GetChannelCount failed: %08x\n", hr);
ok(hr == S_OK, "GetChannelCount failed: %08lx\n", hr); ok(vol == 1.f, "Channel volume was not 1: %f\n", vol);
hr = IChannelAudioVolume_SetChannelVolume(acv, fmt->nChannels, -1.f, NULL);
- ok(hr == E_INVALIDARG, "SetChannelVolume gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "SetChannelVolume gave wrong error: %08lx\n", hr);
hr = IChannelAudioVolume_SetChannelVolume(acv, 0, -1.f, NULL);
- ok(hr == E_INVALIDARG, "SetChannelVolume gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "SetChannelVolume gave wrong error: %08lx\n", hr);
hr = IChannelAudioVolume_SetChannelVolume(acv, 0, 2.f, NULL);
- ok(hr == E_INVALIDARG, "SetChannelVolume gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "SetChannelVolume gave wrong error: %08lx\n", hr);
hr = IChannelAudioVolume_SetChannelVolume(acv, 0, 0.2f, NULL);
- ok(hr == S_OK, "SetChannelVolume failed: %08x\n", hr);
ok(hr == S_OK, "SetChannelVolume failed: %08lx\n", hr);
hr = IChannelAudioVolume_GetChannelVolume(acv, 0, &vol);
- ok(hr == S_OK, "GetChannelCount failed: %08x\n", hr);
ok(hr == S_OK, "GetChannelCount failed: %08lx\n", hr); ok(fabsf(vol - 0.2f) < 0.05f, "Channel volume wasn't 0.2: %f\n", vol);
hr = IChannelAudioVolume_GetAllVolumes(acv, 0, NULL);
- ok(hr == NULL_PTR_ERR, "GetAllVolumes gave wrong error: %08x\n", hr);
ok(hr == NULL_PTR_ERR, "GetAllVolumes gave wrong error: %08lx\n", hr);
hr = IChannelAudioVolume_GetAllVolumes(acv, fmt->nChannels, NULL);
- ok(hr == NULL_PTR_ERR, "GetAllVolumes gave wrong error: %08x\n", hr);
ok(hr == NULL_PTR_ERR, "GetAllVolumes gave wrong error: %08lx\n", hr);
vols = HeapAlloc(GetProcessHeap(), 0, fmt->nChannels * sizeof(float)); ok(vols != NULL, "HeapAlloc failed\n");
hr = IChannelAudioVolume_GetAllVolumes(acv, fmt->nChannels - 1, vols);
- ok(hr == E_INVALIDARG, "GetAllVolumes gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "GetAllVolumes gave wrong error: %08lx\n", hr);
hr = IChannelAudioVolume_GetAllVolumes(acv, fmt->nChannels, vols);
- ok(hr == S_OK, "GetAllVolumes failed: %08x\n", hr);
ok(hr == S_OK, "GetAllVolumes failed: %08lx\n", hr); ok(fabsf(vols[0] - 0.2f) < 0.05f, "Channel 0 volume wasn't 0.2: %f\n", vol); for(i = 1; i < fmt->nChannels; ++i) ok(vols[i] == 1.f, "Channel %d volume is not 1: %f\n", i, vols[i]);
hr = IChannelAudioVolume_SetAllVolumes(acv, 0, NULL, NULL);
- ok(hr == NULL_PTR_ERR, "SetAllVolumes gave wrong error: %08x\n", hr);
ok(hr == NULL_PTR_ERR, "SetAllVolumes gave wrong error: %08lx\n", hr);
hr = IChannelAudioVolume_SetAllVolumes(acv, fmt->nChannels, NULL, NULL);
- ok(hr == NULL_PTR_ERR, "SetAllVolumes gave wrong error: %08x\n", hr);
ok(hr == NULL_PTR_ERR, "SetAllVolumes gave wrong error: %08lx\n", hr);
hr = IChannelAudioVolume_SetAllVolumes(acv, fmt->nChannels - 1, vols, NULL);
- ok(hr == E_INVALIDARG, "SetAllVolumes gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "SetAllVolumes gave wrong error: %08lx\n", hr);
hr = IChannelAudioVolume_SetAllVolumes(acv, fmt->nChannels, vols, NULL);
- ok(hr == S_OK, "SetAllVolumes failed: %08x\n", hr);
ok(hr == S_OK, "SetAllVolumes failed: %08lx\n", hr);
hr = IChannelAudioVolume_SetChannelVolume(acv, 0, 1.0f, NULL);
- ok(hr == S_OK, "SetChannelVolume failed: %08x\n", hr);
ok(hr == S_OK, "SetChannelVolume failed: %08lx\n", hr);
HeapFree(GetProcessHeap(), 0, vols); IChannelAudioVolume_Release(acv);
@@ -759,71 +759,71 @@ static void test_simplevolume(void)
hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ac);
- ok(hr == S_OK, "Activation failed with %08x\n", hr);
ok(hr == S_OK, "Activation failed with %08lx\n", hr); if(hr != S_OK) return;
hr = IAudioClient_GetMixFormat(ac, &fmt);
- ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr);
ok(hr == S_OK, "GetMixFormat failed: %08lx\n", hr);
hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_NOPERSIST, 5000000, 0, fmt, NULL);
- ok(hr == S_OK, "Initialize failed: %08x\n", hr);
ok(hr == S_OK, "Initialize failed: %08lx\n", hr);
hr = IAudioClient_GetService(ac, &IID_ISimpleAudioVolume, (void**)&sav);
- ok(hr == S_OK, "GetService failed: %08x\n", hr);
ok(hr == S_OK, "GetService failed: %08lx\n", hr); if(hr != S_OK) return;
hr = ISimpleAudioVolume_GetMasterVolume(sav, NULL);
- ok(hr == NULL_PTR_ERR, "GetMasterVolume gave wrong error: %08x\n", hr);
ok(hr == NULL_PTR_ERR, "GetMasterVolume gave wrong error: %08lx\n", hr);
hr = ISimpleAudioVolume_GetMasterVolume(sav, &vol);
- ok(hr == S_OK, "GetMasterVolume failed: %08x\n", hr);
ok(hr == S_OK, "GetMasterVolume failed: %08lx\n", hr);
hr = ISimpleAudioVolume_SetMasterVolume(sav, -1.f, NULL);
- ok(hr == E_INVALIDARG, "SetMasterVolume gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "SetMasterVolume gave wrong error: %08lx\n", hr);
hr = ISimpleAudioVolume_SetMasterVolume(sav, 2.f, NULL);
- ok(hr == E_INVALIDARG, "SetMasterVolume gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "SetMasterVolume gave wrong error: %08lx\n", hr);
hr = ISimpleAudioVolume_SetMasterVolume(sav, 0.2f, NULL);
- ok(hr == S_OK, "SetMasterVolume failed: %08x\n", hr);
ok(hr == S_OK, "SetMasterVolume failed: %08lx\n", hr);
hr = ISimpleAudioVolume_GetMasterVolume(sav, &vol);
- ok(hr == S_OK, "GetMasterVolume failed: %08x\n", hr);
ok(hr == S_OK, "GetMasterVolume failed: %08lx\n", hr); ok(fabsf(vol - 0.2f) < 0.05f, "Master volume wasn't 0.2: %f\n", vol);
hr = ISimpleAudioVolume_GetMute(sav, NULL);
- ok(hr == NULL_PTR_ERR, "GetMute gave wrong error: %08x\n", hr);
ok(hr == NULL_PTR_ERR, "GetMute gave wrong error: %08lx\n", hr);
mute = TRUE; hr = ISimpleAudioVolume_GetMute(sav, &mute);
- ok(hr == S_OK, "GetMute failed: %08x\n", hr);
ok(hr == S_OK, "GetMute failed: %08lx\n", hr); ok(mute == FALSE, "Session is already muted\n");
hr = ISimpleAudioVolume_SetMute(sav, TRUE, NULL);
- ok(hr == S_OK, "SetMute failed: %08x\n", hr);
ok(hr == S_OK, "SetMute failed: %08lx\n", hr);
mute = FALSE; hr = ISimpleAudioVolume_GetMute(sav, &mute);
- ok(hr == S_OK, "GetMute failed: %08x\n", hr);
ok(hr == S_OK, "GetMute failed: %08lx\n", hr); ok(mute == TRUE, "Session should have been muted\n");
hr = ISimpleAudioVolume_GetMasterVolume(sav, &vol);
- ok(hr == S_OK, "GetMasterVolume failed: %08x\n", hr);
ok(hr == S_OK, "GetMasterVolume failed: %08lx\n", hr); ok(fabsf(vol - 0.2f) < 0.05f, "Master volume wasn't 0.2: %f\n", vol);
hr = ISimpleAudioVolume_SetMasterVolume(sav, 1.f, NULL);
- ok(hr == S_OK, "SetMasterVolume failed: %08x\n", hr);
ok(hr == S_OK, "SetMasterVolume failed: %08lx\n", hr);
mute = FALSE; hr = ISimpleAudioVolume_GetMute(sav, &mute);
- ok(hr == S_OK, "GetMute failed: %08x\n", hr);
ok(hr == S_OK, "GetMute failed: %08lx\n", hr); ok(mute == TRUE, "Session should have been muted\n");
hr = ISimpleAudioVolume_SetMute(sav, FALSE, NULL);
- ok(hr == S_OK, "SetMute failed: %08x\n", hr);
ok(hr == S_OK, "SetMute failed: %08lx\n", hr);
ISimpleAudioVolume_Release(sav); IAudioClient_Release(ac);
@@ -843,51 +843,51 @@ static void test_volume_dependence(void) UINT32 nch;
hr = CoCreateGuid(&session);
- ok(hr == S_OK, "CoCreateGuid failed: %08x\n", hr);
ok(hr == S_OK, "CoCreateGuid failed: %08lx\n", hr);
hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ac);
- ok(hr == S_OK, "Activation failed with %08x\n", hr);
ok(hr == S_OK, "Activation failed with %08lx\n", hr); if(hr != S_OK) return;
hr = IAudioClient_GetMixFormat(ac, &fmt);
- ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr);
ok(hr == S_OK, "GetMixFormat failed: %08lx\n", hr);
hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_NOPERSIST, 5000000, 0, fmt, &session);
- ok(hr == S_OK, "Initialize failed: %08x\n", hr);
ok(hr == S_OK, "Initialize failed: %08lx\n", hr);
hr = IAudioClient_GetService(ac, &IID_ISimpleAudioVolume, (void**)&sav);
- ok(hr == S_OK, "GetService (SimpleAudioVolume) failed: %08x\n", hr);
ok(hr == S_OK, "GetService (SimpleAudioVolume) failed: %08lx\n", hr);
hr = IAudioClient_GetService(ac, &IID_IChannelAudioVolume, (void**)&cav);
- ok(hr == S_OK, "GetService (ChannelAudioVolume) failed: %08x\n", hr);
ok(hr == S_OK, "GetService (ChannelAudioVolume) failed: %08lx\n", hr);
hr = IAudioClient_GetService(ac, &IID_IAudioStreamVolume, (void**)&asv);
- ok(hr == S_OK, "GetService (AudioStreamVolume) failed: %08x\n", hr);
ok(hr == S_OK, "GetService (AudioStreamVolume) failed: %08lx\n", hr); if(hr != S_OK) return;
hr = IAudioStreamVolume_SetChannelVolume(asv, 0, 0.2f);
- ok(hr == S_OK, "ASV_SetChannelVolume failed: %08x\n", hr);
ok(hr == S_OK, "ASV_SetChannelVolume failed: %08lx\n", hr);
hr = IChannelAudioVolume_SetChannelVolume(cav, 0, 0.4f, NULL);
- ok(hr == S_OK, "CAV_SetChannelVolume failed: %08x\n", hr);
ok(hr == S_OK, "CAV_SetChannelVolume failed: %08lx\n", hr);
hr = ISimpleAudioVolume_SetMasterVolume(sav, 0.6f, NULL);
- ok(hr == S_OK, "SAV_SetMasterVolume failed: %08x\n", hr);
ok(hr == S_OK, "SAV_SetMasterVolume failed: %08lx\n", hr);
hr = IAudioStreamVolume_GetChannelVolume(asv, 0, &vol);
- ok(hr == S_OK, "ASV_GetChannelVolume failed: %08x\n", hr);
ok(hr == S_OK, "ASV_GetChannelVolume failed: %08lx\n", hr); ok(fabsf(vol - 0.2f) < 0.05f, "ASV_GetChannelVolume gave wrong volume: %f\n", vol);
hr = IChannelAudioVolume_GetChannelVolume(cav, 0, &vol);
- ok(hr == S_OK, "CAV_GetChannelVolume failed: %08x\n", hr);
ok(hr == S_OK, "CAV_GetChannelVolume failed: %08lx\n", hr); ok(fabsf(vol - 0.4f) < 0.05f, "CAV_GetChannelVolume gave wrong volume: %f\n", vol);
hr = ISimpleAudioVolume_GetMasterVolume(sav, &vol);
- ok(hr == S_OK, "SAV_GetMasterVolume failed: %08x\n", hr);
ok(hr == S_OK, "SAV_GetMasterVolume failed: %08lx\n", hr); ok(fabsf(vol - 0.6f) < 0.05f, "SAV_GetMasterVolume gave wrong volume: %f\n", vol);
hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER,
@@ -898,28 +898,28 @@ static void test_volume_dependence(void)
hr = IAudioClient_Initialize(ac2, AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_NOPERSIST, 5000000, 0, fmt, &session);
ok(hr == S_OK, "Initialize failed: %08x\n", hr);
ok(hr == S_OK, "Initialize failed: %08lx\n", hr); hr = IAudioClient_GetService(ac2, &IID_IChannelAudioVolume, (void**)&cav2);
ok(hr == S_OK, "GetService failed: %08x\n", hr);
ok(hr == S_OK, "GetService failed: %08lx\n", hr); hr = IAudioClient_GetService(ac2, &IID_IAudioStreamVolume, (void**)&asv2);
ok(hr == S_OK, "GetService failed: %08x\n", hr);
ok(hr == S_OK, "GetService failed: %08lx\n", hr); hr = IChannelAudioVolume_GetChannelVolume(cav2, 0, &vol);
ok(hr == S_OK, "CAV_GetChannelVolume failed: %08x\n", hr);
ok(hr == S_OK, "CAV_GetChannelVolume failed: %08lx\n", hr); ok(fabsf(vol - 0.4f) < 0.05f, "CAV_GetChannelVolume gave wrong volume: %f\n", vol); hr = IAudioStreamVolume_GetChannelVolume(asv2, 0, &vol);
ok(hr == S_OK, "ASV_GetChannelVolume failed: %08x\n", hr);
ok(hr == S_OK, "ASV_GetChannelVolume failed: %08lx\n", hr); ok(vol == 1.f, "ASV_GetChannelVolume gave wrong volume: %f\n", vol); hr = IChannelAudioVolume_GetChannelCount(cav2, &nch);
ok(hr == S_OK, "GetChannelCount failed: %08x\n", hr);
ok(hr == S_OK, "GetChannelCount failed: %08lx\n", hr); ok(nch == fmt->nChannels, "Got wrong channel count, expected %u: %u\n", fmt->nChannels, nch); hr = IAudioStreamVolume_GetChannelCount(asv2, &nch);
ok(hr == S_OK, "GetChannelCount failed: %08x\n", hr);
ok(hr == S_OK, "GetChannelCount failed: %08lx\n", hr); ok(nch == fmt->nChannels, "Got wrong channel count, expected %u: %u\n", fmt->nChannels, nch); IAudioStreamVolume_Release(asv2);
@@ -929,10 +929,10 @@ static void test_volume_dependence(void) skip("Unable to open the same device twice. Skipping session volume control tests\n");
hr = IChannelAudioVolume_SetChannelVolume(cav, 0, 1.f, NULL);
- ok(hr == S_OK, "CAV_SetChannelVolume failed: %08x\n", hr);
ok(hr == S_OK, "CAV_SetChannelVolume failed: %08lx\n", hr);
hr = ISimpleAudioVolume_SetMasterVolume(sav, 1.f, NULL);
- ok(hr == S_OK, "SAV_SetMasterVolume failed: %08x\n", hr);
ok(hr == S_OK, "SAV_SetMasterVolume failed: %08lx\n", hr);
CoTaskMemFree(fmt); ISimpleAudioVolume_Release(sav);
@@ -951,37 +951,37 @@ static void test_marshal(void)
hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ac);
- ok(hr == S_OK, "Activation failed with %08x\n", hr);
ok(hr == S_OK, "Activation failed with %08lx\n", hr); if(hr != S_OK) return;
hr = IAudioClient_GetMixFormat(ac, &pwfx);
- ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr);
ok(hr == S_OK, "GetMixFormat failed: %08lx\n", hr);
hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, 0, pwfx, NULL);
- ok(hr == S_OK, "Initialize failed: %08x\n", hr);
ok(hr == S_OK, "Initialize failed: %08lx\n", hr);
CoTaskMemFree(pwfx);
hr = IAudioClient_GetService(ac, &IID_IAudioCaptureClient, (void**)&cc);
- ok(hr == S_OK, "GetService failed: %08x\n", hr);
ok(hr == S_OK, "GetService failed: %08lx\n", hr); if(hr != S_OK) { IAudioClient_Release(ac); return; }
hr = CreateStreamOnHGlobal(NULL, TRUE, &pStream);
- ok(hr == S_OK, "CreateStreamOnHGlobal failed 0x%08x\n", hr);
ok(hr == S_OK, "CreateStreamOnHGlobal failed 0x%08lx\n", hr);
/* marshal IAudioClient */
hr = CoMarshalInterface(pStream, &IID_IAudioClient, (IUnknown*)ac, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
- ok(hr == S_OK, "CoMarshalInterface IAudioClient failed 0x%08x\n", hr);
ok(hr == S_OK, "CoMarshalInterface IAudioClient failed 0x%08lx\n", hr);
IStream_Seek(pStream, ullZero, STREAM_SEEK_SET, NULL); hr = CoUnmarshalInterface(pStream, &IID_IAudioClient, (void **)&acDest);
- ok(hr == S_OK, "CoUnmarshalInterface IAudioClient failed 0x%08x\n", hr);
- ok(hr == S_OK, "CoUnmarshalInterface IAudioClient failed 0x%08lx\n", hr); if (hr == S_OK) IAudioClient_Release(acDest);
@@ -989,11 +989,11 @@ static void test_marshal(void) /* marshal IAudioCaptureClient */
hr = CoMarshalInterface(pStream, &IID_IAudioCaptureClient, (IUnknown*)cc, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
- ok(hr == S_OK, "CoMarshalInterface IAudioCaptureClient failed 0x%08x\n", hr);
ok(hr == S_OK, "CoMarshalInterface IAudioCaptureClient failed 0x%08lx\n", hr);
IStream_Seek(pStream, ullZero, STREAM_SEEK_SET, NULL); hr = CoUnmarshalInterface(pStream, &IID_IAudioCaptureClient, (void **)&ccDest);
- ok(hr == S_OK, "CoUnmarshalInterface IAudioCaptureClient failed 0x%08x\n", hr);
- ok(hr == S_OK, "CoUnmarshalInterface IAudioCaptureClient failed 0x%08lx\n", hr); if (hr == S_OK) IAudioCaptureClient_Release(ccDest);
@@ -1013,18 +1013,18 @@ START_TEST(capture) hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_INPROC_SERVER, &IID_IMMDeviceEnumerator, (void**)&mme); if (FAILED(hr)) {
skip("mmdevapi not available: 0x%08x\n", hr);
skip("mmdevapi not available: 0x%08lx\n", hr); goto cleanup;
}
hr = IMMDeviceEnumerator_GetDefaultAudioEndpoint(mme, eCapture, eMultimedia, &dev);
- ok(hr == S_OK || hr == E_NOTFOUND, "GetDefaultAudioEndpoint failed: 0x%08x\n", hr);
- ok(hr == S_OK || hr == E_NOTFOUND, "GetDefaultAudioEndpoint failed: 0x%08lx\n", hr); if (hr != S_OK || !dev) { if (hr == E_NOTFOUND) skip("No sound card available\n"); else
skip("GetDefaultAudioEndpoint returns 0x%08x\n", hr);
}skip("GetDefaultAudioEndpoint returns 0x%08lx\n", hr); goto cleanup;
diff --git a/dlls/mmdevapi/tests/dependency.c b/dlls/mmdevapi/tests/dependency.c index 878056506a9..ef99d7bf239 100644 --- a/dlls/mmdevapi/tests/dependency.c +++ b/dlls/mmdevapi/tests/dependency.c @@ -42,25 +42,25 @@ START_TEST(dependency) hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_INPROC_SERVER, &IID_IMMDeviceEnumerator, (void**)&mme); if (FAILED(hr)) {
skip("mmdevapi not available: 0x%08x\n", hr);
skip("mmdevapi not available: 0x%08lx\n", hr); goto cleanup;
}
hr = IMMDeviceEnumerator_GetDefaultAudioEndpoint(mme, eRender, eMultimedia, &dev);
- ok(hr == S_OK || hr == E_NOTFOUND, "GetDefaultAudioEndpoint failed: 0x%08x\n", hr);
- ok(hr == S_OK || hr == E_NOTFOUND, "GetDefaultAudioEndpoint failed: 0x%08lx\n", hr); if (hr != S_OK) { if (hr == E_NOTFOUND) skip("No sound card available\n"); else
skip("GetDefaultAudioEndpoint returns 0x%08x\n", hr);
skip("GetDefaultAudioEndpoint returns 0x%08lx\n", hr); goto cleanup;
}
ok(!GetModuleHandleA("dsound.dll"), "dsound.dll was already loaded!\n");
hr = IMMDevice_Activate(dev, &IID_IDirectSound8, CLSCTX_INPROC_SERVER, NULL, (void**)&ds8);
- ok(hr == S_OK, "Activating ds8 interface failed: 0x%08x\n", hr);
- ok(hr == S_OK, "Activating ds8 interface failed: 0x%08lx\n", hr); if (hr == S_OK) { ok(GetModuleHandleA("dsound.dll") != NULL, "dsound.dll not loaded!\n");
@@ -71,7 +71,7 @@ START_TEST(dependency)
ok(!GetModuleHandleA("quartz.dll"), "quartz.dll was already loaded!\n"); hr = IMMDevice_Activate(dev, &IID_IBaseFilter, CLSCTX_INPROC_SERVER, NULL, (void**)&bf);
- ok(hr == S_OK, "Activating bf failed: 0x%08x\n", hr);
- ok(hr == S_OK, "Activating bf failed: 0x%08lx\n", hr); if (hr == S_OK) { ok(GetModuleHandleA("quartz.dll") != NULL, "quartz.dll not loaded!\n");
@@ -80,7 +80,7 @@ START_TEST(dependency) { CLSID clsid; hr = IBaseFilter_GetClassID(bf, &clsid);
ok(hr == S_OK, "GetClassId failed with 0x%08x\n", hr);
ok(hr == S_OK, "GetClassId failed with 0x%08lx\n", hr); if (hr == S_OK) ok(IsEqualCLSID(&clsid, &CLSID_DSoundRender), "Wrong class id %s\n", wine_dbgstr_guid(&clsid)); }
diff --git a/dlls/mmdevapi/tests/mmdevenum.c b/dlls/mmdevapi/tests/mmdevenum.c index 1fd1c7d4aca..a5b692a53ee 100644 --- a/dlls/mmdevapi/tests/mmdevenum.c +++ b/dlls/mmdevapi/tests/mmdevenum.c @@ -51,17 +51,17 @@ static void test_collection(IMMDeviceEnumerator *mme, IMMDeviceCollection *col) /* collection doesn't keep a ref on parent */ IMMDeviceEnumerator_AddRef(mme); ref = IMMDeviceEnumerator_Release(mme);
- ok(ref == 2, "Reference count on parent is %u\n", ref);
ok(ref == 2, "Reference count on parent is %lu\n", ref);
ref = IMMDeviceCollection_AddRef(col); IMMDeviceCollection_Release(col);
- ok(ref == 2, "Invalid reference count %u on collection\n", ref);
ok(ref == 2, "Invalid reference count %lu on collection\n", ref);
hr = IMMDeviceCollection_QueryInterface(col, &IID_IUnknown, NULL);
- ok(hr == E_POINTER, "Null ppv returns %08x\n", hr);
ok(hr == E_POINTER, "Null ppv returns %08lx\n", hr);
hr = IMMDeviceCollection_QueryInterface(col, &IID_IUnknown, (void**)&unk);
- ok(hr == S_OK, "Cannot query for IID_IUnknown: 0x%08x\n", hr);
- ok(hr == S_OK, "Cannot query for IID_IUnknown: 0x%08lx\n", hr); if (hr == S_OK) { ok((IUnknown*)col == unk, "Pointers are not identical %p/%p/%p\n", col, unk, mme);
@@ -69,24 +69,24 @@ static void test_collection(IMMDeviceEnumerator *mme, IMMDeviceCollection *col) }
hr = IMMDeviceCollection_QueryInterface(col, &IID_IMMDeviceCollection, (void**)&col2);
- ok(hr == S_OK, "Cannot query for IID_IMMDeviceCollection: 0x%08x\n", hr);
ok(hr == S_OK, "Cannot query for IID_IMMDeviceCollection: 0x%08lx\n", hr); if (hr == S_OK) IMMDeviceCollection_Release(col2);
hr = IMMDeviceCollection_QueryInterface(col, &IID_IMMDeviceEnumerator, (void**)&mme2);
- ok(hr == E_NOINTERFACE, "Query for IID_IMMDeviceEnumerator returned: 0x%08x\n", hr);
ok(hr == E_NOINTERFACE, "Query for IID_IMMDeviceEnumerator returned: 0x%08lx\n", hr); if (hr == S_OK) IMMDeviceEnumerator_Release(mme2);
hr = IMMDeviceCollection_GetCount(col, NULL);
- ok(hr == E_POINTER, "GetCount returned 0x%08x\n", hr);
ok(hr == E_POINTER, "GetCount returned 0x%08lx\n", hr);
hr = IMMDeviceCollection_GetCount(col, &numdev);
- ok(hr == S_OK, "GetCount returned 0x%08x\n", hr);
ok(hr == S_OK, "GetCount returned 0x%08lx\n", hr);
dev = (void*)(LONG_PTR)0x12345678; hr = IMMDeviceCollection_Item(col, numdev, &dev);
- ok(hr == E_INVALIDARG, "Asking for too high device returned 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "Asking for too high device returned 0x%08lx\n", hr); ok(dev == NULL, "Returned non-null device\n");
g_num_mmdevs = numdev;
@@ -94,10 +94,10 @@ static void test_collection(IMMDeviceEnumerator *mme, IMMDeviceCollection *col) if (numdev) { hr = IMMDeviceCollection_Item(col, 0, NULL);
ok(hr == E_POINTER, "Query with null pointer returned 0x%08x\n", hr);
ok(hr == E_POINTER, "Query with null pointer returned 0x%08lx\n", hr); hr = IMMDeviceCollection_Item(col, 0, &dev);
ok(hr == S_OK, "Valid Item returned 0x%08x\n", hr);
ok(hr == S_OK, "Valid Item returned 0x%08lx\n", hr); ok(dev != NULL, "Device is null!\n"); if (dev != NULL) {
@@ -113,7 +113,7 @@ static void test_collection(IMMDeviceEnumerator *mme, IMMDeviceCollection *col) trace("Device found: %s\n", temp);
hr = IMMDeviceEnumerator_GetDevice(mme, id, &dev2);
ok(hr == S_OK, "GetDevice failed: %08x\n", hr);
ok(hr == S_OK, "GetDevice failed: %08lx\n", hr); IMMDevice_Release(dev2);
@@ -188,7 +188,7 @@ static HRESULT WINAPI async_activate_ActivateCompleted( hr = IActivateAudioInterfaceAsyncOperation_GetActivateResult(op, &async_activate_test.result_hr, &async_activate_test.result_iface); ok(hr == S_OK,
"%s: GetActivateResult failed: %08x\n",
"%s: GetActivateResult failed: %08lx\n", async_activate_test.msg_pfx, hr);
return S_OK;
@@ -244,16 +244,16 @@ static void test_ActivateAudioInterfaceAsync(void)
EnterCriticalSection(&async_activate_test.lock); hr = pActivateAudioInterfaceAsync(L"winetest_bogus", &IID_IAudioClient3, NULL, &async_activate_done, &async_activate_test.op);
- ok(hr == S_OK, "ActivateAudioInterfaceAsync failed: %08x\n", hr);
ok(hr == S_OK, "ActivateAudioInterfaceAsync failed: %08lx\n", hr); LeaveCriticalSection(&async_activate_test.lock);
IActivateAudioInterfaceAsyncOperation_Release(async_activate_test.op);
dr = WaitForSingleObject(async_activate_test.evt, 1000); /* wait for all refs other than our own to be released */ ok(dr == WAIT_OBJECT_0, "Timed out waiting for async activate to complete\n");
- ok(async_activate_test.ref == 1, "ActivateAudioInterfaceAsync leaked a handler ref: %u\n", async_activate_test.ref);
- ok(async_activate_test.ref == 1, "ActivateAudioInterfaceAsync leaked a handler ref: %lu\n", async_activate_test.ref); ok(async_activate_test.result_hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND),
"mmdevice activation gave wrong result: %08x\n", async_activate_test.result_hr);
ok(async_activate_test.result_iface == NULL, "Got non-NULL iface pointer: %p\n", async_activate_test.result_iface);"mmdevice activation gave wrong result: %08lx\n", async_activate_test.result_hr);
@@ -263,16 +263,16 @@ static void test_ActivateAudioInterfaceAsync(void)
EnterCriticalSection(&async_activate_test.lock); hr = pActivateAudioInterfaceAsync(g_device_path, &IID_IAudioClient3, NULL, &async_activate_done, &async_activate_test.op);
ok(hr == S_OK, "ActivateAudioInterfaceAsync failed: %08x\n", hr);
ok(hr == S_OK, "ActivateAudioInterfaceAsync failed: %08lx\n", hr); LeaveCriticalSection(&async_activate_test.lock); IActivateAudioInterfaceAsyncOperation_Release(async_activate_test.op); dr = WaitForSingleObject(async_activate_test.evt, 1000); ok(dr == WAIT_OBJECT_0, "Timed out waiting for async activate to complete\n");
ok(async_activate_test.ref == 1, "ActivateAudioInterfaceAsync leaked a handler ref: %u\n", async_activate_test.ref);
ok(async_activate_test.ref == 1, "ActivateAudioInterfaceAsync leaked a handler ref: %lu\n", async_activate_test.ref); ok(async_activate_test.result_hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND),
"mmdevice activation gave wrong result: %08x\n", async_activate_test.result_hr);
}"mmdevice activation gave wrong result: %08lx\n", async_activate_test.result_hr); ok(async_activate_test.result_iface == NULL, "Got non-NULL iface pointer: %p\n", async_activate_test.result_iface);
@@ -283,7 +283,7 @@ static void test_ActivateAudioInterfaceAsync(void)
EnterCriticalSection(&async_activate_test.lock); hr = pActivateAudioInterfaceAsync(path, &IID_IAudioClient3, NULL, &async_activate_done, &async_activate_test.op);
- ok(hr == S_OK, "ActivateAudioInterfaceAsync failed: %08x\n", hr);
ok(hr == S_OK, "ActivateAudioInterfaceAsync failed: %08lx\n", hr); LeaveCriticalSection(&async_activate_test.lock);
IActivateAudioInterfaceAsyncOperation_Release(async_activate_test.op);
@@ -294,14 +294,14 @@ static void test_ActivateAudioInterfaceAsync(void) ok(async_activate_test.result_hr == S_OK || (g_num_mmdevs == 0 && async_activate_test.result_hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) || /* no devices */ broken(async_activate_test.result_hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)), /* win8 doesn't support DEVINTERFACE_AUDIO_RENDER */
"mmdevice activation gave wrong result: %08x\n", async_activate_test.result_hr);
"mmdevice activation gave wrong result: %08lx\n", async_activate_test.result_hr);
if(async_activate_test.result_hr == S_OK){ ok(async_activate_test.result_iface != NULL, "Got NULL iface pointer on success?\n");
/* returned iface should be the IID we requested */ hr = IUnknown_QueryInterface(async_activate_test.result_iface, &IID_IAudioClient3, (void**)&ac3);
ok(hr == S_OK, "Failed to query IAudioClient3: %08x\n", hr);
ok(hr == S_OK, "Failed to query IAudioClient3: %08lx\n", hr); ok(async_activate_test.result_iface == (IUnknown*)ac3, "Activated interface other than IAudioClient3!\n"); IAudioClient3_Release(ac3);
@@ -396,17 +396,17 @@ START_TEST(mmdevenum) hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_INPROC_SERVER, &IID_IMMDeviceEnumerator, (void**)&mme); if (FAILED(hr)) {
skip("mmdevapi not available: 0x%08x\n", hr);
skip("mmdevapi not available: 0x%08lx\n", hr); return;
}
/* Odd behavior.. bug? */ ref = IMMDeviceEnumerator_AddRef(mme);
- ok(ref == 3, "Invalid reference count after incrementing: %u\n", ref);
ok(ref == 3, "Invalid reference count after incrementing: %lu\n", ref); IMMDeviceEnumerator_Release(mme);
hr = IMMDeviceEnumerator_QueryInterface(mme, &IID_IUnknown, (void**)&unk);
- ok(hr == S_OK, "returned 0x%08x\n", hr);
ok(hr == S_OK, "returned 0x%08lx\n", hr); if (hr != S_OK) return;
ok( (LONG_PTR)mme == (LONG_PTR)unk, "Pointers are unequal %p/%p\n", unk, mme);
@@ -414,39 +414,39 @@ START_TEST(mmdevenum)
/* Proving that it is static.. */ hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_INPROC_SERVER, &IID_IMMDeviceEnumerator, (void**)&mme2);
- ok(hr == S_OK, "CoCreateInstance failed: 0x%08x\n", hr);
ok(hr == S_OK, "CoCreateInstance failed: 0x%08lx\n", hr); IMMDeviceEnumerator_Release(mme2); ok(mme == mme2, "Pointers are not equal!\n");
hr = IMMDeviceEnumerator_QueryInterface(mme, &IID_IUnknown, NULL);
- ok(hr == E_POINTER, "Null pointer on QueryInterface returned %08x\n", hr);
ok(hr == E_POINTER, "Null pointer on QueryInterface returned %08lx\n", hr);
hr = IMMDeviceEnumerator_QueryInterface(mme, &GUID_NULL, (void**)&unk); ok(!unk, "Unk not reset to null after invalid QI\n");
- ok(hr == E_NOINTERFACE, "Invalid hr %08x returned on IID_NULL\n", hr);
ok(hr == E_NOINTERFACE, "Invalid hr %08lx returned on IID_NULL\n", hr);
hr = IMMDeviceEnumerator_GetDevice(mme, L"notadevice", NULL);
- ok(hr == E_POINTER, "GetDevice gave wrong error: %08x\n", hr);
ok(hr == E_POINTER, "GetDevice gave wrong error: %08lx\n", hr);
hr = IMMDeviceEnumerator_GetDevice(mme, NULL, &dev);
- ok(hr == E_POINTER, "GetDevice gave wrong error: %08x\n", hr);
ok(hr == E_POINTER, "GetDevice gave wrong error: %08lx\n", hr);
hr = IMMDeviceEnumerator_GetDevice(mme, L"notadevice", &dev);
- ok(hr == E_INVALIDARG, "GetDevice gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "GetDevice gave wrong error: %08lx\n", hr);
col = (void*)(LONG_PTR)0x12345678; hr = IMMDeviceEnumerator_EnumAudioEndpoints(mme, 0xffff, DEVICE_STATEMASK_ALL, &col);
- ok(hr == E_INVALIDARG, "Setting invalid data flow returned 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "Setting invalid data flow returned 0x%08lx\n", hr); ok(col == NULL, "Collection pointer non-null on failure\n");
hr = IMMDeviceEnumerator_EnumAudioEndpoints(mme, eAll, DEVICE_STATEMASK_ALL+1, &col);
- ok(hr == E_INVALIDARG, "Setting invalid mask returned 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "Setting invalid mask returned 0x%08lx\n", hr);
hr = IMMDeviceEnumerator_EnumAudioEndpoints(mme, eAll, DEVICE_STATEMASK_ALL, NULL);
- ok(hr == E_POINTER, "Invalid pointer returned: 0x%08x\n", hr);
ok(hr == E_POINTER, "Invalid pointer returned: 0x%08lx\n", hr);
hr = IMMDeviceEnumerator_EnumAudioEndpoints(mme, eAll, DEVICE_STATEMASK_ALL, &col);
- ok(hr == S_OK, "Valid EnumAudioEndpoints returned 0x%08x\n", hr);
- ok(hr == S_OK, "Valid EnumAudioEndpoints returned 0x%08lx\n", hr); if (hr == S_OK) { ok(!!col, "Returned null pointer\n");
@@ -455,28 +455,28 @@ START_TEST(mmdevenum) }
hr = IMMDeviceEnumerator_RegisterEndpointNotificationCallback(mme, NULL);
- ok(hr == E_POINTER, "RegisterEndpointNotificationCallback failed: %08x\n", hr);
ok(hr == E_POINTER, "RegisterEndpointNotificationCallback failed: %08lx\n", hr);
hr = IMMDeviceEnumerator_RegisterEndpointNotificationCallback(mme, ¬if);
- ok(hr == S_OK, "RegisterEndpointNotificationCallback failed: %08x\n", hr);
ok(hr == S_OK, "RegisterEndpointNotificationCallback failed: %08lx\n", hr);
hr = IMMDeviceEnumerator_RegisterEndpointNotificationCallback(mme, ¬if);
- ok(hr == S_OK, "RegisterEndpointNotificationCallback failed: %08x\n", hr);
ok(hr == S_OK, "RegisterEndpointNotificationCallback failed: %08lx\n", hr);
hr = IMMDeviceEnumerator_UnregisterEndpointNotificationCallback(mme, NULL);
- ok(hr == E_POINTER, "UnregisterEndpointNotificationCallback failed: %08x\n", hr);
ok(hr == E_POINTER, "UnregisterEndpointNotificationCallback failed: %08lx\n", hr);
hr = IMMDeviceEnumerator_UnregisterEndpointNotificationCallback(mme, (IMMNotificationClient*)0xdeadbeef);
- ok(hr == E_NOTFOUND, "UnregisterEndpointNotificationCallback failed: %08x\n", hr);
ok(hr == E_NOTFOUND, "UnregisterEndpointNotificationCallback failed: %08lx\n", hr);
hr = IMMDeviceEnumerator_UnregisterEndpointNotificationCallback(mme, ¬if);
- ok(hr == S_OK, "UnregisterEndpointNotificationCallback failed: %08x\n", hr);
ok(hr == S_OK, "UnregisterEndpointNotificationCallback failed: %08lx\n", hr);
hr = IMMDeviceEnumerator_UnregisterEndpointNotificationCallback(mme, ¬if);
- ok(hr == S_OK, "UnregisterEndpointNotificationCallback failed: %08x\n", hr);
ok(hr == S_OK, "UnregisterEndpointNotificationCallback failed: %08lx\n", hr);
hr = IMMDeviceEnumerator_UnregisterEndpointNotificationCallback(mme, ¬if);
- ok(hr == E_NOTFOUND, "UnregisterEndpointNotificationCallback failed: %08x\n", hr);
ok(hr == E_NOTFOUND, "UnregisterEndpointNotificationCallback failed: %08lx\n", hr);
IMMDeviceEnumerator_Release(mme);
diff --git a/dlls/mmdevapi/tests/propstore.c b/dlls/mmdevapi/tests/propstore.c index 8999699fe6b..89eaada5fd7 100644 --- a/dlls/mmdevapi/tests/propstore.c +++ b/dlls/mmdevapi/tests/propstore.c @@ -45,7 +45,7 @@ static void test_propertystore(IPropertyStore *store)
pv.vt = VT_EMPTY; hr = IPropertyStore_GetValue(store, &PKEY_AudioEndpoint_GUID, &pv);
- ok(hr == S_OK, "Failed with %08x\n", hr);
- ok(hr == S_OK, "Failed with %08lx\n", hr); ok(pv.vt == VT_LPWSTR, "Value should be %i, is %i\n", VT_LPWSTR, pv.vt); if (hr == S_OK && pv.vt == VT_LPWSTR) {
@@ -56,19 +56,19 @@ static void test_propertystore(IPropertyStore *store)
pv.vt = VT_EMPTY; hr = IPropertyStore_GetValue(store, (const PROPERTYKEY*)&DEVPKEY_DeviceInterface_FriendlyName, &pv);
- ok(hr == S_OK, "Failed with %08x\n", hr);
ok(hr == S_OK, "Failed with %08lx\n", hr); ok(pv.vt == VT_LPWSTR && pv.pwszVal, "FriendlyName value had wrong type: 0x%x or was NULL\n", pv.vt); PropVariantClear(&pv);
pv.vt = VT_EMPTY; hr = IPropertyStore_GetValue(store, (const PROPERTYKEY*)&DEVPKEY_DeviceInterface_Enabled, &pv);
- ok(hr == S_OK, "Failed with %08x\n", hr);
ok(hr == S_OK, "Failed with %08lx\n", hr); ok(pv.vt == VT_EMPTY, "Key should not be found\n"); PropVariantClear(&pv);
pv.vt = VT_EMPTY; hr = IPropertyStore_GetValue(store, (const PROPERTYKEY*)&DEVPKEY_DeviceInterface_ClassGuid, &pv);
- ok(hr == S_OK, "Failed with %08x\n", hr);
- ok(hr == S_OK, "Failed with %08lx\n", hr); ok(pv.vt == VT_EMPTY, "Key should not be found\n"); PropVariantClear(&pv);
} @@ -84,7 +84,7 @@ static void test_deviceinterface(IPropertyStore *store)
pv.vt = VT_EMPTY; hr = IPropertyStore_GetValue(store, &deviceinterface_key, &pv);
- ok(hr == S_OK, "GetValue failed: %08x\n", hr);
- ok(hr == S_OK, "GetValue failed: %08lx\n", hr); ok(pv.vt == VT_LPWSTR, "Got wrong variant type: 0x%x\n", pv.vt); trace("device interface: %s\n", wine_dbgstr_w(pv.pwszVal)); PropVariantClear(&pv);
@@ -103,12 +103,12 @@ static void test_getat(IPropertyStore *store)
hr = IPropertyStore_GetCount(store, &propcount);
- ok(hr == S_OK, "Failed with %08x\n", hr);
- ok(propcount > 0, "Propcount %d should be greater than zero\n", propcount);
ok(hr == S_OK, "Failed with %08lx\n", hr);
ok(propcount > 0, "Propcount %ld should be greater than zero\n", propcount);
for (prop = 0; prop < propcount; prop++) { hr = IPropertyStore_GetAt(store, prop, &pkey);
- ok(hr == S_OK, "Failed with %08x\n", hr);
- ok(hr == S_OK, "Failed with %08lx\n", hr); if (IsEqualPropertyKey(pkey, DEVPKEY_Device_FriendlyName)) found_name = TRUE; if (IsEqualPropertyKey(pkey, DEVPKEY_Device_DeviceDesc))
@@ -137,7 +137,7 @@ static void test_setvalue_on_wow64(IPropertyStore *store)
pv.vt = VT_EMPTY; hr = IPropertyStore_GetValue(store, &PKEY_AudioEndpoint_GUID, &pv);
- ok(hr == S_OK, "Failed to get Endpoint GUID: %08x\n", hr);
ok(hr == S_OK, "Failed to get Endpoint GUID: %08lx\n", hr);
guidW = pv.pwszVal;
@@ -145,7 +145,7 @@ static void test_setvalue_on_wow64(IPropertyStore *store) pv.ulVal = 0xAB;
hr = IPropertyStore_SetValue(store, &PKEY_Bogus, &pv);
- ok(hr == S_OK || hr == E_ACCESSDENIED, "SetValue failed: %08x\n", hr);
- ok(hr == S_OK || hr == E_ACCESSDENIED, "SetValue failed: %08lx\n", hr); if (hr != S_OK) { win_skip("Missing permission to write to registry\n");
@@ -155,25 +155,25 @@ static void test_setvalue_on_wow64(IPropertyStore *store) pv.ulVal = 0x00;
hr = IPropertyStore_GetValue(store, &PKEY_Bogus, &pv);
- ok(hr == S_OK, "GetValue failed: %08x\n", hr);
- ok(pv.ulVal == 0xAB, "Got wrong value: 0x%x\n", pv.ulVal);
ok(hr == S_OK, "GetValue failed: %08lx\n", hr);
ok(pv.ulVal == 0xAB, "Got wrong value: 0x%lx\n", pv.ulVal);
/* should find the key in 64-bit view */ ret = RegOpenKeyExW(HKEY_LOCAL_MACHINE, software_renderW, 0, KEY_READ|KEY_WOW64_64KEY, &root);
- ok(ret == ERROR_SUCCESS, "Couldn't open mmdevices Render key: %u\n", ret);
ok(ret == ERROR_SUCCESS, "Couldn't open mmdevices Render key: %lu\n", ret);
ret = RegOpenKeyExW(root, guidW, 0, KEY_READ|KEY_WOW64_64KEY, &devkey);
- ok(ret == ERROR_SUCCESS, "Couldn't open mmdevice guid key: %u\n", ret);
ok(ret == ERROR_SUCCESS, "Couldn't open mmdevice guid key: %lu\n", ret);
ret = RegOpenKeyExW(devkey, L"Properties", 0, KEY_READ|KEY_WOW64_64KEY, &props);
- ok(ret == ERROR_SUCCESS, "Couldn't open mmdevice property key: %u\n", ret);
ok(ret == ERROR_SUCCESS, "Couldn't open mmdevice property key: %lu\n", ret);
/* Note: the registry key exists even without calling IPropStore::Commit */ size = sizeof(regval); ret = RegQueryValueExW(props, bogusW, NULL, &type, (LPBYTE)®val, &size);
- ok(ret == ERROR_SUCCESS, "Couldn't get bogus propertykey value: %u\n", ret);
- ok(type == REG_DWORD, "Got wrong value type: %u\n", type);
- ok(regval == 0xAB, "Got wrong value: 0x%x\n", regval);
ok(ret == ERROR_SUCCESS, "Couldn't get bogus propertykey value: %lu\n", ret);
ok(type == REG_DWORD, "Got wrong value type: %lu\n", type);
ok(regval == 0xAB, "Got wrong value: 0x%lx\n", regval);
RegCloseKey(props); RegCloseKey(devkey);
@@ -183,7 +183,7 @@ static void test_setvalue_on_wow64(IPropertyStore *store)
/* should NOT find the key in 32-bit view */ ret = RegOpenKeyExW(HKEY_LOCAL_MACHINE, software_renderW, 0, KEY_READ, &root);
- ok(ret == ERROR_FILE_NOT_FOUND, "Wrong error when opening mmdevices Render key: %u\n", ret);
- ok(ret == ERROR_FILE_NOT_FOUND, "Wrong error when opening mmdevices Render key: %lu\n", ret);
}
START_TEST(propstore) @@ -204,39 +204,39 @@ START_TEST(propstore) hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_INPROC_SERVER, &IID_IMMDeviceEnumerator, (void**)&mme); if (FAILED(hr)) {
skip("mmdevapi not available: 0x%08x\n", hr);
skip("mmdevapi not available: 0x%08lx\n", hr); goto cleanup;
}
hr = IMMDeviceEnumerator_GetDefaultAudioEndpoint(mme, eRender, eMultimedia, &dev);
- ok(hr == S_OK || hr == E_NOTFOUND, "GetDefaultAudioEndpoint failed: 0x%08x\n", hr);
- ok(hr == S_OK || hr == E_NOTFOUND, "GetDefaultAudioEndpoint failed: 0x%08lx\n", hr); if (hr != S_OK) { if (hr == E_NOTFOUND) skip("No sound card available\n"); else
skip("GetDefaultAudioEndpoint returns 0x%08x\n", hr);
} store = NULL; hr = IMMDevice_OpenPropertyStore(dev, 3, &store);skip("GetDefaultAudioEndpoint returns 0x%08lx\n", hr); goto cleanup;
- ok(hr == E_INVALIDARG, "Wrong hr returned: %08x\n", hr);
- ok(hr == E_INVALIDARG, "Wrong hr returned: %08lx\n", hr); if (hr != S_OK) /* It seems on windows returning with E_INVALIDARG doesn't * set store to NULL, so just don't set store to non-null * before calling this function */
ok(!store, "Store set to non-NULL on failure: %p/%08x\n", store, hr);
else if (store) IPropertyStore_Release(store); hr = IMMDevice_OpenPropertyStore(dev, STGM_READ, NULL);ok(!store, "Store set to non-NULL on failure: %p/%08lx\n", store, hr);
- ok(hr == E_POINTER, "Wrong hr returned: %08x\n", hr);
ok(hr == E_POINTER, "Wrong hr returned: %08lx\n", hr);
store = NULL; hr = IMMDevice_OpenPropertyStore(dev, STGM_READWRITE, &store); if(hr == E_ACCESSDENIED) hr = IMMDevice_OpenPropertyStore(dev, STGM_READ, &store);
- ok(hr == S_OK, "Opening valid store returned %08x\n", hr);
- ok(hr == S_OK, "Opening valid store returned %08lx\n", hr); if (store) { test_propertystore(store);
diff --git a/dlls/mmdevapi/tests/render.c b/dlls/mmdevapi/tests/render.c index 6b77edc569e..4e19b91c5f5 100644 --- a/dlls/mmdevapi/tests/render.c +++ b/dlls/mmdevapi/tests/render.c @@ -104,28 +104,28 @@ static void test_uninitialized(IAudioClient *ac) IUnknown *unk;
hr = IAudioClient_GetBufferSize(ac, &num);
- ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized GetBufferSize call returns %08x\n", hr);
ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized GetBufferSize call returns %08lx\n", hr);
hr = IAudioClient_GetStreamLatency(ac, &t1);
- ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized GetStreamLatency call returns %08x\n", hr);
ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized GetStreamLatency call returns %08lx\n", hr);
hr = IAudioClient_GetCurrentPadding(ac, &num);
- ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized GetCurrentPadding call returns %08x\n", hr);
ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized GetCurrentPadding call returns %08lx\n", hr);
hr = IAudioClient_Start(ac);
- ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized Start call returns %08x\n", hr);
ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized Start call returns %08lx\n", hr);
hr = IAudioClient_Stop(ac);
- ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized Stop call returns %08x\n", hr);
ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized Stop call returns %08lx\n", hr);
hr = IAudioClient_Reset(ac);
- ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized Reset call returns %08x\n", hr);
ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized Reset call returns %08lx\n", hr);
hr = IAudioClient_SetEventHandle(ac, handle);
- ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized SetEventHandle call returns %08x\n", hr);
ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized SetEventHandle call returns %08lx\n", hr);
hr = IAudioClient_GetService(ac, &IID_IAudioStreamVolume, (void**)&unk);
- ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized GetService call returns %08x\n", hr);
ok(hr == AUDCLNT_E_NOT_INITIALIZED, "Uninitialized GetService call returns %08lx\n", hr);
CloseHandle(handle);
} @@ -148,7 +148,7 @@ static void test_audioclient(void) NULL, (void**)&ac3); ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* win8 */,
"IAudioClient3 Activation failed with %08x\n", hr);
if(hr == S_OK) IAudioClient3_Release(ac3);"IAudioClient3 Activation failed with %08lx\n", hr);
@@ -156,62 +156,62 @@ static void test_audioclient(void) NULL, (void**)&ac2); ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* win7 */,
"IAudioClient2 Activation failed with %08x\n", hr);
"IAudioClient2 Activation failed with %08lx\n", hr);
if(hr == S_OK) IAudioClient2_Release(ac2);
hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ac);
- ok(hr == S_OK, "Activation failed with %08x\n", hr);
ok(hr == S_OK, "Activation failed with %08lx\n", hr); if(hr != S_OK) return;
handle = CreateEventW(NULL, FALSE, FALSE, NULL);
hr = IAudioClient_QueryInterface(ac, &IID_IUnknown, NULL);
- ok(hr == E_POINTER, "QueryInterface(NULL) returned %08x\n", hr);
ok(hr == E_POINTER, "QueryInterface(NULL) returned %08lx\n", hr);
unk = (void*)(LONG_PTR)0x12345678; hr = IAudioClient_QueryInterface(ac, &IID_NULL, (void**)&unk);
- ok(hr == E_NOINTERFACE, "QueryInterface(IID_NULL) returned %08x\n", hr);
ok(hr == E_NOINTERFACE, "QueryInterface(IID_NULL) returned %08lx\n", hr); ok(!unk, "QueryInterface(IID_NULL) returned non-null pointer %p\n", unk);
hr = IAudioClient_QueryInterface(ac, &IID_IUnknown, (void**)&unk);
- ok(hr == S_OK, "QueryInterface(IID_IUnknown) returned %08x\n", hr);
- ok(hr == S_OK, "QueryInterface(IID_IUnknown) returned %08lx\n", hr); if (unk) { ref = IUnknown_Release(unk);
ok(ref == 1, "Released count is %u\n", ref);
ok(ref == 1, "Released count is %lu\n", ref);
}
hr = IAudioClient_QueryInterface(ac, &IID_IAudioClient, (void**)&unk);
- ok(hr == S_OK, "QueryInterface(IID_IAudioClient) returned %08x\n", hr);
- ok(hr == S_OK, "QueryInterface(IID_IAudioClient) returned %08lx\n", hr); if (unk) { ref = IUnknown_Release(unk);
ok(ref == 1, "Released count is %u\n", ref);
ok(ref == 1, "Released count is %lu\n", ref);
}
hr = IAudioClient_GetDevicePeriod(ac, NULL, NULL);
- ok(hr == E_POINTER, "Invalid GetDevicePeriod call returns %08x\n", hr);
ok(hr == E_POINTER, "Invalid GetDevicePeriod call returns %08lx\n", hr);
hr = IAudioClient_GetDevicePeriod(ac, &t1, NULL);
- ok(hr == S_OK, "Valid GetDevicePeriod call returns %08x\n", hr);
ok(hr == S_OK, "Valid GetDevicePeriod call returns %08lx\n", hr);
hr = IAudioClient_GetDevicePeriod(ac, NULL, &t2);
- ok(hr == S_OK, "Valid GetDevicePeriod call returns %08x\n", hr);
ok(hr == S_OK, "Valid GetDevicePeriod call returns %08lx\n", hr);
hr = IAudioClient_GetDevicePeriod(ac, &t1, &t2);
- ok(hr == S_OK, "Valid GetDevicePeriod call returns %08x\n", hr);
ok(hr == S_OK, "Valid GetDevicePeriod call returns %08lx\n", hr); trace("Returned periods: %u.%04u ms %u.%04u ms\n", (UINT)(t1/10000), (UINT)(t1 % 10000), (UINT)(t2/10000), (UINT)(t2 % 10000));
hr = IAudioClient_GetMixFormat(ac, NULL);
- ok(hr == E_POINTER, "GetMixFormat returns %08x\n", hr);
ok(hr == E_POINTER, "GetMixFormat returns %08lx\n", hr);
hr = IAudioClient_GetMixFormat(ac, &pwfx);
- ok(hr == S_OK, "Valid GetMixFormat returns %08x\n", hr);
ok(hr == S_OK, "Valid GetMixFormat returns %08lx\n", hr);
if (hr == S_OK) {
@@ -219,7 +219,7 @@ static void test_audioclient(void) trace("Tag: %04x\n", pwfx->wFormatTag); trace("bits: %u\n", pwfx->wBitsPerSample); trace("chan: %u\n", pwfx->nChannels);
trace("rate: %u\n", pwfx->nSamplesPerSec);
trace("rate: %lu\n", pwfx->nSamplesPerSec); trace("align: %u\n", pwfx->nBlockAlign); trace("extra: %u\n", pwfx->cbSize); ok(pwfx->wFormatTag == WAVE_FORMAT_EXTENSIBLE, "wFormatTag is %x\n", pwfx->wFormatTag);
@@ -227,7 +227,7 @@ static void test_audioclient(void) { WAVEFORMATEXTENSIBLE *pwfxe = (void*)pwfx; trace("Res: %u\n", pwfxe->Samples.wReserved);
trace("Mask: %x\n", pwfxe->dwChannelMask);
trace("Mask: %lx\n", pwfxe->dwChannelMask); trace("Alg: %s\n", IsEqualGUID(&pwfxe->SubFormat, &KSDATAFORMAT_SUBTYPE_PCM)?"PCM": (IsEqualGUID(&pwfxe->SubFormat,
@@ -237,30 +237,30 @@ static void test_audioclient(void)
pwfxe->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_SHARED, pwfx, &pwfx2);
ok(hr == S_OK, "Valid IsFormatSupported(Shared) call returns %08x\n", hr);
ok(hr == S_OK, "Valid IsFormatSupported(Shared) call returns %08lx\n", hr); ok(pwfx2 == NULL, "pwfx2 is non-null\n"); CoTaskMemFree(pwfx2); } hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_SHARED, pwfx, &pwfx2);
ok(hr == S_OK, "Valid IsFormatSupported(Shared) call returns %08x\n", hr);
ok(hr == S_OK, "Valid IsFormatSupported(Shared) call returns %08lx\n", hr); ok(pwfx2 == NULL, "pwfx2 is non-null\n"); CoTaskMemFree(pwfx2); hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_SHARED, NULL, NULL);
ok(hr == E_POINTER, "IsFormatSupported(NULL) call returns %08x\n", hr);
ok(hr == E_POINTER, "IsFormatSupported(NULL) call returns %08lx\n", hr); hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_SHARED, pwfx, NULL);
ok(hr == E_POINTER, "IsFormatSupported(Shared,NULL) call returns %08x\n", hr);
ok(hr == E_POINTER, "IsFormatSupported(Shared,NULL) call returns %08lx\n", hr); hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_EXCLUSIVE, pwfx, NULL); ok(hr == S_OK || hr == AUDCLNT_E_UNSUPPORTED_FORMAT || hr == AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED,
"IsFormatSupported(Exclusive) call returns %08x\n", hr);
"IsFormatSupported(Exclusive) call returns %08lx\n", hr); hexcl = hr; pwfx2 = (WAVEFORMATEX*)0xDEADF00D; hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_EXCLUSIVE, pwfx, &pwfx2);
ok(hr == hexcl, "IsFormatSupported(Exclusive) call returns %08x\n", hr);
ok(hr == hexcl, "IsFormatSupported(Exclusive) call returns %08lx\n", hr); ok(pwfx2 == NULL, "pwfx2 non-null on exclusive IsFormatSupported\n"); if (hexcl != AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED)
@@ -269,20 +269,20 @@ static void test_audioclient(void) hr = IAudioClient_IsFormatSupported(ac, 0xffffffff, pwfx, NULL); ok(hr == E_INVALIDARG/*w32*/ || broken(hr == AUDCLNT_E_UNSUPPORTED_FORMAT/*w64 response from exclusive mode driver */),
"IsFormatSupported(0xffffffff) call returns %08x\n", hr);
"IsFormatSupported(0xffffffff) call returns %08lx\n", hr);
}
hr = IAudioClient_QueryInterface(ac, &IID_IAudioClient2, (void**)&ac2); if (hr == S_OK) { hr = IAudioClient2_IsOffloadCapable(ac2, AudioCategory_BackgroundCapableMedia, NULL);
ok(hr == E_INVALIDARG, "IsOffloadCapable gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "IsOffloadCapable gave wrong error: %08lx\n", hr); hr = IAudioClient2_IsOffloadCapable(ac2, AudioCategory_BackgroundCapableMedia, &offload_capable);
ok(hr == S_OK, "IsOffloadCapable failed: %08x\n", hr);
ok(hr == S_OK, "IsOffloadCapable failed: %08lx\n", hr); hr = IAudioClient2_SetClientProperties(ac2, NULL);
ok(hr == E_POINTER, "SetClientProperties with NULL props gave wrong error: %08x\n", hr);
ok(hr == E_POINTER, "SetClientProperties with NULL props gave wrong error: %08lx\n", hr); /* invalid cbSize */ client_props.cbSize = 0;
@@ -291,7 +291,7 @@ static void test_audioclient(void) client_props.Options = 0;
hr = IAudioClient2_SetClientProperties(ac2, &client_props);
ok(hr == E_INVALIDARG, "SetClientProperties with invalid cbSize gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "SetClientProperties with invalid cbSize gave wrong error: %08lx\n", hr); /* offload consistency */ client_props.cbSize = sizeof(client_props) - sizeof(client_props.Options);
@@ -299,21 +299,21 @@ static void test_audioclient(void)
hr = IAudioClient2_SetClientProperties(ac2, &client_props); if(!offload_capable)
ok(hr == AUDCLNT_E_ENDPOINT_OFFLOAD_NOT_CAPABLE, "SetClientProperties(offload) gave wrong error: %08x\n", hr);
ok(hr == AUDCLNT_E_ENDPOINT_OFFLOAD_NOT_CAPABLE, "SetClientProperties(offload) gave wrong error: %08lx\n", hr); else
ok(hr == S_OK, "SetClientProperties(offload) failed: %08x\n", hr);
ok(hr == S_OK, "SetClientProperties(offload) failed: %08lx\n", hr); /* disable offload */ client_props.bIsOffload = FALSE; hr = IAudioClient2_SetClientProperties(ac2, &client_props);
ok(hr == S_OK, "SetClientProperties failed: %08x\n", hr);
ok(hr == S_OK, "SetClientProperties failed: %08lx\n", hr); /* Options field added in Win 8.1 */ client_props.cbSize = sizeof(client_props); hr = IAudioClient2_SetClientProperties(ac2, &client_props); ok(hr == S_OK || broken(hr == E_INVALIDARG) /* <= win8 */,
"SetClientProperties failed: %08x\n", hr);
"SetClientProperties failed: %08lx\n", hr); IAudioClient2_Release(ac2);
}
@@ -323,7 +323,7 @@ static void test_audioclient(void) hr = IAudioClient_QueryInterface(ac, &IID_IAudioClient3, (void**)&ac3); ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* win8 */,
"Failed to query IAudioClient3 interface: %08x\n", hr);
"Failed to query IAudioClient3 interface: %08lx\n", hr);
if(hr == S_OK) IAudioClient3_Release(ac3);
@@ -332,42 +332,42 @@ static void test_audioclient(void)
hr = IAudioClient_Initialize(ac, 3, 0, 5000000, 0, pwfx, NULL); ok(broken(hr == AUDCLNT_E_NOT_INITIALIZED) || /* <= win8 */
hr == E_INVALIDARG, "Initialize with invalid sharemode returns %08x\n", hr);
hr == E_INVALIDARG, "Initialize with invalid sharemode returns %08lx\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);
hr == AUDCLNT_E_INVALID_STREAM_FLAG, "Initialize with invalid flags returns %08lx\n", hr);
/* A period != 0 is ignored and the call succeeds. * Since we can only initialize successfully once, skip those tests. */ hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, 0, NULL, NULL);
- ok(hr == E_POINTER, "Initialize with null format returns %08x\n", hr);
ok(hr == E_POINTER, "Initialize with null format returns %08lx\n", hr);
hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0, 0, 0, pwfx, NULL);
- ok(hr == S_OK, "Initialize with 0 buffer size returns %08x\n", hr);
ok(hr == S_OK, "Initialize with 0 buffer size returns %08lx\n", hr); if(hr == S_OK){ UINT32 num;
hr = IAudioClient_GetBufferSize(ac, &num);
ok(hr == S_OK, "GetBufferSize from duration 0 returns %08x\n", hr);
ok(hr == S_OK, "GetBufferSize from duration 0 returns %08lx\n", hr); if(hr == S_OK) trace("Initialize(duration=0) GetBufferSize is %u\n", num);
}
hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, 0, pwfx, NULL);
- ok(hr == AUDCLNT_E_ALREADY_INITIALIZED, "Calling Initialize twice returns %08x\n", hr);
ok(hr == AUDCLNT_E_ALREADY_INITIALIZED, "Calling Initialize twice returns %08lx\n", hr);
hr = IAudioClient_Start(ac); ok(hr == S_OK || broken(hr == AUDCLNT_E_DEVICE_INVALIDATED), /* Win10 >= 1607 */
"Start on a doubly initialized stream returns %08x\n", hr);
"Start on a doubly initialized stream returns %08lx\n", hr);
IAudioClient_Release(ac);
hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ac);
- ok(hr == S_OK, "Activation failed with %08x\n", hr);
ok(hr == S_OK, "Activation failed with %08lx\n", hr);
if(pwfx->wFormatTag == WAVE_FORMAT_EXTENSIBLE){ WAVEFORMATEXTENSIBLE *fmtex = (WAVEFORMATEXTENSIBLE*)pwfx;
@@ -379,83 +379,83 @@ static void test_audioclient(void)
hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, 0, pwfx, NULL); ok(hr == S_OK ||
hr == AUDCLNT_E_UNSUPPORTED_FORMAT /* win10 */, "Initialize(dwChannelMask = 0xffff) returns %08x\n", hr);
hr == AUDCLNT_E_UNSUPPORTED_FORMAT /* win10 */, "Initialize(dwChannelMask = 0xffff) returns %08lx\n", hr); IAudioClient_Release(ac); hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ac);
ok(hr == S_OK, "Activation failed with %08x\n", hr);
ok(hr == S_OK, "Activation failed with %08lx\n", hr); fmtex->dwChannelMask = 0; hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_SHARED, pwfx, &fmt2); ok(hr == S_OK || broken(hr == S_FALSE /* w7 Realtek HDA */),
"IsFormatSupported(dwChannelMask = 0) call returns %08x\n", hr);
"IsFormatSupported(dwChannelMask = 0) call returns %08lx\n", hr); ok(fmtex->dwChannelMask == 0, "Passed format was modified\n"); CoTaskMemFree(fmt2); hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, 0, pwfx, NULL);
ok(hr == S_OK, "Initialize(dwChannelMask = 0) returns %08x\n", hr);
ok(hr == S_OK, "Initialize(dwChannelMask = 0) returns %08lx\n", hr); IAudioClient_Release(ac); hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ac);
ok(hr == S_OK, "Activation failed with %08x\n", hr);
ok(hr == S_OK, "Activation failed with %08lx\n", hr); CoTaskMemFree(pwfx); hr = IAudioClient_GetMixFormat(ac, &pwfx);
ok(hr == S_OK, "Valid GetMixFormat returns %08x\n", hr);
ok(hr == S_OK, "Valid GetMixFormat returns %08lx\n", hr);
}else skip("Skipping dwChannelMask tests\n");
hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, 0, pwfx, NULL);
- ok(hr == S_OK, "Valid Initialize returns %08x\n", hr);
ok(hr == S_OK, "Valid Initialize returns %08lx\n", hr); if (hr != S_OK) goto cleanup;
hr = IAudioClient_GetStreamLatency(ac, NULL);
- ok(hr == E_POINTER, "GetStreamLatency(NULL) call returns %08x\n", hr);
ok(hr == E_POINTER, "GetStreamLatency(NULL) call returns %08lx\n", hr);
hr = IAudioClient_GetStreamLatency(ac, &t2);
- ok(hr == S_OK, "Valid GetStreamLatency call returns %08x\n", hr);
- ok(hr == S_OK, "Valid GetStreamLatency call returns %08lx\n", hr); trace("Returned latency: %u.%04u ms\n", (UINT)(t2/10000), (UINT)(t2 % 10000)); ok(t2 >= t1 || broken(t2 >= t1/2 && pwfx->nSamplesPerSec > 48000) || broken(t2 == 0) /* (!) win10 */,
"Latency < default period, delta %dus (%s vs %s)\n",
"Latency < default period, delta %ldus (%s vs %s)\n", (LONG)((t2-t1)/10), wine_dbgstr_longlong(t2), wine_dbgstr_longlong(t1));
/* Native appears to add the engine period to the HW latency in shared mode */ if(t2 == 0) win10 = TRUE;
hr = IAudioClient_SetEventHandle(ac, NULL);
- ok(hr == E_INVALIDARG, "SetEventHandle(NULL) returns %08x\n", hr);
ok(hr == E_INVALIDARG, "SetEventHandle(NULL) returns %08lx\n", hr);
hr = IAudioClient_SetEventHandle(ac, handle); ok(hr == AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED || broken(hr == HRESULT_FROM_WIN32(ERROR_INVALID_NAME)) || broken(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) /* Some 2k8 */ || broken(hr == HRESULT_FROM_WIN32(ERROR_BAD_PATHNAME)) /* Some Vista */
, "SetEventHandle returns %08x\n", hr);
, "SetEventHandle returns %08lx\n", hr);
hr = IAudioClient_Reset(ac);
- ok(hr == S_OK, "Reset on an initialized stream returns %08x\n", hr);
ok(hr == S_OK, "Reset on an initialized stream returns %08lx\n", hr);
hr = IAudioClient_Reset(ac);
- ok(hr == S_OK, "Reset on an already reset stream returns %08x\n", hr);
ok(hr == S_OK, "Reset on an already reset stream returns %08lx\n", hr);
hr = IAudioClient_Stop(ac);
- ok(hr == S_FALSE, "Stop on a stopped stream returns %08x\n", hr);
ok(hr == S_FALSE, "Stop on a stopped stream returns %08lx\n", hr);
hr = IAudioClient_Start(ac);
- ok(hr == S_OK, "Start on a stopped stream returns %08x\n", hr);
ok(hr == S_OK, "Start on a stopped stream returns %08lx\n", hr);
hr = IAudioClient_Start(ac);
- ok(hr == AUDCLNT_E_NOT_STOPPED, "Start twice returns %08x\n", hr);
- ok(hr == AUDCLNT_E_NOT_STOPPED, "Start twice returns %08lx\n", hr);
cleanup: IAudioClient_Release(ac); @@ -476,12 +476,12 @@ static void test_formats(AUDCLNT_SHAREMODE mode) for(i = 0; i < ARRAY_SIZE(win_formats); i++) { hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ac);
ok(hr == S_OK, "Activation failed with %08x\n", hr);
ok(hr == S_OK, "Activation failed with %08lx\n", hr); if(hr != S_OK) continue; hr = IAudioClient_GetMixFormat(ac, &pwfx);
ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr);
ok(hr == S_OK, "GetMixFormat failed: %08lx\n", hr); fmt.nSamplesPerSec = win_formats[i][0]; fmt.wBitsPerSample = win_formats[i][1];
@@ -498,10 +498,10 @@ static void test_formats(AUDCLNT_SHAREMODE mode) /* 5:1 card exception when asked for 1 channel at mixer rate */ pwfx->nChannels > 2 && fmt.nSamplesPerSec == pwfx->nSamplesPerSec) : (hr == AUDCLNT_E_UNSUPPORTED_FORMAT || hr == hexcl)),
"IsFormatSupported(%d, %ux%2ux%u) returns %08x\n", mode,
"IsFormatSupported(%d, %lux%2ux%u) returns %08lx\n", mode, fmt.nSamplesPerSec, fmt.wBitsPerSample, fmt.nChannels, hr); if (hr == S_OK)
trace("IsSupported(%s, %ux%2ux%u)\n",
trace("IsSupported(%s, %lux%2ux%u)\n", mode == AUDCLNT_SHAREMODE_SHARED ? "shared " : "exclus.", fmt.nSamplesPerSec, fmt.wBitsPerSample, fmt.nChannels);
@@ -511,31 +511,31 @@ static void test_formats(AUDCLNT_SHAREMODE mode) && fmt.nChannels == pwfx->nChannels) ok(hr == S_OK, "Varying BitsPerSample %u\n", fmt.wBitsPerSample);
ok((hr == S_FALSE)^(pwfx2 == NULL), "hr %x<->suggest %p\n", hr, pwfx2);
ok((hr == S_FALSE)^(pwfx2 == NULL), "hr %lx<->suggest %p\n", hr, pwfx2); if (pwfx2 == (WAVEFORMATEX*)0xDEADF00D) pwfx2 = NULL; /* broken in Wine < 1.3.28 */ if (pwfx2) { ok(pwfx2->nSamplesPerSec == pwfx->nSamplesPerSec && pwfx2->nChannels == pwfx->nChannels && pwfx2->wBitsPerSample == pwfx->wBitsPerSample,
"Suggestion %ux%2ux%u differs from GetMixFormat\n",
"Suggestion %lux%2ux%u differs from GetMixFormat\n", pwfx2->nSamplesPerSec, pwfx2->wBitsPerSample, pwfx2->nChannels); } /* Vista returns E_INVALIDARG upon AUDCLNT_STREAMFLAGS_RATEADJUST */ hr = IAudioClient_Initialize(ac, mode, 0, 5000000, 0, &fmt, NULL); if ((hrs == S_OK) ^ (hr == S_OK))
trace("Initialize (%s, %ux%2ux%u) returns %08x unlike IsFormatSupported\n",
trace("Initialize (%s, %lux%2ux%u) returns %08lx unlike IsFormatSupported\n", mode == AUDCLNT_SHAREMODE_SHARED ? "shared " : "exclus.", fmt.nSamplesPerSec, fmt.wBitsPerSample, fmt.nChannels, hr); if (mode == AUDCLNT_SHAREMODE_SHARED) ok(hrs == S_OK ? hr == S_OK : hr == AUDCLNT_E_UNSUPPORTED_FORMAT,
"Initialize(shared, %ux%2ux%u) returns %08x\n",
"Initialize(shared, %lux%2ux%u) returns %08lx\n", fmt.nSamplesPerSec, fmt.wBitsPerSample, fmt.nChannels, hr); else if (hrs == AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED) /* Unsupported format implies "create failed" and shadows "not allowed" */ ok(hrs == hexcl && (hr == AUDCLNT_E_ENDPOINT_CREATE_FAILED || hr == hrs),
"Initialize(noexcl., %ux%2ux%u) returns %08x(%08x)\n",
"Initialize(noexcl., %lux%2ux%u) returns %08lx(%08lx)\n", fmt.nSamplesPerSec, fmt.wBitsPerSample, fmt.nChannels, hr, hrs); else /* On testbot 48000x16x1 claims support, but does not Initialize.
@@ -546,7 +546,7 @@ static void test_formats(AUDCLNT_SHAREMODE mode) broken(hr == S_OK && ((fmt.nChannels == 1 && fmt.wBitsPerSample == 16) || (fmt.nSamplesPerSec == 12000 || fmt.nSamplesPerSec == 96000))),
"Initialize(exclus., %ux%2ux%u) returns %08x\n",
"Initialize(exclus., %lux%2ux%u) returns %08lx\n", fmt.nSamplesPerSec, fmt.wBitsPerSample, fmt.nChannels, hr); /* Bug in native (Vista/w2k8/w7): after Initialize failed, better
@@ -576,21 +576,21 @@ static void test_references(void) /* IAudioRenderClient */ hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ac);
- ok(hr == S_OK, "Activation failed with %08x\n", hr);
ok(hr == S_OK, "Activation failed with %08lx\n", hr); if(hr != S_OK) return;
hr = IAudioClient_GetMixFormat(ac, &pwfx);
- ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr);
ok(hr == S_OK, "GetMixFormat failed: %08lx\n", hr);
hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, 0, pwfx, NULL);
- ok(hr == S_OK, "Initialize failed: %08x\n", hr);
ok(hr == S_OK, "Initialize failed: %08lx\n", hr);
CoTaskMemFree(pwfx);
hr = IAudioClient_GetService(ac, &IID_IAudioRenderClient, (void**)&rc);
- ok(hr == S_OK, "GetService failed: %08x\n", hr);
- ok(hr == S_OK, "GetService failed: %08lx\n", hr); if(hr != S_OK) { IAudioClient_Release(ac); return;
@@ -598,100 +598,100 @@ static void test_references(void)
IAudioRenderClient_AddRef(rc); ref = IAudioRenderClient_Release(rc);
- ok(ref != 0, "RenderClient_Release gave wrong refcount: %u\n", ref);
ok(ref != 0, "RenderClient_Release gave wrong refcount: %lu\n", ref);
ref = IAudioClient_Release(ac);
- ok(ref != 0, "Client_Release gave wrong refcount: %u\n", ref);
ok(ref != 0, "Client_Release gave wrong refcount: %lu\n", ref);
ref = IAudioRenderClient_Release(rc);
- ok(ref == 0, "RenderClient_Release gave wrong refcount: %u\n", ref);
ok(ref == 0, "RenderClient_Release gave wrong refcount: %lu\n", ref);
/* ISimpleAudioVolume */ hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ac);
- ok(hr == S_OK, "Activation failed with %08x\n", hr);
ok(hr == S_OK, "Activation failed with %08lx\n", hr); if(hr != S_OK) return;
hr = IAudioClient_GetMixFormat(ac, &pwfx);
- ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr);
ok(hr == S_OK, "GetMixFormat failed: %08lx\n", hr);
hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, 0, pwfx, NULL);
- ok(hr == S_OK, "Initialize failed: %08x\n", hr);
ok(hr == S_OK, "Initialize failed: %08lx\n", hr);
CoTaskMemFree(pwfx);
hr = IAudioClient_GetService(ac, &IID_ISimpleAudioVolume, (void**)&sav);
- ok(hr == S_OK, "GetService failed: %08x\n", hr);
ok(hr == S_OK, "GetService failed: %08lx\n", hr);
ISimpleAudioVolume_AddRef(sav); ref = ISimpleAudioVolume_Release(sav);
- ok(ref != 0, "SimpleAudioVolume_Release gave wrong refcount: %u\n", ref);
ok(ref != 0, "SimpleAudioVolume_Release gave wrong refcount: %lu\n", ref);
ref = IAudioClient_Release(ac);
- ok(ref != 0, "Client_Release gave wrong refcount: %u\n", ref);
ok(ref != 0, "Client_Release gave wrong refcount: %lu\n", ref);
ref = ISimpleAudioVolume_Release(sav);
- ok(ref == 0, "SimpleAudioVolume_Release gave wrong refcount: %u\n", ref);
ok(ref == 0, "SimpleAudioVolume_Release gave wrong refcount: %lu\n", ref);
/* IAudioClock */ hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ac);
- ok(hr == S_OK, "Activation failed with %08x\n", hr);
ok(hr == S_OK, "Activation failed with %08lx\n", hr); if(hr != S_OK) return;
hr = IAudioClient_GetMixFormat(ac, &pwfx);
- ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr);
ok(hr == S_OK, "GetMixFormat failed: %08lx\n", hr);
hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, 0, pwfx, NULL);
- ok(hr == S_OK, "Initialize failed: %08x\n", hr);
ok(hr == S_OK, "Initialize failed: %08lx\n", hr);
CoTaskMemFree(pwfx);
hr = IAudioClient_GetService(ac, &IID_IAudioClock, (void**)&acl);
- ok(hr == S_OK, "GetService failed: %08x\n", hr);
ok(hr == S_OK, "GetService failed: %08lx\n", hr);
IAudioClock_AddRef(acl); ref = IAudioClock_Release(acl);
- ok(ref != 0, "AudioClock_Release gave wrong refcount: %u\n", ref);
ok(ref != 0, "AudioClock_Release gave wrong refcount: %lu\n", ref);
ref = IAudioClient_Release(ac);
- ok(ref != 0, "Client_Release gave wrong refcount: %u\n", ref);
ok(ref != 0, "Client_Release gave wrong refcount: %lu\n", ref);
ref = IAudioClock_Release(acl);
- ok(ref == 0, "AudioClock_Release gave wrong refcount: %u\n", ref);
ok(ref == 0, "AudioClock_Release gave wrong refcount: %lu\n", ref);
/* IAudioStreamVolume */ hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ac);
- ok(hr == S_OK, "Activation failed with %08x\n", hr);
ok(hr == S_OK, "Activation failed with %08lx\n", hr); if(hr != S_OK) return;
hr = IAudioClient_GetMixFormat(ac, &pwfx);
- ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr);
ok(hr == S_OK, "GetMixFormat failed: %08lx\n", hr);
hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, 0, pwfx, NULL);
- ok(hr == S_OK, "Initialize failed: %08x\n", hr);
ok(hr == S_OK, "Initialize failed: %08lx\n", hr);
CoTaskMemFree(pwfx);
hr = IAudioClient_GetService(ac, &IID_IAudioStreamVolume, (void**)&asv);
- ok(hr == S_OK, "GetService failed: %08x\n", hr);
ok(hr == S_OK, "GetService failed: %08lx\n", hr);
IAudioStreamVolume_AddRef(asv); ref = IAudioStreamVolume_Release(asv);
- ok(ref != 0, "AudioStreamVolume_Release gave wrong refcount: %u\n", ref);
ok(ref != 0, "AudioStreamVolume_Release gave wrong refcount: %lu\n", ref);
ref = IAudioClient_Release(ac);
- ok(ref != 0, "Client_Release gave wrong refcount: %u\n", ref);
ok(ref != 0, "Client_Release gave wrong refcount: %lu\n", ref);
ref = IAudioStreamVolume_Release(asv);
- ok(ref == 0, "AudioStreamVolume_Release gave wrong refcount: %u\n", ref);
- ok(ref == 0, "AudioStreamVolume_Release gave wrong refcount: %lu\n", ref);
}
static void test_event(void) @@ -704,17 +704,17 @@ static void test_event(void)
hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ac);
- ok(hr == S_OK, "Activation failed with %08x\n", hr);
ok(hr == S_OK, "Activation failed with %08lx\n", hr); if(hr != S_OK) return;
hr = IAudioClient_GetMixFormat(ac, &pwfx);
- ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr);
ok(hr == S_OK, "GetMixFormat failed: %08lx\n", hr);
hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_EVENTCALLBACK, 5000000, 0, pwfx, NULL);
- ok(hr == S_OK, "Initialize failed: %08x\n", hr);
ok(hr == S_OK, "Initialize failed: %08lx\n", hr);
CoTaskMemFree(pwfx);
@@ -723,50 +723,50 @@ static void test_event(void)
hr = IAudioClient_Start(ac); ok(hr == AUDCLNT_E_EVENTHANDLE_NOT_SET ||
hr == D3D11_ERROR_4E /* win10 */, "Start failed: %08x\n", hr);
hr == D3D11_ERROR_4E /* win10 */, "Start failed: %08lx\n", hr);
hr = IAudioClient_SetEventHandle(ac, event);
- ok(hr == S_OK, "SetEventHandle failed: %08x\n", hr);
ok(hr == S_OK, "SetEventHandle failed: %08lx\n", hr);
hr = IAudioClient_SetEventHandle(ac, event); ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_NAME) ||
hr == E_UNEXPECTED /* win10 */, "SetEventHandle returns %08x\n", hr);
hr == E_UNEXPECTED /* win10 */, "SetEventHandle returns %08lx\n", hr);
r = WaitForSingleObject(event, 40);
- ok(r == WAIT_TIMEOUT, "Wait(event) before Start gave %x\n", r);
ok(r == WAIT_TIMEOUT, "Wait(event) before Start gave %lx\n", r);
hr = IAudioClient_Start(ac);
- ok(hr == S_OK, "Start failed: %08x\n", hr);
ok(hr == S_OK, "Start failed: %08lx\n", hr);
r = WaitForSingleObject(event, 20);
- ok(r == WAIT_OBJECT_0, "Wait(event) after Start gave %x\n", r);
ok(r == WAIT_OBJECT_0, "Wait(event) after Start gave %lx\n", r);
hr = IAudioClient_Stop(ac);
- ok(hr == S_OK, "Stop failed: %08x\n", hr);
ok(hr == S_OK, "Stop failed: %08lx\n", hr);
ok(ResetEvent(event), "ResetEvent\n");
/* Still receiving events! */ r = WaitForSingleObject(event, 20);
- ok(r == WAIT_OBJECT_0, "Wait(event) after Stop gave %x\n", r);
ok(r == WAIT_OBJECT_0, "Wait(event) after Stop gave %lx\n", r);
hr = IAudioClient_Reset(ac);
- ok(hr == S_OK, "Reset failed: %08x\n", hr);
ok(hr == S_OK, "Reset failed: %08lx\n", hr);
ok(ResetEvent(event), "ResetEvent\n");
r = WaitForSingleObject(event, 120);
- ok(r == WAIT_OBJECT_0, "Wait(event) after Reset gave %x\n", r);
ok(r == WAIT_OBJECT_0, "Wait(event) after Reset gave %lx\n", r);
hr = IAudioClient_SetEventHandle(ac, NULL);
- ok(hr == E_INVALIDARG, "SetEventHandle(NULL) returns %08x\n", hr);
ok(hr == E_INVALIDARG, "SetEventHandle(NULL) returns %08lx\n", hr);
r = WaitForSingleObject(event, 70);
- ok(r == WAIT_OBJECT_0, "Wait(NULL event) gave %x\n", r);
ok(r == WAIT_OBJECT_0, "Wait(NULL event) gave %lx\n", r);
/* test releasing a playing stream */ hr = IAudioClient_Start(ac);
- ok(hr == S_OK, "Start failed: %08x\n", hr);
ok(hr == S_OK, "Start failed: %08lx\n", hr); IAudioClient_Release(ac);
CloseHandle(event);
@@ -784,18 +784,18 @@ static void test_padding(void)
hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ac);
- ok(hr == S_OK, "Activation failed with %08x\n", hr);
ok(hr == S_OK, "Activation failed with %08lx\n", hr); if(hr != S_OK) return;
hr = IAudioClient_GetMixFormat(ac, &pwfx);
- ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr);
ok(hr == S_OK, "GetMixFormat failed: %08lx\n", hr); if(hr != S_OK) return;
hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, 0, pwfx, NULL);
- ok(hr == S_OK, "Initialize failed: %08x\n", hr);
- ok(hr == S_OK, "Initialize failed: %08lx\n", hr); if(hr != S_OK) return;
@@ -810,25 +810,25 @@ static void test_padding(void) * e.g. 10.1587ms is 28 * 16 = 448 frames at 44100 with HDA. * 441 observed with Vista, 448 with w7 on the same HW! */ hr = IAudioClient_GetDevicePeriod(ac, &defp, &minp);
- ok(hr == S_OK, "GetDevicePeriod failed: %08x\n", hr);
- ok(hr == S_OK, "GetDevicePeriod failed: %08lx\n", hr); /* some wineXYZ.drv use 20ms, not seen on native */ ok(defp == 100000 || broken(defp == 101587) || defp == 200000,
"Expected 10ms default period: %u\n", (ULONG)defp);
"Expected 10ms default period: %lu\n", (ULONG)defp);
ok(minp != 0, "Minimum period is 0\n"); ok(minp <= defp, "Minimum period is greater than default period\n");
hr = IAudioClient_GetService(ac, &IID_IAudioRenderClient, (void**)&arc);
- ok(hr == S_OK, "GetService failed: %08x\n", hr);
ok(hr == S_OK, "GetService failed: %08lx\n", hr);
psize = MulDiv(defp, pwfx->nSamplesPerSec, 10000000) * 10;
written = 0; hr = IAudioClient_GetCurrentPadding(ac, &pad);
- ok(hr == S_OK, "GetCurrentPadding failed: %08x\n", hr);
ok(hr == S_OK, "GetCurrentPadding failed: %08lx\n", hr); ok(pad == written, "GetCurrentPadding returned %u, should be %u\n", pad, written);
hr = IAudioRenderClient_GetBuffer(arc, psize, &buf);
- ok(hr == S_OK, "GetBuffer failed: %08x\n", hr);
- ok(hr == S_OK, "GetBuffer failed: %08lx\n", hr); ok(buf != NULL, "NULL buffer returned\n"); if(!win10){ /* win10 appears not to clear the buffer */
@@ -841,35 +841,35 @@ static void test_padding(void) }
hr = IAudioRenderClient_GetBuffer(arc, 0, &buf);
- ok(hr == AUDCLNT_E_OUT_OF_ORDER, "GetBuffer 0 size failed: %08x\n", hr);
ok(hr == AUDCLNT_E_OUT_OF_ORDER, "GetBuffer 0 size failed: %08lx\n", hr); ok(buf == NULL, "GetBuffer 0 gave %p\n", buf); /* MSDN instead documents buf remains untouched */
hr = IAudioClient_Reset(ac);
- ok(hr == AUDCLNT_E_BUFFER_OPERATION_PENDING, "Reset failed: %08x\n", hr);
ok(hr == AUDCLNT_E_BUFFER_OPERATION_PENDING, "Reset failed: %08lx\n", hr);
hr = IAudioRenderClient_ReleaseBuffer(arc, psize, AUDCLNT_BUFFERFLAGS_SILENT);
- ok(hr == S_OK, "ReleaseBuffer failed: %08x\n", hr);
ok(hr == S_OK, "ReleaseBuffer failed: %08lx\n", hr); if(hr == S_OK) written += psize;
hr = IAudioClient_GetCurrentPadding(ac, &pad);
- ok(hr == S_OK, "GetCurrentPadding failed: %08x\n", hr);
ok(hr == S_OK, "GetCurrentPadding failed: %08lx\n", hr); ok(pad == written, "GetCurrentPadding returned %u, should be %u\n", pad, written);
psize = MulDiv(minp, pwfx->nSamplesPerSec, 10000000) * 10;
hr = IAudioRenderClient_GetBuffer(arc, psize, &buf);
- ok(hr == S_OK, "GetBuffer failed: %08x\n", hr);
ok(hr == S_OK, "GetBuffer failed: %08lx\n", hr); ok(buf != NULL, "NULL buffer returned\n");
hr = IAudioRenderClient_ReleaseBuffer(arc, psize, AUDCLNT_BUFFERFLAGS_SILENT);
- ok(hr == S_OK, "ReleaseBuffer failed: %08x\n", hr);
ok(hr == S_OK, "ReleaseBuffer failed: %08lx\n", hr); written += psize;
hr = IAudioClient_GetCurrentPadding(ac, &pad);
- ok(hr == S_OK, "GetCurrentPadding failed: %08x\n", hr);
ok(hr == S_OK, "GetCurrentPadding failed: %08lx\n", hr); ok(pad == written, "GetCurrentPadding returned %u, should be %u\n", pad, written);
/* overfull buffer. requested 1/2s buffer size, so try
@@ -877,65 +877,65 @@ static void test_padding(void) psize = pwfx->nSamplesPerSec / 2; buf = (void*)0xDEADF00D; hr = IAudioRenderClient_GetBuffer(arc, psize, &buf);
- ok(hr == AUDCLNT_E_BUFFER_TOO_LARGE, "GetBuffer gave wrong error: %08x\n", hr);
ok(hr == AUDCLNT_E_BUFFER_TOO_LARGE, "GetBuffer gave wrong error: %08lx\n", hr); ok(buf == NULL, "NULL expected %p\n", buf);
hr = IAudioRenderClient_ReleaseBuffer(arc, psize, 0);
- ok(hr == AUDCLNT_E_OUT_OF_ORDER, "ReleaseBuffer gave wrong error: %08x\n", hr);
ok(hr == AUDCLNT_E_OUT_OF_ORDER, "ReleaseBuffer gave wrong error: %08lx\n", hr);
psize = MulDiv(minp, pwfx->nSamplesPerSec, 10000000) * 2;
hr = IAudioRenderClient_GetBuffer(arc, psize, &buf);
- ok(hr == S_OK, "GetBuffer failed: %08x\n", hr);
ok(hr == S_OK, "GetBuffer failed: %08lx\n", hr); ok(buf != NULL, "NULL buffer returned\n");
hr = IAudioRenderClient_ReleaseBuffer(arc, 0, 0);
- ok(hr == S_OK, "ReleaseBuffer 0 gave wrong error: %08x\n", hr);
ok(hr == S_OK, "ReleaseBuffer 0 gave wrong error: %08lx\n", hr);
buf = (void*)0xDEADF00D; hr = IAudioRenderClient_GetBuffer(arc, 0, &buf);
- ok(hr == S_OK, "GetBuffer 0 size failed: %08x\n", hr);
ok(hr == S_OK, "GetBuffer 0 size failed: %08lx\n", hr); ok(buf == NULL, "GetBuffer 0 gave %p\n", buf); /* MSDN instead documents buf remains untouched */
buf = (void*)0xDEADF00D; hr = IAudioRenderClient_GetBuffer(arc, 0, &buf);
- ok(hr == S_OK, "GetBuffer 0 size #2 failed: %08x\n", hr);
ok(hr == S_OK, "GetBuffer 0 size #2 failed: %08lx\n", hr); ok(buf == NULL, "GetBuffer 0 #2 gave %p\n", buf);
hr = IAudioRenderClient_ReleaseBuffer(arc, psize, 0);
- ok(hr == AUDCLNT_E_OUT_OF_ORDER, "ReleaseBuffer not size 0 gave %08x\n", hr);
ok(hr == AUDCLNT_E_OUT_OF_ORDER, "ReleaseBuffer not size 0 gave %08lx\n", hr);
hr = IAudioRenderClient_GetBuffer(arc, psize, &buf);
- ok(hr == S_OK, "GetBuffer failed: %08x\n", hr);
ok(hr == S_OK, "GetBuffer failed: %08lx\n", hr); ok(buf != NULL, "NULL buffer returned\n");
hr = IAudioRenderClient_ReleaseBuffer(arc, 0, 0);
- ok(hr == S_OK, "ReleaseBuffer 0 gave wrong error: %08x\n", hr);
ok(hr == S_OK, "ReleaseBuffer 0 gave wrong error: %08lx\n", hr);
hr = IAudioClient_GetCurrentPadding(ac, &pad);
- ok(hr == S_OK, "GetCurrentPadding failed: %08x\n", hr);
ok(hr == S_OK, "GetCurrentPadding failed: %08lx\n", hr); ok(pad == written, "GetCurrentPadding returned %u, should be %u\n", pad, written);
hr = IAudioRenderClient_GetBuffer(arc, psize, &buf);
- ok(hr == S_OK, "GetBuffer failed: %08x\n", hr);
ok(hr == S_OK, "GetBuffer failed: %08lx\n", hr); ok(buf != NULL, "NULL buffer returned\n");
hr = IAudioRenderClient_ReleaseBuffer(arc, psize+1, AUDCLNT_BUFFERFLAGS_SILENT);
- ok(hr == AUDCLNT_E_INVALID_SIZE, "ReleaseBuffer too large error: %08x\n", hr);
ok(hr == AUDCLNT_E_INVALID_SIZE, "ReleaseBuffer too large error: %08lx\n", hr); /* todo_wine means Wine may overwrite memory */ if(hr == S_OK) written += psize+1;
/* Buffer still hold */ hr = IAudioRenderClient_ReleaseBuffer(arc, psize/2, AUDCLNT_BUFFERFLAGS_SILENT);
- ok(hr == S_OK, "ReleaseBuffer after error: %08x\n", hr);
ok(hr == S_OK, "ReleaseBuffer after error: %08lx\n", hr); if(hr == S_OK) written += psize/2;
hr = IAudioRenderClient_ReleaseBuffer(arc, 0, 0);
- ok(hr == S_OK, "ReleaseBuffer 0 gave wrong error: %08x\n", hr);
ok(hr == S_OK, "ReleaseBuffer 0 gave wrong error: %08lx\n", hr);
hr = IAudioClient_GetCurrentPadding(ac, &pad);
- ok(hr == S_OK, "GetCurrentPadding failed: %08x\n", hr);
ok(hr == S_OK, "GetCurrentPadding failed: %08lx\n", hr); ok(pad == written, "GetCurrentPadding returned %u, should be %u\n", pad, written);
CoTaskMemFree(pwfx);
@@ -963,18 +963,18 @@ static void test_clock(int share)
hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ac);
- ok(hr == S_OK, "Activation failed with %08x\n", hr);
ok(hr == S_OK, "Activation failed with %08lx\n", hr); if(hr != S_OK) return;
hr = IAudioClient_GetMixFormat(ac, &pwfx);
- ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr);
ok(hr == S_OK, "GetMixFormat failed: %08lx\n", hr); if(hr != S_OK) return;
hr = IAudioClient_GetDevicePeriod(ac, &defp, &minp);
- ok(hr == S_OK, "GetDevicePeriod failed: %08x\n", hr);
- ok(minp <= period, "desired period %u too small for %u\n", (ULONG)period, (ULONG)minp);
ok(hr == S_OK, "GetDevicePeriod failed: %08lx\n", hr);
ok(minp <= period, "desired period %lu too small for %lu\n", (ULONG)period, (ULONG)minp);
if (share) { trace("Testing shared mode\n");
@@ -989,12 +989,12 @@ static void test_clock(int share) pwfx->wBitsPerSample = 16; /* no floating point */ pwfx->nBlockAlign = pwfx->nChannels * pwfx->wBitsPerSample / 8; pwfx->nAvgBytesPerSec = pwfx->nSamplesPerSec * pwfx->nBlockAlign;
trace("Testing exclusive mode at %u\n", pwfx->nSamplesPerSec);
trace("Testing exclusive mode at %lu\n", pwfx->nSamplesPerSec); hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_EXCLUSIVE, 0, duration, period, pwfx, NULL);
}
- ok(share ? hr == S_OK : hr == hexcl || hr == AUDCLNT_E_DEVICE_IN_USE, "Initialize failed: %08x\n", hr);
- ok(share ? hr == S_OK : hr == hexcl || hr == AUDCLNT_E_DEVICE_IN_USE, "Initialize failed: %08lx\n", hr); if (hr != S_OK) { CoTaskMemFree(pwfx); IAudioClient_Release(ac);
@@ -1008,7 +1008,7 @@ static void test_clock(int share) * Exclusive mode: testbot returns 2x period + a little, but * some HDA drivers return 1x period, some + a little. */ hr = IAudioClient_GetStreamLatency(ac, &t2);
- ok(hr == S_OK, "GetStreamLatency failed: %08x\n", hr);
- ok(hr == S_OK, "GetStreamLatency failed: %08lx\n", hr); trace("Latency: %u.%04u ms\n", (UINT)(t2/10000), (UINT)(t2 % 10000)); ok(t2 >= period || broken(t2 >= period/2 && share && pwfx->nSamplesPerSec > 48000) || broken(t2 == 0) /* win10 */,
@@ -1024,7 +1024,7 @@ static void test_clock(int share) * is either the rounded period or a fixed constant like 1024, * whatever the driver implements. */ hr = IAudioClient_GetBufferSize(ac, &gbsize);
- ok(hr == S_OK, "GetBufferSize failed: %08x\n", hr);
ok(hr == S_OK, "GetBufferSize failed: %08lx\n", hr);
bufsize = MulDiv(duration, pwfx->nSamplesPerSec, 10000000); fragment = MulDiv(period, pwfx->nSamplesPerSec, 10000000);
@@ -1035,10 +1035,10 @@ static void test_clock(int share) * but it is rounded down modulo fragment ! */ if (share) ok(gbsize == bufsize,
"BufferSize %u at rate %u\n", gbsize, pwfx->nSamplesPerSec);
else ok(gbsize == parts * fragment || gbsize == MulDiv(bufsize, 1, 1024) * 1024,"BufferSize %u at rate %lu\n", gbsize, pwfx->nSamplesPerSec);
"BufferSize %u misfits fragment size %u at rate %u\n", gbsize, fragment, pwfx->nSamplesPerSec);
"BufferSize %u misfits fragment size %u at rate %lu\n", gbsize, fragment, pwfx->nSamplesPerSec);
/* In shared mode, GetCurrentPadding decreases in multiples of * fragment size (i.e. updated only at period ticks), whereas
@@ -1049,10 +1049,10 @@ static void test_clock(int share) * GetCurrentPadding = GetPosition - frames held in mmdevapi */
hr = IAudioClient_GetService(ac, &IID_IAudioClock, (void**)&acl);
- ok(hr == S_OK, "GetService(IAudioClock) failed: %08x\n", hr);
ok(hr == S_OK, "GetService(IAudioClock) failed: %08lx\n", hr);
hr = IAudioClock_GetFrequency(acl, &freq);
- ok(hr == S_OK, "GetFrequency failed: %08x\n", hr);
ok(hr == S_OK, "GetFrequency failed: %08lx\n", hr); trace("Clock Frequency %u\n", (UINT)freq);
/* MSDN says it's arbitrary units, but shared mode is unlikely to change */
@@ -1064,74 +1064,74 @@ static void test_clock(int share) "Clock Frequency %u\n", (UINT)freq);
hr = IAudioClock_GetPosition(acl, NULL, NULL);
- ok(hr == E_POINTER, "GetPosition wrong error: %08x\n", hr);
ok(hr == E_POINTER, "GetPosition wrong error: %08lx\n", hr);
pcpos0 = 0; hr = IAudioClock_GetPosition(acl, &pos, &pcpos0);
- ok(hr == S_OK, "GetPosition failed: %08x\n", hr);
ok(hr == S_OK, "GetPosition failed: %08lx\n", hr); ok(pos == 0, "GetPosition returned non-zero pos before being started\n"); ok(pcpos0 != 0, "GetPosition returned zero pcpos\n");
hr = IAudioClient_GetService(ac, &IID_IAudioRenderClient, (void**)&arc);
- ok(hr == S_OK, "GetService(IAudioRenderClient) failed: %08x\n", hr);
ok(hr == S_OK, "GetService(IAudioRenderClient) failed: %08lx\n", hr);
hr = IAudioRenderClient_GetBuffer(arc, gbsize+1, &data);
- ok(hr == AUDCLNT_E_BUFFER_TOO_LARGE, "GetBuffer too large failed: %08x\n", hr);
ok(hr == AUDCLNT_E_BUFFER_TOO_LARGE, "GetBuffer too large failed: %08lx\n", hr);
avail = gbsize; data = NULL; hr = IAudioRenderClient_GetBuffer(arc, avail, &data);
- ok(hr == S_OK, "GetBuffer failed: %08x\n", hr);
ok(hr == S_OK, "GetBuffer failed: %08lx\n", hr); trace("data at %p\n", data);
hr = IAudioRenderClient_ReleaseBuffer(arc, avail, winetest_debug>2 ? wave_generate_tone(pwfx, data, avail) : AUDCLNT_BUFFERFLAGS_SILENT);
- ok(hr == S_OK, "ReleaseBuffer failed: %08x\n", hr);
ok(hr == S_OK, "ReleaseBuffer failed: %08lx\n", hr); if(hr == S_OK) sum += avail;
hr = IAudioClient_GetCurrentPadding(ac, &pad);
- ok(hr == S_OK, "GetCurrentPadding failed: %08x\n", hr);
ok(hr == S_OK, "GetCurrentPadding failed: %08lx\n", hr); ok(pad == sum, "padding %u prior to start\n", pad);
hr = IAudioClock_GetPosition(acl, &pos, NULL);
- ok(hr == S_OK, "GetPosition failed: %08x\n", hr);
ok(hr == S_OK, "GetPosition failed: %08lx\n", hr); ok(pos == 0, "GetPosition returned non-zero pos before being started\n");
hr = IAudioClient_Start(ac); /* #1 */
- ok(hr == S_OK, "Start failed: %08x\n", hr);
ok(hr == S_OK, "Start failed: %08lx\n", hr);
Sleep(100); slept += 100;
hr = IAudioClient_GetStreamLatency(ac, &t1);
- ok(hr == S_OK, "GetStreamLatency failed: %08x\n", hr);
ok(hr == S_OK, "GetStreamLatency failed: %08lx\n", hr); ok(t1 == t2, "Latency not constant, delta %ld\n", (long)(t1-t2));
hr = IAudioClock_GetPosition(acl, &pos, NULL);
- ok(hr == S_OK, "GetPosition failed: %08x\n", hr);
ok(hr == S_OK, "GetPosition failed: %08lx\n", hr); ok(pos > 0, "Position %u vs. last %u\n", (UINT)pos,0); /* in rare cases is slept*1.1 not enough with dmix */ ok(pos*1000/freq <= slept*1.4, "Position %u too far after playing %ums\n", (UINT)pos, slept); last = pos;
hr = IAudioClient_Stop(ac);
- ok(hr == S_OK, "Stop failed: %08x\n", hr);
ok(hr == S_OK, "Stop failed: %08lx\n", hr);
hr = IAudioClock_GetPosition(acl, &pos, NULL);
- ok(hr == S_OK, "GetPosition failed: %08x\n", hr);
ok(hr == S_OK, "GetPosition failed: %08lx\n", hr); ok(pos >= last, "Position %u vs. last %u\n", (UINT)pos,(UINT)last); last = pos; if(/*share &&*/ winetest_debug>1) ok(pos*1000/freq <= slept*1.1, "Position %u too far after stop %ums\n", (UINT)pos, slept);
hr = IAudioClient_Start(ac); /* #2 */
- ok(hr == S_OK, "Start failed: %08x\n", hr);
ok(hr == S_OK, "Start failed: %08lx\n", hr);
Sleep(100); slept += 100;
hr = IAudioClient_GetCurrentPadding(ac, &pad);
- ok(hr == S_OK, "GetCurrentPadding failed: %08x\n", hr);
ok(hr == S_OK, "GetCurrentPadding failed: %08lx\n", hr); trace("padding %u past sleep #2\n", pad);
/** IAudioClient_Stop
@@ -1144,13 +1144,13 @@ static void test_clock(int share) * padding 0 and bumping pos to sum minus 17 frames! */
hr = IAudioClient_Stop(ac);
- ok(hr == S_OK, "Stop failed: %08x\n", hr);
ok(hr == S_OK, "Stop failed: %08lx\n", hr);
hr = IAudioClient_GetCurrentPadding(ac, &pad);
- ok(hr == S_OK, "GetCurrentPadding failed: %08x\n", hr);
ok(hr == S_OK, "GetCurrentPadding failed: %08lx\n", hr);
hr = IAudioClock_GetPosition(acl, &pos, NULL);
- ok(hr == S_OK, "GetPosition failed: %08x\n", hr);
- ok(hr == S_OK, "GetPosition failed: %08lx\n", hr); trace("padding %u position %u past stop #2\n", pad, (UINT)pos); ok(pos * pwfx->nSamplesPerSec <= sum * freq, "Position %u > written %u\n", (UINT)pos, sum); /* Prove that Stop must not drop frames (in shared mode). */
@@ -1166,49 +1166,49 @@ static void test_clock(int share) Sleep(100);
hr = IAudioClock_GetPosition(acl, &pos, NULL);
- ok(hr == S_OK, "GetPosition failed: %08x\n", hr);
ok(hr == S_OK, "GetPosition failed: %08lx\n", hr); ok(pos == last, "Position %u should stop.\n", (UINT)pos);
/* Restart from 0 */ hr = IAudioClient_Reset(ac);
- ok(hr == S_OK, "Reset failed: %08x\n", hr);
ok(hr == S_OK, "Reset failed: %08lx\n", hr); slept = sum = 0;
hr = IAudioClient_Reset(ac);
- ok(hr == S_OK, "Reset on an already reset stream returns %08x\n", hr);
ok(hr == S_OK, "Reset on an already reset stream returns %08lx\n", hr);
hr = IAudioClock_GetPosition(acl, &pos, &pcpos);
- ok(hr == S_OK, "GetPosition failed: %08x\n", hr);
ok(hr == S_OK, "GetPosition failed: %08lx\n", hr); ok(pos == 0, "GetPosition returned non-zero pos after Reset\n"); ok(pcpos > pcpos0, "pcpos should increase\n");
avail = gbsize; /* implies GetCurrentPadding == 0 */ hr = IAudioRenderClient_GetBuffer(arc, avail, &data);
- ok(hr == S_OK, "GetBuffer failed: %08x\n", hr);
ok(hr == S_OK, "GetBuffer failed: %08lx\n", hr); trace("data at %p\n", data);
hr = IAudioRenderClient_ReleaseBuffer(arc, avail, winetest_debug>2 ? wave_generate_tone(pwfx, data, avail) : AUDCLNT_BUFFERFLAGS_SILENT);
- ok(hr == S_OK, "ReleaseBuffer failed: %08x\n", hr);
ok(hr == S_OK, "ReleaseBuffer failed: %08lx\n", hr); if(hr == S_OK) sum += avail;
hr = IAudioClient_GetCurrentPadding(ac, &pad);
- ok(hr == S_OK, "GetCurrentPadding failed: %08x\n", hr);
ok(hr == S_OK, "GetCurrentPadding failed: %08lx\n", hr); ok(pad == sum, "padding %u prior to start\n", pad);
hr = IAudioClock_GetPosition(acl, &pos, NULL);
- ok(hr == S_OK, "GetPosition failed: %08x\n", hr);
ok(hr == S_OK, "GetPosition failed: %08lx\n", hr); ok(pos == 0, "GetPosition returned non-zero pos after Reset\n"); last = pos;
hr = IAudioClient_Start(ac); /* #3 */
- ok(hr == S_OK, "Start failed: %08x\n", hr);
ok(hr == S_OK, "Start failed: %08lx\n", hr);
Sleep(100); slept += 100;
hr = IAudioClock_GetPosition(acl, &pos, NULL);
- ok(hr == S_OK, "GetPosition failed: %08x\n", hr);
- ok(hr == S_OK, "GetPosition failed: %08lx\n", hr); trace("position %u past %ums sleep #3\n", (UINT)pos, slept); ok(pos > last, "Position %u vs. last %u\n", (UINT)pos,(UINT)last); ok(pos * pwfx->nSamplesPerSec <= sum * freq, "Position %u > written %u\n", (UINT)pos, sum);
@@ -1219,16 +1219,16 @@ static void test_clock(int share) last = pos;
hr = IAudioClient_Reset(ac);
- ok(hr == AUDCLNT_E_NOT_STOPPED, "Reset while playing: %08x\n", hr);
ok(hr == AUDCLNT_E_NOT_STOPPED, "Reset while playing: %08lx\n", hr);
hr = IAudioClient_Stop(ac);
- ok(hr == S_OK, "Stop failed: %08x\n", hr);
ok(hr == S_OK, "Stop failed: %08lx\n", hr);
hr = IAudioClient_GetCurrentPadding(ac, &pad);
- ok(hr == S_OK, "GetCurrentPadding failed: %08x\n", hr);
ok(hr == S_OK, "GetCurrentPadding failed: %08lx\n", hr);
hr = IAudioClock_GetPosition(acl, &pos, &pcpos);
- ok(hr == S_OK, "GetPosition failed: %08x\n", hr);
- ok(hr == S_OK, "GetPosition failed: %08lx\n", hr); trace("padding %u position %u past stop #3\n", pad, (UINT)pos); ok(pos >= last, "Position %u vs. last %u\n", (UINT)pos,(UINT)last); ok(pcpos > pcpos0, "pcpos should increase\n");
@@ -1242,42 +1242,42 @@ static void test_clock(int share)
/* Begin the big loop */ hr = IAudioClient_Reset(ac);
- ok(hr == S_OK, "Reset failed: %08x\n", hr);
ok(hr == S_OK, "Reset failed: %08lx\n", hr); slept = last = sum = 0; pcpos0 = pcpos;
ok(QueryPerformanceCounter(&hpctime0), "PerfCounter unavailable\n");
hr = IAudioClient_Reset(ac);
- ok(hr == S_OK, "Reset on an already reset stream returns %08x\n", hr);
ok(hr == S_OK, "Reset on an already reset stream returns %08lx\n", hr);
hr = IAudioClient_Start(ac);
- ok(hr == S_OK, "Start failed: %08x\n", hr);
ok(hr == S_OK, "Start failed: %08lx\n", hr);
avail = pwfx->nSamplesPerSec * 15 / 16 / 2; data = NULL; hr = IAudioRenderClient_GetBuffer(arc, avail, &data);
- ok(hr == S_OK, "GetBuffer failed: %08x\n", hr);
ok(hr == S_OK, "GetBuffer failed: %08lx\n", hr); trace("data at %p for prefill %u\n", data, avail);
if (winetest_debug>2) { hr = IAudioClient_Stop(ac);
ok(hr == S_OK, "Stop failed: %08x\n", hr);
ok(hr == S_OK, "Stop failed: %08lx\n", hr); Sleep(20); slept += 20; hr = IAudioClient_Reset(ac);
ok(hr == AUDCLNT_E_BUFFER_OPERATION_PENDING, "Reset failed: %08x\n", hr);
ok(hr == AUDCLNT_E_BUFFER_OPERATION_PENDING, "Reset failed: %08lx\n", hr); hr = IAudioClient_Start(ac);
ok(hr == S_OK, "Start failed: %08x\n", hr);
ok(hr == S_OK, "Start failed: %08lx\n", hr);
}
/* Despite passed time, data must still point to valid memory... */ hr = IAudioRenderClient_ReleaseBuffer(arc, avail, wave_generate_tone(pwfx, data, avail));
- ok(hr == S_OK, "ReleaseBuffer after stop+start failed: %08x\n", hr);
ok(hr == S_OK, "ReleaseBuffer after stop+start failed: %08lx\n", hr); if(hr == S_OK) sum += avail;
/* GetCurrentPadding(GCP) == 0 does not mean an underrun happened, as the
@@ -1290,11 +1290,11 @@ static void test_clock(int share) Sleep(350); slept += 350; ok(QueryPerformanceCounter(&hpctime), "PerfCounter failed\n");
- trace("hpctime %u after %ums\n",
trace("hpctime %lu after %ums\n", (ULONG)((hpctime.QuadPart-hpctime0.QuadPart)*1000/hpcfreq.QuadPart), slept);
hr = IAudioClock_GetPosition(acl, &pos, &pcpos);
- ok(hr == S_OK, "GetPosition failed: %08x\n", hr);
- ok(hr == S_OK, "GetPosition failed: %08lx\n", hr); ok(pos > last, "Position %u vs. last %u\n", (UINT)pos,(UINT)last); last = pos;
@@ -1303,13 +1303,13 @@ static void test_clock(int share) slept += 100;
hr = IAudioClock_GetPosition(acl, &pos, &pcpos);
ok(hr == S_OK, "GetPosition failed: %08x\n", hr);
ok(hr == S_OK, "GetPosition failed: %08lx\n", hr); hr = IAudioClient_GetCurrentPadding(ac, &pad);
ok(hr == S_OK, "GetCurrentPadding failed: %08x\n", hr);
ok(hr == S_OK, "GetCurrentPadding failed: %08lx\n", hr); ok(QueryPerformanceCounter(&hpctime), "PerfCounter failed\n");
trace("hpctime %u pcpos %u\n",
trace("hpctime %lu pcpos %lu\n", (ULONG)((hpctime.QuadPart-hpctime0.QuadPart)*1000/hpcfreq.QuadPart), (ULONG)((pcpos-pcpos0)/10000));
@@ -1328,7 +1328,7 @@ static void test_clock(int share) last = pos;
hr = IAudioClient_GetStreamLatency(ac, &t1);
ok(hr == S_OK, "GetStreamLatency failed: %08x\n", hr);
ok(hr == S_OK, "GetStreamLatency failed: %08lx\n", hr); ok(t1 == t2, "Latency not constant, delta %ld\n", (long)(t1-t2)); avail = pwfx->nSamplesPerSec * 15 / 16 / 2;
@@ -1336,7 +1336,7 @@ static void test_clock(int share) hr = IAudioRenderClient_GetBuffer(arc, avail, &data); /* ok(hr == AUDCLNT_E_BUFFER_TOO_LARGE || (hr == S_OK && i==0) without todo_wine */ ok(hr == S_OK || hr == AUDCLNT_E_BUFFER_TOO_LARGE,
"GetBuffer large (%u) failed: %08x\n", avail, hr);
"GetBuffer large (%u) failed: %08lx\n", avail, hr); if(hr == S_OK && i) ok(FALSE, "GetBuffer large (%u) at iteration %d\n", avail, i); /* Only the first iteration should allow that large a buffer * as prefill was drained during the first 350+100ms sleep.
@@ -1347,7 +1347,7 @@ static void test_clock(int share) } else { avail = gbsize - pad; hr = IAudioRenderClient_GetBuffer(arc, avail, &data);
ok(hr == S_OK, "GetBuffer small %u failed: %08x\n", avail, hr);
ok(hr == S_OK, "GetBuffer small %u failed: %08lx\n", avail, hr); trace("data at %p (small %u)\n", data, avail); } ok(data != NULL, "NULL buffer returned\n");
@@ -1358,21 +1358,21 @@ static void test_clock(int share) hr = IAudioRenderClient_ReleaseBuffer(arc, avail, wave_generate_tone(pwfx, data, avail)); }
ok(hr == S_OK, "ReleaseBuffer failed: %08x\n", hr);
ok(hr == S_OK, "ReleaseBuffer failed: %08lx\n", hr); if(hr == S_OK) sum += avail;
}
hr = IAudioClock_GetPosition(acl, &pos, NULL);
- ok(hr == S_OK, "GetPosition failed: %08x\n", hr);
ok(hr == S_OK, "GetPosition failed: %08lx\n", hr); trace("position %u\n", (UINT)pos);
Sleep(1000); /* 500ms buffer underrun past full buffer */
hr = IAudioClient_GetCurrentPadding(ac, &pad);
- ok(hr == S_OK, "GetCurrentPadding failed: %08x\n", hr);
ok(hr == S_OK, "GetCurrentPadding failed: %08lx\n", hr);
hr = IAudioClock_GetPosition(acl, &pos, NULL);
- ok(hr == S_OK, "GetPosition failed: %08x\n", hr);
ok(hr == S_OK, "GetPosition failed: %08lx\n", hr); trace("position %u past underrun, %u padding left, %u frames written\n", (UINT)pos, pad, sum);
if (share) {
@@ -1391,14 +1391,14 @@ static void test_clock(int share) }
hr = IAudioClient_GetStreamLatency(ac, &t1);
- ok(hr == S_OK, "GetStreamLatency failed: %08x\n", hr);
ok(hr == S_OK, "GetStreamLatency failed: %08lx\n", hr); ok(t1 == t2, "Latency not constant, delta %ld\n", (long)(t1-t2));
ok(QueryPerformanceCounter(&hpctime), "PerfCounter failed\n");
- trace("hpctime %u after underrun\n", (ULONG)((hpctime.QuadPart-hpctime0.QuadPart)*1000/hpcfreq.QuadPart));
trace("hpctime %lu after underrun\n", (ULONG)((hpctime.QuadPart-hpctime0.QuadPart)*1000/hpcfreq.QuadPart));
hr = IAudioClient_Stop(ac);
- ok(hr == S_OK, "Stop failed: %08x\n", hr);
ok(hr == S_OK, "Stop failed: %08lx\n", hr);
CoTaskMemFree(pwfx);
@@ -1419,184 +1419,184 @@ static void test_session(void) HRESULT hr;
hr = CoCreateGuid(&ses1_guid);
- ok(hr == S_OK, "CoCreateGuid failed: %08x\n", hr);
ok(hr == S_OK, "CoCreateGuid failed: %08lx\n", hr);
hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ses1_ac1);
- ok(hr == S_OK, "Activation failed with %08x\n", hr);
ok(hr == S_OK, "Activation failed with %08lx\n", hr); if (FAILED(hr)) return;
hr = IAudioClient_GetMixFormat(ses1_ac1, &pwfx);
- ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr);
ok(hr == S_OK, "GetMixFormat failed: %08lx\n", hr);
hr = IAudioClient_Initialize(ses1_ac1, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, 0, pwfx, &ses1_guid);
- ok(hr == S_OK, "Initialize failed: %08x\n", hr);
ok(hr == S_OK, "Initialize failed: %08lx\n", hr);
if(hr == S_OK){ hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ses1_ac2);
ok(hr == S_OK, "Activation failed with %08x\n", hr);
ok(hr == S_OK, "Activation failed with %08lx\n", hr);
} if(hr != S_OK){ skip("Unable to open the same device twice. Skipping session tests\n");
ref = IAudioClient_Release(ses1_ac1);
ok(ref == 0, "AudioClient wasn't released: %u\n", ref);
ok(ref == 0, "AudioClient wasn't released: %lu\n", ref); CoTaskMemFree(pwfx); return;
}
hr = IAudioClient_Initialize(ses1_ac2, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, 0, pwfx, &ses1_guid);
- ok(hr == S_OK, "Initialize failed: %08x\n", hr);
ok(hr == S_OK, "Initialize failed: %08lx\n", hr);
hr = IMMDeviceEnumerator_GetDefaultAudioEndpoint(mme, eCapture, eMultimedia, &cap_dev); if(hr == S_OK){ hr = IMMDevice_Activate(cap_dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&cap_ac);
ok((hr == S_OK)^(cap_ac == NULL), "Activate %08x &out pointer\n", hr);
ok(hr == S_OK, "Activate failed: %08x\n", hr);
ok((hr == S_OK)^(cap_ac == NULL), "Activate %08lx &out pointer\n", hr);
ok(hr == S_OK, "Activate failed: %08lx\n", hr); IMMDevice_Release(cap_dev);
} if(hr == S_OK){ WAVEFORMATEX *cap_pwfx;
hr = IAudioClient_GetMixFormat(cap_ac, &cap_pwfx);
ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr);
ok(hr == S_OK, "GetMixFormat failed: %08lx\n", hr); hr = IAudioClient_Initialize(cap_ac, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, 0, cap_pwfx, &ses1_guid);
ok(hr == S_OK, "Initialize failed for capture in rendering session: %08x\n", hr);
} if(hr == S_OK){ hr = IAudioClient_GetService(cap_ac, &IID_IAudioSessionControl, (void**)&cap_ctl);ok(hr == S_OK, "Initialize failed for capture in rendering session: %08lx\n", hr); CoTaskMemFree(cap_pwfx);
ok(hr == S_OK, "GetService failed: %08x\n", hr);
}elseok(hr == S_OK, "GetService failed: %08lx\n", hr); if(FAILED(hr)) cap_ctl = NULL;
skip("No capture session: %08x; skipping capture device in render session tests\n", hr);
skip("No capture session: %08lx; skipping capture device in render session tests\n", hr);
hr = IAudioClient_GetService(ses1_ac1, &IID_IAudioSessionControl2, (void**)&ses1_ctl);
- ok(hr == E_NOINTERFACE, "GetService gave wrong error: %08x\n", hr);
ok(hr == E_NOINTERFACE, "GetService gave wrong error: %08lx\n", hr);
hr = IAudioClient_GetService(ses1_ac1, &IID_IAudioSessionControl, (void**)&ses1_ctl);
- ok(hr == S_OK, "GetService failed: %08x\n", hr);
ok(hr == S_OK, "GetService failed: %08lx\n", hr);
hr = IAudioClient_GetService(ses1_ac1, &IID_IAudioSessionControl, (void**)&ses1_ctl2);
- ok(hr == S_OK, "GetService failed: %08x\n", hr);
ok(hr == S_OK, "GetService failed: %08lx\n", hr); ok(ses1_ctl == ses1_ctl2, "Got different controls: %p %p\n", ses1_ctl, ses1_ctl2); ref = IAudioSessionControl2_Release(ses1_ctl2); ok(ref != 0, "AudioSessionControl was destroyed\n");
hr = IAudioClient_GetService(ses1_ac2, &IID_IAudioSessionControl, (void**)&ses1_ctl2);
- ok(hr == S_OK, "GetService failed: %08x\n", hr);
ok(hr == S_OK, "GetService failed: %08lx\n", hr);
hr = IAudioSessionControl2_GetState(ses1_ctl, NULL);
- ok(hr == NULL_PTR_ERR, "GetState gave wrong error: %08x\n", hr);
ok(hr == NULL_PTR_ERR, "GetState gave wrong error: %08lx\n", hr);
hr = IAudioSessionControl2_GetState(ses1_ctl, &state);
- ok(hr == S_OK, "GetState failed: %08x\n", hr);
ok(hr == S_OK, "GetState failed: %08lx\n", hr); ok(state == AudioSessionStateInactive, "Got wrong state: %d\n", state);
hr = IAudioSessionControl2_GetState(ses1_ctl2, &state);
- ok(hr == S_OK, "GetState failed: %08x\n", hr);
ok(hr == S_OK, "GetState failed: %08lx\n", hr); ok(state == AudioSessionStateInactive, "Got wrong state: %d\n", state);
if(cap_ctl){ hr = IAudioSessionControl2_GetState(cap_ctl, &state);
ok(hr == S_OK, "GetState failed: %08x\n", hr);
ok(hr == S_OK, "GetState failed: %08lx\n", hr); ok(state == AudioSessionStateInactive, "Got wrong state: %d\n", state);
}
hr = IAudioClient_Start(ses1_ac1);
- ok(hr == S_OK, "Start failed: %08x\n", hr);
ok(hr == S_OK, "Start failed: %08lx\n", hr);
hr = IAudioSessionControl2_GetState(ses1_ctl, &state);
- ok(hr == S_OK, "GetState failed: %08x\n", hr);
ok(hr == S_OK, "GetState failed: %08lx\n", hr); ok(state == AudioSessionStateActive, "Got wrong state: %d\n", state);
hr = IAudioSessionControl2_GetState(ses1_ctl2, &state);
- ok(hr == S_OK, "GetState failed: %08x\n", hr);
ok(hr == S_OK, "GetState failed: %08lx\n", hr); ok(state == AudioSessionStateActive, "Got wrong state: %d\n", state);
if(cap_ctl){ hr = IAudioSessionControl2_GetState(cap_ctl, &state);
ok(hr == S_OK, "GetState failed: %08x\n", hr);
ok(hr == S_OK, "GetState failed: %08lx\n", hr); ok(state == AudioSessionStateInactive, "Got wrong state: %d\n", state);
}
hr = IAudioClient_Stop(ses1_ac1);
- ok(hr == S_OK, "Start failed: %08x\n", hr);
ok(hr == S_OK, "Start failed: %08lx\n", hr);
hr = IAudioSessionControl2_GetState(ses1_ctl, &state);
- ok(hr == S_OK, "GetState failed: %08x\n", hr);
ok(hr == S_OK, "GetState failed: %08lx\n", hr); ok(state == AudioSessionStateInactive, "Got wrong state: %d\n", state);
hr = IAudioSessionControl2_GetState(ses1_ctl2, &state);
- ok(hr == S_OK, "GetState failed: %08x\n", hr);
ok(hr == S_OK, "GetState failed: %08lx\n", hr); ok(state == AudioSessionStateInactive, "Got wrong state: %d\n", state);
if(cap_ctl){ hr = IAudioSessionControl2_GetState(cap_ctl, &state);
ok(hr == S_OK, "GetState failed: %08x\n", hr);
ok(hr == S_OK, "GetState failed: %08lx\n", hr); ok(state == AudioSessionStateInactive, "Got wrong state: %d\n", state); hr = IAudioClient_Start(cap_ac);
ok(hr == S_OK, "Start failed: %08x\n", hr);
ok(hr == S_OK, "Start failed: %08lx\n", hr); hr = IAudioSessionControl2_GetState(ses1_ctl, &state);
ok(hr == S_OK, "GetState failed: %08x\n", hr);
ok(hr == S_OK, "GetState failed: %08lx\n", hr); ok(state == AudioSessionStateInactive, "Got wrong state: %d\n", state); hr = IAudioSessionControl2_GetState(ses1_ctl2, &state);
ok(hr == S_OK, "GetState failed: %08x\n", hr);
ok(hr == S_OK, "GetState failed: %08lx\n", hr); ok(state == AudioSessionStateInactive, "Got wrong state: %d\n", state); hr = IAudioSessionControl2_GetState(cap_ctl, &state);
ok(hr == S_OK, "GetState failed: %08x\n", hr);
ok(hr == S_OK, "GetState failed: %08lx\n", hr); ok(state == AudioSessionStateActive, "Got wrong state: %d\n", state); hr = IAudioClient_Stop(cap_ac);
ok(hr == S_OK, "Stop failed: %08x\n", hr);
ok(hr == S_OK, "Stop failed: %08lx\n", hr); hr = IAudioSessionControl2_GetState(ses1_ctl, &state);
ok(hr == S_OK, "GetState failed: %08x\n", hr);
ok(hr == S_OK, "GetState failed: %08lx\n", hr); ok(state == AudioSessionStateInactive, "Got wrong state: %d\n", state); hr = IAudioSessionControl2_GetState(ses1_ctl2, &state);
ok(hr == S_OK, "GetState failed: %08x\n", hr);
ok(hr == S_OK, "GetState failed: %08lx\n", hr); ok(state == AudioSessionStateInactive, "Got wrong state: %d\n", state); hr = IAudioSessionControl2_GetState(cap_ctl, &state);
ok(hr == S_OK, "GetState failed: %08x\n", hr);
ok(hr == S_OK, "GetState failed: %08lx\n", hr); ok(state == AudioSessionStateInactive, "Got wrong state: %d\n", state); ref = IAudioSessionControl2_Release(cap_ctl);
ok(ref == 0, "AudioSessionControl wasn't released: %u\n", ref);
ok(ref == 0, "AudioSessionControl wasn't released: %lu\n", ref); ref = IAudioClient_Release(cap_ac);
ok(ref == 0, "AudioClient wasn't released: %u\n", ref);
ok(ref == 0, "AudioClient wasn't released: %lu\n", ref);
}
ref = IAudioSessionControl2_Release(ses1_ctl);
- ok(ref == 0, "AudioSessionControl wasn't released: %u\n", ref);
ok(ref == 0, "AudioSessionControl wasn't released: %lu\n", ref);
ref = IAudioClient_Release(ses1_ac1);
- ok(ref == 0, "AudioClient wasn't released: %u\n", ref);
ok(ref == 0, "AudioClient wasn't released: %lu\n", ref);
ref = IAudioClient_Release(ses1_ac2);
- ok(ref == 1, "AudioClient had wrong refcount: %u\n", ref);
ok(ref == 1, "AudioClient had wrong refcount: %lu\n", ref);
/* we've released all of our IAudioClient references, so check GetState */ hr = IAudioSessionControl2_GetState(ses1_ctl2, &state);
- ok(hr == S_OK, "GetState failed: %08x\n", hr);
ok(hr == S_OK, "GetState failed: %08lx\n", hr); ok(state == AudioSessionStateInactive, "Got wrong state: %d\n", state);
ref = IAudioSessionControl2_Release(ses1_ctl2);
- ok(ref == 0, "AudioSessionControl wasn't released: %u\n", ref);
ok(ref == 0, "AudioSessionControl wasn't released: %lu\n", ref);
CoTaskMemFree(pwfx);
} @@ -1612,20 +1612,20 @@ static void test_streamvolume(void)
hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ac);
- ok(hr == S_OK, "Activation failed with %08x\n", hr);
ok(hr == S_OK, "Activation failed with %08lx\n", hr); if(hr != S_OK) return;
hr = IAudioClient_GetMixFormat(ac, &fmt);
- ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr);
ok(hr == S_OK, "GetMixFormat failed: %08lx\n", hr);
hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, 0, fmt, NULL);
- ok(hr == S_OK, "Initialize failed: %08x\n", hr);
ok(hr == S_OK, "Initialize failed: %08lx\n", hr);
if(hr == S_OK){ hr = IAudioClient_GetService(ac, &IID_IAudioStreamVolume, (void**)&asv);
ok(hr == S_OK, "GetService failed: %08x\n", hr);
} if(hr != S_OK){ IAudioClient_Release(ac);ok(hr == S_OK, "GetService failed: %08lx\n", hr);
@@ -1634,70 +1634,70 @@ static void test_streamvolume(void) }
hr = IAudioStreamVolume_GetChannelCount(asv, NULL);
- ok(hr == E_POINTER, "GetChannelCount gave wrong error: %08x\n", hr);
ok(hr == E_POINTER, "GetChannelCount gave wrong error: %08lx\n", hr);
hr = IAudioStreamVolume_GetChannelCount(asv, &chans);
- ok(hr == S_OK, "GetChannelCount failed: %08x\n", hr);
ok(hr == S_OK, "GetChannelCount failed: %08lx\n", hr); ok(chans == fmt->nChannels, "GetChannelCount gave wrong number of channels: %d\n", chans);
hr = IAudioStreamVolume_GetChannelVolume(asv, fmt->nChannels, NULL);
- ok(hr == E_POINTER, "GetChannelCount gave wrong error: %08x\n", hr);
ok(hr == E_POINTER, "GetChannelCount gave wrong error: %08lx\n", hr);
hr = IAudioStreamVolume_GetChannelVolume(asv, fmt->nChannels, &vol);
- ok(hr == E_INVALIDARG, "GetChannelCount gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "GetChannelCount gave wrong error: %08lx\n", hr);
hr = IAudioStreamVolume_GetChannelVolume(asv, 0, NULL);
- ok(hr == E_POINTER, "GetChannelCount gave wrong error: %08x\n", hr);
ok(hr == E_POINTER, "GetChannelCount gave wrong error: %08lx\n", hr);
hr = IAudioStreamVolume_GetChannelVolume(asv, 0, &vol);
- ok(hr == S_OK, "GetChannelCount failed: %08x\n", hr);
ok(hr == S_OK, "GetChannelCount failed: %08lx\n", hr); ok(vol == 1.f, "Channel volume was not 1: %f\n", vol);
hr = IAudioStreamVolume_SetChannelVolume(asv, fmt->nChannels, -1.f);
- ok(hr == E_INVALIDARG, "SetChannelVolume gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "SetChannelVolume gave wrong error: %08lx\n", hr);
hr = IAudioStreamVolume_SetChannelVolume(asv, 0, -1.f);
- ok(hr == E_INVALIDARG, "SetChannelVolume gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "SetChannelVolume gave wrong error: %08lx\n", hr);
hr = IAudioStreamVolume_SetChannelVolume(asv, 0, 2.f);
- ok(hr == E_INVALIDARG, "SetChannelVolume gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "SetChannelVolume gave wrong error: %08lx\n", hr);
hr = IAudioStreamVolume_SetChannelVolume(asv, 0, 0.2f);
- ok(hr == S_OK, "SetChannelVolume failed: %08x\n", hr);
ok(hr == S_OK, "SetChannelVolume failed: %08lx\n", hr);
hr = IAudioStreamVolume_GetChannelVolume(asv, 0, &vol);
- ok(hr == S_OK, "GetChannelCount failed: %08x\n", hr);
ok(hr == S_OK, "GetChannelCount failed: %08lx\n", hr); ok(fabsf(vol - 0.2f) < 0.05f, "Channel volume wasn't 0.2: %f\n", vol);
hr = IAudioStreamVolume_GetAllVolumes(asv, 0, NULL);
- ok(hr == E_POINTER, "GetAllVolumes gave wrong error: %08x\n", hr);
ok(hr == E_POINTER, "GetAllVolumes gave wrong error: %08lx\n", hr);
hr = IAudioStreamVolume_GetAllVolumes(asv, fmt->nChannels, NULL);
- ok(hr == E_POINTER, "GetAllVolumes gave wrong error: %08x\n", hr);
ok(hr == E_POINTER, "GetAllVolumes gave wrong error: %08lx\n", hr);
vols = HeapAlloc(GetProcessHeap(), 0, fmt->nChannels * sizeof(float)); ok(vols != NULL, "HeapAlloc failed\n");
hr = IAudioStreamVolume_GetAllVolumes(asv, fmt->nChannels - 1, vols);
- ok(hr == E_INVALIDARG, "GetAllVolumes gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "GetAllVolumes gave wrong error: %08lx\n", hr);
hr = IAudioStreamVolume_GetAllVolumes(asv, fmt->nChannels, vols);
- ok(hr == S_OK, "GetAllVolumes failed: %08x\n", hr);
ok(hr == S_OK, "GetAllVolumes failed: %08lx\n", hr); ok(fabsf(vols[0] - 0.2f) < 0.05f, "Channel 0 volume wasn't 0.2: %f\n", vol); for(i = 1; i < fmt->nChannels; ++i) ok(vols[i] == 1.f, "Channel %d volume is not 1: %f\n", i, vols[i]);
hr = IAudioStreamVolume_SetAllVolumes(asv, 0, NULL);
- ok(hr == E_POINTER, "SetAllVolumes gave wrong error: %08x\n", hr);
ok(hr == E_POINTER, "SetAllVolumes gave wrong error: %08lx\n", hr);
hr = IAudioStreamVolume_SetAllVolumes(asv, fmt->nChannels, NULL);
- ok(hr == E_POINTER, "SetAllVolumes gave wrong error: %08x\n", hr);
ok(hr == E_POINTER, "SetAllVolumes gave wrong error: %08lx\n", hr);
hr = IAudioStreamVolume_SetAllVolumes(asv, fmt->nChannels - 1, vols);
- ok(hr == E_INVALIDARG, "SetAllVolumes gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "SetAllVolumes gave wrong error: %08lx\n", hr);
hr = IAudioStreamVolume_SetAllVolumes(asv, fmt->nChannels, vols);
- ok(hr == S_OK, "SetAllVolumes failed: %08x\n", hr);
ok(hr == S_OK, "SetAllVolumes failed: %08lx\n", hr);
HeapFree(GetProcessHeap(), 0, vols); IAudioStreamVolume_Release(asv);
@@ -1716,20 +1716,20 @@ static void test_channelvolume(void)
hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ac);
- ok(hr == S_OK, "Activation failed with %08x\n", hr);
ok(hr == S_OK, "Activation failed with %08lx\n", hr); if(hr != S_OK) return;
hr = IAudioClient_GetMixFormat(ac, &fmt);
- ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr);
ok(hr == S_OK, "GetMixFormat failed: %08lx\n", hr);
hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_NOPERSIST, 5000000, 0, fmt, NULL);
- ok(hr == S_OK, "Initialize failed: %08x\n", hr);
ok(hr == S_OK, "Initialize failed: %08lx\n", hr);
if(hr == S_OK){ hr = IAudioClient_GetService(ac, &IID_IChannelAudioVolume, (void**)&acv);
ok(hr == S_OK, "GetService failed: %08x\n", hr);
} if(hr != S_OK){ IAudioClient_Release(ac);ok(hr == S_OK, "GetService failed: %08lx\n", hr);
@@ -1738,73 +1738,73 @@ static void test_channelvolume(void) }
hr = IChannelAudioVolume_GetChannelCount(acv, NULL);
- ok(hr == NULL_PTR_ERR, "GetChannelCount gave wrong error: %08x\n", hr);
ok(hr == NULL_PTR_ERR, "GetChannelCount gave wrong error: %08lx\n", hr);
hr = IChannelAudioVolume_GetChannelCount(acv, &chans);
- ok(hr == S_OK, "GetChannelCount failed: %08x\n", hr);
ok(hr == S_OK, "GetChannelCount failed: %08lx\n", hr); ok(chans == fmt->nChannels, "GetChannelCount gave wrong number of channels: %d\n", chans);
hr = IChannelAudioVolume_GetChannelVolume(acv, fmt->nChannels, NULL);
- ok(hr == NULL_PTR_ERR, "GetChannelCount gave wrong error: %08x\n", hr);
ok(hr == NULL_PTR_ERR, "GetChannelCount gave wrong error: %08lx\n", hr);
hr = IChannelAudioVolume_GetChannelVolume(acv, fmt->nChannels, &vol);
- ok(hr == E_INVALIDARG, "GetChannelCount gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "GetChannelCount gave wrong error: %08lx\n", hr);
hr = IChannelAudioVolume_GetChannelVolume(acv, 0, NULL);
- ok(hr == NULL_PTR_ERR, "GetChannelCount gave wrong error: %08x\n", hr);
ok(hr == NULL_PTR_ERR, "GetChannelCount gave wrong error: %08lx\n", hr);
hr = IChannelAudioVolume_GetChannelVolume(acv, 0, &vol);
- ok(hr == S_OK, "GetChannelCount failed: %08x\n", hr);
ok(hr == S_OK, "GetChannelCount failed: %08lx\n", hr); ok(vol == 1.f, "Channel volume was not 1: %f\n", vol);
hr = IChannelAudioVolume_SetChannelVolume(acv, fmt->nChannels, -1.f, NULL);
- ok(hr == E_INVALIDARG, "SetChannelVolume gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "SetChannelVolume gave wrong error: %08lx\n", hr);
hr = IChannelAudioVolume_SetChannelVolume(acv, 0, -1.f, NULL);
- ok(hr == E_INVALIDARG, "SetChannelVolume gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "SetChannelVolume gave wrong error: %08lx\n", hr);
hr = IChannelAudioVolume_SetChannelVolume(acv, 0, 2.f, NULL);
- ok(hr == E_INVALIDARG, "SetChannelVolume gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "SetChannelVolume gave wrong error: %08lx\n", hr);
hr = IChannelAudioVolume_SetChannelVolume(acv, 0, 0.2f, NULL);
- ok(hr == S_OK, "SetChannelVolume failed: %08x\n", hr);
ok(hr == S_OK, "SetChannelVolume failed: %08lx\n", hr);
hr = IChannelAudioVolume_GetChannelVolume(acv, 0, &vol);
- ok(hr == S_OK, "GetChannelCount failed: %08x\n", hr);
ok(hr == S_OK, "GetChannelCount failed: %08lx\n", hr); ok(fabsf(vol - 0.2f) < 0.05f, "Channel volume wasn't 0.2: %f\n", vol);
hr = IChannelAudioVolume_GetAllVolumes(acv, 0, NULL);
- ok(hr == NULL_PTR_ERR, "GetAllVolumes gave wrong error: %08x\n", hr);
ok(hr == NULL_PTR_ERR, "GetAllVolumes gave wrong error: %08lx\n", hr);
hr = IChannelAudioVolume_GetAllVolumes(acv, fmt->nChannels, NULL);
- ok(hr == NULL_PTR_ERR, "GetAllVolumes gave wrong error: %08x\n", hr);
ok(hr == NULL_PTR_ERR, "GetAllVolumes gave wrong error: %08lx\n", hr);
vols = HeapAlloc(GetProcessHeap(), 0, fmt->nChannels * sizeof(float)); ok(vols != NULL, "HeapAlloc failed\n");
hr = IChannelAudioVolume_GetAllVolumes(acv, fmt->nChannels - 1, vols);
- ok(hr == E_INVALIDARG, "GetAllVolumes gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "GetAllVolumes gave wrong error: %08lx\n", hr);
hr = IChannelAudioVolume_GetAllVolumes(acv, fmt->nChannels, vols);
- ok(hr == S_OK, "GetAllVolumes failed: %08x\n", hr);
ok(hr == S_OK, "GetAllVolumes failed: %08lx\n", hr); ok(fabsf(vols[0] - 0.2f) < 0.05f, "Channel 0 volume wasn't 0.2: %f\n", vol); for(i = 1; i < fmt->nChannels; ++i) ok(vols[i] == 1.f, "Channel %d volume is not 1: %f\n", i, vols[i]);
hr = IChannelAudioVolume_SetAllVolumes(acv, 0, NULL, NULL);
- ok(hr == NULL_PTR_ERR, "SetAllVolumes gave wrong error: %08x\n", hr);
ok(hr == NULL_PTR_ERR, "SetAllVolumes gave wrong error: %08lx\n", hr);
hr = IChannelAudioVolume_SetAllVolumes(acv, fmt->nChannels, NULL, NULL);
- ok(hr == NULL_PTR_ERR, "SetAllVolumes gave wrong error: %08x\n", hr);
ok(hr == NULL_PTR_ERR, "SetAllVolumes gave wrong error: %08lx\n", hr);
hr = IChannelAudioVolume_SetAllVolumes(acv, fmt->nChannels - 1, vols, NULL);
- ok(hr == E_INVALIDARG, "SetAllVolumes gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "SetAllVolumes gave wrong error: %08lx\n", hr);
hr = IChannelAudioVolume_SetAllVolumes(acv, fmt->nChannels, vols, NULL);
- ok(hr == S_OK, "SetAllVolumes failed: %08x\n", hr);
ok(hr == S_OK, "SetAllVolumes failed: %08lx\n", hr);
hr = IChannelAudioVolume_SetChannelVolume(acv, 0, 1.0f, NULL);
- ok(hr == S_OK, "SetChannelVolume failed: %08x\n", hr);
ok(hr == S_OK, "SetChannelVolume failed: %08lx\n", hr);
HeapFree(GetProcessHeap(), 0, vols); IChannelAudioVolume_Release(acv);
@@ -1823,20 +1823,20 @@ static void test_simplevolume(void)
hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ac);
- ok(hr == S_OK, "Activation failed with %08x\n", hr);
ok(hr == S_OK, "Activation failed with %08lx\n", hr); if(hr != S_OK) return;
hr = IAudioClient_GetMixFormat(ac, &fmt);
- ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr);
ok(hr == S_OK, "GetMixFormat failed: %08lx\n", hr);
hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_NOPERSIST, 5000000, 0, fmt, NULL);
- ok(hr == S_OK, "Initialize failed: %08x\n", hr);
ok(hr == S_OK, "Initialize failed: %08lx\n", hr);
if(hr == S_OK){ hr = IAudioClient_GetService(ac, &IID_ISimpleAudioVolume, (void**)&sav);
ok(hr == S_OK, "GetService failed: %08x\n", hr);
} if(hr != S_OK){ IAudioClient_Release(ac);ok(hr == S_OK, "GetService failed: %08lx\n", hr);
@@ -1845,55 +1845,55 @@ static void test_simplevolume(void) }
hr = ISimpleAudioVolume_GetMasterVolume(sav, NULL);
- ok(hr == NULL_PTR_ERR, "GetMasterVolume gave wrong error: %08x\n", hr);
ok(hr == NULL_PTR_ERR, "GetMasterVolume gave wrong error: %08lx\n", hr);
hr = ISimpleAudioVolume_GetMasterVolume(sav, &vol);
- ok(hr == S_OK, "GetMasterVolume failed: %08x\n", hr);
ok(hr == S_OK, "GetMasterVolume failed: %08lx\n", hr); ok(vol == 1.f, "Master volume wasn't 1: %f\n", vol);
hr = ISimpleAudioVolume_SetMasterVolume(sav, -1.f, NULL);
- ok(hr == E_INVALIDARG, "SetMasterVolume gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "SetMasterVolume gave wrong error: %08lx\n", hr);
hr = ISimpleAudioVolume_SetMasterVolume(sav, 2.f, NULL);
- ok(hr == E_INVALIDARG, "SetMasterVolume gave wrong error: %08x\n", hr);
ok(hr == E_INVALIDARG, "SetMasterVolume gave wrong error: %08lx\n", hr);
hr = ISimpleAudioVolume_SetMasterVolume(sav, 0.2f, NULL);
- ok(hr == S_OK, "SetMasterVolume failed: %08x\n", hr);
ok(hr == S_OK, "SetMasterVolume failed: %08lx\n", hr);
hr = ISimpleAudioVolume_GetMasterVolume(sav, &vol);
- ok(hr == S_OK, "GetMasterVolume failed: %08x\n", hr);
ok(hr == S_OK, "GetMasterVolume failed: %08lx\n", hr); ok(fabsf(vol - 0.2f) < 0.05f, "Master volume wasn't 0.2: %f\n", vol);
hr = ISimpleAudioVolume_GetMute(sav, NULL);
- ok(hr == NULL_PTR_ERR, "GetMute gave wrong error: %08x\n", hr);
ok(hr == NULL_PTR_ERR, "GetMute gave wrong error: %08lx\n", hr);
mute = TRUE; hr = ISimpleAudioVolume_GetMute(sav, &mute);
- ok(hr == S_OK, "GetMute failed: %08x\n", hr);
ok(hr == S_OK, "GetMute failed: %08lx\n", hr); ok(mute == FALSE, "Session is already muted\n");
hr = ISimpleAudioVolume_SetMute(sav, TRUE, NULL);
- ok(hr == S_OK, "SetMute failed: %08x\n", hr);
ok(hr == S_OK, "SetMute failed: %08lx\n", hr);
mute = FALSE; hr = ISimpleAudioVolume_GetMute(sav, &mute);
- ok(hr == S_OK, "GetMute failed: %08x\n", hr);
ok(hr == S_OK, "GetMute failed: %08lx\n", hr); ok(mute == TRUE, "Session should have been muted\n");
hr = ISimpleAudioVolume_GetMasterVolume(sav, &vol);
- ok(hr == S_OK, "GetMasterVolume failed: %08x\n", hr);
ok(hr == S_OK, "GetMasterVolume failed: %08lx\n", hr); ok(fabsf(vol - 0.2f) < 0.05f, "Master volume wasn't 0.2: %f\n", vol);
hr = ISimpleAudioVolume_SetMasterVolume(sav, 1.f, NULL);
- ok(hr == S_OK, "SetMasterVolume failed: %08x\n", hr);
ok(hr == S_OK, "SetMasterVolume failed: %08lx\n", hr);
mute = FALSE; hr = ISimpleAudioVolume_GetMute(sav, &mute);
- ok(hr == S_OK, "GetMute failed: %08x\n", hr);
ok(hr == S_OK, "GetMute failed: %08lx\n", hr); ok(mute == TRUE, "Session should have been muted\n");
hr = ISimpleAudioVolume_SetMute(sav, FALSE, NULL);
- ok(hr == S_OK, "SetMute failed: %08x\n", hr);
ok(hr == S_OK, "SetMute failed: %08lx\n", hr);
ISimpleAudioVolume_Release(sav); IAudioClient_Release(ac);
@@ -1913,24 +1913,24 @@ static void test_volume_dependence(void) UINT32 nch;
hr = CoCreateGuid(&session);
- ok(hr == S_OK, "CoCreateGuid failed: %08x\n", hr);
ok(hr == S_OK, "CoCreateGuid failed: %08lx\n", hr);
hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ac);
- ok(hr == S_OK, "Activation failed with %08x\n", hr);
ok(hr == S_OK, "Activation failed with %08lx\n", hr); if(hr != S_OK) return;
hr = IAudioClient_GetMixFormat(ac, &fmt);
- ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr);
ok(hr == S_OK, "GetMixFormat failed: %08lx\n", hr);
hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_NOPERSIST, 5000000, 0, fmt, &session);
- ok(hr == S_OK, "Initialize failed: %08x\n", hr);
ok(hr == S_OK, "Initialize failed: %08lx\n", hr);
if(hr == S_OK){ hr = IAudioClient_GetService(ac, &IID_ISimpleAudioVolume, (void**)&sav);
ok(hr == S_OK, "GetService (SimpleAudioVolume) failed: %08x\n", hr);
} if(hr != S_OK){ IAudioClient_Release(ac);ok(hr == S_OK, "GetService (SimpleAudioVolume) failed: %08lx\n", hr);
@@ -1939,40 +1939,40 @@ static void test_volume_dependence(void) }
hr = IAudioClient_GetService(ac, &IID_IChannelAudioVolume, (void**)&cav);
- ok(hr == S_OK, "GetService (ChannelAudioVolume) failed: %08x\n", hr);
ok(hr == S_OK, "GetService (ChannelAudioVolume) failed: %08lx\n", hr);
hr = IAudioClient_GetService(ac, &IID_IAudioStreamVolume, (void**)&asv);
- ok(hr == S_OK, "GetService (AudioStreamVolume) failed: %08x\n", hr);
ok(hr == S_OK, "GetService (AudioStreamVolume) failed: %08lx\n", hr);
hr = IAudioStreamVolume_SetChannelVolume(asv, 0, 0.2f);
- ok(hr == S_OK, "ASV_SetChannelVolume failed: %08x\n", hr);
ok(hr == S_OK, "ASV_SetChannelVolume failed: %08lx\n", hr);
hr = IChannelAudioVolume_SetChannelVolume(cav, 0, 0.4f, NULL);
- ok(hr == S_OK, "CAV_SetChannelVolume failed: %08x\n", hr);
ok(hr == S_OK, "CAV_SetChannelVolume failed: %08lx\n", hr);
hr = ISimpleAudioVolume_SetMasterVolume(sav, 0.6f, NULL);
- ok(hr == S_OK, "SAV_SetMasterVolume failed: %08x\n", hr);
ok(hr == S_OK, "SAV_SetMasterVolume failed: %08lx\n", hr);
hr = IAudioStreamVolume_GetChannelVolume(asv, 0, &vol);
- ok(hr == S_OK, "ASV_GetChannelVolume failed: %08x\n", hr);
ok(hr == S_OK, "ASV_GetChannelVolume failed: %08lx\n", hr); ok(fabsf(vol - 0.2f) < 0.05f, "ASV_GetChannelVolume gave wrong volume: %f\n", vol);
hr = IChannelAudioVolume_GetChannelVolume(cav, 0, &vol);
- ok(hr == S_OK, "CAV_GetChannelVolume failed: %08x\n", hr);
ok(hr == S_OK, "CAV_GetChannelVolume failed: %08lx\n", hr); ok(fabsf(vol - 0.4f) < 0.05f, "CAV_GetChannelVolume gave wrong volume: %f\n", vol);
hr = ISimpleAudioVolume_GetMasterVolume(sav, &vol);
- ok(hr == S_OK, "SAV_GetMasterVolume failed: %08x\n", hr);
ok(hr == S_OK, "SAV_GetMasterVolume failed: %08lx\n", hr); ok(fabsf(vol - 0.6f) < 0.05f, "SAV_GetMasterVolume gave wrong volume: %f\n", vol);
hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ac2);
- ok(hr == S_OK, "Activation failed with %08x\n", hr);
ok(hr == S_OK, "Activation failed with %08lx\n", hr);
if(hr == S_OK){ hr = IAudioClient_Initialize(ac2, AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_NOPERSIST, 5000000, 0, fmt, &session);
ok(hr == S_OK, "Initialize failed: %08x\n", hr);
}ok(hr == S_OK, "Initialize failed: %08lx\n", hr); if(hr != S_OK) IAudioClient_Release(ac2);
@@ -1982,25 +1982,25 @@ static void test_volume_dependence(void) IAudioStreamVolume *asv2;
hr = IAudioClient_GetService(ac2, &IID_IChannelAudioVolume, (void**)&cav2);
ok(hr == S_OK, "GetService failed: %08x\n", hr);
ok(hr == S_OK, "GetService failed: %08lx\n", hr); hr = IAudioClient_GetService(ac2, &IID_IAudioStreamVolume, (void**)&asv2);
ok(hr == S_OK, "GetService failed: %08x\n", hr);
ok(hr == S_OK, "GetService failed: %08lx\n", hr); hr = IChannelAudioVolume_GetChannelVolume(cav2, 0, &vol);
ok(hr == S_OK, "CAV_GetChannelVolume failed: %08x\n", hr);
ok(hr == S_OK, "CAV_GetChannelVolume failed: %08lx\n", hr); ok(fabsf(vol - 0.4f) < 0.05f, "CAV_GetChannelVolume gave wrong volume: %f\n", vol); hr = IAudioStreamVolume_GetChannelVolume(asv2, 0, &vol);
ok(hr == S_OK, "ASV_GetChannelVolume failed: %08x\n", hr);
ok(hr == S_OK, "ASV_GetChannelVolume failed: %08lx\n", hr); ok(vol == 1.f, "ASV_GetChannelVolume gave wrong volume: %f\n", vol); hr = IChannelAudioVolume_GetChannelCount(cav2, &nch);
ok(hr == S_OK, "GetChannelCount failed: %08x\n", hr);
ok(hr == S_OK, "GetChannelCount failed: %08lx\n", hr); ok(nch == fmt->nChannels, "Got wrong channel count, expected %u: %u\n", fmt->nChannels, nch); hr = IAudioStreamVolume_GetChannelCount(asv2, &nch);
ok(hr == S_OK, "GetChannelCount failed: %08x\n", hr);
ok(hr == S_OK, "GetChannelCount failed: %08lx\n", hr); ok(nch == fmt->nChannels, "Got wrong channel count, expected %u: %u\n", fmt->nChannels, nch); IAudioStreamVolume_Release(asv2);
@@ -2010,10 +2010,10 @@ static void test_volume_dependence(void) skip("Unable to open the same device twice. Skipping session volume control tests\n");
hr = IChannelAudioVolume_SetChannelVolume(cav, 0, 1.f, NULL);
- ok(hr == S_OK, "CAV_SetChannelVolume failed: %08x\n", hr);
ok(hr == S_OK, "CAV_SetChannelVolume failed: %08lx\n", hr);
hr = ISimpleAudioVolume_SetMasterVolume(sav, 1.f, NULL);
- ok(hr == S_OK, "SAV_SetMasterVolume failed: %08x\n", hr);
ok(hr == S_OK, "SAV_SetMasterVolume failed: %08lx\n", hr);
CoTaskMemFree(fmt); ISimpleAudioVolume_Release(sav);
@@ -2037,15 +2037,15 @@ static void test_session_creation(void)
hr = IMMDevice_Activate(dev, &IID_IAudioSessionManager, CLSCTX_INPROC_SERVER, NULL, (void**)&sesm);
- ok((hr == S_OK)^(sesm == NULL), "Activate %08x &out pointer\n", hr);
- ok(hr == S_OK, "Activate failed: %08x\n", hr);
ok((hr == S_OK)^(sesm == NULL), "Activate %08lx &out pointer\n", hr);
ok(hr == S_OK, "Activate failed: %08lx\n", hr);
hr = IAudioSessionManager_GetSimpleAudioVolume(sesm, &session_guid, FALSE, &sav);
- ok(hr == S_OK, "GetSimpleAudioVolume failed: %08x\n", hr);
ok(hr == S_OK, "GetSimpleAudioVolume failed: %08lx\n", hr);
hr = ISimpleAudioVolume_SetMasterVolume(sav, 0.6f, NULL);
- ok(hr == S_OK, "SetMasterVolume failed: %08x\n", hr);
ok(hr == S_OK, "SetMasterVolume failed: %08lx\n", hr);
/* Release completely to show session persistence */ ISimpleAudioVolume_Release(sav);
@@ -2063,44 +2063,44 @@ static void test_session_creation(void)
hr = IMMDevice_Activate(cap_dev, &IID_IAudioSessionManager, CLSCTX_INPROC_SERVER, NULL, (void**)&cap_sesm);
ok((hr == S_OK)^(cap_sesm == NULL), "Activate %08x &out pointer\n", hr);
ok(hr == S_OK, "Activate failed: %08x\n", hr);
ok((hr == S_OK)^(cap_sesm == NULL), "Activate %08lx &out pointer\n", hr);
ok(hr == S_OK, "Activate failed: %08lx\n", hr); hr = IAudioSessionManager_GetSimpleAudioVolume(cap_sesm, &session_guid, FALSE, &cap_sav);
ok(hr == S_OK, "GetSimpleAudioVolume failed: %08x\n", hr);
ok(hr == S_OK, "GetSimpleAudioVolume failed: %08lx\n", hr); vol = 0.5f; hr = ISimpleAudioVolume_GetMasterVolume(cap_sav, &vol);
ok(hr == S_OK, "GetMasterVolume failed: %08x\n", hr);
ok(hr == S_OK, "GetMasterVolume failed: %08lx\n", hr); ISimpleAudioVolume_Release(cap_sav); IAudioSessionManager_Release(cap_sesm); hr = IMMDevice_Activate(cap_dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&cap_ac);
ok(hr == S_OK, "Activate failed: %08x\n", hr);
ok(hr == S_OK, "Activate failed: %08lx\n", hr); IMMDevice_Release(cap_dev); hr = IAudioClient_GetMixFormat(cap_ac, &cap_pwfx);
ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr);
ok(hr == S_OK, "GetMixFormat failed: %08lx\n", hr); hr = IAudioClient_Initialize(cap_ac, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, 0, cap_pwfx, &session_guid);
ok(hr == S_OK, "Initialize failed: %08x\n", hr);
ok(hr == S_OK, "Initialize failed: %08lx\n", hr); CoTaskMemFree(cap_pwfx); if(hr == S_OK){ hr = IAudioClient_GetService(cap_ac, &IID_ISimpleAudioVolume, (void**)&cap_sav);
ok(hr == S_OK, "GetService failed: %08x\n", hr);
ok(hr == S_OK, "GetService failed: %08lx\n", hr); } if(hr == S_OK){ vol = 0.5f; hr = ISimpleAudioVolume_GetMasterVolume(cap_sav, &vol);
ok(hr == S_OK, "GetMasterVolume failed: %08x\n", hr);
ok(hr == S_OK, "GetMasterVolume failed: %08lx\n", hr); ISimpleAudioVolume_Release(cap_sav); }
@@ -2110,24 +2110,24 @@ static void test_session_creation(void)
hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ac);
- ok((hr == S_OK)^(ac == NULL), "Activate %08x &out pointer\n", hr);
- ok(hr == S_OK, "Activation failed with %08x\n", hr);
ok((hr == S_OK)^(ac == NULL), "Activate %08lx &out pointer\n", hr);
ok(hr == S_OK, "Activation failed with %08lx\n", hr); if(hr != S_OK) return;
hr = IAudioClient_GetMixFormat(ac, &fmt);
- ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr);
ok(hr == S_OK, "GetMixFormat failed: %08lx\n", hr);
hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_NOPERSIST, 5000000, 0, fmt, &session_guid);
- ok(hr == S_OK, "Initialize failed: %08x\n", hr);
ok(hr == S_OK, "Initialize failed: %08lx\n", hr);
hr = IAudioClient_GetService(ac, &IID_ISimpleAudioVolume, (void**)&sav);
- ok(hr == S_OK, "GetService failed: %08x\n", hr);
- ok(hr == S_OK, "GetService failed: %08lx\n", hr); if(hr == S_OK){ vol = 0.5f; hr = ISimpleAudioVolume_GetMasterVolume(sav, &vol);
ok(hr == S_OK, "GetMasterVolume failed: %08x\n", hr);
ok(hr == S_OK, "GetMasterVolume failed: %08lx\n", hr); ok(fabs(vol - 0.6f) < 0.05f, "Got wrong volume: %f\n", vol); ISimpleAudioVolume_Release(sav);
@@ -2154,21 +2154,21 @@ static void test_worst_case(void)
hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ac);
- ok(hr == S_OK, "Activation failed with %08x\n", hr);
ok(hr == S_OK, "Activation failed with %08lx\n", hr); if(hr != S_OK) return;
hr = IAudioClient_GetMixFormat(ac, &pwfx);
- ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr);
ok(hr == S_OK, "GetMixFormat failed: %08lx\n", hr);
hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_EVENTCALLBACK, 500000, 0, pwfx, NULL);
- ok(hr == S_OK, "Initialize failed: %08x\n", hr);
ok(hr == S_OK, "Initialize failed: %08lx\n", hr); if(hr != S_OK) return;
hr = IAudioClient_GetDevicePeriod(ac, &defp, NULL);
- ok(hr == S_OK, "GetDevicePeriod failed: %08x\n", hr);
ok(hr == S_OK, "GetDevicePeriod failed: %08lx\n", hr);
fragment = MulDiv(defp, pwfx->nSamplesPerSec, 10000000);
@@ -2176,74 +2176,74 @@ static void test_worst_case(void) ok(event != NULL, "CreateEvent failed\n");
hr = IAudioClient_SetEventHandle(ac, event);
- ok(hr == S_OK, "SetEventHandle failed: %08x\n", hr);
ok(hr == S_OK, "SetEventHandle failed: %08lx\n", hr);
hr = IAudioClient_GetService(ac, &IID_IAudioRenderClient, (void**)&arc);
- ok(hr == S_OK, "GetService(IAudioRenderClient) failed: %08x\n", hr);
ok(hr == S_OK, "GetService(IAudioRenderClient) failed: %08lx\n", hr);
hr = IAudioClient_GetService(ac, &IID_IAudioClock, (void**)&acl);
- ok(hr == S_OK, "GetService(IAudioClock) failed: %08x\n", hr);
ok(hr == S_OK, "GetService(IAudioClock) failed: %08lx\n", hr);
hr = IAudioClock_GetFrequency(acl, &freq);
- ok(hr == S_OK, "GetFrequency failed: %08x\n", hr);
ok(hr == S_OK, "GetFrequency failed: %08lx\n", hr);
for(j = 0; j <= (winetest_interactive ? 9 : 2); j++){ sum = 0;
trace("Should play %ums continuous tone with fragment size %u.\n",
trace("Should play %lums continuous tone with fragment size %u.\n", (ULONG)(defp/100), fragment); hr = IAudioClock_GetPosition(acl, &pos, &pcpos0);
ok(hr == S_OK, "GetPosition failed: %08x\n", hr);
ok(hr == S_OK, "GetPosition failed: %08lx\n", hr); /* XAudio2 prefills one period, play without it */ if(winetest_debug>2){ hr = IAudioRenderClient_GetBuffer(arc, fragment, &data);
ok(hr == S_OK, "GetBuffer failed: %08x\n", hr);
ok(hr == S_OK, "GetBuffer failed: %08lx\n", hr); hr = IAudioRenderClient_ReleaseBuffer(arc, fragment, AUDCLNT_BUFFERFLAGS_SILENT);
ok(hr == S_OK, "ReleaseBuffer failed: %08x\n", hr);
ok(hr == S_OK, "ReleaseBuffer failed: %08lx\n", hr); if(hr == S_OK) sum += fragment; } hr = IAudioClient_Start(ac);
ok(hr == S_OK, "Start failed: %08x\n", hr);
ok(hr == S_OK, "Start failed: %08lx\n", hr); for(i = 0; i <= 99; i++){ /* 100 x 10ms = 1 second */ r = WaitForSingleObject(event, 60 + defp / 10000);
ok(r == WAIT_OBJECT_0, "Wait iteration %d gave %x\n", i, r);
ok(r == WAIT_OBJECT_0, "Wait iteration %d gave %lx\n", i, r); /* the app has nearly one period time to feed data */ Sleep((i % 10) * defp / 120000); hr = IAudioClient_GetCurrentPadding(ac, &pad);
ok(hr == S_OK, "GetCurrentPadding failed: %08x\n", hr);
ok(hr == S_OK, "GetCurrentPadding failed: %08lx\n", hr); /* XAudio2 writes only when there's little data left */ if(pad <= fragment){ hr = IAudioRenderClient_GetBuffer(arc, fragment, &data);
ok(hr == S_OK, "GetBuffer failed: %08x\n", hr);
ok(hr == S_OK, "GetBuffer failed: %08lx\n", hr); hr = IAudioRenderClient_ReleaseBuffer(arc, fragment, wave_generate_tone(pwfx, data, fragment));
ok(hr == S_OK, "ReleaseBuffer failed: %08x\n", hr);
ok(hr == S_OK, "ReleaseBuffer failed: %08lx\n", hr); if(hr == S_OK) sum += fragment; } } hr = IAudioClient_Stop(ac);
ok(hr == S_OK, "Stop failed: %08x\n", hr);
ok(hr == S_OK, "Stop failed: %08lx\n", hr); hr = IAudioClient_GetCurrentPadding(ac, &pad);
ok(hr == S_OK, "GetCurrentPadding failed: %08x\n", hr);
ok(hr == S_OK, "GetCurrentPadding failed: %08lx\n", hr); hr = IAudioClock_GetPosition(acl, &pos, &pcpos);
ok(hr == S_OK, "GetPosition failed: %08x\n", hr);
ok(hr == S_OK, "GetPosition failed: %08lx\n", hr); Sleep(100);
trace("Released %u=%ux%u -%u frames at %u worth %ums in %ums\n",
trace("Released %u=%ux%u -%u frames at %lu worth %ums in %lums\n", sum, sum/fragment, fragment, pad, pwfx->nSamplesPerSec, MulDiv(sum-pad, 1000, pwfx->nSamplesPerSec), (ULONG)((pcpos-pcpos0)/10000));
@@ -2252,7 +2252,7 @@ static void test_worst_case(void) "Position %u at end vs. %u-%u submitted frames\n", (UINT)pos, sum, pad);
hr = IAudioClient_Reset(ac);
ok(hr == S_OK, "Reset failed: %08x\n", hr);
ok(hr == S_OK, "Reset failed: %08lx\n", hr); Sleep(250);
}
@@ -2274,37 +2274,37 @@ static void test_marshal(void) /* IAudioRenderClient */ hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ac);
- ok(hr == S_OK, "Activation failed with %08x\n", hr);
ok(hr == S_OK, "Activation failed with %08lx\n", hr); if(hr != S_OK) return;
hr = IAudioClient_GetMixFormat(ac, &pwfx);
- ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr);
ok(hr == S_OK, "GetMixFormat failed: %08lx\n", hr);
hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, 0, pwfx, NULL);
- ok(hr == S_OK, "Initialize failed: %08x\n", hr);
ok(hr == S_OK, "Initialize failed: %08lx\n", hr);
CoTaskMemFree(pwfx);
hr = IAudioClient_GetService(ac, &IID_IAudioRenderClient, (void**)&rc);
- ok(hr == S_OK, "GetService failed: %08x\n", hr);
ok(hr == S_OK, "GetService failed: %08lx\n", hr); if(hr != S_OK) { IAudioClient_Release(ac); return; }
hr = CreateStreamOnHGlobal(NULL, TRUE, &pStream);
- ok(hr == S_OK, "CreateStreamOnHGlobal failed 0x%08x\n", hr);
ok(hr == S_OK, "CreateStreamOnHGlobal failed 0x%08lx\n", hr);
/* marshal IAudioClient */
hr = CoMarshalInterface(pStream, &IID_IAudioClient, (IUnknown*)ac, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
- ok(hr == S_OK, "CoMarshalInterface IAudioClient failed 0x%08x\n", hr);
ok(hr == S_OK, "CoMarshalInterface IAudioClient failed 0x%08lx\n", hr);
IStream_Seek(pStream, ullZero, STREAM_SEEK_SET, NULL); hr = CoUnmarshalInterface(pStream, &IID_IAudioClient, (void **)&acDest);
- ok(hr == S_OK, "CoUnmarshalInterface IAudioClient failed 0x%08x\n", hr);
- ok(hr == S_OK, "CoUnmarshalInterface IAudioClient failed 0x%08lx\n", hr); if (hr == S_OK) IAudioClient_Release(acDest);
@@ -2312,11 +2312,11 @@ static void test_marshal(void) /* marshal IAudioRenderClient */
hr = CoMarshalInterface(pStream, &IID_IAudioRenderClient, (IUnknown*)rc, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
- ok(hr == S_OK, "CoMarshalInterface IAudioRenderClient failed 0x%08x\n", hr);
ok(hr == S_OK, "CoMarshalInterface IAudioRenderClient failed 0x%08lx\n", hr);
IStream_Seek(pStream, ullZero, STREAM_SEEK_SET, NULL); hr = CoUnmarshalInterface(pStream, &IID_IAudioRenderClient, (void **)&rcDest);
- ok(hr == S_OK, "CoUnmarshalInterface IAudioRenderClient failed 0x%08x\n", hr);
- ok(hr == S_OK, "CoUnmarshalInterface IAudioRenderClient failed 0x%08lx\n", hr); if (hr == S_OK) IAudioRenderClient_Release(rcDest);
@@ -2337,31 +2337,31 @@ static void test_endpointvolume(void)
hr = IMMDevice_Activate(dev, &IID_IAudioEndpointVolume, CLSCTX_INPROC_SERVER, NULL, (void**)&aev);
- ok(hr == S_OK, "Activation failed with %08x\n", hr);
ok(hr == S_OK, "Activation failed with %08lx\n", hr); if(hr != S_OK) return;
hr = IAudioEndpointVolume_GetVolumeRange(aev, &mindb, NULL, NULL);
- ok(hr == E_POINTER, "GetVolumeRange should have failed with E_POINTER: 0x%08x\n", hr);
ok(hr == E_POINTER, "GetVolumeRange should have failed with E_POINTER: 0x%08lx\n", hr);
hr = IAudioEndpointVolume_GetVolumeRange(aev, &mindb, &maxdb, &increment);
- ok(hr == S_OK, "GetVolumeRange failed: 0x%08x\n", hr);
ok(hr == S_OK, "GetVolumeRange failed: 0x%08lx\n", hr); trace("got range: [%f,%f]/%f\n", mindb, maxdb, increment);
hr = IAudioEndpointVolume_SetMasterVolumeLevel(aev, mindb - increment, NULL);
- ok(hr == E_INVALIDARG, "SetMasterVolumeLevel failed: 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "SetMasterVolumeLevel failed: 0x%08lx\n", hr);
hr = IAudioEndpointVolume_GetMasterVolumeLevel(aev, &volume);
- ok(hr == S_OK, "GetMasterVolumeLevel failed: 0x%08x\n", hr);
ok(hr == S_OK, "GetMasterVolumeLevel failed: 0x%08lx\n", hr);
hr = IAudioEndpointVolume_SetMasterVolumeLevel(aev, volume, NULL);
- ok(hr == S_OK, "SetMasterVolumeLevel failed: 0x%08x\n", hr);
ok(hr == S_OK, "SetMasterVolumeLevel failed: 0x%08lx\n", hr);
hr = IAudioEndpointVolume_GetMute(aev, &mute);
- ok(hr == S_OK, "GetMute failed: %08x\n", hr);
ok(hr == S_OK, "GetMute failed: %08lx\n", hr);
hr = IAudioEndpointVolume_SetMute(aev, mute, NULL);
- ok(hr == S_OK || hr == S_FALSE, "SetMute failed: %08x\n", hr);
ok(hr == S_OK || hr == S_FALSE, "SetMute failed: %08lx\n", hr);
IAudioEndpointVolume_Release(aev);
} @@ -2375,18 +2375,18 @@ START_TEST(render) hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_INPROC_SERVER, &IID_IMMDeviceEnumerator, (void**)&mme); if (FAILED(hr)) {
skip("mmdevapi not available: 0x%08x\n", hr);
skip("mmdevapi not available: 0x%08lx\n", hr); goto cleanup;
}
hr = IMMDeviceEnumerator_GetDefaultAudioEndpoint(mme, eRender, eMultimedia, &dev);
- ok(hr == S_OK || hr == E_NOTFOUND, "GetDefaultAudioEndpoint failed: 0x%08x\n", hr);
- ok(hr == S_OK || hr == E_NOTFOUND, "GetDefaultAudioEndpoint failed: 0x%08lx\n", hr); if (hr != S_OK || !dev) { if (hr == E_NOTFOUND) skip("No sound card available\n"); else
skip("GetDefaultAudioEndpoint returns 0x%08x\n", hr);
}skip("GetDefaultAudioEndpoint returns 0x%08lx\n", hr); goto cleanup;
diff --git a/dlls/mmdevapi/tests/spatialaudio.c b/dlls/mmdevapi/tests/spatialaudio.c index d9ccc429ce8..2f55b12f68e 100644 --- a/dlls/mmdevapi/tests/spatialaudio.c +++ b/dlls/mmdevapi/tests/spatialaudio.c @@ -46,22 +46,22 @@ static void test_formats(void) WAVEFORMATEX *fmt = NULL;
hr = ISpatialAudioClient_GetSupportedAudioObjectFormatEnumerator(sac, &afe);
- ok(hr == S_OK, "Getting format enumerator failed: 0x%08x\n", hr);
ok(hr == S_OK, "Getting format enumerator failed: 0x%08lx\n", hr);
hr = IAudioFormatEnumerator_GetCount(afe, &format_count);
- ok(hr == S_OK, "Getting format count failed: 0x%08x\n", hr);
ok(hr == S_OK, "Getting format count failed: 0x%08lx\n", hr); ok(format_count == 1, "Got wrong format count, expected 1 got %u\n", format_count);
hr = IAudioFormatEnumerator_GetFormat(afe, 0, &fmt);
- ok(hr == S_OK, "Getting format failed: 0x%08x\n", hr);
ok(hr == S_OK, "Getting format failed: 0x%08lx\n", hr); ok(fmt != NULL, "Expected to get non-NULL format\n");
ok(fmt->wFormatTag == WAVE_FORMAT_IEEE_FLOAT, "Wrong format, expected WAVE_FORMAT_IEEE_FLOAT got %hx\n", fmt->wFormatTag); ok(fmt->nChannels == 1, "Wrong number of channels, expected 1 got %hu\n", fmt->nChannels);
- ok(fmt->nSamplesPerSec == 48000, "Wrong sample ret, expected 48000 got %u\n", fmt->nSamplesPerSec);
- ok(fmt->nSamplesPerSec == 48000, "Wrong sample ret, expected 48000 got %lu\n", fmt->nSamplesPerSec); ok(fmt->wBitsPerSample == 32, "Wrong bits per sample, expected 32 got %hu\n", fmt->wBitsPerSample); ok(fmt->nBlockAlign == 4, "Wrong block align, expected 4 got %hu\n", fmt->nBlockAlign);
- ok(fmt->nAvgBytesPerSec == 192000, "Wrong avg bytes per sec, expected 192000 got %u\n", fmt->nAvgBytesPerSec);
ok(fmt->nAvgBytesPerSec == 192000, "Wrong avg bytes per sec, expected 192000 got %lu\n", fmt->nAvgBytesPerSec); ok(fmt->cbSize == 0, "Wrong cbSize for simple format, expected 0, got %hu\n", fmt->cbSize);
memcpy(&format, fmt, sizeof(format));
@@ -160,19 +160,19 @@ static void test_stream_activation(void) /* correct params */ fill_activation_params(&activation_params); hr = ISpatialAudioClient_ActivateSpatialAudioStream(sac, &activation_params_prop, &IID_ISpatialAudioObjectRenderStream, (void**)&sas);
- ok(hr == S_OK, "Failed to activate spatial audio stream: 0x%08x\n", hr);
ok(hr == S_OK, "Failed to activate spatial audio stream: 0x%08lx\n", hr); ok(ISpatialAudioObjectRenderStream_Release(sas) == 0, "Expected to release the last reference\n");
/* event handle */ fill_activation_params(&activation_params); activation_params.EventHandle = NULL; hr = ISpatialAudioClient_ActivateSpatialAudioStream(sac, &activation_params_prop, &IID_ISpatialAudioObjectRenderStream, (void**)&sas);
- ok(hr == E_INVALIDARG, "Expected lack of no EventHandle to be invalid: 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "Expected lack of no EventHandle to be invalid: 0x%08lx\n", hr); ok(sas == NULL, "Expected spatial audio stream to be set to NULL upon failed activation\n");
activation_params.EventHandle = INVALID_HANDLE_VALUE; hr = ISpatialAudioClient_ActivateSpatialAudioStream(sac, &activation_params_prop, &IID_ISpatialAudioObjectRenderStream, (void**)&sas);
- ok(hr == E_INVALIDARG, "Expected INVALID_HANDLE_VALUE to be invalid: 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "Expected INVALID_HANDLE_VALUE to be invalid: 0x%08lx\n", hr); ok(sas == NULL, "Expected spatial audio stream to be set to NULL upon failed activation\n");
/* must use only queried sample rate */
@@ -182,7 +182,7 @@ static void test_stream_activation(void) wrong_format.nSamplesPerSec = 44100; wrong_format.nAvgBytesPerSec = wrong_format.nSamplesPerSec * wrong_format.nBlockAlign; hr = ISpatialAudioClient_ActivateSpatialAudioStream(sac, &activation_params_prop, &IID_ISpatialAudioObjectRenderStream, (void**)&sas);
- ok(hr == AUDCLNT_E_UNSUPPORTED_FORMAT, "Expected format to be unsupported: 0x%08x\n", hr);
ok(hr == AUDCLNT_E_UNSUPPORTED_FORMAT, "Expected format to be unsupported: 0x%08lx\n", hr); ok(sas == NULL, "Expected spatial audio stream to be set to NULL upon failed activation\n");
/* dynamic objects are not supported */
@@ -191,7 +191,7 @@ static void test_stream_activation(void) fill_activation_params(&activation_params); activation_params.StaticObjectTypeMask |= AudioObjectType_Dynamic; hr = ISpatialAudioClient_ActivateSpatialAudioStream(sac, &activation_params_prop, &IID_ISpatialAudioObjectRenderStream, (void**)&sas);
ok(hr == E_INVALIDARG, "Expected dynamic objects type be invalid: 0x%08x\n", hr);
}ok(hr == E_INVALIDARG, "Expected dynamic objects type be invalid: 0x%08lx\n", hr); ok(sas == NULL, "Expected spatial audio stream to be set to NULL upon failed activation\n");
@@ -199,9 +199,9 @@ static void test_stream_activation(void) activation_params.MaxDynamicObjectCount = max_dyn_count + 1; hr = ISpatialAudioClient_ActivateSpatialAudioStream(sac, &activation_params_prop, &IID_ISpatialAudioObjectRenderStream, (void**)&sas); if (max_dyn_count)
ok(hr == AUDCLNT_E_UNSUPPORTED_FORMAT, "Expected dynamic object count exceeding max to be unsupported: 0x%08x\n", hr);
elseok(hr == AUDCLNT_E_UNSUPPORTED_FORMAT, "Expected dynamic object count exceeding max to be unsupported: 0x%08lx\n", hr);
ok(hr == E_INVALIDARG, "Expected setting dynamic object count to be invalid: 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "Expected setting dynamic object count to be invalid: 0x%08lx\n", hr);
/* ISpatialAudioObjectRenderStreamNotify */ fill_activation_params(&activation_params);
@@ -209,7 +209,7 @@ static void test_stream_activation(void) notify_object.ref = 0; activation_params.NotifyObject = ¬ify_object.ISpatialAudioObjectRenderStreamNotify_iface; hr = ISpatialAudioClient_ActivateSpatialAudioStream(sac, &activation_params_prop, &IID_ISpatialAudioObjectRenderStream, (void**)&sas);
- ok(hr == S_OK, "Failed to activate spatial audio stream: 0x%08x\n", hr);
- ok(hr == S_OK, "Failed to activate spatial audio stream: 0x%08lx\n", hr); ok(notify_object.ref == 1, "Expected to get increased NotifyObject's ref count\n"); ok(ISpatialAudioObjectRenderStream_Release(sas) == 0, "Expected to release the last reference\n"); ok(notify_object.ref == 0, "Expected to get lowered NotifyObject's ref count\n");
@@ -233,23 +233,23 @@ static void test_audio_object_activation(void) fill_activation_params(&activation_params); activation_params.StaticObjectTypeMask &= ~AudioObjectType_FrontRight; hr = ISpatialAudioClient_ActivateSpatialAudioStream(sac, &activation_params_prop, &IID_ISpatialAudioObjectRenderStream, (void**)&sas);
- ok(hr == S_OK, "Failed to activate spatial audio stream: 0x%08x\n", hr);
ok(hr == S_OK, "Failed to activate spatial audio stream: 0x%08lx\n", hr);
hr = ISpatialAudioObjectRenderStream_ActivateSpatialAudioObject(sas, AudioObjectType_FrontLeft, &sao1);
- ok(hr == S_OK, "Failed to activate spatial audio object: 0x%08x\n", hr);
- ok(hr == S_OK, "Failed to activate spatial audio object: 0x%08lx\n", hr); hr = ISpatialAudioObject_IsActive(sao1, &is_active);
- todo_wine ok(hr == S_OK, "Failed to check if spatial audio object is active: 0x%08x\n", hr);
todo_wine ok(hr == S_OK, "Failed to check if spatial audio object is active: 0x%08lx\n", hr); if (hr == S_OK) ok(is_active, "Expected spaital audio object to be active\n");
hr = ISpatialAudioObjectRenderStream_ActivateSpatialAudioObject(sas, AudioObjectType_FrontLeft, &sao2);
- ok(hr == SPTLAUDCLNT_E_OBJECT_ALREADY_ACTIVE, "Expected audio object to be already active: 0x%08x\n", hr);
ok(hr == SPTLAUDCLNT_E_OBJECT_ALREADY_ACTIVE, "Expected audio object to be already active: 0x%08lx\n", hr);
hr = ISpatialAudioObjectRenderStream_ActivateSpatialAudioObject(sas, AudioObjectType_FrontRight, &sao2);
- ok(hr == SPTLAUDCLNT_E_STATIC_OBJECT_NOT_AVAILABLE, "Expected static object to be not available: 0x%08x\n", hr);
ok(hr == SPTLAUDCLNT_E_STATIC_OBJECT_NOT_AVAILABLE, "Expected static object to be not available: 0x%08lx\n", hr);
hr = ISpatialAudioObjectRenderStream_ActivateSpatialAudioObject(sas, AudioObjectType_Dynamic, &sao2);
- ok(hr == SPTLAUDCLNT_E_NO_MORE_OBJECTS, "Expected to not have no more dynamic objects: 0x%08x\n", hr);
ok(hr == SPTLAUDCLNT_E_NO_MORE_OBJECTS, "Expected to not have no more dynamic objects: 0x%08lx\n", hr);
ISpatialAudioObject_Release(sao1); ISpatialAudioObjectRenderStream_Release(sas);
@@ -286,10 +286,10 @@ static void test_audio_object_buffers(void)
fill_activation_params(&activation_params); hr = ISpatialAudioClient_ActivateSpatialAudioStream(sac, &activation_params_prop, &IID_ISpatialAudioObjectRenderStream, (void**)&sas);
- ok(hr == S_OK, "Failed to activate spatial audio stream: 0x%08x\n", hr);
ok(hr == S_OK, "Failed to activate spatial audio stream: 0x%08lx\n", hr);
hr = ISpatialAudioClient_GetMaxFrameCount(sac, &format, &max_frame_count);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
- ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); frame_count = format.nSamplesPerSec / 100; /* 10ms */ /* Most of the time the frame count matches the 10ms interval exactly.
- However (seen on some Testbot machines) it might be a bit higher for some reason. */
@@ -300,32 +300,32 @@ static void test_audio_object_buffers(void) max_frame_count = frame_count + frame_count / 4;
hr = ISpatialAudioObjectRenderStream_ActivateSpatialAudioObject(sas, AudioObjectType_FrontLeft, &sao[0]);
- ok(hr == S_OK, "Failed to activate spatial audio object: 0x%08x\n", hr);
ok(hr == S_OK, "Failed to activate spatial audio object: 0x%08lx\n", hr);
hr = ISpatialAudioObjectRenderStream_Start(sas);
- ok(hr == S_OK, "Failed to activate spatial audio render stream: 0x%08x\n", hr);
ok(hr == S_OK, "Failed to activate spatial audio render stream: 0x%08lx\n", hr);
hr = ISpatialAudioObjectRenderStream_ActivateSpatialAudioObject(sas, AudioObjectType_FrontRight, &sao[1]);
- ok(hr == S_OK, "Failed to activate spatial audio object: 0x%08x\n", hr);
ok(hr == S_OK, "Failed to activate spatial audio object: 0x%08lx\n", hr);
hr = WaitForSingleObject(event, 200);
- ok(hr == WAIT_OBJECT_0, "Expected event to be flagged: 0x%08x\n", hr);
ok(hr == WAIT_OBJECT_0, "Expected event to be flagged: 0x%08lx\n", hr);
hr = ISpatialAudioObjectRenderStream_ActivateSpatialAudioObject(sas, AudioObjectType_SideLeft, &sao[2]);
- ok(hr == S_OK, "Failed to activate spatial audio object: 0x%08x\n", hr);
ok(hr == S_OK, "Failed to activate spatial audio object: 0x%08lx\n", hr);
hr = ISpatialAudioObjectRenderStream_BeginUpdatingAudioObjects(sas, &dyn_object_count, &frame_count);
- ok(hr == S_OK, "Failed to beging updating audio objects: 0x%08x\n", hr);
ok(hr == S_OK, "Failed to beging updating audio objects: 0x%08lx\n", hr); ok(dyn_object_count == 0, "Unexpected dynamic objects\n"); ok(frame_count <= max_frame_count, "Got unexpected frame count %u.\n", frame_count);
hr = ISpatialAudioObjectRenderStream_ActivateSpatialAudioObject(sas, AudioObjectType_SideRight, &sao[3]);
- ok(hr == S_OK, "Failed to activate spatial audio object: 0x%08x\n", hr);
ok(hr == S_OK, "Failed to activate spatial audio object: 0x%08lx\n", hr);
for (i = 0; i < ARRAYSIZE(sao); i++) { hr = ISpatialAudioObject_GetBuffer(sao[i], &buffer, &buffer_length);
ok(hr == S_OK, "Expected to be able to get buffers for audio object: 0x%08x\n", hr);
ok(hr == S_OK, "Expected to be able to get buffers for audio object: 0x%08lx\n", hr); ok(buffer != NULL, "Expected to get a non-NULL buffer\n"); ok(buffer_length == frame_count * format.wBitsPerSample / 8, "Expected buffer length to be sample_size * frame_count = %hu but got %u\n", frame_count * format.wBitsPerSample / 8, buffer_length);
@@ -333,7 +333,7 @@ static void test_audio_object_buffers(void) }
hr = ISpatialAudioObjectRenderStream_EndUpdatingAudioObjects(sas);
- ok(hr == S_OK, "Failed to end updating audio objects: 0x%08x\n", hr);
ok(hr == S_OK, "Failed to end updating audio objects: 0x%08lx\n", hr);
/* Emulate underrun and test frame count approximate limit. */
@@ -342,10 +342,10 @@ static void test_audio_object_buffers(void) for (j = 0; j < 20; ++j) { hr = WaitForSingleObject(event, 200);
ok(hr == WAIT_OBJECT_0, "Expected event to be flagged: 0x%08x, j %u.\n", hr, j);
ok(hr == WAIT_OBJECT_0, "Expected event to be flagged: 0x%08lx, j %u.\n", hr, j); hr = ISpatialAudioObjectRenderStream_BeginUpdatingAudioObjects(sas, &dyn_object_count, &frame_count);
ok(hr == S_OK, "Failed to beging updating audio objects: 0x%08x\n", hr);
ok(hr == S_OK, "Failed to beging updating audio objects: 0x%08lx\n", hr); ok(dyn_object_count == 0, "Unexpected dynamic objects\n"); ok(frame_count <= max_frame_count, "Got unexpected frame_count %u.\n", frame_count);
@@ -358,7 +358,7 @@ static void test_audio_object_buffers(void) for (i = 0; i < ARRAYSIZE(sao); i++) { hr = ISpatialAudioObject_GetBuffer(sao[i], &buffer, &buffer_length);
ok(hr == S_OK, "Expected to be able to get buffers for audio object: 0x%08x, i %d\n", hr, i);
ok(hr == S_OK, "Expected to be able to get buffers for audio object: 0x%08lx, i %d\n", hr, i); ok(buffer != NULL, "Expected to get a non-NULL buffer\n"); ok(buffer_length == frame_count * format.wBitsPerSample / 8, "Expected buffer length to be sample_size * frame_count = %hu but got %u\n",
@@ -380,22 +380,22 @@ static void test_audio_object_buffers(void) } } hr = ISpatialAudioObjectRenderStream_EndUpdatingAudioObjects(sas);
ok(hr == S_OK, "Failed to end updating audio objects: 0x%08x\n", hr);
ok(hr == S_OK, "Failed to end updating audio objects: 0x%08lx\n", hr);
} timeEndPeriod(1);
hr = WaitForSingleObject(event, 200);
- ok(hr == WAIT_OBJECT_0, "Expected event to be flagged: 0x%08x\n", hr);
ok(hr == WAIT_OBJECT_0, "Expected event to be flagged: 0x%08lx\n", hr);
hr = ISpatialAudioObjectRenderStream_BeginUpdatingAudioObjects(sas, &dyn_object_count, &frame_count);
- ok(hr == S_OK, "Failed to beging updating audio objects: 0x%08x\n", hr);
ok(hr == S_OK, "Failed to beging updating audio objects: 0x%08lx\n", hr); ok(dyn_object_count == 0, "Unexpected dynamic objects\n");
/* one more iteration but not with every object */ for (i = 0; i < ARRAYSIZE(sao) - 1; i++) { hr = ISpatialAudioObject_GetBuffer(sao[i], &buffer, &buffer_length);
ok(hr == S_OK, "Expected to be able to get buffers for audio object: 0x%08x\n", hr);
ok(hr == S_OK, "Expected to be able to get buffers for audio object: 0x%08lx\n", hr); ok(buffer != NULL, "Expected to get a non-NULL buffer\n"); ok(buffer_length == frame_count * format.wBitsPerSample / 8, "Expected buffer length to be sample_size * frame_count = %hu but got %u\n", frame_count * format.wBitsPerSample / 8, buffer_length);
@@ -403,40 +403,40 @@ static void test_audio_object_buffers(void) }
hr = ISpatialAudioObjectRenderStream_EndUpdatingAudioObjects(sas);
- ok(hr == S_OK, "Failed to end updating audio objects: 0x%08x\n", hr);
ok(hr == S_OK, "Failed to end updating audio objects: 0x%08lx\n", hr);
/* ending the stream */ hr = ISpatialAudioObject_SetEndOfStream(sao[0], 0);
- todo_wine ok(hr == SPTLAUDCLNT_E_OUT_OF_ORDER, "Expected that ending the stream at this point won't be allowed: 0x%08x\n", hr);
todo_wine ok(hr == SPTLAUDCLNT_E_OUT_OF_ORDER, "Expected that ending the stream at this point won't be allowed: 0x%08lx\n", hr);
hr = WaitForSingleObject(event, 200);
- ok(hr == WAIT_OBJECT_0, "Expected event to be flagged: 0x%08x\n", hr);
ok(hr == WAIT_OBJECT_0, "Expected event to be flagged: 0x%08lx\n", hr);
hr = ISpatialAudioObject_SetEndOfStream(sao[0], 0);
- todo_wine ok(hr == SPTLAUDCLNT_E_OUT_OF_ORDER, "Expected that ending the stream at this point won't be allowed: 0x%08x\n", hr);
todo_wine ok(hr == SPTLAUDCLNT_E_OUT_OF_ORDER, "Expected that ending the stream at this point won't be allowed: 0x%08lx\n", hr);
hr = ISpatialAudioObjectRenderStream_BeginUpdatingAudioObjects(sas, &dyn_object_count, &frame_count);
- ok(hr == S_OK, "Failed to beging updating audio objects: 0x%08x\n", hr);
ok(hr == S_OK, "Failed to beging updating audio objects: 0x%08lx\n", hr); ok(dyn_object_count == 0, "Unexpected dynamic objects\n");
/* expect the object that was not updated last cycle to be invalidated */ hr = ISpatialAudioObject_GetBuffer(sao[ARRAYSIZE(sao) - 1], &buffer, &buffer_length);
- todo_wine ok(hr == SPTLAUDCLNT_E_RESOURCES_INVALIDATED, "Expected audio object to be invalidated: 0x%08x\n", hr);
todo_wine ok(hr == SPTLAUDCLNT_E_RESOURCES_INVALIDATED, "Expected audio object to be invalidated: 0x%08lx\n", hr);
for (i = 0; i < ARRAYSIZE(sao) - 1; i++) { hr = ISpatialAudioObject_GetBuffer(sao[i], &buffer, &buffer_length);
ok(hr == S_OK, "Expected to be able to get buffers for audio object: 0x%08x\n", hr);
ok(hr == S_OK, "Expected to be able to get buffers for audio object: 0x%08lx\n", hr); hr = ISpatialAudioObject_SetEndOfStream(sao[i], 0);
todo_wine ok(hr == S_OK, "Failed to end the stream: 0x%08x\n", hr);
todo_wine ok(hr == S_OK, "Failed to end the stream: 0x%08lx\n", hr); hr = ISpatialAudioObject_GetBuffer(sao[i], &buffer, &buffer_length);
todo_wine ok(hr == SPTLAUDCLNT_E_RESOURCES_INVALIDATED, "Expected audio object to be invalidated: 0x%08x\n", hr);
todo_wine ok(hr == SPTLAUDCLNT_E_RESOURCES_INVALIDATED, "Expected audio object to be invalidated: 0x%08lx\n", hr);
}
hr = ISpatialAudioObjectRenderStream_EndUpdatingAudioObjects(sas);
- ok(hr == S_OK, "Failed to end updating audio objects: 0x%08x\n", hr);
ok(hr == S_OK, "Failed to end updating audio objects: 0x%08lx\n", hr);
for (i = 0; i < ARRAYSIZE(sao); i++) {
@@ -451,40 +451,40 @@ START_TEST(spatialaudio) HRESULT hr;
event = CreateEventA(NULL, FALSE, FALSE, "spatial-audio-test-prog-event");
- ok(event != NULL, "Failed to create event, last error: 0x%08x\n", GetLastError());
ok(event != NULL, "Failed to create event, last error: 0x%08lx\n", GetLastError());
CoInitializeEx(NULL, COINIT_MULTITHREADED); hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_INPROC_SERVER, &IID_IMMDeviceEnumerator, (void**)&mme); if (FAILED(hr)) {
skip("mmdevapi not available: 0x%08x\n", hr);
skip("mmdevapi not available: 0x%08lx\n", hr); goto cleanup;
}
hr = IMMDeviceEnumerator_GetDefaultAudioEndpoint(mme, eRender, eMultimedia, &dev);
- ok(hr == S_OK || hr == E_NOTFOUND, "GetDefaultAudioEndpoint failed: 0x%08x\n", hr);
- ok(hr == S_OK || hr == E_NOTFOUND, "GetDefaultAudioEndpoint failed: 0x%08lx\n", hr); if (hr != S_OK || !dev) { if (hr == E_NOTFOUND) skip("No sound card available\n"); else
skip("GetDefaultAudioEndpoint returns 0x%08x\n", hr);
skip("GetDefaultAudioEndpoint returns 0x%08lx\n", hr); goto cleanup;
}
hr = IMMDevice_Activate(dev, &IID_ISpatialAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&sac);
- ok(hr == S_OK || hr == E_NOINTERFACE, "ISpatialAudioClient Activation failed: 0x%08x\n", hr);
- ok(hr == S_OK || hr == E_NOINTERFACE, "ISpatialAudioClient Activation failed: 0x%08lx\n", hr); if (hr != S_OK || !dev) { if (hr == E_NOINTERFACE) skip("ISpatialAudioClient interface not found\n"); else
skip("ISpatialAudioClient Activation returns 0x%08x\n", hr);
skip("ISpatialAudioClient Activation returns 0x%08lx\n", hr); goto cleanup;
}
hr = ISpatialAudioClient_GetMaxDynamicObjectCount(sac, &max_dyn_count);
- ok(hr == S_OK, "Failed to get max dynamic object count: 0x%08x\n", hr);
ok(hr == S_OK, "Failed to get max dynamic object count: 0x%08lx\n", hr);
/* that's the default, after manually enabling Windows Sonic it's possible to have max_dyn_count > 0 */ /* ok(max_dyn_count == 0, "expected max dynamic object count to be 0 got %u\n", max_dyn_count); */