Dmitry Timoshkov : windowscodecs: Do not assume that vtable is the first element of the object, avoid not necessary casts.

Alexandre Julliard julliard at winehq.org
Tue Jul 24 14:39:37 CDT 2012


Module: wine
Branch: master
Commit: 6859a15b076d536e11ffe78e5f2a456953f1eb62
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6859a15b076d536e11ffe78e5f2a456953f1eb62

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Tue Jul 24 15:10:15 2012 +0900

windowscodecs: Do not assume that vtable is the first element of the object, avoid not necessary casts.

---

 dlls/windowscodecs/imgfactory.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/windowscodecs/imgfactory.c b/dlls/windowscodecs/imgfactory.c
index c9bba2b..ea6df28 100644
--- a/dlls/windowscodecs/imgfactory.c
+++ b/dlls/windowscodecs/imgfactory.c
@@ -58,7 +58,7 @@ static HRESULT WINAPI ComponentFactory_QueryInterface(IWICComponentFactory *ifac
         IsEqualIID(&IID_IWICImagingFactory, iid) ||
         IsEqualIID(&IID_IWICComponentFactory, iid))
     {
-        *ppv = This;
+        *ppv = &This->IWICComponentFactory_iface;
     }
     else
     {
@@ -650,8 +650,8 @@ HRESULT ComponentFactory_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void**
     This->IWICComponentFactory_iface.lpVtbl = &ComponentFactory_Vtbl;
     This->ref = 1;
 
-    ret = IUnknown_QueryInterface((IUnknown*)This, iid, ppv);
-    IUnknown_Release((IUnknown*)This);
+    ret = IWICComponentFactory_QueryInterface(&This->IWICComponentFactory_iface, iid, ppv);
+    IWICComponentFactory_Release(&This->IWICComponentFactory_iface);
 
     return ret;
 }




More information about the wine-cvs mailing list