36 IDirectSoundCapture * dsc;
37 IDirectSoundFullDuplex * dsfd;
41 ok(rc==
DS_OK,
"IDirectSoundFullDuplex_QueryInterface(IID_IUnknown) failed: %08x\n", rc);
44 ok(
ref==0,
"IDirectSoundFullDuplex_Release() has %d references, "
45 "should have 0\n",
ref);
52 ok(
ref==0,
"IDirectSound_Release() has %d references, "
53 "should have 0\n",
ref);
60 IDirectSoundFullDuplex * dsfd1;
62 ok(rc==
DS_OK,
"IDirectSound8_QueryInterface(IID_IDirectSoundFullDuplex) "
66 ok(
ref==1,
"IDirectSoundFullDuplex_Release() has %d references, "
67 "should have 1\n",
ref);
70 ok(
ref==0,
"IDirectSound8_Release() has %d references, "
71 "should have 0\n",
ref);
79 ok(
ref==0,
"IDirectSoundCapture_Release() has %d references, "
80 "should have 0\n",
ref);
84 ok(rc==
DS_OK,
"IDirectSoundFullDuplex_QueryInterface(IID_IDirectSoundFullDuplex) "
87 ok(dsfdo==dsfd,
"different interfaces\n");
89 ok(
ref==1,
"IDirectSoundFullDuplex_Release() has %d references, should have 1\n",
ref);
93 ok(
ref==0,
"IDirectSoundFullDuplex_Release() has %d references, "
94 "should have 0\n",
ref);
107 trace(
"Testing IDirectSoundFullDuplex\n");
111 CLSCTX_INPROC_SERVER, &IID_IDirectSoundFullDuplex,
114 "CoCreateInstance(CLSID_DirectSoundFullDuplex) failed: 0x%08x\n", rc);
116 trace(
" Class Not Registered\n");
119 trace(
" Class Not Available\n");
128 CLSCTX_INPROC_SERVER, &IID_IDirectSoundFullDuplex,
130 ok(rc==
S_OK,
"CoCreateInstance(CLSID_DirectSoundFullDuplex) failed: 0x%08x\n", rc);
133 &DSDEVID_DefaultPlayback);
138 CLSCTX_INPROC_SERVER, &IID_IDirectSoundFullDuplex,
140 ok(rc==
S_OK,
"CoCreateInstance(CLSID_DirectSoundFullDuplex) failed: 0x%08x\n", rc);
143 &DSDEVID_DefaultVoicePlayback);
148 CLSCTX_INPROC_SERVER, &CLSID_DirectSoundPrivate,
151 "CoCreateInstance(CLSID_DirectSoundFullDuplex,CLSID_DirectSoundPrivate) "
152 "should have failed: 0x%08x\n", rc);
162 ZeroMemory(&DSCBufferDesc,
sizeof(DSCBufferDesc));
163 DSCBufferDesc.
dwSize =
sizeof(DSCBufferDesc);
168 ZeroMemory(&DSBufferDesc,
sizeof(DSBufferDesc));
169 DSBufferDesc.
dwSize =
sizeof(DSBufferDesc);
175 rc=pDirectSoundFullDuplexCreate(
NULL,
NULL,&DSCBufferDesc,&DSBufferDesc,
179 "DirectSoundFullDuplexCreate(NULL,NULL) failed: %08x\n",rc);
180 if (rc==
S_OK && dsfdo)
184 rc=pDirectSoundFullDuplexCreate(&DSDEVID_DefaultCapture,
185 &DSDEVID_DefaultPlayback,&DSCBufferDesc,
187 &pDSCBuffer8,&pDSBuffer8,
NULL);
189 "DirectSoundFullDuplexCreate(DSDEVID_DefaultCapture,"
190 "DSDEVID_DefaultPlayback) failed: %08x\n", rc);
191 if (rc==
DS_OK && dsfdo)
195 rc=pDirectSoundFullDuplexCreate(&DSDEVID_DefaultVoiceCapture,
196 &DSDEVID_DefaultVoicePlayback,
198 &dsfdo,&pDSCBuffer8,&pDSBuffer8,
NULL);
200 "DirectSoundFullDuplexCreate(DSDEVID_DefaultVoiceCapture,"
201 "DSDEVID_DefaultVoicePlayback) failed: %08x\n", rc);
202 if (rc==
DS_OK && dsfdo)
206 rc=pDirectSoundFullDuplexCreate(&DSDEVID_DefaultVoicePlayback,
207 &DSDEVID_DefaultVoiceCapture,
209 &dsfdo,&pDSCBuffer8,&pDSBuffer8,
NULL);
211 "DirectSoundFullDuplexCreate(DSDEVID_DefaultVoicePlayback,"
212 "DSDEVID_DefaultVoiceCapture) should have failed: %08x\n", rc);
213 if (rc==
DS_OK && dsfdo)
219 IDirectSoundFullDuplex *dsfd = (IDirectSoundFullDuplex*)0xdeadbeef;
222 IDirectSoundCapture *dsc;
224 IDirectSoundBuffer8 *dsb8;
225 IDirectSoundCaptureBuffer8 *dscb8;
236 "DirectSoundFullDuplex create failed: %08x, expected CLASS_E_NOAGGREGATION\n",
hr);
237 ok(!dsfd,
"dsfd = %p\n", dsfd);
241 &IID_IDirectSound3DBuffer, (
void**)&dsfd);
243 "DirectSoundFullDuplex create failed: %08x, expected E_NOINTERFACE\n",
hr);
247 &IID_IDirectSoundFullDuplex, (
void**)&dsfd);
248 ok(
hr ==
S_OK,
"DirectSoundFullDuplex create failed: %08x, expected S_OK\n",
hr);
250 ok(refcount == 2,
"refcount == %u, expected 2\n", refcount);
252 ok(
hr ==
S_OK,
"QueryInterface for IID_IUnknown failed: %08x\n",
hr);
253 refcount = IUnknown_AddRef(unk);
254 ok(refcount == 2,
"refcount == %u, expected 2\n", refcount);
259 "QueryInterface for IID_IDirectSound8 failed: %08x, expected E_NOINTERFACE\n",
hr);
262 "QueryInterface for IID_IDirectSoundCapture failed: %08x, expected E_NOINTERFACE\n",
hr);
266 bufdesc.
dwSize =
sizeof(bufdesc);
270 cbufdesc.
dwSize =
sizeof(cbufdesc);
276 "IDirectSoundFullDuplex_Initialize failed: %08x, expected E_INVALIDARG\n",
hr);
283 ok(
hr ==
S_OK,
"IDirectSoundFullDuplex_Initialize failed: %08x\n",
hr);
287 ok(
hr ==
S_OK,
"QueryInterface for IID_IDirectSound8 failed: %08x\n",
hr);
289 ok(refcount == 2,
"refcount == %u, expected 2\n", refcount);
291 ok(
hr ==
S_OK,
"QueryInterface for IID_IDirectSound failed: %08x\n",
hr);
293 ok(refcount == 4,
"refcount == %u, expected 4\n", refcount);
295 ok(refcount == 5,
"refcount == %u, expected 5\n", refcount);
297 ok(
hr ==
S_OK,
"QueryInterface for IID_IUnknown failed: %08x\n",
hr);
298 ok(unk == unk8,
"Got different IUnknown when QI'ing IDirectSoundFullDuplex and IDirectSound\n");
299 refcount = IUnknown_AddRef(unk8);
300 ok(refcount == 4,
"refcount == %u, expected 4\n", refcount);
302 ok(refcount == 6,
"refcount == %u, expected 6\n", refcount);
304 ok(refcount == 3,
"refcount == %u, expected 3\n", refcount);
308 ok(
hr ==
S_OK,
"QueryInterface for IID_IDirectSoundCapture failed: %08x\n",
hr);
310 ok(refcount == 2,
"refcount == %u, expected 2\n", refcount);
312 ok(refcount == 4,
"refcount == %u, expected 4\n", refcount);
314 ok(
hr ==
S_OK,
"QueryInterface for IID_IUnknown failed: %08x\n",
hr);
316 "Got different IUnknown when QI'ing IDirectSoundFullDuplex and IDirectSoundCapture\n");
317 refcount = IUnknown_AddRef(unk8);
318 ok(refcount == 6,
"refcount == %u, expected 6\n", refcount);
325 while (IUnknown_Release(unk));
339 "DirectSoundFullDuplexCreate");
340 if (pDirectSoundFullDuplexCreate) {
344 skip(
"DirectSoundFullDuplexCreate missing - skipping all tests\n");
349 skip(
"dsound.dll not found - skipping all tests\n");
static WCHAR unknown[MAX_STRING_RESOURCE_LEN]
#define GetProcAddress(x, y)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
void init_format(WAVEFORMATEX *wfx, int format, int rate, int depth, int channels)
#define IDirectSoundCapture_QueryInterface(p, a, b)
#define IDirectSoundCapture_Release(p)
#define DSBCAPS_GLOBALFOCUS
struct IDirectSoundCaptureBuffer8 * LPDIRECTSOUNDCAPTUREBUFFER8
#define IDirectSoundFullDuplex_Initialize(p, a, b, c, d, e, f, g, h)
struct IDirectSoundFullDuplex * LPDIRECTSOUNDFULLDUPLEX
#define IDirectSoundCapture_AddRef(p)
#define IDirectSoundBuffer8_Release(p)
#define IDirectSoundCaptureBuffer8_Release(p)
#define IDirectSound8_QueryInterface(p, a, b)
#define IDirectSoundFullDuplex_QueryInterface(p, a, b)
#define IDirectSound_AddRef(p)
#define DSERR_INVALIDCALL
#define IDirectSoundFullDuplex_Release(p)
#define IDirectSound8_Release(p)
struct IDirectSoundBuffer8 * LPDIRECTSOUNDBUFFER8
#define IDirectSound_Release(p)
#define DSCBCAPS_WAVEMAPPED
#define IDirectSoundFullDuplex_AddRef(p)
#define IDirectSound8_AddRef(p)
static void IDirectSoundFullDuplex_tests(void)
static void IDirectSoundFullDuplex_test(LPDIRECTSOUNDFULLDUPLEX dsfdo, BOOL initialized, LPCGUID lpGuidCapture, LPCGUID lpGuidRender)
static void test_COM(void)
LPWAVEFORMATEX lpwfxFormat
LPWAVEFORMATEX lpwfxFormat
#define REGDB_E_CLASSNOTREG
#define CLASS_E_NOAGGREGATION
#define CLASS_E_CLASSNOTAVAILABLE