ole32/tests: Add free threaded marshaler GetUnmarshalClass tests.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2018-10-11 19:12:19 +02:00 committed by Alexandre Julliard
parent 4e58d594c1
commit aa1cfbbcc8
1 changed files with 29 additions and 21 deletions

View File

@ -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);
}