Commit 8e1b054b authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

mmdevapi/tests: Enable compilation with long types.

parent 9b6a229b
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = mmdevapi.dll
IMPORTS = ole32 version user32 advapi32 winmm
......
......@@ -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;
}
......
......@@ -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));
}
......
......@@ -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);
"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);
......@@ -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, &notif);
ok(hr == S_OK, "RegisterEndpointNotificationCallback failed: %08x\n", hr);
ok(hr == S_OK, "RegisterEndpointNotificationCallback failed: %08lx\n", hr);
hr = IMMDeviceEnumerator_RegisterEndpointNotificationCallback(mme, &notif);
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, &notif);
ok(hr == S_OK, "UnregisterEndpointNotificationCallback failed: %08x\n", hr);
ok(hr == S_OK, "UnregisterEndpointNotificationCallback failed: %08lx\n", hr);
hr = IMMDeviceEnumerator_UnregisterEndpointNotificationCallback(mme, &notif);
ok(hr == S_OK, "UnregisterEndpointNotificationCallback failed: %08x\n", hr);
ok(hr == S_OK, "UnregisterEndpointNotificationCallback failed: %08lx\n", hr);
hr = IMMDeviceEnumerator_UnregisterEndpointNotificationCallback(mme, &notif);
ok(hr == E_NOTFOUND, "UnregisterEndpointNotificationCallback failed: %08x\n", hr);
ok(hr == E_NOTFOUND, "UnregisterEndpointNotificationCallback failed: %08lx\n", hr);
IMMDeviceEnumerator_Release(mme);
......
......@@ -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)&regval, &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);
skip("GetDefaultAudioEndpoint returns 0x%08lx\n", hr);
goto cleanup;
}
store = NULL;
hr = IMMDevice_OpenPropertyStore(dev, 3, &store);
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);
ok(!store, "Store set to non-NULL on failure: %p/%08lx\n", store, hr);
else if (store)
IPropertyStore_Release(store);
hr = IMMDevice_OpenPropertyStore(dev, STGM_READ, NULL);
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);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -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);
ok(hr == AUDCLNT_E_UNSUPPORTED_FORMAT, "Expected dynamic object count exceeding max to be unsupported: 0x%08lx\n", hr);
else
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 = &notify_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); */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment