dsound: IDirectSoundNotify is only available when DSBCAPS_CTRLPOSITIONNOTIFY is specified.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45473 Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com> Signed-off-by: Andrew Eikum <aeikum@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
6925fb0bb6
commit
9a258c5dd7
|
@ -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){
|
||||
|
|
|
@ -1561,6 +1561,19 @@ static void test_notifications(LPGUID lpGuid)
|
|||
wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign;
|
||||
wfx.cbSize = 0;
|
||||
|
||||
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;
|
||||
|
|
Loading…
Reference in New Issue