ReactOS 0.4.15-dev-5669-g09dde2c
duplex.c File Reference
#include "dsound_private.h"
Include dependency graph for duplex.c:

Go to the source code of this file.

Classes

struct  IDirectSoundFullDuplexImpl
 
struct  IDirectSoundFullDuplex_IUnknown
 
struct  IDirectSoundFullDuplex_IDirectSound8
 
struct  IDirectSoundFullDuplex_IDirectSoundCapture
 

Typedefs

typedef struct IDirectSoundFullDuplexImpl IDirectSoundFullDuplexImpl
 
typedef struct IDirectSoundFullDuplex_IUnknown IDirectSoundFullDuplex_IUnknown
 
typedef struct IDirectSoundFullDuplex_IDirectSound8 IDirectSoundFullDuplex_IDirectSound8
 
typedef struct IDirectSoundFullDuplex_IDirectSoundCapture IDirectSoundFullDuplex_IDirectSoundCapture
 

Functions

static HRESULT WINAPI IDirectSoundFullDuplex_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj)
 
static ULONG WINAPI IDirectSoundFullDuplex_IUnknown_AddRef (LPUNKNOWN iface)
 
static ULONG WINAPI IDirectSoundFullDuplex_IUnknown_Release (LPUNKNOWN iface)
 
static HRESULT IDirectSoundFullDuplex_IUnknown_Create (LPDIRECTSOUNDFULLDUPLEX pdsfd, LPUNKNOWN *ppunk)
 
static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_QueryInterface (LPDIRECTSOUND8 iface, REFIID riid, LPVOID *ppobj)
 
static ULONG WINAPI IDirectSoundFullDuplex_IDirectSound8_AddRef (LPDIRECTSOUND8 iface)
 
static ULONG WINAPI IDirectSoundFullDuplex_IDirectSound8_Release (LPDIRECTSOUND8 iface)
 
static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_CreateSoundBuffer (LPDIRECTSOUND8 iface, LPCDSBUFFERDESC dsbd, LPLPDIRECTSOUNDBUFFER ppdsb, LPUNKNOWN lpunk)
 
static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_GetCaps (LPDIRECTSOUND8 iface, LPDSCAPS lpDSCaps)
 
static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_DuplicateSoundBuffer (LPDIRECTSOUND8 iface, LPDIRECTSOUNDBUFFER psb, LPLPDIRECTSOUNDBUFFER ppdsb)
 
static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_SetCooperativeLevel (LPDIRECTSOUND8 iface, HWND hwnd, DWORD level)
 
static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_Compact (LPDIRECTSOUND8 iface)
 
static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_GetSpeakerConfig (LPDIRECTSOUND8 iface, LPDWORD lpdwSpeakerConfig)
 
static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_SetSpeakerConfig (LPDIRECTSOUND8 iface, DWORD config)
 
static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_Initialize (LPDIRECTSOUND8 iface, LPCGUID lpcGuid)
 
static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_VerifyCertification (LPDIRECTSOUND8 iface, DWORD *cert)
 
static HRESULT IDirectSoundFullDuplex_IDirectSound8_Create (LPDIRECTSOUNDFULLDUPLEX pdsfd, LPDIRECTSOUND8 *ppds8)
 
static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSoundCapture_QueryInterface (LPDIRECTSOUNDCAPTURE iface, REFIID riid, LPVOID *ppobj)
 
static ULONG WINAPI IDirectSoundFullDuplex_IDirectSoundCapture_AddRef (LPDIRECTSOUNDCAPTURE iface)
 
static ULONG WINAPI IDirectSoundFullDuplex_IDirectSoundCapture_Release (LPDIRECTSOUNDCAPTURE iface)
 
static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSoundCapture_CreateCaptureBuffer (LPDIRECTSOUNDCAPTURE iface, LPCDSCBUFFERDESC lpcDSCBufferDesc, LPDIRECTSOUNDCAPTUREBUFFER *lplpDSCaptureBuffer, LPUNKNOWN pUnk)
 
static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSoundCapture_GetCaps (LPDIRECTSOUNDCAPTURE iface, LPDSCCAPS lpDSCCaps)
 
static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSoundCapture_Initialize (LPDIRECTSOUNDCAPTURE iface, LPCGUID lpcGUID)
 
static HRESULT IDirectSoundFullDuplex_IDirectSoundCapture_Create (LPDIRECTSOUNDFULLDUPLEX pdsfd, LPDIRECTSOUNDCAPTURE8 *ppdsc8)
 
static ULONG WINAPI IDirectSoundFullDuplexImpl_AddRef (LPDIRECTSOUNDFULLDUPLEX iface)
 
static HRESULT WINAPI IDirectSoundFullDuplexImpl_QueryInterface (LPDIRECTSOUNDFULLDUPLEX iface, REFIID riid, LPVOID *ppobj)
 
static ULONG WINAPI IDirectSoundFullDuplexImpl_Release (LPDIRECTSOUNDFULLDUPLEX iface)
 
static HRESULT WINAPI IDirectSoundFullDuplexImpl_Initialize (LPDIRECTSOUNDFULLDUPLEX iface, LPCGUID pCaptureGuid, LPCGUID pRendererGuid, LPCDSCBUFFERDESC lpDscBufferDesc, LPCDSBUFFERDESC lpDsBufferDesc, HWND hWnd, DWORD dwLevel, LPLPDIRECTSOUNDCAPTUREBUFFER8 lplpDirectSoundCaptureBuffer8, LPLPDIRECTSOUNDBUFFER8 lplpDirectSoundBuffer8)
 
