3 * Copyright 1998 Marcus Meissner
4 * Copyright 1998 Rob Riggs
5 * Copyright 2000-2001 TransGaming Technologies, Inc.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 * Implement DirectSoundFullDuplex support.
24 * Implement FX support.
30 #include <sys/types.h>
31 #include <sys/fcntl.h>
47 #include "wine/debug.h"
50 #include "dsound_private.h"
52 WINE_DEFAULT_DEBUG_CHANNEL(dsound);
54 static HRESULT WINAPI IDirectSoundCaptureImpl_Initialize(
55 LPDIRECTSOUNDCAPTURE iface,
57 static ULONG WINAPI IDirectSoundCaptureImpl_Release(
58 LPDIRECTSOUNDCAPTURE iface );
59 static ULONG WINAPI IDirectSoundCaptureBufferImpl_Release(
60 LPDIRECTSOUNDCAPTUREBUFFER8 iface );
61 static HRESULT DSOUND_CreateDirectSoundCaptureBuffer(
62 IDirectSoundCaptureImpl *ipDSC,
63 LPCDSCBUFFERDESC lpcDSCBufferDesc,
65 static HRESULT WINAPI IDirectSoundFullDuplexImpl_Initialize(
66 LPDIRECTSOUNDFULLDUPLEX iface,
68 LPCGUID pRendererGuid,
69 LPCDSCBUFFERDESC lpDscBufferDesc,
70 LPCDSBUFFERDESC lpDsBufferDesc,
73 LPLPDIRECTSOUNDCAPTUREBUFFER8 lplpDirectSoundCaptureBuffer8,
74 LPLPDIRECTSOUNDBUFFER8 lplpDirectSoundBuffer8 );
76 static ICOM_VTABLE(IDirectSoundCapture) dscvt;
77 static ICOM_VTABLE(IDirectSoundCaptureBuffer8) dscbvt;
78 static ICOM_VTABLE(IDirectSoundFullDuplex) dsfdvt;
80 IDirectSoundCaptureImpl* dsound_capture = NULL;
82 /***************************************************************************
83 * DirectSoundCaptureCreate [DSOUND.6]
85 * Create and initialize a DirectSoundCapture interface
89 * Failure: DSERR_NOAGGREGATION, DSERR_ALLOCATED, DSERR_INVALIDPARAM,
93 DirectSoundCaptureCreate8(
95 LPDIRECTSOUNDCAPTURE* lplpDSC,
98 IDirectSoundCaptureImpl** ippDSC=(IDirectSoundCaptureImpl**)lplpDSC;
99 TRACE("(%s,%p,%p)\n", debugstr_guid(lpcGUID), lplpDSC, pUnkOuter);
102 WARN("pUnkOuter != 0\n");
103 return DSERR_NOAGGREGATION;
107 WARN("invalid parameter: lplpDSC == NULL\n");
108 return DSERR_INVALIDPARAM;
111 /* Default device? */
112 if ( !lpcGUID || IsEqualGUID(lpcGUID, &GUID_NULL) )
113 lpcGUID = &DSDEVID_DefaultCapture;
115 *ippDSC = (IDirectSoundCaptureImpl*)HeapAlloc(GetProcessHeap(),
116 HEAP_ZERO_MEMORY, sizeof(IDirectSoundCaptureImpl));
118 if (*ippDSC == NULL) {
119 TRACE("couldn't allocate memory\n");
120 return DSERR_OUTOFMEMORY;
124 ICOM_THIS(IDirectSoundCaptureImpl, *ippDSC);
127 This->state = STATE_STOPPED;
129 InitializeCriticalSection( &(This->lock) );
131 This->lpVtbl = &dscvt;
132 dsound_capture = This;
134 if (GetDeviceID(lpcGUID, &This->guid) == DS_OK)
135 return IDirectSoundCaptureImpl_Initialize( (LPDIRECTSOUNDCAPTURE)This, &This->guid);
137 WARN("invalid GUID\n");
138 return DSERR_INVALIDPARAM;
141 /***************************************************************************
142 * DirectSoundCaptureEnumerateA [DSOUND.7]
144 * Enumerate all DirectSound drivers installed in the system
148 * Failure: DSERR_INVALIDPARAM
151 DirectSoundCaptureEnumerateA(
152 LPDSENUMCALLBACKA lpDSEnumCallback,
160 TRACE("(%p,%p)\n", lpDSEnumCallback, lpContext );
162 if (lpDSEnumCallback == NULL) {
163 WARN("invalid parameter\n");
164 return DSERR_INVALIDPARAM;
167 devs = waveInGetNumDevs();
169 if (GetDeviceID(&DSDEVID_DefaultCapture, &guid) == DS_OK) {
171 for (wid = 0; wid < devs; ++wid) {
172 err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDGUID,(DWORD)&temp,0));
174 if (IsEqualGUID( &guid, &temp ) ) {
175 err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0));
177 TRACE("calling lpDSEnumCallback(%s,\"%s\",\"%s\",%p)\n",
178 debugstr_guid(&DSDEVID_DefaultCapture),"Primary Sound Capture Driver",desc.szDrvName,lpContext);
179 if (lpDSEnumCallback((LPGUID)&DSDEVID_DefaultCapture, "Primary Sound Capture Driver", desc.szDrvName, lpContext) == FALSE)
188 for (wid = 0; wid < devs; ++wid) {
189 err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0));
191 err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDGUID,(DWORD)&guid,0));
193 TRACE("calling lpDSEnumCallback(%s,\"%s\",\"%s\",%p)\n",
194 debugstr_guid(&guid),desc.szDesc,desc.szDrvName,lpContext);
195 if (lpDSEnumCallback(&guid, desc.szDesc, desc.szDrvName, lpContext) == FALSE)
204 /***************************************************************************
205 * DirectSoundCaptureEnumerateW [DSOUND.8]
207 * Enumerate all DirectSound drivers installed in the system
211 * Failure: DSERR_INVALIDPARAM
214 DirectSoundCaptureEnumerateW(
215 LPDSENUMCALLBACKW lpDSEnumCallback,
222 WCHAR wDesc[MAXPNAMELEN];
223 WCHAR wName[MAXPNAMELEN];
225 TRACE("(%p,%p)\n", lpDSEnumCallback, lpContext );
227 if (lpDSEnumCallback == NULL) {
228 WARN("invalid parameter\n");
229 return DSERR_INVALIDPARAM;
232 devs = waveInGetNumDevs();
234 if (GetDeviceID(&DSDEVID_DefaultCapture, &guid) == DS_OK) {
236 for (wid = 0; wid < devs; ++wid) {
237 err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDGUID,(DWORD)&temp,0));
239 if (IsEqualGUID( &guid, &temp ) ) {
240 err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0));
242 TRACE("calling lpDSEnumCallback(%s,\"%s\",\"%s\",%p)\n",
243 debugstr_guid(&DSDEVID_DefaultCapture),"Primary Sound Capture Driver",desc.szDrvName,lpContext);
244 MultiByteToWideChar( CP_ACP, 0, "Primary Sound Capture Driver", -1,
245 wDesc, sizeof(wDesc)/sizeof(WCHAR) );
246 MultiByteToWideChar( CP_ACP, 0, desc.szDrvName, -1,
247 wName, sizeof(wName)/sizeof(WCHAR) );
248 if (lpDSEnumCallback((LPGUID)&DSDEVID_DefaultCapture, wDesc, wName, lpContext) == FALSE)
257 for (wid = 0; wid < devs; ++wid) {
258 err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0));
260 err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDGUID,(DWORD)&guid,0));
262 TRACE("calling lpDSEnumCallback(%s,\"%s\",\"%s\",%p)\n",
263 debugstr_guid(&DSDEVID_DefaultCapture),desc.szDesc,desc.szDrvName,lpContext);
264 MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1,
265 wDesc, sizeof(wDesc)/sizeof(WCHAR) );
266 MultiByteToWideChar( CP_ACP, 0, desc.szDrvName, -1,
267 wName, sizeof(wName)/sizeof(WCHAR) );
268 if (lpDSEnumCallback((LPGUID)&DSDEVID_DefaultCapture, wDesc, wName, lpContext) == FALSE)
278 DSOUND_capture_callback(
285 IDirectSoundCaptureImpl* This = (IDirectSoundCaptureImpl*)dwUser;
286 TRACE("entering at %ld, msg=%08x\n", GetTickCount(), msg);
288 if (msg == MM_WIM_DATA) {
289 EnterCriticalSection( &(This->lock) );
290 TRACE("DirectSoundCapture msg=MM_WIM_DATA, old This->state=%ld, old This->index=%d\n",This->state,This->index);
291 if (This->state != STATE_STOPPED) {
292 if (This->state == STATE_STARTING) {
294 mtime.wType = TIME_BYTES;
295 waveInGetPosition(This->hwi, &mtime, sizeof(mtime));
296 TRACE("mtime.u.cb=%ld,This->buflen=%ld\n", mtime.u.cb, This->buflen);
297 mtime.u.cb = mtime.u.cb % This->buflen;
298 This->read_position = mtime.u.cb;
299 This->state = STATE_CAPTURING;
301 This->index = (This->index + 1) % This->nrofpwaves;
302 waveInUnprepareHeader(hwi,&(This->pwave[This->index]),sizeof(WAVEHDR));
303 if (This->capture_buffer->nrofnotifies)
304 SetEvent(This->capture_buffer->notifies[This->index].hEventNotify);
305 if ( (This->index == 0) && !(This->capture_buffer->flags & DSCBSTART_LOOPING) ) {
306 TRACE("end of buffer\n");
307 This->state = STATE_STOPPED;
309 if (This->state == STATE_CAPTURING) {
310 waveInPrepareHeader(hwi,&(This->pwave[This->index]),sizeof(WAVEHDR));
311 waveInAddBuffer(hwi, &(This->pwave[This->index]), sizeof(WAVEHDR));
315 TRACE("DirectSoundCapture new This->state=%ld, new This->index=%d\n",This->state,This->index);
316 LeaveCriticalSection( &(This->lock) );
319 TRACE("completed\n");
322 static HRESULT WINAPI
323 IDirectSoundCaptureImpl_QueryInterface(
324 LPDIRECTSOUNDCAPTURE iface,
328 ICOM_THIS(IDirectSoundCaptureImpl,iface);
329 TRACE( "(%p,%s,%p)\n", This, debugstr_guid(riid), ppobj );
332 return IDsCaptureDriver_QueryInterface(This->driver, riid, ppobj);
338 IDirectSoundCaptureImpl_AddRef( LPDIRECTSOUNDCAPTURE iface )
341 ICOM_THIS(IDirectSoundCaptureImpl,iface);
343 EnterCriticalSection( &(This->lock) );
345 TRACE( "(%p) was 0x%08lx\n", This, This->ref );
346 uRef = ++(This->ref);
349 IDsCaptureDriver_AddRef(This->driver);
351 LeaveCriticalSection( &(This->lock) );
357 IDirectSoundCaptureImpl_Release( LPDIRECTSOUNDCAPTURE iface )
360 ICOM_THIS(IDirectSoundCaptureImpl,iface);
362 EnterCriticalSection( &(This->lock) );
364 TRACE( "(%p) was 0x%08lx\n", This, This->ref );
365 uRef = --(This->ref);
367 LeaveCriticalSection( &(This->lock) );
370 TRACE("deleting object\n");
371 if (This->capture_buffer)
372 IDirectSoundCaptureBufferImpl_Release(
373 (LPDIRECTSOUNDCAPTUREBUFFER8) This->capture_buffer);
376 IDsCaptureDriver_Close(This->driver);
377 IDsCaptureDriver_Release(This->driver);
380 DeleteCriticalSection( &(This->lock) );
381 HeapFree( GetProcessHeap(), 0, This );
382 dsound_capture = NULL;
385 TRACE( "returning 0x%08lx\n", uRef );
389 static HRESULT WINAPI
390 IDirectSoundCaptureImpl_CreateCaptureBuffer(
391 LPDIRECTSOUNDCAPTURE iface,
392 LPCDSCBUFFERDESC lpcDSCBufferDesc,
393 LPDIRECTSOUNDCAPTUREBUFFER* lplpDSCaptureBuffer,
397 ICOM_THIS(IDirectSoundCaptureImpl,iface);
399 TRACE( "(%p,%p,%p,%p)\n",This,lpcDSCBufferDesc,lplpDSCaptureBuffer,pUnk );
401 if ( (This == NULL) || (lpcDSCBufferDesc== NULL) ||
402 (lplpDSCaptureBuffer == NULL) || pUnk ) {
403 WARN("invalid parameters\n");
404 return DSERR_INVALIDPARAM;
407 /* FIXME: We can only have one buffer so what do we do here? */
408 if (This->capture_buffer) {
409 WARN("already has buffer\n");
410 return DSERR_INVALIDPARAM; /* DSERR_GENERIC ? */
413 hr = DSOUND_CreateDirectSoundCaptureBuffer( This, lpcDSCBufferDesc,
414 (LPVOID*)lplpDSCaptureBuffer );
419 static HRESULT WINAPI
420 IDirectSoundCaptureImpl_GetCaps(
421 LPDIRECTSOUNDCAPTURE iface,
422 LPDSCCAPS lpDSCCaps )
424 ICOM_THIS(IDirectSoundCaptureImpl,iface);
425 TRACE("(%p,%p)\n",This,lpDSCCaps);
427 if ( (lpDSCCaps== NULL) || (lpDSCCaps->dwSize != sizeof(*lpDSCCaps)) ) {
428 WARN("invalid parameters\n");
429 return DSERR_INVALIDPARAM;
432 if ( !(This->initialized) ) {
433 WARN("not initialized\n");
434 return DSERR_UNINITIALIZED;
437 lpDSCCaps->dwFlags = This->drvcaps.dwFlags;
438 lpDSCCaps->dwFormats = This->drvcaps.dwFormats;
439 lpDSCCaps->dwChannels = This->drvcaps.dwChannels;
441 TRACE("(flags=0x%08lx,format=0x%08lx,channels=%ld)\n",lpDSCCaps->dwFlags,
442 lpDSCCaps->dwFormats, lpDSCCaps->dwChannels);
447 static HRESULT WINAPI
448 IDirectSoundCaptureImpl_Initialize(
449 LPDIRECTSOUNDCAPTURE iface,
452 HRESULT err = DSERR_INVALIDPARAM;
454 ICOM_THIS(IDirectSoundCaptureImpl,iface);
455 TRACE("(%p)\n", This);
458 WARN("invalid parameter\n");
459 return DSERR_INVALIDPARAM;
462 if (This->initialized) {
463 WARN("already initialized\n");
464 return DSERR_ALREADYINITIALIZED;
467 widn = waveInGetNumDevs();
470 WARN("no audio devices found\n");
471 return DSERR_NODRIVER;
474 /* Get dsound configuration */
475 setup_dsound_options();
477 /* enumerate WINMM audio devices and find the one we want */
478 for (wid=0; wid<widn; wid++) {
480 err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDGUID,(DWORD)(&guid),0));
482 WARN("waveInMessage failed; err=%lx\n",err);
485 if (IsEqualGUID( lpcGUID, &guid) ) {
492 WARN("invalid parameter\n");
493 return DSERR_INVALIDPARAM;
496 err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD)&(This->driver),0));
497 if ( (err != DS_OK) && (err != DSERR_UNSUPPORTED) ) {
498 WARN("waveInMessage failed; err=%lx\n",err);
503 /* Disable the direct sound driver to force emulation if requested. */
504 if (ds_hw_accel == DS_HW_ACCEL_EMULATION)
507 /* Get driver description */
509 TRACE("using DirectSound driver\n");
510 err = IDsCaptureDriver_GetDriverDesc(This->driver, &(This->drvdesc));
512 WARN("IDsCaptureDriver_GetDriverDesc failed\n");
516 TRACE("using WINMM\n");
517 /* if no DirectSound interface available, use WINMM API instead */
518 This->drvdesc.dwFlags = DSDDESC_DOMMSYSTEMOPEN |
519 DSDDESC_DOMMSYSTEMSETFORMAT;
522 This->drvdesc.dnDevNode = wid;
524 /* open the DirectSound driver if available */
525 if (This->driver && (err == DS_OK))
526 err = IDsCaptureDriver_Open(This->driver);
529 This->initialized = TRUE;
531 /* the driver is now open, so it's now allowed to call GetCaps */
533 This->drvcaps.dwSize = sizeof(This->drvcaps);
534 err = IDsCaptureDriver_GetCaps(This->driver,&(This->drvcaps));
536 WARN("IDsCaptureDriver_GetCaps failed\n");
539 } else /*if (This->hwi)*/ {
541 err = mmErr(waveInGetDevCapsA((UINT)This->drvdesc.dnDevNode, &wic, sizeof(wic)));
544 This->drvcaps.dwFlags = 0;
545 strncpy(This->drvdesc.szDrvName, wic.szPname,
546 sizeof(This->drvdesc.szDrvName));
548 This->drvcaps.dwFlags |= DSCCAPS_EMULDRIVER;
549 This->drvcaps.dwFormats = wic.dwFormats;
550 This->drvcaps.dwChannels = wic.wChannels;
558 static ICOM_VTABLE(IDirectSoundCapture) dscvt =
560 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
561 /* IUnknown methods */
562 IDirectSoundCaptureImpl_QueryInterface,
563 IDirectSoundCaptureImpl_AddRef,
564 IDirectSoundCaptureImpl_Release,
566 /* IDirectSoundCapture methods */
567 IDirectSoundCaptureImpl_CreateCaptureBuffer,
568 IDirectSoundCaptureImpl_GetCaps,
569 IDirectSoundCaptureImpl_Initialize
573 DSOUND_CreateDirectSoundCaptureBuffer(
574 IDirectSoundCaptureImpl *ipDSC,
575 LPCDSCBUFFERDESC lpcDSCBufferDesc,
579 TRACE( "(%p,%p)\n", lpcDSCBufferDesc, ppobj );
581 if ( (ipDSC == NULL) || (lpcDSCBufferDesc == NULL) || (ppobj == NULL) ) {
582 WARN("invalid parameters\n");
583 return DSERR_INVALIDPARAM;
586 if ( (lpcDSCBufferDesc->dwSize < sizeof(DSCBUFFERDESC)) ||
587 (lpcDSCBufferDesc->dwBufferBytes == 0) ||
588 (lpcDSCBufferDesc->lpwfxFormat == NULL) ) {
589 WARN("invalid lpcDSCBufferDesc\n");
590 return DSERR_INVALIDPARAM;
593 if ( !ipDSC->initialized ) {
594 WARN("not initialized\n");
595 return DSERR_UNINITIALIZED;
598 wfex = lpcDSCBufferDesc->lpwfxFormat;
601 TRACE("(formattag=0x%04x,chans=%d,samplerate=%ld,"
602 "bytespersec=%ld,blockalign=%d,bitspersamp=%d,cbSize=%d)\n",
603 wfex->wFormatTag, wfex->nChannels, wfex->nSamplesPerSec,
604 wfex->nAvgBytesPerSec, wfex->nBlockAlign,
605 wfex->wBitsPerSample, wfex->cbSize);
607 if (wfex->wFormatTag == WAVE_FORMAT_PCM)
608 memcpy(&(ipDSC->wfx), wfex, sizeof(WAVEFORMATEX));
610 WARN("non PCM formats not supported\n");
611 return DSERR_BADFORMAT;
614 WARN("lpcDSCBufferDesc->lpwfxFormat == 0\n");
615 return DSERR_INVALIDPARAM; /* FIXME: DSERR_BADFORMAT ? */
618 *ppobj = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,
619 sizeof(IDirectSoundCaptureBufferImpl));
621 if ( *ppobj == NULL ) {
622 WARN("out of memory\n");
623 return DSERR_OUTOFMEMORY;
626 ICOM_THIS(IDirectSoundCaptureBufferImpl,*ppobj);
629 This->dsound = ipDSC;
630 This->dsound->capture_buffer = This;
632 This->pdscbd = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,
633 lpcDSCBufferDesc->dwSize);
635 memcpy(This->pdscbd, lpcDSCBufferDesc, lpcDSCBufferDesc->dwSize);
638 This->dsound->capture_buffer = 0;
639 HeapFree( GetProcessHeap(), 0, This );
641 return DSERR_OUTOFMEMORY;
644 This->lpVtbl = &dscbvt;
647 err = IDsCaptureDriver_CreateCaptureBuffer(ipDSC->driver,
648 &(ipDSC->wfx),0,0,&(ipDSC->buflen),&(ipDSC->buffer),(LPVOID*)&(ipDSC->hwbuf));
650 WARN("IDsCaptureDriver_CreateCaptureBuffer failed\n");
651 This->dsound->capture_buffer = 0;
652 HeapFree( GetProcessHeap(), 0, This );
659 DWORD flags = CALLBACK_FUNCTION;
660 if (ds_hw_accel != DS_HW_ACCEL_EMULATION)
661 flags |= WAVE_DIRECTSOUND;
662 err = mmErr(waveInOpen(&(ipDSC->hwi),
663 ipDSC->drvdesc.dnDevNode, &(ipDSC->wfx),
664 (DWORD)DSOUND_capture_callback, (DWORD)ipDSC, flags));
666 WARN("waveInOpen failed\n");
667 This->dsound->capture_buffer = 0;
668 HeapFree( GetProcessHeap(), 0, This );
673 buflen = lpcDSCBufferDesc->dwBufferBytes;
674 TRACE("desired buflen=%ld, old buffer=%p\n", buflen, ipDSC->buffer);
675 newbuf = (LPBYTE)HeapReAlloc(GetProcessHeap(),0,ipDSC->buffer,buflen);
677 if (newbuf == NULL) {
678 WARN("failed to allocate capture buffer\n");
679 err = DSERR_OUTOFMEMORY;
680 /* but the old buffer might still exist and must be re-prepared */
682 ipDSC->buffer = newbuf;
683 ipDSC->buflen = buflen;
688 TRACE("returning DS_OK\n");
692 static HRESULT WINAPI
693 IDirectSoundCaptureBufferImpl_QueryInterface(
694 LPDIRECTSOUNDCAPTUREBUFFER8 iface,
698 ICOM_THIS(IDirectSoundCaptureBufferImpl,iface);
699 TRACE( "(%p,%s,%p)\n", This, debugstr_guid(riid), ppobj );
701 if (IsEqualGUID( &IID_IDirectSoundNotify, riid ) ) {
702 IDirectSoundNotifyImpl *dsn;
704 dsn = (IDirectSoundNotifyImpl*)HeapAlloc(GetProcessHeap(),0,
709 /* FIXME: get this right someday */
710 IDirectSoundCaptureBuffer8_AddRef(iface);
711 dsn->lpVtbl = &dsnvt;
712 *ppobj = (LPVOID)dsn;
716 if ( IsEqualGUID( &IID_IDirectSoundCaptureBuffer8, riid ) ) {
717 IDirectSoundCaptureBuffer8_AddRef(iface);
722 FIXME("(%p,%s,%p) unsupported GUID\n", This, debugstr_guid(riid), ppobj);
728 IDirectSoundCaptureBufferImpl_AddRef( LPDIRECTSOUNDCAPTUREBUFFER8 iface )
731 ICOM_THIS(IDirectSoundCaptureBufferImpl,iface);
732 TRACE( "(%p)\n", This );
734 assert(This->dsound);
736 EnterCriticalSection( &(This->dsound->lock) );
738 TRACE( "(%p) was 0x%08lx\n", This, This->ref );
739 uRef = ++(This->ref);
741 LeaveCriticalSection( &(This->dsound->lock) );
747 IDirectSoundCaptureBufferImpl_Release( LPDIRECTSOUNDCAPTUREBUFFER8 iface )
750 ICOM_THIS(IDirectSoundCaptureBufferImpl,iface);
751 TRACE( "(%p)\n", This );
753 assert(This->dsound);
755 EnterCriticalSection( &(This->dsound->lock) );
757 TRACE( "(%p) was 0x%08lx\n", This, This->ref );
758 uRef = --(This->ref);
760 LeaveCriticalSection( &(This->dsound->lock) );
763 TRACE("deleting object\n");
765 HeapFree(GetProcessHeap(),0, This->pdscbd);
767 if (This->dsound->hwi) {
768 waveInReset(This->dsound->hwi);
769 waveInClose(This->dsound->hwi);
770 if (This->dsound->pwave) {
771 HeapFree(GetProcessHeap(),0, This->dsound->pwave);
772 This->dsound->pwave = 0;
774 This->dsound->hwi = 0;
777 if (This->dsound->hwbuf)
778 IDsCaptureDriverBuffer_Release(This->dsound->hwbuf);
780 /* remove from IDirectSoundCaptureImpl */
782 This->dsound->capture_buffer = NULL;
784 ERR("does not reference dsound\n");
787 HeapFree(GetProcessHeap(),0, This->notifies);
789 HeapFree( GetProcessHeap(), 0, This );
792 TRACE( "returning 0x%08lx\n", uRef );
796 static HRESULT WINAPI
797 IDirectSoundCaptureBufferImpl_GetCaps(
798 LPDIRECTSOUNDCAPTUREBUFFER8 iface,
799 LPDSCBCAPS lpDSCBCaps )
801 ICOM_THIS(IDirectSoundCaptureBufferImpl,iface);
802 TRACE( "(%p,%p)\n", This, lpDSCBCaps );
804 if ( (This == NULL) || (lpDSCBCaps == NULL) ) {
805 WARN("invalid parameters\n");
806 return DSERR_INVALIDPARAM;
809 if ( (lpDSCBCaps->dwSize < sizeof(DSCBCAPS)) || (This->dsound == NULL) ) {
810 WARN("invalid parameters\n");
811 return DSERR_INVALIDPARAM;
814 lpDSCBCaps->dwSize = sizeof(DSCBCAPS);
815 lpDSCBCaps->dwFlags = This->flags;
816 lpDSCBCaps->dwBufferBytes = This->pdscbd->dwBufferBytes;
817 lpDSCBCaps->dwReserved = 0;
819 TRACE("returning DS_OK\n");
823 static HRESULT WINAPI
824 IDirectSoundCaptureBufferImpl_GetCurrentPosition(
825 LPDIRECTSOUNDCAPTUREBUFFER8 iface,
826 LPDWORD lpdwCapturePosition,
827 LPDWORD lpdwReadPosition )
829 ICOM_THIS(IDirectSoundCaptureBufferImpl,iface);
830 TRACE( "(%p,%p,%p)\n", This, lpdwCapturePosition, lpdwReadPosition );
832 if ( (This == NULL) || (This->dsound == NULL) ) {
833 WARN("invalid parameter\n");
834 return DSERR_INVALIDPARAM;
837 if (This->dsound->driver) {
838 return IDsCaptureDriverBuffer_GetPosition(This->dsound->hwbuf, lpdwCapturePosition, lpdwReadPosition );
839 } else if (This->dsound->hwi) {
840 EnterCriticalSection(&(This->dsound->lock));
841 TRACE("old This->dsound->state=%ld\n",This->dsound->state);
842 if (lpdwCapturePosition) {
844 mtime.wType = TIME_BYTES;
845 waveInGetPosition(This->dsound->hwi, &mtime, sizeof(mtime));
846 TRACE("mtime.u.cb=%ld,This->dsound->buflen=%ld\n", mtime.u.cb,
847 This->dsound->buflen);
848 mtime.u.cb = mtime.u.cb % This->dsound->buflen;
849 *lpdwCapturePosition = mtime.u.cb;
852 if (lpdwReadPosition) {
853 if (This->dsound->state == STATE_STARTING) {
854 if (lpdwCapturePosition)
855 This->dsound->read_position = *lpdwCapturePosition;
856 This->dsound->state = STATE_CAPTURING;
858 *lpdwReadPosition = This->dsound->read_position;
860 TRACE("new This->dsound->state=%ld\n",This->dsound->state);
861 LeaveCriticalSection(&(This->dsound->lock));
862 if (lpdwCapturePosition) TRACE("*lpdwCapturePosition=%ld\n",*lpdwCapturePosition);
863 if (lpdwReadPosition) TRACE("*lpdwReadPosition=%ld\n",*lpdwReadPosition);
866 return DSERR_NODRIVER;
869 TRACE("returning DS_OK\n");
873 static HRESULT WINAPI
874 IDirectSoundCaptureBufferImpl_GetFormat(
875 LPDIRECTSOUNDCAPTUREBUFFER8 iface,
876 LPWAVEFORMATEX lpwfxFormat,
877 DWORD dwSizeAllocated,
878 LPDWORD lpdwSizeWritten )
880 ICOM_THIS(IDirectSoundCaptureBufferImpl,iface);
881 TRACE( "(%p,%p,0x%08lx,%p)\n", This, lpwfxFormat, dwSizeAllocated,
884 if ( (This == NULL) || (This->dsound == NULL) ) {
885 WARN("invalid parameter\n");
886 return DSERR_INVALIDPARAM;
889 /* FIXME: use real size for extended formats someday */
890 if (dwSizeAllocated > sizeof(This->dsound->wfx))
891 dwSizeAllocated = sizeof(This->dsound->wfx);
892 if (lpwfxFormat) { /* NULL is valid (just want size) */
893 memcpy(lpwfxFormat,&(This->dsound->wfx),dwSizeAllocated);
895 *lpdwSizeWritten = dwSizeAllocated;
898 *lpdwSizeWritten = sizeof(This->dsound->wfx);
900 TRACE("invalid parameter\n");
901 return DSERR_INVALIDPARAM;
905 TRACE("returning DS_OK\n");
909 static HRESULT WINAPI
910 IDirectSoundCaptureBufferImpl_GetStatus(
911 LPDIRECTSOUNDCAPTUREBUFFER8 iface,
914 ICOM_THIS(IDirectSoundCaptureBufferImpl,iface);
915 TRACE( "(%p, %p), thread is %04lx\n", This, lpdwStatus, GetCurrentThreadId() );
917 if ( (This == NULL ) || (This->dsound == NULL) || (lpdwStatus == NULL) ) {
918 WARN("invalid parameter\n");
919 return DSERR_INVALIDPARAM;
923 EnterCriticalSection(&(This->dsound->lock));
925 TRACE("old This->dsound->state=%ld, old lpdwStatus=%08lx\n",This->dsound->state,*lpdwStatus);
926 if ((This->dsound->state == STATE_STARTING) ||
927 (This->dsound->state == STATE_CAPTURING)) {
928 *lpdwStatus |= DSCBSTATUS_CAPTURING;
929 if (This->flags & DSCBSTART_LOOPING)
930 *lpdwStatus |= DSCBSTATUS_LOOPING;
932 TRACE("new This->dsound->state=%ld, new lpdwStatus=%08lx\n",This->dsound->state,*lpdwStatus);
933 LeaveCriticalSection(&(This->dsound->lock));
935 TRACE("status=%lx\n", *lpdwStatus);
936 TRACE("returning DS_OK\n");
940 static HRESULT WINAPI
941 IDirectSoundCaptureBufferImpl_Initialize(
942 LPDIRECTSOUNDCAPTUREBUFFER8 iface,
943 LPDIRECTSOUNDCAPTURE lpDSC,
944 LPCDSCBUFFERDESC lpcDSCBDesc )
946 ICOM_THIS(IDirectSoundCaptureBufferImpl,iface);
948 FIXME( "(%p,%p,%p): stub\n", This, lpDSC, lpcDSCBDesc );
953 static HRESULT WINAPI
954 IDirectSoundCaptureBufferImpl_Lock(
955 LPDIRECTSOUNDCAPTUREBUFFER8 iface,
958 LPVOID* lplpvAudioPtr1,
959 LPDWORD lpdwAudioBytes1,
960 LPVOID* lplpvAudioPtr2,
961 LPDWORD lpdwAudioBytes2,
965 ICOM_THIS(IDirectSoundCaptureBufferImpl,iface);
966 TRACE( "(%p,%08lu,%08lu,%p,%p,%p,%p,0x%08lx) at %ld\n", This, dwReadCusor,
967 dwReadBytes, lplpvAudioPtr1, lpdwAudioBytes1, lplpvAudioPtr2,
968 lpdwAudioBytes2, dwFlags, GetTickCount() );
970 if ( (This == NULL) || (This->dsound == NULL) || (lplpvAudioPtr1 == NULL) ||
971 (lpdwAudioBytes1 == NULL) ) {
972 WARN("invalid parameter\n");
973 return DSERR_INVALIDPARAM;
976 EnterCriticalSection(&(This->dsound->lock));
978 if (This->dsound->driver) {
979 err = IDsCaptureDriverBuffer_Lock(This->dsound->hwbuf, lplpvAudioPtr1,
980 lpdwAudioBytes1, lplpvAudioPtr2, lpdwAudioBytes2,
981 dwReadCusor, dwReadBytes, dwFlags);
982 } else if (This->dsound->hwi) {
983 *lplpvAudioPtr1 = This->dsound->buffer + dwReadCusor;
984 if ( (dwReadCusor + dwReadBytes) > This->dsound->buflen) {
985 *lpdwAudioBytes1 = This->dsound->buflen - dwReadCusor;
987 *lplpvAudioPtr2 = This->dsound->buffer;
989 *lpdwAudioBytes2 = dwReadBytes - *lpdwAudioBytes1;
991 *lpdwAudioBytes1 = dwReadBytes;
995 *lpdwAudioBytes2 = 0;
998 TRACE("invalid call\n");
999 err = DSERR_INVALIDCALL; /* DSERR_NODRIVER ? */
1002 LeaveCriticalSection(&(This->dsound->lock));
1007 static HRESULT WINAPI
1008 IDirectSoundCaptureBufferImpl_Start(
1009 LPDIRECTSOUNDCAPTUREBUFFER8 iface,
1012 HRESULT err = DS_OK;
1013 ICOM_THIS(IDirectSoundCaptureBufferImpl,iface);
1014 TRACE( "(%p,0x%08lx)\n", This, dwFlags );
1016 if ( (This == NULL) || (This->dsound == NULL) ) {
1017 WARN("invalid parameter\n");
1018 return DSERR_INVALIDPARAM;
1021 if ( (This->dsound->driver == 0) && (This->dsound->hwi == 0) ) {
1022 WARN("no driver\n");
1023 return DSERR_NODRIVER;
1026 EnterCriticalSection(&(This->dsound->lock));
1028 This->flags = dwFlags;
1029 TRACE("old This->dsound->state=%ld\n",This->dsound->state);
1030 if (This->dsound->state == STATE_STOPPED)
1031 This->dsound->state = STATE_STARTING;
1032 else if (This->dsound->state == STATE_STOPPING)
1033 This->dsound->state = STATE_CAPTURING;
1034 TRACE("new This->dsound->state=%ld\n",This->dsound->state);
1036 LeaveCriticalSection(&(This->dsound->lock));
1038 if (This->dsound->driver) {
1039 err = IDsCaptureDriverBuffer_Start(This->dsound->hwbuf, dwFlags);
1042 IDirectSoundCaptureImpl* ipDSC = This->dsound;
1044 if (ipDSC->buffer) {
1045 if (This->nrofnotifies) {
1048 ipDSC->nrofpwaves = This->nrofnotifies;
1050 /* prepare headers */
1051 ipDSC->pwave = HeapReAlloc(GetProcessHeap(),0,ipDSC->pwave,
1052 ipDSC->nrofpwaves*sizeof(WAVEHDR));
1054 for (c = 0; c < ipDSC->nrofpwaves; c++) {
1056 ipDSC->pwave[0].lpData = ipDSC->buffer;
1057 ipDSC->pwave[0].dwBufferLength =
1058 This->notifies[0].dwOffset + 1;
1060 ipDSC->pwave[c].lpData = ipDSC->buffer +
1061 This->notifies[c-1].dwOffset + 1;
1062 ipDSC->pwave[c].dwBufferLength =
1063 This->notifies[c].dwOffset -
1064 This->notifies[c-1].dwOffset;
1066 ipDSC->pwave[c].dwUser = (DWORD)ipDSC;
1067 ipDSC->pwave[c].dwFlags = 0;
1068 ipDSC->pwave[c].dwLoops = 0;
1069 err = mmErr(waveInPrepareHeader(ipDSC->hwi,
1070 &(ipDSC->pwave[c]),sizeof(WAVEHDR)));
1073 waveInUnprepareHeader(ipDSC->hwi,
1074 &(ipDSC->pwave[c]),sizeof(WAVEHDR));
1079 memset(ipDSC->buffer,
1080 (ipDSC->wfx.wBitsPerSample == 16) ? 0 : 128, ipDSC->buflen);
1082 TRACE("no notifiers specified\n");
1083 /* no notifiers specified so just create a single default header */
1084 ipDSC->nrofpwaves = 1;
1085 ipDSC->pwave = HeapReAlloc(GetProcessHeap(),0,ipDSC->pwave,sizeof(WAVEHDR));
1086 ipDSC->pwave[0].lpData = ipDSC->buffer;
1087 ipDSC->pwave[0].dwBufferLength = ipDSC->buflen;
1088 ipDSC->pwave[0].dwUser = (DWORD)ipDSC;
1089 ipDSC->pwave[0].dwFlags = 0;
1090 ipDSC->pwave[0].dwLoops = 0;
1092 err = mmErr(waveInPrepareHeader(ipDSC->hwi,
1093 &(ipDSC->pwave[0]),sizeof(WAVEHDR)));
1095 waveInUnprepareHeader(ipDSC->hwi,
1096 &(ipDSC->pwave[0]),sizeof(WAVEHDR));
1102 ipDSC->read_position = 0;
1105 err = mmErr(waveInReset(ipDSC->hwi));
1107 /* add the first buffer to the queue */
1108 err = mmErr(waveInAddBuffer(ipDSC->hwi, &(ipDSC->pwave[0]), sizeof(WAVEHDR)));
1110 /* start filling the first buffer */
1111 err = mmErr(waveInStart(ipDSC->hwi));
1118 WARN("calling waveInClose because of error\n");
1119 waveInClose(This->dsound->hwi);
1120 This->dsound->hwi = 0;
1123 TRACE("returning %ld\n", err);
1127 static HRESULT WINAPI
1128 IDirectSoundCaptureBufferImpl_Stop( LPDIRECTSOUNDCAPTUREBUFFER8 iface )
1130 HRESULT err = DS_OK;
1131 ICOM_THIS(IDirectSoundCaptureBufferImpl,iface);
1132 TRACE( "(%p)\n", This );
1134 if ( (This == NULL) || (This->dsound == NULL) ) {
1135 WARN("invalid parameter\n");
1136 return DSERR_INVALIDPARAM;
1139 EnterCriticalSection(&(This->dsound->lock));
1141 TRACE("old This->dsound->state=%ld\n",This->dsound->state);
1142 if (This->dsound->state == STATE_CAPTURING)
1143 This->dsound->state = STATE_STOPPING;
1144 else if (This->dsound->state == STATE_STARTING)
1145 This->dsound->state = STATE_STOPPED;
1146 TRACE("new This->dsound->state=%ld\n",This->dsound->state);
1148 LeaveCriticalSection(&(This->dsound->lock));
1150 if (This->dsound->driver) {
1151 err = IDsCaptureDriverBuffer_Stop(This->dsound->hwbuf);
1152 if (err == DSERR_BUFFERLOST) {
1153 /* Wine-only: the driver wants us to reopen the device */
1154 IDsCaptureDriverBuffer_Release(This->dsound->hwbuf);
1155 err = IDsCaptureDriver_CreateCaptureBuffer(This->dsound->driver,
1156 &(This->dsound->wfx),0,0,&(This->dsound->buflen),&(This->dsound->buffer),
1157 (LPVOID*)&(This->dsound->hwbuf));
1159 WARN("IDsCaptureDriver_CreateCaptureBuffer failed\n");
1160 This->dsound->hwbuf = 0;
1163 } else if (This->dsound->hwi) {
1164 err = waveInStop(This->dsound->hwi);
1166 WARN("no driver\n");
1167 err = DSERR_NODRIVER;
1170 TRACE( "(%p) returning 0x%08lx\n", This,err);
1174 static HRESULT WINAPI
1175 IDirectSoundCaptureBufferImpl_Unlock(
1176 LPDIRECTSOUNDCAPTUREBUFFER8 iface,
1177 LPVOID lpvAudioPtr1,
1178 DWORD dwAudioBytes1,
1179 LPVOID lpvAudioPtr2,
1180 DWORD dwAudioBytes2 )
1182 ICOM_THIS(IDirectSoundCaptureBufferImpl,iface);
1183 TRACE( "(%p,%p,%08lu,%p,%08lu)\n", This, lpvAudioPtr1, dwAudioBytes1,
1184 lpvAudioPtr2, dwAudioBytes2 );
1186 if ( (This == NULL) || (lpvAudioPtr1 == NULL) ) {
1187 WARN("invalid parameters\n");
1188 return DSERR_INVALIDPARAM;
1191 if (This->dsound->driver) {
1192 return IDsCaptureDriverBuffer_Unlock(This->dsound->hwbuf, lpvAudioPtr1,
1193 dwAudioBytes1, lpvAudioPtr2, dwAudioBytes2);
1194 } else if (This->dsound->hwi) {
1195 This->dsound->read_position = (This->dsound->read_position +
1196 (dwAudioBytes1 + dwAudioBytes2)) % This->dsound->buflen;
1198 WARN("invalid call\n");
1199 return DSERR_INVALIDCALL;
1205 static HRESULT WINAPI
1206 IDirectSoundCaptureBufferImpl_GetObjectInPath(
1207 LPDIRECTSOUNDCAPTUREBUFFER8 iface,
1208 REFGUID rguidObject,
1210 REFGUID rguidInterface,
1213 ICOM_THIS(IDirectSoundCaptureBufferImpl,iface);
1215 FIXME( "(%p,%s,%lu,%s,%p): stub\n", This, debugstr_guid(rguidObject),
1216 dwIndex, debugstr_guid(rguidInterface), ppObject );
1221 static HRESULT WINAPI
1222 IDirectSoundCaptureBufferImpl_GetFXStatus(
1223 LPDIRECTSOUNDCAPTUREBUFFER8 iface,
1225 LPDWORD pdwFXStatus )
1227 ICOM_THIS(IDirectSoundCaptureBufferImpl,iface);
1229 FIXME( "(%p,%lu,%p): stub\n", This, dwFXCount, pdwFXStatus );
1234 static ICOM_VTABLE(IDirectSoundCaptureBuffer8) dscbvt =
1236 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1237 /* IUnknown methods */
1238 IDirectSoundCaptureBufferImpl_QueryInterface,
1239 IDirectSoundCaptureBufferImpl_AddRef,
1240 IDirectSoundCaptureBufferImpl_Release,
1242 /* IDirectSoundCaptureBuffer methods */
1243 IDirectSoundCaptureBufferImpl_GetCaps,
1244 IDirectSoundCaptureBufferImpl_GetCurrentPosition,
1245 IDirectSoundCaptureBufferImpl_GetFormat,
1246 IDirectSoundCaptureBufferImpl_GetStatus,
1247 IDirectSoundCaptureBufferImpl_Initialize,
1248 IDirectSoundCaptureBufferImpl_Lock,
1249 IDirectSoundCaptureBufferImpl_Start,
1250 IDirectSoundCaptureBufferImpl_Stop,
1251 IDirectSoundCaptureBufferImpl_Unlock,
1253 /* IDirectSoundCaptureBuffer methods */
1254 IDirectSoundCaptureBufferImpl_GetObjectInPath,
1255 IDirectSoundCaptureBufferImpl_GetFXStatus
1258 /***************************************************************************
1259 * DirectSoundFullDuplexCreate8 [DSOUND.8]
1261 * Create and initialize a DirectSoundFullDuplex interface
1265 * Failure: DSERR_NOAGGREGATION, DSERR_ALLOCATED, DSERR_INVALIDPARAM,
1266 * DSERR_OUTOFMEMORY DSERR_INVALIDCALL DSERR_NODRIVER
1269 DirectSoundFullDuplexCreate8(
1270 LPCGUID pcGuidCaptureDevice,
1271 LPCGUID pcGuidRenderDevice,
1272 LPCDSCBUFFERDESC pcDSCBufferDesc,
1273 LPCDSBUFFERDESC pcDSBufferDesc,
1276 LPDIRECTSOUNDFULLDUPLEX *ppDSFD,
1277 LPDIRECTSOUNDCAPTUREBUFFER8 *ppDSCBuffer8,
1278 LPDIRECTSOUNDBUFFER8 *ppDSBuffer8,
1279 LPUNKNOWN pUnkOuter)
1281 IDirectSoundFullDuplexImpl** ippDSFD=(IDirectSoundFullDuplexImpl**)ppDSFD;
1282 TRACE("(%s,%s,%p,%p,%lx,%lx,%p,%p,%p,%p)\n", debugstr_guid(pcGuidCaptureDevice),
1283 debugstr_guid(pcGuidRenderDevice), pcDSCBufferDesc, pcDSBufferDesc,
1284 (DWORD)hWnd, dwLevel, ppDSFD, ppDSCBuffer8, ppDSBuffer8, pUnkOuter);
1287 WARN("pUnkOuter != 0\n");
1288 return DSERR_NOAGGREGATION;
1291 *ippDSFD = (IDirectSoundFullDuplexImpl*)HeapAlloc(GetProcessHeap(),
1292 HEAP_ZERO_MEMORY, sizeof(IDirectSoundFullDuplexImpl));
1294 if (*ippDSFD == NULL) {
1295 TRACE("couldn't allocate memory\n");
1296 return DSERR_OUTOFMEMORY;
1300 ICOM_THIS(IDirectSoundFullDuplexImpl, *ippDSFD);
1303 This->lpVtbl = &dsfdvt;
1305 InitializeCriticalSection( &(This->lock) );
1307 return IDirectSoundFullDuplexImpl_Initialize( (LPDIRECTSOUNDFULLDUPLEX)This,
1308 pcGuidCaptureDevice, pcGuidRenderDevice,
1309 pcDSCBufferDesc, pcDSBufferDesc,
1310 hWnd, dwLevel, ppDSCBuffer8, ppDSBuffer8);
1314 static HRESULT WINAPI
1315 IDirectSoundFullDuplexImpl_QueryInterface(
1316 LPDIRECTSOUNDFULLDUPLEX iface,
1320 ICOM_THIS(IDirectSoundFullDuplexImpl,iface);
1321 TRACE( "(%p,%s,%p)\n", This, debugstr_guid(riid), ppobj );
1327 IDirectSoundFullDuplexImpl_AddRef( LPDIRECTSOUNDFULLDUPLEX iface )
1330 ICOM_THIS(IDirectSoundFullDuplexImpl,iface);
1332 EnterCriticalSection( &(This->lock) );
1334 TRACE( "(%p) was 0x%08lx\n", This, This->ref );
1335 uRef = ++(This->ref);
1337 LeaveCriticalSection( &(This->lock) );
1343 IDirectSoundFullDuplexImpl_Release( LPDIRECTSOUNDFULLDUPLEX iface )
1346 ICOM_THIS(IDirectSoundFullDuplexImpl,iface);
1348 EnterCriticalSection( &(This->lock) );
1350 TRACE( "(%p) was 0x%08lx\n", This, This->ref );
1351 uRef = --(This->ref);
1353 LeaveCriticalSection( &(This->lock) );
1356 TRACE("deleting object\n");
1357 DeleteCriticalSection( &(This->lock) );
1358 HeapFree( GetProcessHeap(), 0, This );
1364 static HRESULT WINAPI
1365 IDirectSoundFullDuplexImpl_Initialize(
1366 LPDIRECTSOUNDFULLDUPLEX iface,
1367 LPCGUID pCaptureGuid,
1368 LPCGUID pRendererGuid,
1369 LPCDSCBUFFERDESC lpDscBufferDesc,
1370 LPCDSBUFFERDESC lpDsBufferDesc,
1373 LPLPDIRECTSOUNDCAPTUREBUFFER8 lplpDirectSoundCaptureBuffer8,
1374 LPLPDIRECTSOUNDBUFFER8 lplpDirectSoundBuffer8 )
1376 ICOM_THIS(IDirectSoundFullDuplexImpl,iface);
1377 IDirectSoundCaptureBufferImpl** ippdscb=(IDirectSoundCaptureBufferImpl**)lplpDirectSoundCaptureBuffer8;
1378 IDirectSoundBufferImpl** ippdsc=(IDirectSoundBufferImpl**)lplpDirectSoundBuffer8;
1380 TRACE( "(%p,%s,%s,%p,%p,%lx,%lx,%p,%p)\n", This, debugstr_guid(pCaptureGuid),
1381 debugstr_guid(pRendererGuid), lpDscBufferDesc, lpDsBufferDesc, (DWORD)hWnd, dwLevel,
1387 static ICOM_VTABLE(IDirectSoundFullDuplex) dsfdvt =
1389 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1390 /* IUnknown methods */
1391 IDirectSoundFullDuplexImpl_QueryInterface,
1392 IDirectSoundFullDuplexImpl_AddRef,
1393 IDirectSoundFullDuplexImpl_Release,
1395 /* IDirectSoundFullDuplex methods */
1396 IDirectSoundFullDuplexImpl_Initialize