Sebastian Lackner : windowscodecs: Distinguish interface pointer and implementation pointer.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Jun 26 07:11:53 CDT 2015


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

Author: Sebastian Lackner <sebastian at fds-team.de>
Date:   Fri Jun 26 05:52:08 2015 +0200

windowscodecs: Distinguish interface pointer and implementation pointer.

---

 dlls/windowscodecs/info.c   | 20 ++++++++++----------
 dlls/windowscodecs/stream.c |  2 +-
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/dlls/windowscodecs/info.c b/dlls/windowscodecs/info.c
index 2cb64d4..cf3c38a 100644
--- a/dlls/windowscodecs/info.c
+++ b/dlls/windowscodecs/info.c
@@ -230,7 +230,7 @@ static HRESULT WINAPI BitmapDecoderInfo_QueryInterface(IWICBitmapDecoderInfo *if
         IsEqualIID(&IID_IWICBitmapCodecInfo, iid) ||
         IsEqualIID(&IID_IWICBitmapDecoderInfo ,iid))
     {
-        *ppv = This;
+        *ppv = &This->IWICBitmapDecoderInfo_iface;
     }
     else
     {
@@ -671,7 +671,7 @@ static HRESULT BitmapDecoderInfo_Constructor(HKEY classkey, REFCLSID clsid, IWIC
     This->classkey = classkey;
     memcpy(&This->clsid, clsid, sizeof(CLSID));
 
-    *ppIInfo = (IWICComponentInfo*)This;
+    *ppIInfo = (IWICComponentInfo *)&This->IWICBitmapDecoderInfo_iface;
     return S_OK;
 }
 
@@ -700,7 +700,7 @@ static HRESULT WINAPI BitmapEncoderInfo_QueryInterface(IWICBitmapEncoderInfo *if
         IsEqualIID(&IID_IWICBitmapCodecInfo, iid) ||
         IsEqualIID(&IID_IWICBitmapEncoderInfo ,iid))
     {
-        *ppv = This;
+        *ppv = &This->IWICBitmapEncoderInfo_iface;
     }
     else
     {
@@ -962,7 +962,7 @@ static HRESULT BitmapEncoderInfo_Constructor(HKEY classkey, REFCLSID clsid, IWIC
     This->classkey = classkey;
     memcpy(&This->clsid, clsid, sizeof(CLSID));
 
-    *ppIInfo = (IWICComponentInfo*)This;
+    *ppIInfo = (IWICComponentInfo *)&This->IWICBitmapEncoderInfo_iface;
     return S_OK;
 }
 
@@ -990,7 +990,7 @@ static HRESULT WINAPI FormatConverterInfo_QueryInterface(IWICFormatConverterInfo
         IsEqualIID(&IID_IWICComponentInfo, iid) ||
         IsEqualIID(&IID_IWICFormatConverterInfo ,iid))
     {
-        *ppv = This;
+        *ppv = &This->IWICFormatConverterInfo_iface;
     }
     else
     {
@@ -1179,7 +1179,7 @@ static HRESULT FormatConverterInfo_Constructor(HKEY classkey, REFCLSID clsid, IW
     This->classkey = classkey;
     memcpy(&This->clsid, clsid, sizeof(CLSID));
 
-    *ppIInfo = (IWICComponentInfo*)This;
+    *ppIInfo = (IWICComponentInfo *)&This->IWICFormatConverterInfo_iface;
     return S_OK;
 }
 
@@ -1208,7 +1208,7 @@ static HRESULT WINAPI PixelFormatInfo_QueryInterface(IWICPixelFormatInfo2 *iface
         IsEqualIID(&IID_IWICPixelFormatInfo, iid) ||
         IsEqualIID(&IID_IWICPixelFormatInfo2 ,iid))
     {
-        *ppv = This;
+        *ppv = &This->IWICPixelFormatInfo2_iface;
     }
     else
     {
@@ -1473,7 +1473,7 @@ static HRESULT PixelFormatInfo_Constructor(HKEY classkey, REFCLSID clsid, IWICCo
     This->classkey = classkey;
     memcpy(&This->clsid, clsid, sizeof(CLSID));
 
-    *ppIInfo = (IWICComponentInfo*)This;
+    *ppIInfo = (IWICComponentInfo *)&This->IWICPixelFormatInfo2_iface;
     return S_OK;
 }
 
@@ -1504,7 +1504,7 @@ static HRESULT WINAPI MetadataReaderInfo_QueryInterface(IWICMetadataReaderInfo *
         IsEqualIID(&IID_IWICMetadataHandlerInfo, riid) ||
         IsEqualIID(&IID_IWICMetadataReaderInfo, riid))
     {
-        *ppv = This;
+        *ppv = &This->IWICMetadataReaderInfo_iface;
     }
     else
     {
@@ -1912,7 +1912,7 @@ static HRESULT MetadataReaderInfo_Constructor(HKEY classkey, REFCLSID clsid, IWI
     This->classkey = classkey;
     This->clsid = *clsid;
 
-    *info = (IWICComponentInfo *)This;
+    *info = (IWICComponentInfo *)&This->IWICMetadataReaderInfo_iface;
     return S_OK;
 }
 
diff --git a/dlls/windowscodecs/stream.c b/dlls/windowscodecs/stream.c
index f6bfedf..d05e940 100644
--- a/dlls/windowscodecs/stream.c
+++ b/dlls/windowscodecs/stream.c
@@ -757,7 +757,7 @@ static HRESULT WINAPI IWICStreamImpl_QueryInterface(IWICStream *iface,
     if (IsEqualIID(&IID_IUnknown, iid) || IsEqualIID(&IID_IStream, iid) ||
         IsEqualIID(&IID_ISequentialStream, iid) || IsEqualIID(&IID_IWICStream, iid))
     {
-        *ppv = This;
+        *ppv = &This->IWICStream_iface;
         IUnknown_AddRef((IUnknown*)*ppv);
         return S_OK;
     }




More information about the wine-cvs mailing list