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

This commit is contained in:
Michael Stefaniuc 2010-12-05 15:15:18 +01:00 committed by Alexandre Julliard
parent 72f3765a5b
commit 6d7d1b5850
1 changed files with 13 additions and 8 deletions

View File

@ -794,24 +794,29 @@ static const IDirectInput8WVtbl ddi8wvt = {
typedef struct
{
/* IUnknown fields */
const IClassFactoryVtbl *lpVtbl;
LONG ref;
IClassFactory IClassFactory_iface;
LONG ref;
} IClassFactoryImpl;
static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface)
{
return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface);
}
static HRESULT WINAPI DICF_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);
return E_NOINTERFACE;
}
static ULONG WINAPI DICF_AddRef(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
IClassFactoryImpl *This = impl_from_IClassFactory(iface);
return InterlockedIncrement(&(This->ref));
}
static ULONG WINAPI DICF_Release(LPCLASSFACTORY iface) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
IClassFactoryImpl *This = impl_from_IClassFactory(iface);
/* static class, won't be freed */
return InterlockedDecrement(&(This->ref));
}
@ -819,7 +824,7 @@ static ULONG WINAPI DICF_Release(LPCLASSFACTORY iface) {
static HRESULT WINAPI DICF_CreateInstance(
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);
if ( IsEqualGUID( &IID_IUnknown, riid ) ||
@ -840,7 +845,7 @@ static HRESULT WINAPI DICF_CreateInstance(
}
static HRESULT WINAPI DICF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
IClassFactoryImpl *This = impl_from_IClassFactory(iface);
FIXME("(%p)->(%d),stub!\n",This,dolock);
return S_OK;
}
@ -852,7 +857,7 @@ static const IClassFactoryVtbl DICF_Vtbl = {
DICF_CreateInstance,
DICF_LockServer
};
static IClassFactoryImpl DINPUT_CF = {&DICF_Vtbl, 1 };
static IClassFactoryImpl DINPUT_CF = {{&DICF_Vtbl}, 1 };
/***********************************************************************
* DllCanUnloadNow (DINPUT.@)