dsound: Fix duplex create bug.
This commit is contained in:
parent
6a0e711681
commit
919ee6b699
|
@ -258,6 +258,12 @@ HRESULT IDirectSoundFullDuplex_IDirectSound_Create(
|
||||||
return DSERR_INVALIDPARAM;
|
return DSERR_INVALIDPARAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (((IDirectSoundFullDuplexImpl*)pdsfd)->renderer_device == NULL) {
|
||||||
|
WARN("not initialized\n");
|
||||||
|
*ppds = NULL;
|
||||||
|
return DSERR_UNINITIALIZED;
|
||||||
|
}
|
||||||
|
|
||||||
pdsfdds = HeapAlloc(GetProcessHeap(),0,sizeof(*pdsfdds));
|
pdsfdds = HeapAlloc(GetProcessHeap(),0,sizeof(*pdsfdds));
|
||||||
if (pdsfdds == NULL) {
|
if (pdsfdds == NULL) {
|
||||||
WARN("out of memory\n");
|
WARN("out of memory\n");
|
||||||
|
@ -417,6 +423,12 @@ HRESULT IDirectSoundFullDuplex_IDirectSound8_Create(
|
||||||
return DSERR_INVALIDPARAM;
|
return DSERR_INVALIDPARAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (((IDirectSoundFullDuplexImpl*)pdsfd)->renderer_device == NULL) {
|
||||||
|
WARN("not initialized\n");
|
||||||
|
*ppds8 = NULL;
|
||||||
|
return DSERR_UNINITIALIZED;
|
||||||
|
}
|
||||||
|
|
||||||
pdsfdds8 = HeapAlloc(GetProcessHeap(),0,sizeof(*pdsfdds8));
|
pdsfdds8 = HeapAlloc(GetProcessHeap(),0,sizeof(*pdsfdds8));
|
||||||
if (pdsfdds8 == NULL) {
|
if (pdsfdds8 == NULL) {
|
||||||
WARN("out of memory\n");
|
WARN("out of memory\n");
|
||||||
|
@ -525,6 +537,12 @@ HRESULT IDirectSoundFullDuplex_IDirectSoundCapture_Create(
|
||||||
return DSERR_INVALIDPARAM;
|
return DSERR_INVALIDPARAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (((IDirectSoundFullDuplexImpl*)pdsfd)->capture_device == NULL) {
|
||||||
|
WARN("not initialized\n");
|
||||||
|
*ppdsc8 = NULL;
|
||||||
|
return DSERR_UNINITIALIZED;
|
||||||
|
}
|
||||||
|
|
||||||
pdsfddsc = HeapAlloc(GetProcessHeap(),0,sizeof(*pdsfddsc));
|
pdsfddsc = HeapAlloc(GetProcessHeap(),0,sizeof(*pdsfddsc));
|
||||||
if (pdsfddsc == NULL) {
|
if (pdsfddsc == NULL) {
|
||||||
WARN("out of memory\n");
|
WARN("out of memory\n");
|
||||||
|
@ -774,6 +792,8 @@ HRESULT DSOUND_FullDuplexCreate(LPDIRECTSOUNDFULLDUPLEX* ppDSFD, IUnknown *pUnkO
|
||||||
This->capture_device = NULL;
|
This->capture_device = NULL;
|
||||||
This->renderer_device = NULL;
|
This->renderer_device = NULL;
|
||||||
|
|
||||||
|
*ppDSFD = (LPDIRECTSOUNDFULLDUPLEX)This;
|
||||||
|
|
||||||
return DS_OK;
|
return DS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue