Rob Shearman : ole32: Add a test for the failure case of same-apartment unmarshaling when passing in an unsupported iid .

Alexandre Julliard julliard at wine.codeweavers.com
Wed Jan 10 05:36:05 CST 2007


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

Author: Rob Shearman <rob at codeweavers.com>
Date:   Tue Jan  9 17:18:12 2007 +0000

ole32: Add a test for the failure case of same-apartment unmarshaling when passing in an unsupported iid.

---

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

diff --git a/dlls/ole32/tests/marshal.c b/dlls/ole32/tests/marshal.c
index 1742588..11f03df 100644
--- a/dlls/ole32/tests/marshal.c
+++ b/dlls/ole32/tests/marshal.c
@@ -392,6 +392,32 @@ static void test_marshal_and_unmarshal_i
     end_host_object(tid, thread);
 }
 
+static void test_same_apartment_unmarshal_failure(void)
+{
+    HRESULT hr;
+    IStream *pStream;
+    IUnknown *pProxy;
+    static const LARGE_INTEGER llZero;
+
+    cLocks = 0;
+
+    hr = CreateStreamOnHGlobal(NULL, TRUE, &pStream);
+    ok_ole_success(hr, CreateStreamOnHGlobal);
+
+    hr = CoMarshalInterface(pStream, &IID_IUnknown, (IUnknown *)&Test_ClassFactory, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
+    ok_ole_success(hr, CoMarshalInterface);
+
+    ok_more_than_one_lock();
+
+    hr = IStream_Seek(pStream, llZero, STREAM_SEEK_SET, NULL);
+    ok_ole_success(hr, IStream_Seek);
+
+    hr = CoUnmarshalInterface(pStream, &IID_IParseDisplayName, (void **)&pProxy);
+    ok(hr == E_NOINTERFACE, "CoUnmarshalInterface should have returned E_NOINTERFACE instead of 0x%08x\n", hr);
+
+    ok_no_locks();
+}
+
 /* tests success case of an interthread marshal */
 static void test_interthread_marshal_and_unmarshal(void)
 {
@@ -2388,6 +2414,7 @@ START_TEST(marshal)
     test_normal_marshal_and_release();
     test_normal_marshal_and_unmarshal();
     test_marshal_and_unmarshal_invalid();
+    test_same_apartment_unmarshal_failure();
     test_interthread_marshal_and_unmarshal();
     test_proxy_marshal_and_unmarshal();
     test_proxy_marshal_and_unmarshal2();




More information about the wine-cvs mailing list