Michael Stefaniuc : dsound: Cleanup IKsPrivatePropertySetImpl_Create().
Alexandre Julliard
julliard at winehq.org
Fri Aug 24 13:46:43 CDT 2012
Module: wine
Branch: master
Commit: 1555aebf1e54ada0123e8da9faa206176b5301ac
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1555aebf1e54ada0123e8da9faa206176b5301ac
Author: Michael Stefaniuc <mstefani at redhat.de>
Date: Fri Aug 24 01:47:14 2012 +0200
dsound: Cleanup IKsPrivatePropertySetImpl_Create().
---
dlls/dsound/dsound_main.c | 2 +-
dlls/dsound/dsound_private.h | 2 +-
dlls/dsound/propset.c | 23 ++++++++++++-----------
3 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/dlls/dsound/dsound_main.c b/dlls/dsound/dsound_main.c
index f5199fd..9c550eb 100644
--- a/dlls/dsound/dsound_main.c
+++ b/dlls/dsound/dsound_main.c
@@ -724,7 +724,7 @@ static IClassFactoryImpl DSOUND_CF[] = {
{ { &DSCF_Vtbl }, &CLSID_DirectSoundCapture, DSOUND_CaptureCreate },
{ { &DSCF_Vtbl }, &CLSID_DirectSoundCapture8, DSOUND_CaptureCreate8 },
{ { &DSCF_Vtbl }, &CLSID_DirectSoundFullDuplex, DSOUND_FullDuplexCreate },
- { { &DSCF_Vtbl }, &CLSID_DirectSoundPrivate, (FnCreateInstance)IKsPrivatePropertySetImpl_Create },
+ { { &DSCF_Vtbl }, &CLSID_DirectSoundPrivate, IKsPrivatePropertySetImpl_Create },
{ { NULL }, NULL, NULL }
};
diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h
index f8e5ca6..0d2cf75 100644
--- a/dlls/dsound/dsound_private.h
+++ b/dlls/dsound/dsound_private.h
@@ -254,7 +254,7 @@ struct IDirectSoundCaptureBufferImpl
int nrofnotifies;
};
-HRESULT IKsPrivatePropertySetImpl_Create(REFIID riid, IKsPropertySet **piks) DECLSPEC_HIDDEN;
+HRESULT IKsPrivatePropertySetImpl_Create(REFIID riid, void **ppv) DECLSPEC_HIDDEN;
/*******************************************************************************
*/
diff --git a/dlls/dsound/propset.c b/dlls/dsound/propset.c
index 242b237..eb4c195 100644
--- a/dlls/dsound/propset.c
+++ b/dlls/dsound/propset.c
@@ -619,23 +619,24 @@ static const IKsPropertySetVtbl ikspvt = {
IKsPrivatePropertySetImpl_QuerySupport
};
-HRESULT IKsPrivatePropertySetImpl_Create(
- REFIID riid,
- IKsPropertySet **piks)
+HRESULT IKsPrivatePropertySetImpl_Create(REFIID riid, void **ppv)
{
IKsPrivatePropertySetImpl *iks;
- TRACE("(%s, %p)\n", debugstr_guid(riid), piks);
+ HRESULT hr;
+
+ TRACE("(%s, %p)\n", debugstr_guid(riid), ppv);
- if (!IsEqualIID(riid, &IID_IUnknown) &&
- !IsEqualIID(riid, &IID_IKsPropertySet)) {
- *piks = 0;
- return E_NOINTERFACE;
+ iks = HeapAlloc(GetProcessHeap(), 0, sizeof(*iks));
+ if (!iks) {
+ WARN("out of memory\n");
+ return DSERR_OUTOFMEMORY;
}
- iks = HeapAlloc(GetProcessHeap(),0,sizeof(*iks));
iks->ref = 1;
iks->IKsPropertySet_iface.lpVtbl = &ikspvt;
- *piks = &iks->IKsPropertySet_iface;
- return S_OK;
+ hr = IKsPropertySet_QueryInterface(&iks->IKsPropertySet_iface, riid, ppv);
+ IKsPropertySet_Release(&iks->IKsPropertySet_iface);
+
+ return hr;
}
More information about the wine-cvs
mailing list