dsound: Fix duplex create bug.

This commit is contained in:
Robert Reif 2006-02-27 07:34:01 -05:00 committed by Alexandre Julliard
parent 6a0e711681
commit 919ee6b699
1 changed files with 20 additions and 0 deletions

View File

@ -258,6 +258,12 @@ HRESULT IDirectSoundFullDuplex_IDirectSound_Create(
return DSERR_INVALIDPARAM;
}
if (((IDirectSoundFullDuplexImpl*)pdsfd)->renderer_device == NULL) {
WARN("not initialized\n");
*ppds = NULL;
return DSERR_UNINITIALIZED;
}
pdsfdds = HeapAlloc(GetProcessHeap(),0,sizeof(*pdsfdds));
if (pdsfdds == NULL) {
WARN("out of memory\n");
@ -417,6 +423,12 @@ HRESULT IDirectSoundFullDuplex_IDirectSound8_Create(
return DSERR_INVALIDPARAM;
}
if (((IDirectSoundFullDuplexImpl*)pdsfd)->renderer_device == NULL) {
WARN("not initialized\n");
*ppds8 = NULL;
return DSERR_UNINITIALIZED;
}
pdsfdds8 = HeapAlloc(GetProcessHeap(),0,sizeof(*pdsfdds8));
if (pdsfdds8 == NULL) {
WARN("out of memory\n");
@ -525,6 +537,12 @@ HRESULT IDirectSoundFullDuplex_IDirectSoundCapture_Create(
return DSERR_INVALIDPARAM;
}
if (((IDirectSoundFullDuplexImpl*)pdsfd)->capture_device == NULL) {
WARN("not initialized\n");
*ppdsc8 = NULL;
return DSERR_UNINITIALIZED;
}
pdsfddsc = HeapAlloc(GetProcessHeap(),0,sizeof(*pdsfddsc));
if (pdsfddsc == NULL) {
WARN("out of memory\n");
@ -774,6 +792,8 @@ HRESULT DSOUND_FullDuplexCreate(LPDIRECTSOUNDFULLDUPLEX* ppDSFD, IUnknown *pUnkO
This->capture_device = NULL;
This->renderer_device = NULL;
*ppDSFD = (LPDIRECTSOUNDFULLDUPLEX)This;
return DS_OK;
}