Commit 919ee6b6 authored by Robert Reif's avatar Robert Reif Committed by Alexandre Julliard

dsound: Fix duplex create bug.

parent 6a0e7116
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment