2 * Tests the panning and 3D functions of DirectSound
4 * Part of this test involves playing test tones. But this only makes
5 * sense if someone is going to carefully listen to it, and would only
6 * bother everyone else.
7 * So this is only done if the test is being run in interactive mode.
9 * Copyright (c) 2002-2004 Francois Gouget
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2.1 of the License, or (at your option) any later version.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this library; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #define NONAMELESSSTRUCT
27 #define NONAMELESSUNION
32 #include "wine/test.h"
36 #include "dsound_test.h"
38 static HRESULT (WINAPI *pDirectSoundCreate8)(LPCGUID,LPDIRECTSOUND8*,LPUNKNOWN)=NULL;
44 LPDIRECTSOUNDBUFFER dsbo;
52 static int buffer_refill8(play_state_t* state, DWORD size)
58 if (size>state->wave_len-state->written)
59 size=state->wave_len-state->written;
61 rc=IDirectSoundBuffer_Lock(state->dsbo,state->offset,size,
62 &ptr1,&len1,&ptr2,&len2,0);
63 ok(rc==DS_OK,"IDirectSoundBuffer_Lock() failed: %s\n",
64 DXGetErrorString8(rc));
68 memcpy(ptr1,state->wave+state->written,len1);
71 memcpy(ptr2,state->wave+state->written,len2);
74 state->offset=state->written % state->buffer_size;
75 rc=IDirectSoundBuffer_Unlock(state->dsbo,ptr1,len1,ptr2,len2);
76 ok(rc==DS_OK,"IDirectSoundBuffer_Unlock() failed: %s\n",
77 DXGetErrorString8(rc));
83 static int buffer_silence8(play_state_t* state, DWORD size)
90 rc=IDirectSoundBuffer_Lock(state->dsbo,state->offset,size,
91 &ptr1,&len1,&ptr2,&len2,0);
92 ok(rc==DS_OK,"IDirectSoundBuffer_Lock() failed: %s\n",
93 DXGetErrorString8(rc));
97 s=(state->wfx->wBitsPerSample==8?0x80:0);
102 state->offset=(state->offset+size) % state->buffer_size;
103 rc=IDirectSoundBuffer_Unlock(state->dsbo,ptr1,len1,ptr2,len2);
104 ok(rc==DS_OK,"IDirectSoundBuffer_Unlock() failed: %s\n",
105 DXGetErrorString8(rc));
111 static int buffer_service8(play_state_t* state)
113 DWORD last_play_pos,play_pos,buf_free;
116 rc=IDirectSoundBuffer_GetCurrentPosition(state->dsbo,&play_pos,NULL);
117 ok(rc==DS_OK,"IDirectSoundBuffer_GetCurrentPosition() failed: %s\n",
118 DXGetErrorString8(rc));
123 /* Update the amount played */
124 last_play_pos=state->played % state->buffer_size;
125 if (play_pos<last_play_pos)
126 state->played+=state->buffer_size-last_play_pos+play_pos;
128 state->played+=play_pos-last_play_pos;
130 if (winetest_debug > 1)
131 trace("buf size=%ld last_play_pos=%ld play_pos=%ld played=%ld / %ld\n",
132 state->buffer_size,last_play_pos,play_pos,state->played,
135 if (state->played>state->wave_len)
137 /* Everything has been played */
141 /* Refill the buffer */
142 if (state->offset<=play_pos)
143 buf_free=play_pos-state->offset;
145 buf_free=state->buffer_size-state->offset+play_pos;
147 if (winetest_debug > 1)
148 trace("offset=%ld free=%ld written=%ld / %ld\n",
149 state->offset,buf_free,state->written,state->wave_len);
153 if (state->written<state->wave_len)
155 int w=buffer_refill8(state,buf_free);
159 if (state->written==state->wave_len && winetest_debug > 1)
160 trace("last sound byte at %ld\n",
161 (state->written % state->buffer_size));
165 /* Fill with silence */
166 if (winetest_debug > 1)
167 trace("writing %ld bytes of silence\n",buf_free);
168 if (buffer_silence8(state,buf_free)==-1)
174 if (winetest_debug > 1)
175 trace("stopping playback\n");
176 rc=IDirectSoundBuffer_Stop(state->dsbo);
177 ok(rc==DS_OK,"IDirectSoundBuffer_Stop() failed: %s\n",
178 DXGetErrorString8(rc));
182 void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER dsbo,
183 BOOL is_primary, BOOL set_volume, LONG volume,
184 BOOL set_pan, LONG pan, BOOL play, double duration,
185 BOOL buffer3d, LPDIRECTSOUND3DLISTENER listener,
186 BOOL move_listener, BOOL move_sound)
190 WAVEFORMATEX wfx,wfx2;
191 DWORD size,status,freq;
194 /* DSOUND: Error: Invalid caps pointer */
195 rc=IDirectSoundBuffer_GetCaps(dsbo,0);
196 ok(rc==DSERR_INVALIDPARAM,"IDirectSoundBuffer_GetCaps() should have "
197 "returned DSERR_INVALIDPARAM, returned: %s\n",DXGetErrorString8(rc));
199 ZeroMemory(&dsbcaps, sizeof(dsbcaps));
201 /* DSOUND: Error: Invalid caps pointer */
202 rc=IDirectSoundBuffer_GetCaps(dsbo,&dsbcaps);
203 ok(rc==DSERR_INVALIDPARAM,"IDirectSoundBuffer_GetCaps() should have "
204 "returned DSERR_INVALIDPARAM, returned: %s\n",DXGetErrorString8(rc));
206 dsbcaps.dwSize=sizeof(dsbcaps);
207 rc=IDirectSoundBuffer_GetCaps(dsbo,&dsbcaps);
208 ok(rc==DS_OK,"IDirectSoundBuffer_GetCaps() failed: %s\n",
209 DXGetErrorString8(rc));
210 if (rc==DS_OK && winetest_debug > 1) {
211 trace(" Caps: flags=0x%08lx size=%ld\n",dsbcaps.dwFlags,
212 dsbcaps.dwBufferBytes);
215 /* Query the format size. Note that it may not match sizeof(wfx) */
217 rc=IDirectSoundBuffer_GetFormat(dsbo,NULL,0,&size);
218 ok(rc==DS_OK && size!=0,"IDirectSoundBuffer_GetFormat() should have "
219 "returned the needed size: rc=%s size=%ld\n",DXGetErrorString8(rc),size);
221 rc=IDirectSoundBuffer_GetFormat(dsbo,&wfx,sizeof(wfx),NULL);
222 ok(rc==DS_OK,"IDirectSoundBuffer_GetFormat() failed: %s\n",
223 DXGetErrorString8(rc));
224 if (rc==DS_OK && winetest_debug > 1) {
225 trace(" Format: %s tag=0x%04x %ldx%dx%d avg.B/s=%ld align=%d\n",
226 is_primary ? "Primary" : "Secondary",
227 wfx.wFormatTag,wfx.nSamplesPerSec,wfx.wBitsPerSample,
228 wfx.nChannels,wfx.nAvgBytesPerSec,wfx.nBlockAlign);
231 /* DSOUND: Error: Invalid frequency buffer */
232 rc=IDirectSoundBuffer_GetFrequency(dsbo,0);
233 ok(rc==DSERR_INVALIDPARAM,"IDirectSoundBuffer_GetFrequency() should have "
234 "returned DSERR_INVALIDPARAM, returned: %s\n",DXGetErrorString8(rc));
236 /* DSOUND: Error: Primary buffers don't support CTRLFREQUENCY */
237 rc=IDirectSoundBuffer_GetFrequency(dsbo,&freq);
238 ok((rc==DS_OK && !is_primary) || (rc==DSERR_CONTROLUNAVAIL&&is_primary) ||
239 (rc==DSERR_CONTROLUNAVAIL&&!(dsbcaps.dwFlags&DSBCAPS_CTRLFREQUENCY)),
240 "IDirectSoundBuffer_GetFrequency() failed: %s\n",DXGetErrorString8(rc));
242 ok(freq==wfx.nSamplesPerSec,"The frequency returned by GetFrequency "
243 "%ld does not match the format %ld\n",freq,wfx.nSamplesPerSec);
246 /* DSOUND: Error: Invalid status pointer */
247 rc=IDirectSoundBuffer_GetStatus(dsbo,0);
248 ok(rc==DSERR_INVALIDPARAM,"IDirectSoundBuffer_GetStatus() should have "
249 "returned DSERR_INVALIDPARAM, returned: %s\n",DXGetErrorString8(rc));
251 rc=IDirectSoundBuffer_GetStatus(dsbo,&status);
252 ok(rc==DS_OK,"IDirectSoundBuffer_GetStatus() failed: %s\n",
253 DXGetErrorString8(rc));
254 ok(status==0,"status=0x%lx instead of 0\n",status);
257 /* We must call SetCooperativeLevel to be allowed to call SetFormat */
258 /* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */
259 rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
260 ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel(DSSCL_PRIORITY) "
261 "failed: %s\n",DXGetErrorString8(rc));
265 /* DSOUND: Error: Invalid format pointer */
266 rc=IDirectSoundBuffer_SetFormat(dsbo,0);
267 ok(rc==DSERR_INVALIDPARAM,"IDirectSoundBuffer_SetFormat() should have "
268 "returned DSERR_INVALIDPARAM, returned: %s\n",DXGetErrorString8(rc));
270 init_format(&wfx2,WAVE_FORMAT_PCM,11025,16,2);
271 rc=IDirectSoundBuffer_SetFormat(dsbo,&wfx2);
272 ok(rc==DS_OK,"IDirectSoundBuffer_SetFormat() failed: %s\n",
273 DXGetErrorString8(rc));
275 /* There is no garantee that SetFormat will actually change the
276 * format to what we asked for. It depends on what the soundcard
277 * supports. So we must re-query the format.
279 rc=IDirectSoundBuffer_GetFormat(dsbo,&wfx,sizeof(wfx),NULL);
280 ok(rc==DS_OK,"IDirectSoundBuffer_GetFormat() failed: %s\n",
281 DXGetErrorString8(rc));
283 (wfx.wFormatTag!=wfx2.wFormatTag ||
284 wfx.nSamplesPerSec!=wfx2.nSamplesPerSec ||
285 wfx.wBitsPerSample!=wfx2.wBitsPerSample ||
286 wfx.nChannels!=wfx2.nChannels)) {
287 trace("Requested format tag=0x%04x %ldx%dx%d avg.B/s=%ld align=%d\n",
288 wfx2.wFormatTag,wfx2.nSamplesPerSec,wfx2.wBitsPerSample,
289 wfx2.nChannels,wfx2.nAvgBytesPerSec,wfx2.nBlockAlign);
290 trace("Got tag=0x%04x %ldx%dx%d avg.B/s=%ld align=%d\n",
291 wfx.wFormatTag,wfx.nSamplesPerSec,wfx.wBitsPerSample,
292 wfx.nChannels,wfx.nAvgBytesPerSec,wfx.nBlockAlign);
295 /* Set the CooperativeLevel back to normal */
296 /* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */
297 rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
298 ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel(DSSCL_NORMAL) "
299 "failed: %s\n",DXGetErrorString8(rc));
304 DS3DLISTENER listener_param;
305 LPDIRECTSOUND3DBUFFER buffer=NULL;
306 DS3DBUFFER buffer_param;
307 DWORD start_time,now;
309 if (winetest_interactive) {
310 trace(" Playing %g second 440Hz tone at %ldx%dx%d\n", duration,
311 wfx.nSamplesPerSec, wfx.wBitsPerSample,wfx.nChannels);
315 /* We must call SetCooperativeLevel to be allowed to call Lock */
316 /* DSOUND: Setting DirectSound cooperative level to
317 * DSSCL_WRITEPRIMARY */
318 rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),
321 "IDirectSound8_SetCooperativeLevel(DSSCL_WRITEPRIMARY) failed: "
322 "%s\n",DXGetErrorString8(rc));
327 LPDIRECTSOUNDBUFFER temp_buffer;
329 rc=IDirectSoundBuffer_QueryInterface(dsbo,&IID_IDirectSound3DBuffer,
331 ok(rc==DS_OK,"IDirectSoundBuffer_QueryInterface() failed: %s\n",
332 DXGetErrorString8(rc));
336 /* check the COM interface */
337 rc=IDirectSoundBuffer_QueryInterface(dsbo, &IID_IDirectSoundBuffer,
338 (LPVOID *)&temp_buffer);
339 ok(rc==DS_OK && temp_buffer!=NULL,
340 "IDirectSoundBuffer_QueryInterface() failed: %s\n",
341 DXGetErrorString8(rc));
342 ok(temp_buffer==dsbo,"COM interface broken: 0x%08lx != 0x%08lx\n",
343 (DWORD)temp_buffer,(DWORD)dsbo);
344 ref=IDirectSoundBuffer_Release(temp_buffer);
345 ok(ref==1,"IDirectSoundBuffer_Release() has %d references, "
346 "should have 1\n",ref);
349 rc=IDirectSound3DBuffer_QueryInterface(dsbo, &IID_IDirectSoundBuffer,
350 (LPVOID *)&temp_buffer);
351 ok(rc==DS_OK && temp_buffer!=NULL,
352 "IDirectSound3DBuffer_QueryInterface() failed: %s\n",
353 DXGetErrorString8(rc));
354 ok(temp_buffer==dsbo,"COM interface broken: 0x%08lx != 0x%08lx\n",
355 (DWORD)temp_buffer,(DWORD)dsbo);
356 ref=IDirectSoundBuffer_Release(temp_buffer);
357 ok(ref==1,"IDirectSoundBuffer_Release() has %d references, "
358 "should have 1\n",ref);
361 /* FIXME: this works on windows */
362 ref=IDirectSoundBuffer_Release(dsbo);
363 ok(ref==0,"IDirectSoundBuffer_Release() has %d references, "
364 "should have 0\n",ref);
366 rc=IDirectSound3DBuffer_QueryInterface(buffer,
367 &IID_IDirectSoundBuffer,
369 ok(rc==DS_OK && dsbo!=NULL,"IDirectSound3DBuffer_QueryInterface() "
370 "failed: %s\n",DXGetErrorString8(rc),
373 /* DSOUND: Error: Invalid buffer */
374 rc=IDirectSound3DBuffer_GetAllParameters(buffer,0);
375 ok(rc==DSERR_INVALIDPARAM,"IDirectSound3DBuffer_GetAllParameters() "
376 "failed: %s\n",DXGetErrorString8(rc));
378 ZeroMemory(&buffer_param, sizeof(buffer_param));
380 /* DSOUND: Error: Invalid buffer */
381 rc=IDirectSound3DBuffer_GetAllParameters(buffer,&buffer_param);
382 ok(rc==DSERR_INVALIDPARAM,"IDirectSound3DBuffer_GetAllParameters() "
383 "failed: %s\n",DXGetErrorString8(rc));
385 buffer_param.dwSize=sizeof(buffer_param);
386 rc=IDirectSound3DBuffer_GetAllParameters(buffer,&buffer_param);
387 ok(rc==DS_OK,"IDirectSound3DBuffer_GetAllParameters() failed: %s\n",
388 DXGetErrorString8(rc));
391 if (dsbcaps.dwFlags & DSBCAPS_CTRLVOLUME) {
393 rc=IDirectSoundBuffer_GetVolume(dsbo,&val);
394 ok(rc==DS_OK,"IDirectSoundBuffer_GetVolume() failed: %s\n",
395 DXGetErrorString8(rc));
397 rc=IDirectSoundBuffer_SetVolume(dsbo,volume);
398 ok(rc==DS_OK,"IDirectSoundBuffer_SetVolume() failed: %s\n",
399 DXGetErrorString8(rc));
401 /* DSOUND: Error: Buffer does not have CTRLVOLUME */
402 rc=IDirectSoundBuffer_GetVolume(dsbo,&volume);
403 ok(rc==DSERR_CONTROLUNAVAIL,"IDirectSoundBuffer_GetVolume() "
404 "should have returned DSERR_CONTROLUNAVAIL, returned: %s\n",
405 DXGetErrorString8(rc));
410 if (dsbcaps.dwFlags & DSBCAPS_CTRLPAN) {
412 rc=IDirectSoundBuffer_GetPan(dsbo,&val);
413 ok(rc==DS_OK,"IDirectSoundBuffer_GetPan() failed: %s\n",
414 DXGetErrorString8(rc));
416 rc=IDirectSoundBuffer_SetPan(dsbo,pan);
417 ok(rc==DS_OK,"IDirectSoundBuffer_SetPan() failed: %s\n",
418 DXGetErrorString8(rc));
420 /* DSOUND: Error: Buffer does not have CTRLPAN */
421 rc=IDirectSoundBuffer_GetPan(dsbo,&pan);
422 ok(rc==DSERR_CONTROLUNAVAIL,"IDirectSoundBuffer_GetPan() "
423 "should have returned DSERR_CONTROLUNAVAIL, returned: %s\n",
424 DXGetErrorString8(rc));
428 state.wave=wave_generate_la(&wfx,duration,&state.wave_len);
432 state.buffer_size=dsbcaps.dwBufferBytes;
433 state.played=state.written=state.offset=0;
434 buffer_refill8(&state,state.buffer_size);
436 rc=IDirectSoundBuffer_Play(dsbo,0,0,DSBPLAY_LOOPING);
437 ok(rc==DS_OK,"IDirectSoundBuffer_Play() failed: %s\n",
438 DXGetErrorString8(rc));
440 rc=IDirectSoundBuffer_GetStatus(dsbo,&status);
441 ok(rc==DS_OK,"IDirectSoundBuffer_GetStatus() failed: %s\n",
442 DXGetErrorString8(rc));
443 ok(status==(DSBSTATUS_PLAYING|DSBSTATUS_LOOPING),
444 "GetStatus: bad status: %lx\n",status);
447 ZeroMemory(&listener_param,sizeof(listener_param));
448 listener_param.dwSize=sizeof(listener_param);
449 rc=IDirectSound3DListener_GetAllParameters(listener,&listener_param);
450 ok(rc==DS_OK,"IDirectSound3dListener_GetAllParameters() "
451 "failed: %s\n",DXGetErrorString8(rc));
453 listener_param.vPosition.x = -5.0;
454 listener_param.vVelocity.x = 10.0/duration;
456 rc=IDirectSound3DListener_SetAllParameters(listener,
459 ok(rc==DS_OK,"IDirectSound3dListener_SetPosition() failed: %s\n",
460 DXGetErrorString8(rc));
464 buffer_param.vPosition.x = 100.0;
465 buffer_param.vVelocity.x = -200.0/duration;
467 buffer_param.flMinDistance = 10;
468 rc=IDirectSound3DBuffer_SetAllParameters(buffer,&buffer_param,
470 ok(rc==DS_OK,"IDirectSound3dBuffer_SetPosition() failed: %s\n",
471 DXGetErrorString8(rc));
474 start_time=GetTickCount();
475 while (buffer_service8(&state)) {
476 WaitForSingleObject(GetCurrentProcess(),TIME_SLICE);
478 if (listener && move_listener) {
479 listener_param.vPosition.x = -5.0+10.0*(now-start_time)/
481 if (winetest_debug>2)
482 trace("listener position=%g\n",listener_param.vPosition.x);
483 rc=IDirectSound3DListener_SetPosition(listener,
484 listener_param.vPosition.x,listener_param.vPosition.y,
485 listener_param.vPosition.z,DS3D_IMMEDIATE);
486 ok(rc==DS_OK,"IDirectSound3dListener_SetPosition() failed: "
487 "%s\n",DXGetErrorString8(rc));
489 if (buffer3d && move_sound) {
490 buffer_param.vPosition.x = 100-200.0*(now-start_time)/
492 if (winetest_debug>2)
493 trace("sound position=%g\n",buffer_param.vPosition.x);
494 rc=IDirectSound3DBuffer_SetPosition(buffer,
495 buffer_param.vPosition.x,buffer_param.vPosition.y,
496 buffer_param.vPosition.z,DS3D_IMMEDIATE);
497 ok(rc==DS_OK,"IDirectSound3dBuffer_SetPosition() failed: %s\n",
498 DXGetErrorString8(rc));
501 /* Check the sound duration was within 10% of the expected value */
503 ok(fabs(1000*duration-now+start_time)<=100*duration,
504 "The sound played for %ld ms instead of %g ms\n",
505 now-start_time,1000*duration);
509 /* Set the CooperativeLevel back to normal */
510 /* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */
511 rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
512 ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel(DSSCL_NORMAL) "
513 "failed: %s\n",DXGetErrorString8(rc));
516 ref=IDirectSound3DBuffer_Release(buffer);
517 ok(ref==0,"IDirectSound3DBuffer_Release() has %d references, "
518 "should have 0\n",ref);
523 static HRESULT test_secondary8(LPGUID lpGuid, int play,
524 int has_3d, int has_3dbuffer,
525 int has_listener, int has_duplicate,
526 int move_listener, int move_sound)
529 LPDIRECTSOUND8 dso=NULL;
530 LPDIRECTSOUNDBUFFER primary=NULL,secondary=NULL;
531 LPDIRECTSOUND3DLISTENER listener=NULL;
532 DSBUFFERDESC bufdesc;
533 WAVEFORMATEX wfx, wfx1;
536 /* Create the DirectSound object */
537 rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
538 ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %s\n",
539 DXGetErrorString8(rc));
543 /* We must call SetCooperativeLevel before creating primary buffer */
544 /* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */
545 rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
546 ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel(DSSCL_PRIORITY) failed: "
547 "%s\n",DXGetErrorString8(rc));
551 ZeroMemory(&bufdesc, sizeof(bufdesc));
552 bufdesc.dwSize=sizeof(bufdesc);
553 bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER;
555 bufdesc.dwFlags|=DSBCAPS_CTRL3D;
557 bufdesc.dwFlags|=(DSBCAPS_CTRLVOLUME|DSBCAPS_CTRLPAN);
558 rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&primary,NULL);
559 ok((rc==DS_OK && primary!=NULL) || (rc == DSERR_CONTROLUNAVAIL),
560 "IDirectSound8_CreateSoundBuffer() failed to create a %sprimary buffer: "
561 "%s\n",has_3d?"3D ":"", DXGetErrorString8(rc));
562 if (rc == DSERR_CONTROLUNAVAIL)
563 trace(" No Primary\n");
564 else if (rc==DS_OK && primary!=NULL) {
565 rc=IDirectSoundBuffer_GetFormat(primary,&wfx1,sizeof(wfx1),NULL);
566 ok(rc==DS_OK,"IDirectSoundBuffer8_Getformat() failed: %s\n",
567 DXGetErrorString8(rc));
572 rc=IDirectSoundBuffer_QueryInterface(primary,
573 &IID_IDirectSound3DListener,
575 ok(rc==DS_OK && listener!=NULL,
576 "IDirectSoundBuffer_QueryInterface() failed to get a 3D "
577 "listener %s\n",DXGetErrorString8(rc));
578 ref=IDirectSoundBuffer_Release(primary);
579 ok(ref==0,"IDirectSoundBuffer_Release() primary has %d references, "
580 "should have 0\n",ref);
581 if (rc==DS_OK && listener!=NULL) {
582 DS3DLISTENER listener_param;
583 ZeroMemory(&listener_param,sizeof(listener_param));
584 /* DSOUND: Error: Invalid buffer */
585 rc=IDirectSound3DListener_GetAllParameters(listener,0);
586 ok(rc==DSERR_INVALIDPARAM,
587 "IDirectSound3dListener_GetAllParameters() should have "
588 "returned DSERR_INVALIDPARAM, returned: %s\n",
589 DXGetErrorString8(rc));
591 /* DSOUND: Error: Invalid buffer */
592 rc=IDirectSound3DListener_GetAllParameters(listener,
594 ok(rc==DSERR_INVALIDPARAM,
595 "IDirectSound3dListener_GetAllParameters() should have "
596 "returned DSERR_INVALIDPARAM, returned: %s\n",
597 DXGetErrorString8(rc));
599 listener_param.dwSize=sizeof(listener_param);
600 rc=IDirectSound3DListener_GetAllParameters(listener,
602 ok(rc==DS_OK,"IDirectSound3dListener_GetAllParameters() "
603 "failed: %s\n",DXGetErrorString8(rc));
609 init_format(&wfx,WAVE_FORMAT_PCM,22050,16,2);
611 ZeroMemory(&bufdesc, sizeof(bufdesc));
612 bufdesc.dwSize=sizeof(bufdesc);
613 bufdesc.dwFlags=DSBCAPS_GETCURRENTPOSITION2;
615 bufdesc.dwFlags|=DSBCAPS_CTRL3D;
618 (DSBCAPS_CTRLFREQUENCY|DSBCAPS_CTRLVOLUME|DSBCAPS_CTRLPAN);
619 bufdesc.dwBufferBytes=align(wfx.nAvgBytesPerSec*BUFFER_LEN/1000,
621 bufdesc.lpwfxFormat=&wfx;
623 /* a stereo 3D buffer should fail */
624 rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL);
625 ok(rc==DSERR_INVALIDPARAM,
626 "IDirectSound8_CreateSoundBuffer(secondary) should have "
627 "returned DSERR_INVALIDPARAM, returned %s\n",
628 DXGetErrorString8(rc));
630 ref=IDirectSoundBuffer_Release(secondary);
631 init_format(&wfx,WAVE_FORMAT_PCM,22050,16,1);
634 if (winetest_interactive) {
635 trace(" Testing a %s%ssecondary buffer %s%s%s%sat %ldx%dx%d "
636 "with a primary buffer at %ldx%dx%d\n",
637 has_3dbuffer?"3D ":"",
638 has_duplicate?"duplicated ":"",
639 listener!=NULL||move_sound?"with ":"",
640 move_listener?"moving ":"",
641 listener!=NULL?"listener ":"",
642 listener&&move_sound?"and moving sound ":move_sound?
644 wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels,
645 wfx1.nSamplesPerSec,wfx1.wBitsPerSample,wfx1.nChannels);
647 rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL);
648 ok(rc==DS_OK && secondary!=NULL,"IDirectSound8_CreateSoundBuffer() "
649 "failed to create a %s%ssecondary buffer %s%s%s%sat %ldx%dx%d (%s): %s\n",
650 has_3dbuffer?"3D ":"", has_duplicate?"duplicated ":"",
651 listener!=NULL||move_sound?"with ":"", move_listener?"moving ":"",
652 listener!=NULL?"listener ":"",
653 listener&&move_sound?"and moving sound ":move_sound?
655 wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels,
656 getDSBCAPS(bufdesc.dwFlags),DXGetErrorString8(rc));
657 if (rc==DS_OK && secondary!=NULL) {
662 /* Check the initial secondary buffer's volume and pan */
663 rc=IDirectSoundBuffer_GetVolume(secondary,&vol);
664 ok(rc==DS_OK,"IDirectSoundBuffer_GetVolume(secondary) failed: "
665 "%s\n",DXGetErrorString8(rc));
666 ok(vol==0,"wrong volume for a new secondary buffer: %ld\n",vol);
667 rc=IDirectSoundBuffer_GetPan(secondary,&pan);
668 ok(rc==DS_OK,"IDirectSoundBuffer_GetPan(secondary) failed: "
669 "%s\n",DXGetErrorString8(rc));
670 ok(pan==0,"wrong pan for a new secondary buffer: %ld\n",pan);
672 /* Check that changing the secondary buffer's volume and pan
673 * does not impact the primary buffer's volume and pan
675 rc=IDirectSoundBuffer_GetVolume(primary,&refvol);
676 ok(rc==DS_OK,"IDirectSoundBuffer_GetVolume(primary) failed: "
677 "%s\n",DXGetErrorString8(rc));
678 rc=IDirectSoundBuffer_GetPan(primary,&refpan);
679 ok(rc==DS_OK,"IDirectSoundBuffer_GetPan(primary) failed: "
680 "%s\n",DXGetErrorString8(rc));
682 rc=IDirectSoundBuffer_SetVolume(secondary,-1000);
683 ok(rc==DS_OK,"IDirectSoundBuffer_SetVolume(secondary) failed: "
684 "%s\n",DXGetErrorString8(rc));
685 rc=IDirectSoundBuffer_GetVolume(secondary,&vol);
686 ok(rc==DS_OK,"IDirectSoundBuffer_SetVolume(secondary) failed: "
687 "%s\n",DXGetErrorString8(rc));
688 ok(vol==-1000,"secondary: wrong volume %ld instead of -1000\n",
690 rc=IDirectSoundBuffer_SetPan(secondary,-1000);
691 ok(rc==DS_OK,"IDirectSoundBuffer_SetPan(secondary) failed: "
692 "%s\n",DXGetErrorString8(rc));
693 rc=IDirectSoundBuffer_GetPan(secondary,&pan);
694 ok(rc==DS_OK,"IDirectSoundBuffer_SetPan(secondary) failed: "
695 "%s\n",DXGetErrorString8(rc));
696 ok(pan==-1000,"secondary: wrong pan %ld instead of -1000\n",
699 rc=IDirectSoundBuffer_GetVolume(primary,&vol);
700 ok(rc==DS_OK,"IDirectSoundBuffer_`GetVolume(primary) failed: i"
701 "%s\n",DXGetErrorString8(rc));
702 ok(vol==refvol,"The primary volume changed from %ld to %ld\n",
704 rc=IDirectSoundBuffer_GetPan(primary,&pan);
705 ok(rc==DS_OK,"IDirectSoundBuffer_GetPan(primary) failed: "
706 "%s\n",DXGetErrorString8(rc));
707 ok(pan==refpan,"The primary pan changed from %ld to %ld\n",
710 rc=IDirectSoundBuffer_SetVolume(secondary,0);
711 ok(rc==DS_OK,"IDirectSoundBuffer_SetVolume(secondary) failed: "
712 "%s\n",DXGetErrorString8(rc));
713 rc=IDirectSoundBuffer_SetPan(secondary,0);
714 ok(rc==DS_OK,"IDirectSoundBuffer_SetPan(secondary) failed: "
715 "%s\n",DXGetErrorString8(rc));
718 LPDIRECTSOUNDBUFFER duplicated=NULL;
720 /* DSOUND: Error: Invalid source buffer */
721 rc=IDirectSound8_DuplicateSoundBuffer(dso,0,0);
722 ok(rc==DSERR_INVALIDPARAM,
723 "IDirectSound8_DuplicateSoundBuffer() should have returned "
724 "DSERR_INVALIDPARAM, returned: %s\n",DXGetErrorString8(rc));
726 /* DSOUND: Error: Invalid dest buffer */
727 rc=IDirectSound8_DuplicateSoundBuffer(dso,secondary,0);
728 ok(rc==DSERR_INVALIDPARAM,
729 "IDirectSound8_DuplicateSoundBuffer() should have returned "
730 "DSERR_INVALIDPARAM, returned: %s\n",DXGetErrorString8(rc));
732 /* DSOUND: Error: Invalid source buffer */
733 rc=IDirectSound8_DuplicateSoundBuffer(dso,0,&duplicated);
734 ok(rc==DSERR_INVALIDPARAM,
735 "IDirectSound8_DuplicateSoundBuffer() should have returned "
736 "DSERR_INVALIDPARAM, returned: %s\n",DXGetErrorString8(rc));
739 rc=IDirectSound8_DuplicateSoundBuffer(dso,secondary,
741 ok(rc==DS_OK && duplicated!=NULL,
742 "IDirectSound8_DuplicateSoundBuffer() failed to duplicate "
743 "a secondary buffer: %s\n",DXGetErrorString8(rc));
745 if (rc==DS_OK && duplicated!=NULL) {
746 ref=IDirectSoundBuffer_Release(secondary);
747 ok(ref==0,"IDirectSoundBuffer_Release() secondary has %d "
748 "references, should have 0\n",ref);
749 secondary=duplicated;
753 if (rc==DS_OK && secondary!=NULL) {
755 duration=(move_listener || move_sound?4.0:1.0);
756 test_buffer8(dso,secondary,0,FALSE,0,FALSE,0,
757 winetest_interactive,duration,has_3dbuffer,
758 listener,move_listener,move_sound);
759 ref=IDirectSoundBuffer_Release(secondary);
760 ok(ref==0,"IDirectSoundBuffer_Release() %s has %d references, "
761 "should have 0\n",has_duplicate?"duplicated":"secondary",
768 ref=IDirectSound3DListener_Release(listener);
769 ok(ref==0,"IDirectSound3dListener_Release() listener has %d "
770 "references, should have 0\n",ref);
772 ref=IDirectSoundBuffer_Release(primary);
773 ok(ref==0,"IDirectSoundBuffer_Release() primary has %d references, "
774 "should have 0\n",ref);
777 /* Set the CooperativeLevel back to normal */
778 /* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */
779 rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
780 ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel(DSSCL_NORMAL) failed: "
781 "%s\n",DXGetErrorString8(rc));
784 ref=IDirectSound8_Release(dso);
785 ok(ref==0,"IDirectSound8_Release() has %d references, should have 0\n",ref);
787 return DSERR_GENERIC;
792 static HRESULT test_for_driver8(LPGUID lpGuid)
795 LPDIRECTSOUND8 dso=NULL;
798 /* Create the DirectSound object */
799 rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
800 ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
801 "DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
805 ref=IDirectSound8_Release(dso);
806 ok(ref==0,"IDirectSound8_Release() has %d references, should have 0\n",ref);
808 return DSERR_GENERIC;
813 static HRESULT test_primary8(LPGUID lpGuid)
816 LPDIRECTSOUND8 dso=NULL;
817 LPDIRECTSOUNDBUFFER primary=NULL;
818 DSBUFFERDESC bufdesc;
822 /* Create the DirectSound object */
823 rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
824 ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %s\n",
825 DXGetErrorString8(rc));
829 /* Get the device capabilities */
830 ZeroMemory(&dscaps, sizeof(dscaps));
831 dscaps.dwSize=sizeof(dscaps);
832 rc=IDirectSound8_GetCaps(dso,&dscaps);
833 ok(rc==DS_OK,"IDirectSound8_GetCaps() failed: %s\n",DXGetErrorString8(rc));
837 /* We must call SetCooperativeLevel before calling CreateSoundBuffer */
838 /* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */
839 rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
840 ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel(DSSCL_PRIORITY) failed: "
841 "%s\n",DXGetErrorString8(rc));
845 /* Testing the primary buffer */
847 ZeroMemory(&bufdesc, sizeof(bufdesc));
848 bufdesc.dwSize=sizeof(bufdesc);
849 bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER|DSBCAPS_CTRLVOLUME|DSBCAPS_CTRLPAN;
850 rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&primary,NULL);
851 ok((rc==DS_OK && primary!=NULL) || (rc == DSERR_CONTROLUNAVAIL),
852 "IDirectSound8_CreateSoundBuffer() failed to create a primary buffer: "
853 "%s\n",DXGetErrorString8(rc));
854 if (rc == DSERR_CONTROLUNAVAIL)
855 trace(" No Primary\n");
856 else if (rc==DS_OK && primary!=NULL) {
857 test_buffer8(dso,primary,1,TRUE,0,TRUE,0,winetest_interactive &&
858 !(dscaps.dwFlags & DSCAPS_EMULDRIVER),1.0,0,NULL,0,0);
859 if (winetest_interactive) {
862 volume = DSBVOLUME_MAX;
863 for (i = 0; i < 6; i++) {
864 test_buffer8(dso,primary,1,TRUE,volume,TRUE,0,
865 winetest_interactive &&
866 !(dscaps.dwFlags & DSCAPS_EMULDRIVER),
868 volume -= ((DSBVOLUME_MAX-DSBVOLUME_MIN) / 40);
872 for (i = 0; i < 7; i++) {
873 test_buffer8(dso,primary,1,TRUE,0,TRUE,pan,
874 winetest_interactive &&
875 !(dscaps.dwFlags & DSCAPS_EMULDRIVER),1.0,0,0,0,0);
876 pan += ((DSBPAN_RIGHT-DSBPAN_LEFT) / 6);
879 ref=IDirectSoundBuffer_Release(primary);
880 ok(ref==0,"IDirectSoundBuffer_Release() primary has %d references, "
881 "should have 0\n",ref);
884 /* Set the CooperativeLevel back to normal */
885 /* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */
886 rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
887 ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel(DSSCL_NORMAL) failed: "
888 "%s\n",DXGetErrorString8(rc));
891 ref=IDirectSound8_Release(dso);
892 ok(ref==0,"IDirectSound8_Release() has %d references, should have 0\n",ref);
894 return DSERR_GENERIC;
899 static HRESULT test_primary_3d8(LPGUID lpGuid)
902 LPDIRECTSOUND8 dso=NULL;
903 LPDIRECTSOUNDBUFFER primary=NULL;
904 DSBUFFERDESC bufdesc;
908 /* Create the DirectSound object */
909 rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
910 ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %s\n",
911 DXGetErrorString8(rc));
915 /* Get the device capabilities */
916 ZeroMemory(&dscaps, sizeof(dscaps));
917 dscaps.dwSize=sizeof(dscaps);
918 rc=IDirectSound8_GetCaps(dso,&dscaps);
919 ok(rc==DS_OK,"IDirectSound8_GetCaps failed: %s\n",DXGetErrorString8(rc));
923 /* We must call SetCooperativeLevel before calling CreateSoundBuffer */
924 /* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */
925 rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
926 ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel(DSSCL_PRIORITY) failed: "
927 "%s\n",DXGetErrorString8(rc));
932 ZeroMemory(&bufdesc, sizeof(bufdesc));
933 bufdesc.dwSize=sizeof(bufdesc);
934 bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER;
935 rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&primary,NULL);
936 ok(rc==DS_OK && primary!=NULL,"IDirectSound8_CreateSoundBuffer() failed "
937 "to create a primary buffer: %s\n",DXGetErrorString8(rc));
938 if (rc==DS_OK && primary!=NULL) {
939 ref=IDirectSoundBuffer_Release(primary);
940 ok(ref==0,"IDirectSoundBuffer_Release() primary has %d references, "
941 "should have 0\n",ref);
943 ZeroMemory(&bufdesc, sizeof(bufdesc));
944 bufdesc.dwSize=sizeof(bufdesc);
945 bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER|DSBCAPS_CTRL3D;
946 rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&primary,NULL);
947 ok(rc==DS_OK && primary!=NULL,"IDirectSound8_CreateSoundBuffer() "
948 "failed to create a 3D primary buffer: %s\n",DXGetErrorString8(rc));
949 if (rc==DS_OK && primary!=NULL) {
950 test_buffer8(dso,primary,1,FALSE,0,FALSE,0,
951 winetest_interactive &&
952 !(dscaps.dwFlags & DSCAPS_EMULDRIVER),1.0,0,0,0,0);
953 ref=IDirectSoundBuffer_Release(primary);
954 ok(ref==0,"IDirectSoundBuffer_Release() primary has %d references, "
955 "should have 0\n",ref);
958 /* Set the CooperativeLevel back to normal */
959 /* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */
960 rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
961 ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel(DSSCL_NORMAL) failed: "
962 "%s\n",DXGetErrorString8(rc));
965 ref=IDirectSound8_Release(dso);
966 ok(ref==0,"IDirectSound8_Release() has %d references, should have 0\n",ref);
968 return DSERR_GENERIC;
973 static HRESULT test_primary_3d_with_listener8(LPGUID lpGuid)
976 LPDIRECTSOUND8 dso=NULL;
977 LPDIRECTSOUNDBUFFER primary=NULL;
978 DSBUFFERDESC bufdesc;
982 /* Create the DirectSound object */
983 rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
984 ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %s\n",
985 DXGetErrorString8(rc));
989 /* Get the device capabilities */
990 ZeroMemory(&dscaps, sizeof(dscaps));
991 dscaps.dwSize=sizeof(dscaps);
992 rc=IDirectSound8_GetCaps(dso,&dscaps);
993 ok(rc==DS_OK,"IDirectSound8_GetCaps() failed: %s\n",DXGetErrorString8(rc));
997 /* We must call SetCooperativeLevel before calling CreateSoundBuffer */
998 /* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */
999 rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
1000 ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel(DSSCL_PRIORITY) failed: "
1001 "%s\n",DXGetErrorString8(rc));
1005 ZeroMemory(&bufdesc, sizeof(bufdesc));
1006 bufdesc.dwSize=sizeof(bufdesc);
1007 bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER|DSBCAPS_CTRL3D;
1008 rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&primary,NULL);
1009 ok(rc==DS_OK && primary!=NULL,"IDirectSound8_CreateSoundBuffer() failed "
1010 "to create a 3D primary buffer %s\n",DXGetErrorString8(rc));
1011 if (rc==DS_OK && primary!=NULL) {
1012 LPDIRECTSOUND3DLISTENER listener=NULL;
1013 rc=IDirectSoundBuffer_QueryInterface(primary,
1014 &IID_IDirectSound3DListener,
1015 (void **)&listener);
1016 ok(rc==DS_OK && listener!=NULL,"IDirectSoundBuffer_QueryInterface() "
1017 "failed to get a 3D listener: %s\n",DXGetErrorString8(rc));
1018 if (rc==DS_OK && listener!=NULL) {
1019 LPDIRECTSOUNDBUFFER temp_buffer=NULL;
1021 /* Checking the COM interface */
1022 rc=IDirectSoundBuffer_QueryInterface(primary,
1023 &IID_IDirectSoundBuffer,
1024 (LPVOID *)&temp_buffer);
1025 ok(rc==DS_OK && temp_buffer!=NULL,
1026 "IDirectSoundBuffer_QueryInterface() failed: %s\n",
1027 DXGetErrorString8(rc));
1028 ok(temp_buffer==primary,"COM interface broken: 0x%08lx != "
1029 "0x%08lx\n",(DWORD)temp_buffer,(DWORD)primary);
1030 if (rc==DS_OK && temp_buffer!=NULL) {
1031 ref=IDirectSoundBuffer_Release(temp_buffer);
1032 ok(ref==1,"IDirectSoundBuffer_Release() has %d references, "
1033 "should have 1\n",ref);
1036 rc=IDirectSound3DListener_QueryInterface(listener,
1037 &IID_IDirectSoundBuffer,(LPVOID *)&temp_buffer);
1038 ok(rc==DS_OK && temp_buffer!=NULL,
1039 "IDirectSoundBuffer_QueryInterface() failed: %s\n",
1040 DXGetErrorString8(rc));
1041 ok(temp_buffer==primary,"COM interface broken: 0x%08lx != "
1042 "0x%08lx\n",(DWORD)temp_buffer,(DWORD)primary);
1043 ref=IDirectSoundBuffer_Release(temp_buffer);
1044 ok(ref==1,"IDirectSoundBuffer_Release() has %d references, "
1045 "should have 1\n",ref);
1047 /* Testing the buffer */
1048 test_buffer8(dso,primary,1,FALSE,0,FALSE,0,
1049 winetest_interactive &&
1050 !(dscaps.dwFlags & DSCAPS_EMULDRIVER),
1051 1.0,0,listener,0,0);
1054 /* Testing the reference counting */
1055 ref=IDirectSound3DListener_Release(listener);
1056 ok(ref==0,"IDirectSound3DListener_Release() listener has %d "
1057 "references, should have 0\n",ref);
1060 /* Testing the reference counting */
1061 ref=IDirectSoundBuffer_Release(primary);
1062 ok(ref==0,"IDirectSoundBuffer_Release() primary has %d references, "
1063 "should have 0\n",ref);
1067 ref=IDirectSound8_Release(dso);
1068 ok(ref==0,"IDirectSound8_Release() has %d references, should have 0\n",ref);
1070 return DSERR_GENERIC;
1075 static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
1076 LPCSTR lpcstrModule, LPVOID lpContext)
1079 trace("*** Testing %s - %s ***\n",lpcstrDescription,lpcstrModule);
1081 rc = test_for_driver8(lpGuid);
1082 if (rc == DSERR_NODRIVER) {
1083 trace(" No Driver\n");
1085 } else if (rc == DSERR_ALLOCATED) {
1086 trace(" Already In Use\n");
1088 } else if (rc == E_FAIL) {
1089 trace(" No Device\n");
1093 trace(" Testing the primary buffer\n");
1094 test_primary8(lpGuid);
1096 trace(" Testing 3D primary buffer\n");
1097 test_primary_3d8(lpGuid);
1099 trace(" Testing 3D primary buffer with listener\n");
1100 test_primary_3d_with_listener8(lpGuid);
1102 /* Testing secondary buffers */
1103 test_secondary8(lpGuid,winetest_interactive,0,0,0,0,0,0);
1104 test_secondary8(lpGuid,winetest_interactive,0,0,0,1,0,0);
1106 /* Testing 3D secondary buffers */
1107 test_secondary8(lpGuid,winetest_interactive,1,0,0,0,0,0);
1108 test_secondary8(lpGuid,winetest_interactive,1,1,0,0,0,0);
1109 test_secondary8(lpGuid,winetest_interactive,1,1,0,1,0,0);
1110 test_secondary8(lpGuid,winetest_interactive,1,0,1,0,0,0);
1111 test_secondary8(lpGuid,winetest_interactive,1,0,1,1,0,0);
1112 test_secondary8(lpGuid,winetest_interactive,1,1,1,0,0,0);
1113 test_secondary8(lpGuid,winetest_interactive,1,1,1,1,0,0);
1114 test_secondary8(lpGuid,winetest_interactive,1,1,1,0,1,0);
1115 test_secondary8(lpGuid,winetest_interactive,1,1,1,0,0,1);
1116 test_secondary8(lpGuid,winetest_interactive,1,1,1,0,1,1);
1121 static void ds3d8_tests()
1124 rc=DirectSoundEnumerateA(&dsenum_callback,NULL);
1125 ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %s\n",DXGetErrorString8(rc));
1134 hDsound = LoadLibraryA("dsound.dll");
1136 trace("dsound.dll not found\n");
1140 trace("DLL Version: %s\n", get_file_version("dsound.dll"));
1142 pDirectSoundCreate8 = (void*)GetProcAddress(hDsound, "DirectSoundCreate8");
1143 if (!pDirectSoundCreate8) {
1144 trace("ds3d8 test skipped\n");