HRESULT DSOUND_FullDuplexCreate (REFIID riid, LPDIRECTSOUNDFULLDUPLEX *ppDSFD)
 
HRESULT WINAPI DirectSoundFullDuplexCreate (LPCGUID pcGuidCaptureDevice, LPCGUID pcGuidRenderDevice, LPCDSCBUFFERDESC pcDSCBufferDesc, LPCDSBUFFERDESC pcDSBufferDesc, HWND hWnd, DWORD dwLevel, LPDIRECTSOUNDFULLDUPLEX *ppDSFD, LPDIRECTSOUNDCAPTUREBUFFER8 *ppDSCBuffer8, LPDIRECTSOUNDBUFFER8 *ppDSBuffer8, LPUNKNOWN pUnkOuter)
 

Variables

static const IUnknownVtbl DirectSoundFullDuplex_Unknown_Vtbl
 
static const IDirectSound8Vtbl DirectSoundFullDuplex_DirectSound8_Vtbl
 
static const IDirectSoundCaptureVtbl DirectSoundFullDuplex_DirectSoundCapture_Vtbl
 
static const IDirectSoundFullDuplexVtbl dsfdvt
 

Typedef Documentation

◆ IDirectSoundFullDuplex_IDirectSound8

◆ IDirectSoundFullDuplex_IDirectSoundCapture

◆ IDirectSoundFullDuplex_IUnknown

◆ IDirectSoundFullDuplexImpl

Function Documentation

◆ DirectSoundFullDuplexCreate()

HRESULT WINAPI DirectSoundFullDuplexCreate ( LPCGUID  pcGuidCaptureDevice,
LPCGUID  pcGuidRenderDevice,
LPCDSCBUFFERDESC  pcDSCBufferDesc,
LPCDSBUFFERDESC  pcDSBufferDesc,
HWND  hWnd,
DWORD  dwLevel,
LPDIRECTSOUNDFULLDUPLEX ppDSFD,
LPDIRECTSOUNDCAPTUREBUFFER8 ppDSCBuffer8,
LPDIRECTSOUNDBUFFER8 ppDSBuffer8,
LPUNKNOWN  pUnkOuter 
)

Definition at line 667 of file duplex.c.

678{
681 TRACE("(%s,%s,%p,%p,%p,%x,%p,%p,%p,%p)\n",
682 debugstr_guid(pcGuidCaptureDevice), debugstr_guid(pcGuidRenderDevice),
683 pcDSCBufferDesc, pcDSBufferDesc, hWnd, dwLevel, ppDSFD, ppDSCBuffer8,
684 ppDSBuffer8, pUnkOuter);
685
686 if (pUnkOuter) {
687 WARN("pUnkOuter != 0\n");
688 *ppDSFD = NULL;
689 return DSERR_NOAGGREGATION;
690 }
691
692 if (pcDSCBufferDesc == NULL) {
693 WARN("invalid parameter: pcDSCBufferDesc == NULL\n");
694 *ppDSFD = NULL;
695 return DSERR_INVALIDPARAM;
696 }
697
698 if (pcDSBufferDesc == NULL) {
699 WARN("invalid parameter: pcDSBufferDesc == NULL\n");
700 *ppDSFD = NULL;
701 return DSERR_INVALIDPARAM;
702 }
703
704 if (ppDSFD == NULL) {
705 WARN("invalid parameter: ppDSFD == NULL\n");
706 return DSERR_INVALIDPARAM;
707 }
708
709 if (ppDSCBuffer8 == NULL) {
710 WARN("invalid parameter: ppDSCBuffer8 == NULL\n");
711 *ppDSFD = NULL;
712 return DSERR_INVALIDPARAM;
713 }
714
715 if (ppDSBuffer8 == NULL) {
716 WARN("invalid parameter: ppDSBuffer8 == NULL\n");
717 *ppDSFD = NULL;
718 return DSERR_INVALIDPARAM;
719 }
720
721 hres = DSOUND_FullDuplexCreate(&IID_IDirectSoundFullDuplex, (LPDIRECTSOUNDFULLDUPLEX*)&This);
722 if (FAILED(hres)) return hres;
723
725 pcGuidCaptureDevice,
726 pcGuidRenderDevice,
727 pcDSCBufferDesc,
728 pcDSBufferDesc,
729 hWnd, dwLevel, ppDSCBuffer8,
730 ppDSBuffer8);
731 if (hres != DS_OK) {
732 IUnknown_Release((LPDIRECTSOUNDFULLDUPLEX)This);
733 WARN("IDirectSoundFullDuplexImpl_Initialize failed\n");
734 *ppDSFD = NULL;
735 } else
736 *ppDSFD = (LPDIRECTSOUNDFULLDUPLEX)This;
737
738 return hres;
739}
HWND hWnd
Definition: settings.c:17
#define WARN(fmt,...)
Definition: debug.h:112
#define NULL
Definition: types.h:112
HRESULT DSOUND_FullDuplexCreate(REFIID riid, LPDIRECTSOUNDFULLDUPLEX *ppDSFD)
Definition: duplex.c:604
static HRESULT WINAPI IDirectSoundFullDuplexImpl_Initialize(LPDIRECTSOUNDFULLDUPLEX iface, LPCGUID pCaptureGuid, LPCGUID pRendererGuid, LPCDSCBUFFERDESC lpDscBufferDesc, LPCDSBUFFERDESC lpDsBufferDesc, HWND hWnd, DWORD dwLevel, LPLPDIRECTSOUNDCAPTUREBUFFER8 lplpDirectSoundCaptureBuffer8, LPLPDIRECTSOUNDBUFFER8 lplpDirectSoundBuffer8)
Definition: duplex.c:519
struct IDirectSoundFullDuplex * LPDIRECTSOUNDFULLDUPLEX
Definition: dsound.h:103
#define DS_OK
Definition: dsound.h:116
#define DSERR_INVALIDPARAM
Definition: dsound.h:121
#define DSERR_NOAGGREGATION
Definition: dsound.h:130
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
HRESULT hres
Definition: protocol.c:465
#define TRACE(s)
Definition: solgame.cpp:4

