Huw Davies : ole32/tests: Set tymed in GetData and AddRef the interfaces ( ReleaseStgMedium releases them even if pUnkForRelease is non-NULL).

Alexandre Julliard julliard at winehq.org
Wed Apr 1 10:11:28 CDT 2009


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

Author: Huw Davies <huw at codeweavers.com>
Date:   Tue Mar 31 14:41:11 2009 +0100

ole32/tests: Set tymed in GetData and AddRef the interfaces (ReleaseStgMedium releases them even if pUnkForRelease is non-NULL).

---

 dlls/ole32/tests/clipboard.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/dlls/ole32/tests/clipboard.c b/dlls/ole32/tests/clipboard.c
index 1918b2c..88b3ba6 100644
--- a/dlls/ole32/tests/clipboard.c
+++ b/dlls/ole32/tests/clipboard.c
@@ -245,11 +245,22 @@ static HRESULT WINAPI DataObjectImpl_GetData(IDataObject* iface, FORMATETC *pfor
                 IUnknown_AddRef(pmedium->pUnkForRelease);
 
                 if(pformatetc->cfFormat == CF_TEXT || pformatetc->cfFormat == cf_global)
+                {
+                    pmedium->tymed = TYMED_HGLOBAL;
                     U(*pmedium).hGlobal = This->text;
+                }
                 else if(pformatetc->cfFormat == cf_stream)
+                {
+                    pmedium->tymed = TYMED_ISTREAM;
+                    IStream_AddRef(This->stm);
                     U(*pmedium).pstm = This->stm;
+                }
                 else if(pformatetc->cfFormat == cf_storage)
+                {
+                    pmedium->tymed = TYMED_ISTORAGE;
+                    IStorage_AddRef(This->stg);
                     U(*pmedium).pstg = This->stg;
+                }
                 return S_OK;
             }
         }




More information about the wine-cvs mailing list