Module: wine Branch: master Commit: 1b94450f789791908a370f16e125087b84f35bcb URL: http://source.winehq.org/git/wine.git/?a=commit;h=1b94450f789791908a370f16e1...
Author: Maarten Lankhorst m.b.lankhorst@gmail.com Date: Tue Dec 15 15:39:14 2009 +0100
dsound: Remove refcounting in classfactory.
---
dlls/dsound/dsound_main.c | 25 +++++++++---------------- 1 files changed, 9 insertions(+), 16 deletions(-)
diff --git a/dlls/dsound/dsound_main.c b/dlls/dsound/dsound_main.c index f65dbf9..e7c59e9 100644 --- a/dlls/dsound/dsound_main.c +++ b/dlls/dsound/dsound_main.c @@ -497,7 +497,6 @@ typedef HRESULT (*FnCreateInstance)(REFIID riid, LPVOID *ppobj);
typedef struct { const IClassFactoryVtbl *lpVtbl; - LONG ref; REFCLSID rclsid; FnCreateInstance pfnCreateInstance; } IClassFactoryImpl; @@ -522,19 +521,13 @@ DSCF_QueryInterface(LPCLASSFACTORY iface, REFIID riid, LPVOID *ppobj)
static ULONG WINAPI DSCF_AddRef(LPCLASSFACTORY iface) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; - ULONG ref = InterlockedIncrement(&(This->ref)); - TRACE("(%p) ref was %d\n", This, ref - 1); - return ref; + return 2; }
static ULONG WINAPI DSCF_Release(LPCLASSFACTORY iface) { - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; - ULONG ref = InterlockedDecrement(&(This->ref)); - TRACE("(%p) ref was %d\n", This, ref + 1); /* static class, won't be freed */ - return ref; + return 1; }
static HRESULT WINAPI DSCF_CreateInstance( @@ -573,13 +566,13 @@ static const IClassFactoryVtbl DSCF_Vtbl = { };
static IClassFactoryImpl DSOUND_CF[] = { - { &DSCF_Vtbl, 1, &CLSID_DirectSound, (FnCreateInstance)DSOUND_Create }, - { &DSCF_Vtbl, 1, &CLSID_DirectSound8, (FnCreateInstance)DSOUND_Create8 }, - { &DSCF_Vtbl, 1, &CLSID_DirectSoundCapture, (FnCreateInstance)DSOUND_CaptureCreate }, - { &DSCF_Vtbl, 1, &CLSID_DirectSoundCapture8, (FnCreateInstance)DSOUND_CaptureCreate8 }, - { &DSCF_Vtbl, 1, &CLSID_DirectSoundFullDuplex, (FnCreateInstance)DSOUND_FullDuplexCreate }, - { &DSCF_Vtbl, 1, &CLSID_DirectSoundPrivate, (FnCreateInstance)IKsPrivatePropertySetImpl_Create }, - { NULL, 0, NULL, NULL } + { &DSCF_Vtbl, &CLSID_DirectSound, (FnCreateInstance)DSOUND_Create }, + { &DSCF_Vtbl, &CLSID_DirectSound8, (FnCreateInstance)DSOUND_Create8 }, + { &DSCF_Vtbl, &CLSID_DirectSoundCapture, (FnCreateInstance)DSOUND_CaptureCreate }, + { &DSCF_Vtbl, &CLSID_DirectSoundCapture8, (FnCreateInstance)DSOUND_CaptureCreate8 }, + { &DSCF_Vtbl, &CLSID_DirectSoundFullDuplex, (FnCreateInstance)DSOUND_FullDuplexCreate }, + { &DSCF_Vtbl, &CLSID_DirectSoundPrivate, (FnCreateInstance)IKsPrivatePropertySetImpl_Create }, + { NULL, NULL, NULL } };
/*******************************************************************************