◆ DSOUND_FullDuplexCreate()

HRESULT DSOUND_FullDuplexCreate ( REFIID  riid,
LPDIRECTSOUNDFULLDUPLEX ppDSFD 
)

Definition at line 604 of file duplex.c.

607{
609 TRACE("(%s, %p)\n", debugstr_guid(riid), ppDSFD);
610
611 if (ppDSFD == NULL) {
612 WARN("invalid parameter: ppDSFD == NULL\n");
613 return DSERR_INVALIDPARAM;
614 }
615
616 if (!IsEqualIID(riid, &IID_IUnknown) &&
617 !IsEqualIID(riid, &IID_IDirectSoundFullDuplex)) {
618 *ppDSFD = 0;
619 return E_NOINTERFACE;
620 }
621
622 /* Get dsound configuration */
624
627
628 if (This == NULL) {
629 WARN("out of memory\n");
630 *ppDSFD = NULL;
631 return DSERR_OUTOFMEMORY;
632 }
633
634 This->lpVtbl = &dsfdvt;
635 This->ref = 1;
636 This->capture_device = NULL;
637 This->renderer_device = NULL;
638
639 *ppDSFD = (LPDIRECTSOUNDFULLDUPLEX)This;
640
641 return DS_OK;
642}
const GUID IID_IUnknown
static const IDirectSoundFullDuplexVtbl dsfdvt
Definition: duplex.c:593
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define DSERR_OUTOFMEMORY
Definition: dsound.h:125
void setup_dsound_options(void)
Definition: dsound_main.c:102
REFIID riid
Definition: atlbase.h:39
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define E_NOINTERFACE
Definition: winerror.h:2364

Referenced by DirectSoundFullDuplexCreate().

◆ IDirectSoundFullDuplex_IDirectSound8_AddRef()

static ULONG WINAPI IDirectSoundFullDuplex_IDirectSound8_AddRef ( LPDIRECTSOUND8  iface)
static

Definition at line 150 of file duplex.c.

152{
155 TRACE("(%p) ref was %d\n", This, ref - 1);
156 return ref;
157}
#define InterlockedIncrement
Definition: armddk.h:53
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

Referenced by IDirectSoundFullDuplexImpl_QueryInterface().

◆ IDirectSoundFullDuplex_IDirectSound8_Compact()

static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_Compact ( LPDIRECTSOUND8  iface)
static

Definition at line 213 of file duplex.c.

215{
217 TRACE("(%p)\n", This);
218 return IDirectSound8_Compact(This->pdsfd->renderer_device);
219}
#define IDirectSound8_Compact(p)
Definition: dsound.h:513

◆ IDirectSoundFullDuplex_IDirectSound8_Create()

static HRESULT IDirectSoundFullDuplex_IDirectSound8_Create ( LPDIRECTSOUNDFULLDUPLEX  pdsfd,
LPDIRECTSOUND8 ppds8 
)
static

Definition at line 273 of file duplex.c.

276{
278 TRACE("(%p,%p)\n",pdsfd,ppds8);
279
280 if (pdsfd == NULL) {
281 ERR("invalid parameter: pdsfd == NULL\n");
282 return DSERR_INVALIDPARAM;
283 }
284
285 if (ppds8 == NULL) {
286 ERR("invalid parameter: ppds8 == NULL\n");
287 return DSERR_INVALIDPARAM;
288 }
289
290 if (((IDirectSoundFullDuplexImpl*)pdsfd)->renderer_device == NULL) {
291 WARN("not initialized\n");
292 *ppds8 = NULL;
293 return DSERR_UNINITIALIZED;
294 }
295
296 pdsfdds8 = HeapAlloc(GetProcessHeap(),0,sizeof(*pdsfdds8));
297 if (pdsfdds8 == NULL) {
298 WARN("out of memory\n");
299 *ppds8 = NULL;
300 return DSERR_OUTOFMEMORY;
301 }
302
304 pdsfdds8->ref = 0;
305 pdsfdds8->pdsfd = (IDirectSoundFullDuplexImpl *)pdsfd;
306
307 *ppds8 = (LPDIRECTSOUND8)pdsfdds8;
308
309 return DS_OK;
310}
#define ERR(fmt,...)
Definition: debug.h:110
static const IDirectSound8Vtbl DirectSoundFullDuplex_DirectSound8_Vtbl
Definition: duplex.c:257
#define DSERR_UNINITIALIZED
Definition: dsound.h:133
struct IDirectSound8 * LPDIRECTSOUND8
Definition: dsound.h:73
IDirectSoundFullDuplexImpl * pdsfd
Definition: duplex.c:52
const IDirectSound8Vtbl * lpVtbl
Definition: duplex.c:50

