[10/18] windowscodecs: Do not assume that vtable is the first element of the object, avoid not necessary casts.

Dmitry Timoshkov dmitry at baikal.ru
Tue Jul 24 01:10:15 CDT 2012


---
 dlls/windowscodecs/imgfactory.c | 6 +++---
 1 file 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;
 }
-- 
1.7.11.2




More information about the wine-patches mailing list