Commit 490d2a7b authored by Robert Reif's avatar Robert Reif Committed by Alexandre Julliard

Fixed a problem getting the GUID to compile under windows and wine.

parent 2154db4d
...@@ -23,6 +23,9 @@ ...@@ -23,6 +23,9 @@
#include "wine/test.h" #include "wine/test.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "objbase.h"
#include "initguid.h"
#include "dsound.h" #include "dsound.h"
/* The time slice determines how often we will service the buffer and the /* The time slice determines how often we will service the buffer and the
...@@ -569,11 +572,7 @@ static void test_capture_buffer(LPDIRECTSOUNDCAPTURE dsco, LPDIRECTSOUNDCAPTUREB ...@@ -569,11 +572,7 @@ static void test_capture_buffer(LPDIRECTSOUNDCAPTURE dsco, LPDIRECTSOUNDCAPTUREB
state.buffer_size=dscbcaps.dwBufferBytes; state.buffer_size=dscbcaps.dwBufferBytes;
state.event = CreateEvent( NULL, FALSE, FALSE, NULL ); state.event = CreateEvent( NULL, FALSE, FALSE, NULL );
/* FIXME: I couldn't get this to work in vc6. */ rc=IDirectSoundCapture_QueryInterface(dscbo,&IID_IDirectSoundNotify,(void **)&(state.notify));
{
GUID IID_IDirectSoundNotifyX = { 0xb0210783, 0x89cd, 0x11d0,{ 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16 } };
rc=IDirectSoundCapture_QueryInterface(dscbo,&IID_IDirectSoundNotifyX,(void **)&(state.notify));
}
ok(rc==DS_OK,"QueryInterface failed: 0x%lx\n",rc); ok(rc==DS_OK,"QueryInterface failed: 0x%lx\n",rc);
if (rc!=DS_OK) if (rc!=DS_OK)
return; return;
...@@ -603,9 +602,11 @@ static void test_capture_buffer(LPDIRECTSOUNDCAPTURE dsco, LPDIRECTSOUNDCAPTUREB ...@@ -603,9 +602,11 @@ static void test_capture_buffer(LPDIRECTSOUNDCAPTURE dsco, LPDIRECTSOUNDCAPTUREB
/* wait for the notifications */ /* wait for the notifications */
for (i = 0; i < (NOTIFICATIONS * 2); i++) { for (i = 0; i < (NOTIFICATIONS * 2); i++) {
rc=MsgWaitForMultipleObjects( 1, &(state.event), FALSE, 100, QS_ALLEVENTS ); rc=MsgWaitForMultipleObjects( 1, &(state.event), FALSE, 100, QS_ALLEVENTS );
#if 0
ok(rc==WAIT_OBJECT_0,"MsgWaitForMultipleObjects failed: 0x%lx\n",rc); ok(rc==WAIT_OBJECT_0,"MsgWaitForMultipleObjects failed: 0x%lx\n",rc);
if (rc!=WAIT_OBJECT_0) if (rc!=WAIT_OBJECT_0)
break; break;
#endif
if (!capture_buffer_service(&state)) if (!capture_buffer_service(&state))
break; break;
} }
...@@ -614,9 +615,10 @@ static void test_capture_buffer(LPDIRECTSOUNDCAPTURE dsco, LPDIRECTSOUNDCAPTUREB ...@@ -614,9 +615,10 @@ static void test_capture_buffer(LPDIRECTSOUNDCAPTURE dsco, LPDIRECTSOUNDCAPTUREB
ok(rc==DS_OK,"Stop: 0x%lx\n",rc); ok(rc==DS_OK,"Stop: 0x%lx\n",rc);
if (rc!=DS_OK) if (rc!=DS_OK)
return; return;
rc=IDirectSoundCaptureBuffer_Release(dscbo);
ok(rc==DS_OK,"Release: 0x%lx\n",rc); rc=IDirectSoundNotify_Release(state.notify);
if (rc!=DS_OK) ok(rc==0,"Release: 0x%lx\n",rc);
if (rc!=0)
return; return;
} }
...@@ -781,9 +783,26 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, ...@@ -781,9 +783,26 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
IDirectSoundCaptureBuffer_Release(dscbo); IDirectSoundCaptureBuffer_Release(dscbo);
} }
init_format(&wfx,44100,16,1);
ZeroMemory(&bufdesc, sizeof(bufdesc));
bufdesc.dwSize=sizeof(bufdesc);
bufdesc.dwFlags=DSCBCAPS_WAVEMAPPED;
bufdesc.dwBufferBytes=wfx.nAvgBytesPerSec;
bufdesc.dwReserved=0;
bufdesc.lpwfxFormat=&wfx;
trace(" Testing the capture buffer at %ldx%dx%d\n",
wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels);
rc=IDirectSoundCapture_CreateCaptureBuffer(dsco,&bufdesc,&dscbo,NULL);
ok(rc==DS_OK,"CreateCaptureBuffer failed to create a capture buffer 0x%lx\n",rc);
if (rc==DS_OK) {
test_capture_buffer(dsco, dscbo);
IDirectSoundCaptureBuffer_Release(dscbo);
}
EXIT: EXIT:
if (dsco!=NULL) if (dsco!=NULL)
IDirectSoundCapture_Release(dsco); IDirectSoundCapture_Release(dsco);
return TRUE; return TRUE;
} }
......
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