Referenced by IDirectSoundFullDuplexImpl_QueryInterface().

◆ IDirectSoundFullDuplex_IDirectSound8_CreateSoundBuffer()

static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_CreateSoundBuffer ( LPDIRECTSOUND8  iface,
LPCDSBUFFERDESC  dsbd,
LPLPDIRECTSOUNDBUFFER  ppdsb,
LPUNKNOWN  lpunk 
)
static

Definition at line 173 of file duplex.c.

178{
180 TRACE("(%p,%p,%p,%p)\n",This,dsbd,ppdsb,lpunk);
181 return IDirectSound8_CreateSoundBuffer(This->pdsfd->renderer_device,dsbd,ppdsb,lpunk);
182}
#define IDirectSound8_CreateSoundBuffer(p, a, b, c)
Definition: dsound.h:509

◆ IDirectSoundFullDuplex_IDirectSound8_DuplicateSoundBuffer()

static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_DuplicateSoundBuffer ( LPDIRECTSOUND8  iface,
LPDIRECTSOUNDBUFFER  psb,
LPLPDIRECTSOUNDBUFFER  ppdsb 
)
static

Definition at line 193 of file duplex.c.

197{
199 TRACE("(%p,%p,%p)\n",This,psb,ppdsb);
200 return IDirectSound8_DuplicateSoundBuffer(This->pdsfd->renderer_device,psb,ppdsb);
201}
#define IDirectSound8_DuplicateSoundBuffer(p, a, b)
Definition: dsound.h:511

◆ IDirectSoundFullDuplex_IDirectSound8_GetCaps()

static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_GetCaps ( LPDIRECTSOUND8  iface,
LPDSCAPS  lpDSCaps 
)
static

Definition at line 184 of file duplex.c.

187{
189 TRACE("(%p,%p)\n",This,lpDSCaps);
190 return IDirectSound8_GetCaps(This->pdsfd->renderer_device, lpDSCaps);
191}
#define IDirectSound8_GetCaps(p, a)
Definition: dsound.h:510

◆ IDirectSoundFullDuplex_IDirectSound8_GetSpeakerConfig()

static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_GetSpeakerConfig ( LPDIRECTSOUND8  iface,
LPDWORD  lpdwSpeakerConfig 
)
static

Definition at line 221 of file duplex.c.

224{
226 TRACE("(%p, %p)\n", This, lpdwSpeakerConfig);
227 return IDirectSound8_GetSpeakerConfig(This->pdsfd->renderer_device,lpdwSpeakerConfig);
228}
#define IDirectSound8_GetSpeakerConfig(p, a)
Definition: dsound.h:514

◆ IDirectSoundFullDuplex_IDirectSound8_Initialize()

static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_Initialize ( LPDIRECTSOUND8  iface,
LPCGUID  lpcGuid 
)
static

Definition at line 239 of file duplex.c.

242{
244 TRACE("(%p, %s)\n", This, debugstr_guid(lpcGuid));
245 return IDirectSound8_Initialize(This->pdsfd->renderer_device,lpcGuid);
246}
#define IDirectSound8_Initialize(p, a)
Definition: dsound.h:516

◆ IDirectSoundFullDuplex_IDirectSound8_QueryInterface()

static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_QueryInterface ( LPDIRECTSOUND8  iface,
REFIID  riid,
LPVOID ppobj 
)
static

Definition at line 140 of file duplex.c.

144{
146 TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj);
148}
#define IDirectSoundFullDuplex_QueryInterface(p, a, b)
Definition: dsound.h:1185

◆ IDirectSoundFullDuplex_IDirectSound8_Release()

static ULONG WINAPI IDirectSoundFullDuplex_IDirectSound8_Release ( LPDIRECTSOUND8  iface)
static

Definition at line 159 of file duplex.c.

161{
164 TRACE("(%p) ref was %d\n", This, ref + 1);
165 if (!ref) {
166 This->pdsfd->pDS8 = NULL;
168 TRACE("(%p) released\n", This);
169 }
170 return ref;
171}
#define InterlockedDecrement
Definition: armddk.h:52
#define HeapFree(x, y, z)
Definition: compat.h:735

◆ IDirectSoundFullDuplex_IDirectSound8_SetCooperativeLevel()

static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_SetCooperativeLevel ( LPDIRECTSOUND8  iface,
HWND  hwnd,
DWORD  level 
)
static

Definition at line 203 of file duplex.c.

207{
209 TRACE("(%p,%p,%s)\n",This,hwnd,dumpCooperativeLevel(level));
210 return IDirectSound8_SetCooperativeLevel(This->pdsfd->renderer_device,hwnd,level);
211}
const char * dumpCooperativeLevel(DWORD level)
Definition: dsound.c:92
#define IDirectSound8_SetCooperativeLevel(p, a, b)
Definition: dsound.h:512
GLint level
Definition: gl.h:1546
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

◆ IDirectSoundFullDuplex_IDirectSound8_SetSpeakerConfig()

static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_SetSpeakerConfig ( LPDIRECTSOUND8  iface,
DWORD  config 
)
static

Definition at line 230 of file duplex.c.

233{
235 TRACE("(%p,0x%08x)\n",This,config);
236 return IDirectSound8_SetSpeakerConfig(This->pdsfd->renderer_device,config);
237}
#define IDirectSound8_SetSpeakerConfig(p, a)
Definition: dsound.h:515

◆ IDirectSoundFullDuplex_IDirectSound8_VerifyCertification()

