Commit 3ef0a523 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

dplayx: Use an iface instead of a vtbl pointer in IClassFactoryImpl.

parent e4094231
...@@ -43,13 +43,18 @@ WINE_DEFAULT_DEBUG_CHANNEL(dplay); ...@@ -43,13 +43,18 @@ WINE_DEFAULT_DEBUG_CHANNEL(dplay);
typedef struct typedef struct
{ {
/* IUnknown fields */ /* IUnknown fields */
const IClassFactoryVtbl *lpVtbl; IClassFactory IClassFactory_iface;
LONG ref; LONG ref;
} IClassFactoryImpl; } IClassFactoryImpl;
static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface)
{
return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface);
}
static HRESULT WINAPI static HRESULT WINAPI
DP_and_DPL_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) { DP_and_DPL_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface; IClassFactoryImpl *This = impl_from_IClassFactory(iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj); FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
...@@ -58,12 +63,12 @@ DP_and_DPL_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) { ...@@ -58,12 +63,12 @@ DP_and_DPL_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
static ULONG WINAPI static ULONG WINAPI
DP_and_DPL_AddRef(LPCLASSFACTORY iface) { DP_and_DPL_AddRef(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface; IClassFactoryImpl *This = impl_from_IClassFactory(iface);
return InterlockedIncrement(&This->ref); return InterlockedIncrement(&This->ref);
} }
static ULONG WINAPI DP_and_DPL_Release(LPCLASSFACTORY iface) { static ULONG WINAPI DP_and_DPL_Release(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface; IClassFactoryImpl *This = impl_from_IClassFactory(iface);
/* static class (reference starts @ 1), won't ever be freed */ /* static class (reference starts @ 1), won't ever be freed */
return InterlockedDecrement(&This->ref); return InterlockedDecrement(&This->ref);
} }
...@@ -71,7 +76,7 @@ static ULONG WINAPI DP_and_DPL_Release(LPCLASSFACTORY iface) { ...@@ -71,7 +76,7 @@ static ULONG WINAPI DP_and_DPL_Release(LPCLASSFACTORY iface) {
static HRESULT WINAPI DP_and_DPL_CreateInstance( static HRESULT WINAPI DP_and_DPL_CreateInstance(
LPCLASSFACTORY iface,LPUNKNOWN pOuter,REFIID riid,LPVOID *ppobj LPCLASSFACTORY iface,LPUNKNOWN pOuter,REFIID riid,LPVOID *ppobj
) { ) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface; IClassFactoryImpl *This = impl_from_IClassFactory(iface);
TRACE("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj); TRACE("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj);
...@@ -88,7 +93,7 @@ static HRESULT WINAPI DP_and_DPL_CreateInstance( ...@@ -88,7 +93,7 @@ static HRESULT WINAPI DP_and_DPL_CreateInstance(
} }
static HRESULT WINAPI DP_and_DPL_LockServer(LPCLASSFACTORY iface,BOOL dolock) { static HRESULT WINAPI DP_and_DPL_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface; IClassFactoryImpl *This = impl_from_IClassFactory(iface);
FIXME("(%p)->(%d),stub!\n",This,dolock); FIXME("(%p)->(%d),stub!\n",This,dolock);
return S_OK; return S_OK;
} }
...@@ -101,7 +106,7 @@ static const IClassFactoryVtbl DP_and_DPL_Vtbl = { ...@@ -101,7 +106,7 @@ static const IClassFactoryVtbl DP_and_DPL_Vtbl = {
DP_and_DPL_LockServer DP_and_DPL_LockServer
}; };
static IClassFactoryImpl DP_and_DPL_CF = {&DP_and_DPL_Vtbl, 1 }; static IClassFactoryImpl DP_and_DPL_CF = {{&DP_and_DPL_Vtbl}, 1 };
/******************************************************************************* /*******************************************************************************
......
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