Michael Stefaniuc : msimtf: Use an interface instance instead of a vtbl pointer.
Alexandre Julliard
julliard at winehq.org
Mon Nov 29 13:38:37 CST 2010
Module: wine
Branch: master
Commit: 41dce7cfec131b4e95fb81b69f451ff008ce57bc
URL: http://source.winehq.org/git/wine.git/?a=commit;h=41dce7cfec131b4e95fb81b69f451ff008ce57bc
Author: Michael Stefaniuc <mstefani at redhat.de>
Date: Mon Nov 29 01:01:31 2010 +0100
msimtf: Use an interface instance instead of a vtbl pointer.
---
dlls/msimtf/main.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/dlls/msimtf/main.c b/dlls/msimtf/main.c
index 6b8957b..dab1e27 100644
--- a/dlls/msimtf/main.c
+++ b/dlls/msimtf/main.c
@@ -60,11 +60,16 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
}
typedef struct {
- const IClassFactoryVtbl *lpClassFactoryVtbl;
+ IClassFactory IClassFactory_iface;
HRESULT (*cf)(IUnknown*,IUnknown**);
} ClassFactory;
+static inline ClassFactory *impl_from_IClassFactory(IClassFactory *iface)
+{
+ return CONTAINING_RECORD(iface, ClassFactory, IClassFactory_iface);
+}
+
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface,
REFIID riid, void **ppv)
{
@@ -100,7 +105,7 @@ static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface,
IUnknown *pOuter, REFIID riid, void **ppv)
{
- ClassFactory *This = (ClassFactory*)iface;
+ ClassFactory *This = impl_from_IClassFactory(iface);
HRESULT ret;
IUnknown *obj;
TRACE("(%p, %p, %s, %p)\n", iface, pOuter, debugstr_guid(riid), ppv);
@@ -135,7 +140,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
if(IsEqualGUID(&CLSID_CActiveIMM, rclsid)) {
static ClassFactory cf = {
- &ClassFactoryVtbl,
+ { &ClassFactoryVtbl },
ActiveIMMApp_Constructor,
};
More information about the wine-cvs
mailing list