static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_VerifyCertification ( LPDIRECTSOUND8  iface,
DWORD cert 
)
static

Definition at line 248 of file duplex.c.

251{
253 TRACE("(%p, %p)\n", This, cert);
254 return IDirectSound8_VerifyCertification(This->pdsfd->renderer_device,cert);
255}
#define IDirectSound8_VerifyCertification(p, a)
Definition: dsound.h:518
static BYTE cert[]
Definition: msg.c:1437

◆ IDirectSoundFullDuplex_IDirectSoundCapture_AddRef()

static ULONG WINAPI IDirectSoundFullDuplex_IDirectSoundCapture_AddRef ( LPDIRECTSOUNDCAPTURE  iface)
static

◆ IDirectSoundFullDuplex_IDirectSoundCapture_Create()

static HRESULT IDirectSoundFullDuplex_IDirectSoundCapture_Create ( LPDIRECTSOUNDFULLDUPLEX  pdsfd,
LPDIRECTSOUNDCAPTURE8 ppdsc8 
)
static

Definition at line 387 of file duplex.c.

390{
392 TRACE("(%p,%p)\n",pdsfd,ppdsc8);
393
394 if (pdsfd == NULL) {
395 ERR("invalid parameter: pdsfd == NULL\n");
396 return DSERR_INVALIDPARAM;
397 }
398
399 if (ppdsc8 == NULL) {
400 ERR("invalid parameter: ppdsc8 == NULL\n");
401 return DSERR_INVALIDPARAM;
402 }
403
404 if (((IDirectSoundFullDuplexImpl*)pdsfd)->capture_device == NULL) {
405 WARN("not initialized\n");
406 *ppdsc8 = NULL;
407 return DSERR_UNINITIALIZED;
408 }
409
410 pdsfddsc = HeapAlloc(GetProcessHeap(),0,sizeof(*pdsfddsc));
411 if (pdsfddsc == NULL) {
412 WARN("out of memory\n");
413 *ppdsc8 = NULL;
414 return DSERR_OUTOFMEMORY;
415 }
416
418 pdsfddsc->ref = 0;
419 pdsfddsc->pdsfd = (IDirectSoundFullDuplexImpl *)pdsfd;
420
421 *ppdsc8 = (LPDIRECTSOUNDCAPTURE)pdsfddsc;
422
423 return DS_OK;
424}
static const IDirectSoundCaptureVtbl DirectSoundFullDuplex_DirectSoundCapture_Vtbl
Definition: duplex.c:377
struct IDirectSoundCapture * LPDIRECTSOUNDCAPTURE
Definition: dsound.h:92
const IDirectSoundCaptureVtbl * lpVtbl
Definition: duplex.c:56
IDirectSoundFullDuplexImpl * pdsfd
Definition: duplex.c:58

Referenced by IDirectSoundFullDuplexImpl_QueryInterface().

◆ IDirectSoundFullDuplex_IDirectSoundCapture_CreateCaptureBuffer()

static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSoundCapture_CreateCaptureBuffer ( LPDIRECTSOUNDCAPTURE  iface,
LPCDSCBUFFERDESC  lpcDSCBufferDesc,
LPDIRECTSOUNDCAPTUREBUFFER lplpDSCaptureBuffer,
LPUNKNOWN  pUnk 
)
static

Definition at line 348 of file duplex.c.

353{
355 TRACE("(%p,%p,%p,%p)\n",This,lpcDSCBufferDesc,lplpDSCaptureBuffer,pUnk);
356 return IDirectSoundCapture_CreateCaptureBuffer(This->pdsfd->capture_device,lpcDSCBufferDesc,lplpDSCaptureBuffer,pUnk);
357}
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30
#define IDirectSoundCapture_CreateCaptureBuffer(p, a, b, c)
Definition: dsound.h:738

◆ IDirectSoundFullDuplex_IDirectSoundCapture_GetCaps()

static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSoundCapture_GetCaps ( LPDIRECTSOUNDCAPTURE  iface,
LPDSCCAPS  lpDSCCaps 
)
static

Definition at line 359 of file duplex.c.

362{
364 TRACE("(%p,%p)\n",This,lpDSCCaps);
365 return IDirectSoundCapture_GetCaps(This->pdsfd->capture_device, lpDSCCaps);
366}
#define IDirectSoundCapture_GetCaps(p, a)
Definition: dsound.h:739

◆ IDirectSoundFullDuplex_IDirectSoundCapture_Initialize()

static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSoundCapture_Initialize ( LPDIRECTSOUNDCAPTURE  iface,
LPCGUID  lpcGUID 
)
static

Definition at line 368 of file duplex.c.

371{
373 TRACE("(%p, %s)\n", This, debugstr_guid(lpcGUID));
374 return IDirectSoundCapture_Initialize(This->pdsfd->capture_device,lpcGUID);
375}
#define IDirectSoundCapture_Initialize(p, a)
Definition: dsound.h:740

◆ IDirectSoundFullDuplex_IDirectSoundCapture_QueryInterface()

static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSoundCapture_QueryInterface ( LPDIRECTSOUNDCAPTURE  iface,
REFIID  riid,
LPVOID ppobj 
)
static

◆ IDirectSoundFullDuplex_IDirectSoundCapture_Release()

static ULONG WINAPI IDirectSoundFullDuplex_IDirectSoundCapture_Release ( LPDIRECTSOUNDCAPTURE  iface)
static

Definition at line 334 of file duplex.c.

