Maarten Lankhorst : dsound: Call DSOUND_FullDuplexCreate instead of creating it directly.
Alexandre Julliard
julliard at winehq.org
Mon Nov 30 10:42:52 CST 2009
Module: wine
Branch: master
Commit: 9123f28e46d0fe2d6bc64a4ec90a47fc2dacd7a5
URL: http://source.winehq.org/git/wine.git/?a=commit;h=9123f28e46d0fe2d6bc64a4ec90a47fc2dacd7a5
Author: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date: Tue Nov 24 14:16:52 2009 +0100
dsound: Call DSOUND_FullDuplexCreate instead of creating it directly.
---
dlls/dsound/duplex.c | 20 +++-----------------
1 files changed, 3 insertions(+), 17 deletions(-)
diff --git a/dlls/dsound/duplex.c b/dlls/dsound/duplex.c
index 305bea0..2faf507 100644
--- a/dlls/dsound/duplex.c
+++ b/dlls/dsound/duplex.c
@@ -745,22 +745,8 @@ DirectSoundFullDuplexCreate(
return DSERR_INVALIDPARAM;
}
- /* Get dsound configuration */
- setup_dsound_options();
-
- This = HeapAlloc(GetProcessHeap(),
- HEAP_ZERO_MEMORY, sizeof(IDirectSoundFullDuplexImpl));
-
- if (This == NULL) {
- WARN("out of memory\n");
- *ppDSFD = NULL;
- return DSERR_OUTOFMEMORY;
- }
-
- This->lpVtbl = &dsfdvt;
- This->ref = 1;
- This->capture_device = NULL;
- This->renderer_device = NULL;
+ hres = DSOUND_FullDuplexCreate(&IID_IDirectSoundFullDuplex, (LPDIRECTSOUNDFULLDUPLEX*)&This);
+ if (FAILED(hres)) return hres;
hres = IDirectSoundFullDuplexImpl_Initialize((LPDIRECTSOUNDFULLDUPLEX)This,
pcGuidCaptureDevice,
@@ -770,7 +756,7 @@ DirectSoundFullDuplexCreate(
hWnd, dwLevel, ppDSCBuffer8,
ppDSBuffer8);
if (hres != DS_OK) {
- HeapFree(GetProcessHeap(), 0, This);
+ IUnknown_Release((LPDIRECTSOUNDFULLDUPLEX)This);
WARN("IDirectSoundFullDuplexImpl_Initialize failed\n");
*ppDSFD = NULL;
} else
More information about the wine-cvs
mailing list