Piotr Caban : ole32/tests: Add free threaded marshaler GetUnmarshalClass tests.
Alexandre Julliard
julliard at winehq.org
Mon Oct 15 16:15:27 CDT 2018
Module: wine
Branch: master
Commit: aa1cfbbcc82d19933c4d32cc96996a4d9fe78b0d
URL: https://source.winehq.org/git/wine.git/?a=commit;h=aa1cfbbcc82d19933c4d32cc96996a4d9fe78b0d
Author: Piotr Caban <piotr at codeweavers.com>
Date: Thu Oct 11 19:12:19 2018 +0200
ole32/tests: Add free threaded marshaler GetUnmarshalClass tests.
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/ole32/tests/marshal.c | 50 +++++++++++++++++++++++++++-------------------
1 file changed, 29 insertions(+), 21 deletions(-)
diff --git a/dlls/ole32/tests/marshal.c b/dlls/ole32/tests/marshal.c
index 3a3f9e7..c53acf2 100644
--- a/dlls/ole32/tests/marshal.c
+++ b/dlls/ole32/tests/marshal.c
@@ -3205,6 +3205,7 @@ static void test_freethreadedmarshaler(void)
IStream *pStream;
IUnknown *pProxy;
static const LARGE_INTEGER llZero;
+ CLSID clsid;
cLocks = 0;
hr = CoCreateFreeThreadedMarshaler(NULL, &pFTUnknown);
@@ -3218,6 +3219,12 @@ static void test_freethreadedmarshaler(void)
/* inproc normal marshaling */
+ hr = IMarshal_GetUnmarshalClass(pFTMarshal, &IID_IClassFactory,
+ &Test_ClassFactory, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL, &clsid);
+ ok_ole_success(hr, IMarshal_GetUnmarshalClass);
+ ok(IsEqualIID(&clsid, &CLSID_InProcFreeMarshaler), "clsid = %s\n",
+ wine_dbgstr_guid(&clsid));
+
hr = IMarshal_MarshalInterface(pFTMarshal, pStream, &IID_IClassFactory,
&Test_ClassFactory, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
ok_ole_success(hr, IMarshal_MarshalInterface);
@@ -3234,27 +3241,6 @@ static void test_freethreadedmarshaler(void)
ok_no_locks();
-/* native doesn't allow us to unmarshal or release the stream data,
- * presumably because it wants us to call CoMarshalInterface instead */
- if (0)
- {
- /* local normal marshaling */
-
- IStream_Seek(pStream, llZero, STREAM_SEEK_SET, NULL);
- hr = IMarshal_MarshalInterface(pFTMarshal, pStream, &IID_IClassFactory, &Test_ClassFactory, MSHCTX_LOCAL, NULL, MSHLFLAGS_NORMAL);
- ok_ole_success(hr, IMarshal_MarshalInterface);
-
- ok_more_than_one_lock();
-
- test_freethreadedmarshaldata(pStream, MSHCTX_LOCAL, &Test_ClassFactory, MSHLFLAGS_NORMAL);
-
- IStream_Seek(pStream, llZero, STREAM_SEEK_SET, NULL);
- hr = IMarshal_ReleaseMarshalData(pFTMarshal, pStream);
- ok_ole_success(hr, IMarshal_ReleaseMarshalData);
-
- ok_no_locks();
- }
-
/* inproc table-strong marshaling */
IStream_Seek(pStream, llZero, STREAM_SEEK_SET, NULL);
@@ -3332,6 +3318,28 @@ static void test_freethreadedmarshaler(void)
ok_no_locks();
+ /* local normal marshaling */
+
+ hr = IMarshal_GetUnmarshalClass(pFTMarshal, &IID_IClassFactory,
+ &Test_ClassFactory, MSHCTX_LOCAL, NULL, MSHLFLAGS_NORMAL, &clsid);
+ ok_ole_success(hr, IMarshal_GetUnmarshalClass);
+ ok(IsEqualIID(&clsid, &CLSID_StdMarshal), "clsid = %s\n",
+ wine_dbgstr_guid(&clsid));
+
+ IStream_Seek(pStream, llZero, STREAM_SEEK_SET, NULL);
+ hr = IMarshal_MarshalInterface(pFTMarshal, pStream, &IID_IClassFactory, &Test_ClassFactory, MSHCTX_LOCAL, NULL, MSHLFLAGS_NORMAL);
+ ok_ole_success(hr, IMarshal_MarshalInterface);
+
+ ok_more_than_one_lock();
+
+ test_freethreadedmarshaldata(pStream, MSHCTX_LOCAL, &Test_ClassFactory, MSHLFLAGS_NORMAL);
+
+ IStream_Seek(pStream, llZero, STREAM_SEEK_SET, NULL);
+ hr = CoReleaseMarshalData(pStream);
+ ok_ole_success(hr, CoReleaseMarshalData);
+
+ ok_no_locks();
+
IStream_Release(pStream);
IMarshal_Release(pFTMarshal);
}
More information about the wine-cvs
mailing list