336{
339 TRACE("(%p) ref was %d\n", This, ref + 1);
340 if (!ref) {
341 This->pdsfd->pDSC = NULL;
343 TRACE("(%p) released\n", This);
344 }
345 return ref;
346}

◆ IDirectSoundFullDuplex_IUnknown_AddRef()

static ULONG WINAPI IDirectSoundFullDuplex_IUnknown_AddRef ( LPUNKNOWN  iface)
static

Definition at line 74 of file duplex.c.

76{
79 TRACE("(%p) ref was %d\n", This, ref - 1);
80 return ref;
81}

Referenced by IDirectSoundFullDuplexImpl_QueryInterface().

◆ IDirectSoundFullDuplex_IUnknown_Create()

static HRESULT IDirectSoundFullDuplex_IUnknown_Create ( LPDIRECTSOUNDFULLDUPLEX  pdsfd,
LPUNKNOWN ppunk 
)
static

Definition at line 104 of file duplex.c.

107{
109 TRACE("(%p,%p)\n",pdsfd,ppunk);
110
111 if (pdsfd == NULL) {
112 ERR("invalid parameter: pdsfd == NULL\n");
113 return DSERR_INVALIDPARAM;
114 }
115
116 if (ppunk == NULL) {
117 ERR("invalid parameter: ppunk == NULL\n");
118 return DSERR_INVALIDPARAM;
119 }
120
121 pdsfdunk = HeapAlloc(GetProcessHeap(),0,sizeof(*pdsfdunk));
122 if (pdsfdunk == NULL) {
123 WARN("out of memory\n");
124 *ppunk = NULL;
125 return DSERR_OUTOFMEMORY;
126 }
127
129 pdsfdunk->ref = 0;
130 pdsfdunk->pdsfd = (IDirectSoundFullDuplexImpl *)pdsfd;
131
132 *ppunk = (LPUNKNOWN)pdsfdunk;
133
134 return DS_OK;
135}
static const IUnknownVtbl DirectSoundFullDuplex_Unknown_Vtbl
Definition: duplex.c:97
static LPUNKNOWN
Definition: ndr_ole.c:49
const IUnknownVtbl * lpVtbl
Definition: duplex.c:44
IDirectSoundFullDuplexImpl * pdsfd
Definition: duplex.c:46

Referenced by IDirectSoundFullDuplexImpl_QueryInterface().

◆ IDirectSoundFullDuplex_IUnknown_QueryInterface()

static HRESULT WINAPI IDirectSoundFullDuplex_IUnknown_QueryInterface ( LPUNKNOWN  iface,
REFIID  riid,
LPVOID ppobj 
)
static

Definition at line 64 of file duplex.c.

◆ IDirectSoundFullDuplex_IUnknown_Release()

static ULONG WINAPI IDirectSoundFullDuplex_IUnknown_Release ( LPUNKNOWN  iface)
static

Definition at line 83 of file duplex.c.

85{
88 TRACE("(%p) ref was %d\n", This, ref + 1);
89 if (!ref) {
90 This->pdsfd->pUnknown = NULL;
92 TRACE("(%p) released\n", This);
93 }
94 return ref;
95}

◆ IDirectSoundFullDuplexImpl_AddRef()

static ULONG WINAPI IDirectSoundFullDuplexImpl_AddRef ( LPDIRECTSOUNDFULLDUPLEX  iface)
static

Definition at line 430 of file duplex.c.

431{
434 TRACE("(%p) ref was %d\n", This, ref - 1);
435 return ref;
436}

Referenced by IDirectSoundFullDuplexImpl_QueryInterface().

◆ IDirectSoundFullDuplexImpl_Initialize()

static HRESULT WINAPI IDirectSoundFullDuplexImpl_Initialize ( LPDIRECTSOUNDFULLDUPLEX  iface,
LPCGUID  pCaptureGuid,
LPCGUID  pRendererGuid,
LPCDSCBUFFERDESC  lpDscBufferDesc,
LPCDSBUFFERDESC  lpDsBufferDesc,
HWND  hWnd,
DWORD  dwLevel,
LPLPDIRECTSOUNDCAPTUREBUFFER8  lplpDirectSoundCaptureBuffer8,
LPLPDIRECTSOUNDBUFFER8  lplpDirectSoundBuffer8 
)
static

Definition at line 519 of file duplex.c.

529{
530 HRESULT hr;
532
533 TRACE("(%p,%s,%s,%p,%p,%p,%x,%p,%p)\n", This,
534 debugstr_guid(pCaptureGuid), debugstr_guid(pRendererGuid),
535 lpDscBufferDesc, lpDsBufferDesc, hWnd, dwLevel,
536 lplpDirectSoundCaptureBuffer8, lplpDirectSoundBuffer8);
537
538 if (!lplpDirectSoundCaptureBuffer8 || !lplpDirectSoundBuffer8)
539 return E_INVALIDARG;
540
541 if (This->renderer_device != NULL || This->capture_device != NULL) {
542 WARN("already initialized\n");
543 *lplpDirectSoundCaptureBuffer8 = NULL;
544 *lplpDirectSoundBuffer8 = NULL;
546 }
547
548 hr = DSOUND_Create8(&IID_IDirectSound8, &This->renderer_device);
549 if (SUCCEEDED(hr))
550 hr = IDirectSound_Initialize(This->renderer_device, pRendererGuid);
551 if (hr != DS_OK) {
552 WARN("DirectSoundDevice_Initialize() failed\n");
553 *lplpDirectSoundCaptureBuffer8 = NULL;
554 *lplpDirectSoundBuffer8 = NULL;
555 return hr;
556 }
557
558 IDirectSound8_SetCooperativeLevel(This->renderer_device, hWnd, dwLevel);
559
560 hr = IDirectSound8_CreateSoundBuffer(This->renderer_device, lpDsBufferDesc,
561 (IDirectSoundBuffer**)lplpDirectSoundBuffer8, NULL);
562 if (hr != DS_OK) {
563 WARN("IDirectSoundBufferImpl_Create() failed\n");
564 *lplpDirectSoundCaptureBuffer8 = NULL;
565 *lplpDirectSoundBuffer8 = NULL;
566 return hr;
567 }
568
570 if (SUCCEEDED(hr))
571 hr = IDirectSoundCapture_Initialize(This->capture_device, pCaptureGuid);
572 if (hr != DS_OK) {
573 WARN("DirectSoundCaptureDevice_Initialize() failed\n");
574 *lplpDirectSoundCaptureBuffer8 = NULL;
575 *lplpDirectSoundBuffer8 = NULL;
576 return hr;
577 }
578
580 lpDscBufferDesc,
581 (IDirectSoundCaptureBuffer**)lplpDirectSoundCaptureBuffer8,
582 NULL);
583 if (hr != DS_OK) {
584 WARN("IDirectSoundCaptureBufferImpl_Create() failed\n");
585 *lplpDirectSoundCaptureBuffer8 = NULL;
586 *lplpDirectSoundBuffer8 = NULL;
587 return hr;
588 }
589
590 return hr;
591}
#define E_INVALIDARG
Definition: ddrawi.h:101
HRESULT DSOUND_CaptureCreate8(REFIID riid, LPDIRECTSOUNDCAPTURE8 *ppDSC8)
Definition: capture.c:1365
HRESULT DSOUND_Create8(REFIID riid, LPDIRECTSOUND8 *ppDS)
Definition: dsound.c:1050
#define IID_IDirectSoundCapture8
Definition: dsound.h:93
#define DSERR_ALREADYINITIALIZED
Definition: dsound.h:129
#define IDirectSound_Initialize(p, a)
Definition: dsound.h:462
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT hr
Definition: shlfolder.c:183

Referenced by DirectSoundFullDuplexCreate().

◆ IDirectSoundFullDuplexImpl_QueryInterface()

static HRESULT WINAPI IDirectSoundFullDuplexImpl_QueryInterface ( LPDIRECTSOUNDFULLDUPLEX  iface,
REFIID  riid,
LPVOID ppobj 
)
static

Definition at line 439 of file duplex.c.

443{
445 TRACE( "(%p,%s,%p)\n", This, debugstr_guid(riid), ppobj );
446
447 if (ppobj == NULL) {
448 WARN("invalid parameter\n");
449 return E_INVALIDARG;
450 }
451
452 *ppobj = NULL;
453
455 if (!This->pUnknown) {
457 if (!This->pUnknown) {
458 WARN("IDirectSoundFullDuplex_IUnknown_Create() failed\n");
459 *ppobj = NULL;
460 return E_NOINTERFACE;
461 }
462 }
464 *ppobj = This->pUnknown;
465 return S_OK;
466 } else if (IsEqualIID(riid, &IID_IDirectSoundFullDuplex)) {
468 *ppobj = This;
469 return S_OK;
470 } else if (IsEqualIID(riid, &IID_IDirectSound)
471 || IsEqualIID(riid, &IID_IDirectSound8)) {
472 if (!This->pDS8) {
474 if (!This->pDS8) {
475 WARN("IDirectSoundFullDuplex_IDirectSound8_Create() failed\n");
476 *ppobj = NULL;
477 return E_NOINTERFACE;
478 }
479 }
481 *ppobj = This->pDS8;
482 return S_OK;
483 } else if (IsEqualIID(riid, &IID_IDirectSoundCapture)) {
484 if (!This->pDSC) {
486 if (!This->pDSC) {
487 WARN("IDirectSoundFullDuplex_IDirectSoundCapture_Create() failed\n");
488 *ppobj = NULL;
489 return E_NOINTERFACE;
490 }
491 }
493 *ppobj = This->pDSC;
494 return S_OK;
495 }
496
497 return E_NOINTERFACE;
498}
static HRESULT IDirectSoundFullDuplex_IUnknown_Create(LPDIRECTSOUNDFULLDUPLEX pdsfd, LPUNKNOWN *ppunk)
Definition: duplex.c:104
static ULONG WINAPI IDirectSoundFullDuplex_IUnknown_AddRef(LPUNKNOWN iface)
Definition: duplex.c:74
static ULONG WINAPI IDirectSoundFullDuplex_IDirectSoundCapture_AddRef(LPDIRECTSOUNDCAPTURE iface)
Definition: duplex.c:325
static HRESULT IDirectSoundFullDuplex_IDirectSound8_Create(LPDIRECTSOUNDFULLDUPLEX pdsfd, LPDIRECTSOUND8 *ppds8)
Definition: duplex.c:273
static HRESULT IDirectSoundFullDuplex_IDirectSoundCapture_Create(LPDIRECTSOUNDFULLDUPLEX pdsfd, LPDIRECTSOUNDCAPTURE8 *ppdsc8)
Definition: duplex.c:387
static ULONG WINAPI IDirectSoundFullDuplexImpl_AddRef(LPDIRECTSOUNDFULLDUPLEX iface)
Definition: duplex.c:430
static ULONG WINAPI IDirectSoundFullDuplex_IDirectSound8_AddRef(LPDIRECTSOUND8 iface)
Definition: duplex.c:150
#define S_OK
Definition: intsafe.h:52

