Commit 9a258c5d authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

dsound: IDirectSoundNotify is only available when DSBCAPS_CTRLPOSITIONNOTIFY is specified.

parent 6925fb0b
......@@ -923,11 +923,16 @@ static HRESULT WINAPI IDirectSoundBufferImpl_QueryInterface(IDirectSoundBuffer8
return S_OK;
}
if ( IsEqualGUID( &IID_IDirectSoundNotify, riid ) ) {
if ( IsEqualGUID( &IID_IDirectSoundNotify, riid ) ) {
if(This->dsbd.dwFlags & DSBCAPS_CTRLPOSITIONNOTIFY) {
IDirectSoundNotify_AddRef(&This->IDirectSoundNotify_iface);
*ppobj = &This->IDirectSoundNotify_iface;
return S_OK;
}
}
TRACE( "App requested IDirectSoundNotify without DSBCAPS_CTRLPOSITIONNOTIFY flag.\n");
return E_NOINTERFACE;
}
if ( IsEqualGUID( &IID_IDirectSound3DBuffer, riid ) ) {
if(This->dsbd.dwFlags & DSBCAPS_CTRL3D){
......
......@@ -1563,6 +1563,19 @@ static void test_notifications(LPGUID lpGuid)
ZeroMemory(&bufdesc, sizeof(bufdesc));
bufdesc.dwSize = sizeof(bufdesc);
bufdesc.dwFlags = DSBCAPS_GETCURRENTPOSITION2;
bufdesc.dwBufferBytes = wfx.nSamplesPerSec * wfx.nBlockAlign / 2; /* 0.5s */
bufdesc.lpwfxFormat = &wfx;
rc = IDirectSound_CreateSoundBuffer(dso, &bufdesc, &buf, NULL);
ok(rc == DS_OK && buf != NULL, "IDirectSound_CreateSoundBuffer() failed "
"to create a buffer %08x\n", rc);
rc = IDirectSoundBuffer_QueryInterface(buf, &IID_IDirectSoundNotify, (void**)&buf_notif);
ok(rc == E_NOINTERFACE, "QueryInterface(IID_IDirectSoundNotify): %08x\n", rc);
IDirectSoundBuffer_Release(buf);
ZeroMemory(&bufdesc, sizeof(bufdesc));
bufdesc.dwSize = sizeof(bufdesc);
bufdesc.dwFlags = DSBCAPS_CTRLPOSITIONNOTIFY;
bufdesc.dwBufferBytes = wfx.nSamplesPerSec * wfx.nBlockAlign / 2; /* 0.5s */
bufdesc.lpwfxFormat = &wfx;
......
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