Commit 7cd77b2a authored by Shaun Ren's avatar Shaun Ren Committed by Alexandre Julliard

sapi: Implement ISpMMSysAudio::EventHandle.

parent ef730b6e
......@@ -728,9 +728,11 @@ static HRESULT WINAPI mmsysaudio_GetDefaultFormat(ISpMMSysAudio *iface, GUID *gu
static HANDLE WINAPI mmsysaudio_EventHandle(ISpMMSysAudio *iface)
{
FIXME("(%p): stub.\n", iface);
struct mmaudio *This = impl_from_ISpMMSysAudio(iface);
return NULL;
TRACE("(%p).\n", iface);
return This->event;
}
static HRESULT WINAPI mmsysaudio_GetVolumeLevel(ISpMMSysAudio *iface, ULONG *level)
......
......@@ -167,6 +167,8 @@ static void test_audio_out(void)
UINT devid;
char *buf = NULL;
ULONG written;
DWORD start, end;
HANDLE event = NULL;
HRESULT hr;
if (waveOutGetNumDevs() == 0) {
......@@ -258,6 +260,20 @@ static void test_audio_out(void)
ok(hr == S_OK, "got %#lx.\n", hr);
ok(written == wfx->nAvgBytesPerSec * 200 / 1000, "got %lu.\n", written);
hr = ISpMMSysAudio_Write(mmaudio, buf, wfx->nAvgBytesPerSec * 200 / 1000, NULL);
ok(hr == S_OK, "got %#lx.\n", hr);
start = GetTickCount();
event = ISpMMSysAudio_EventHandle(mmaudio);
ok(event != NULL, "event == NULL.\n");
hr = WaitForSingleObject(event, 1000);
ok(hr == WAIT_OBJECT_0, "got %#lx.\n", hr);
end = GetTickCount();
ok(end - start <= 500, "waited for %lu ms.\n", end - start);
hr = ISpMMSysAudio_SetState(mmaudio, SPAS_CLOSED, 0);
ok(hr == S_OK, "got %#lx.\n", hr);
......
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