◆ IDirectSoundFullDuplexImpl_Release()

static ULONG WINAPI IDirectSoundFullDuplexImpl_Release ( LPDIRECTSOUNDFULLDUPLEX  iface)
static

Definition at line 501 of file duplex.c.

502{
505 TRACE("(%p) ref was %d\n", This, ref - 1);
506
507 if (!ref) {
508 if (This->capture_device)
509 IDirectSoundCapture_Release(This->capture_device);
510 if (This->renderer_device)
511 IDirectSound_Release(This->renderer_device);
513 TRACE("(%p) released\n", This);
514 }
515 return ref;
516}
#define IDirectSoundCapture_Release(p)
Definition: dsound.h:736
#define IDirectSound_Release(p)
Definition: dsound.h:453

Variable Documentation

◆ DirectSoundFullDuplex_DirectSound8_Vtbl

const IDirectSound8Vtbl DirectSoundFullDuplex_DirectSound8_Vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_GetSpeakerConfig(LPDIRECTSOUND8 iface, LPDWORD lpdwSpeakerConfig)
Definition: duplex.c:221
static ULONG WINAPI IDirectSoundFullDuplex_IDirectSound8_Release(LPDIRECTSOUND8 iface)
Definition: duplex.c:159
static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_CreateSoundBuffer(LPDIRECTSOUND8 iface, LPCDSBUFFERDESC dsbd, LPLPDIRECTSOUNDBUFFER ppdsb, LPUNKNOWN lpunk)
Definition: duplex.c:173
static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_QueryInterface(LPDIRECTSOUND8 iface, REFIID riid, LPVOID *ppobj)
Definition: duplex.c:140
static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_VerifyCertification(LPDIRECTSOUND8 iface, DWORD *cert)
Definition: duplex.c:248
static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_Initialize(LPDIRECTSOUND8 iface, LPCGUID lpcGuid)
Definition: duplex.c:239
static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_Compact(LPDIRECTSOUND8 iface)
Definition: duplex.c:213
static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_SetCooperativeLevel(LPDIRECTSOUND8 iface, HWND hwnd, DWORD level)
Definition: duplex.c:203
static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_GetCaps(LPDIRECTSOUND8 iface, LPDSCAPS lpDSCaps)
Definition: duplex.c:184
static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_SetSpeakerConfig(LPDIRECTSOUND8 iface, DWORD config)
Definition: duplex.c:230
static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_DuplicateSoundBuffer(LPDIRECTSOUND8 iface, LPDIRECTSOUNDBUFFER psb, LPLPDIRECTSOUNDBUFFER ppdsb)
Definition: duplex.c:193

Definition at line 257 of file duplex.c.

Referenced by IDirectSoundFullDuplex_IDirectSound8_Create().

◆ DirectSoundFullDuplex_DirectSoundCapture_Vtbl

const IDirectSoundCaptureVtbl DirectSoundFullDuplex_DirectSoundCapture_Vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSoundCapture_QueryInterface(LPDIRECTSOUNDCAPTURE iface, REFIID riid, LPVOID *ppobj)
Definition: duplex.c:315
static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSoundCapture_Initialize(LPDIRECTSOUNDCAPTURE iface, LPCGUID lpcGUID)
Definition: duplex.c:368
static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSoundCapture_GetCaps(LPDIRECTSOUNDCAPTURE iface, LPDSCCAPS lpDSCCaps)
Definition: duplex.c:359
static ULONG WINAPI IDirectSoundFullDuplex_IDirectSoundCapture_Release(LPDIRECTSOUNDCAPTURE iface)
Definition: duplex.c:334
static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSoundCapture_CreateCaptureBuffer(LPDIRECTSOUNDCAPTURE iface, LPCDSCBUFFERDESC lpcDSCBufferDesc, LPDIRECTSOUNDCAPTUREBUFFER *lplpDSCaptureBuffer, LPUNKNOWN pUnk)
Definition: duplex.c:348

Definition at line 377 of file duplex.c.

Referenced by IDirectSoundFullDuplex_IDirectSoundCapture_Create().

◆ DirectSoundFullDuplex_Unknown_Vtbl

const IUnknownVtbl DirectSoundFullDuplex_Unknown_Vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI IDirectSoundFullDuplex_IUnknown_QueryInterface(LPUNKNOWN iface, REFIID riid, LPVOID *ppobj)
Definition: duplex.c:64
static ULONG WINAPI IDirectSoundFullDuplex_IUnknown_Release(LPUNKNOWN iface)
Definition: duplex.c:83

Definition at line 97 of file duplex.c.

Referenced by IDirectSoundFullDuplex_IUnknown_Create().

◆ dsfdvt

const IDirectSoundFullDuplexVtbl dsfdvt
static
Initial value:
=
{
}
static HRESULT WINAPI IDirectSoundFullDuplexImpl_QueryInterface(LPDIRECTSOUNDFULLDUPLEX iface, REFIID riid, LPVOID *ppobj)
Definition: duplex.c:439
static ULONG WINAPI IDirectSoundFullDuplexImpl_Release(LPDIRECTSOUNDFULLDUPLEX iface)
Definition: duplex.c:501

Definition at line 593 of file duplex.c.

Referenced by DSOUND_FullDuplexCreate().