Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
68fc5f88
Commit
68fc5f88
authored
Jan 11, 2005
by
Robert Shearman
Committed by
Alexandre Julliard
Jan 11, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for trying to unmarshal from a bad stream and for testing
what interfaces the proxy exposes.
parent
c353f850
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
86 additions
and
0 deletions
+86
-0
marshal.c
dlls/ole32/tests/marshal.c
+86
-0
No files found.
dlls/ole32/tests/marshal.c
View file @
68fc5f88
...
...
@@ -763,6 +763,90 @@ static void test_message_filter()
end_host_object
(
tid
,
thread
);
}
/* test failure case of trying to unmarshal from bad stream */
static
void
test_bad_marshal_stream
()
{
HRESULT
hr
;
IStream
*
pStream
=
NULL
;
hr
=
CreateStreamOnHGlobal
(
NULL
,
TRUE
,
&
pStream
);
ok_ole_success
(
hr
,
CreateStreamOnHGlobal
);
hr
=
CoMarshalInterface
(
pStream
,
&
IID_IClassFactory
,
(
IUnknown
*
)
&
Test_ClassFactory
,
MSHCTX_INPROC
,
NULL
,
MSHLFLAGS_NORMAL
);
ok_ole_success
(
hr
,
CoMarshalInterface
);
ok_more_than_one_lock
();
/* try to read beyond end of stream */
hr
=
CoReleaseMarshalData
(
pStream
);
ok
(
hr
==
STG_E_READFAULT
,
"Should have failed with STG_E_READFAULT, but returned 0x%08lx instead
\n
"
,
hr
);
/* now release for real */
IStream_Seek
(
pStream
,
ullZero
,
STREAM_SEEK_SET
,
NULL
);
hr
=
CoReleaseMarshalData
(
pStream
);
ok_ole_success
(
hr
,
CoReleaseMarshalData
);
IStream_Release
(
pStream
);
}
/* tests that proxies implement certain interfaces */
static
void
test_proxy_interfaces
()
{
HRESULT
hr
;
IStream
*
pStream
=
NULL
;
IUnknown
*
pProxy
=
NULL
;
IUnknown
*
pOtherUnknown
=
NULL
;
DWORD
tid
;
HANDLE
thread
;
static
const
IID
IID_IMarshal2
=
{
0x000001cf
,
0x0000
,
0x0000
,
{
0xC0
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x46
}
};
cLocks
=
0
;
hr
=
CreateStreamOnHGlobal
(
NULL
,
TRUE
,
&
pStream
);
ok_ole_success
(
hr
,
CreateStreamOnHGlobal
);
tid
=
start_host_object
(
pStream
,
&
IID_IClassFactory
,
(
IUnknown
*
)
&
Test_ClassFactory
,
MSHLFLAGS_NORMAL
,
&
thread
);
ok_more_than_one_lock
();
IStream_Seek
(
pStream
,
ullZero
,
STREAM_SEEK_SET
,
NULL
);
hr
=
CoUnmarshalInterface
(
pStream
,
&
IID_IClassFactory
,
(
void
**
)
&
pProxy
);
ok_ole_success
(
hr
,
CoReleaseMarshalData
);
IStream_Release
(
pStream
);
ok_more_than_one_lock
();
hr
=
IUnknown_QueryInterface
(
pProxy
,
&
IID_IUnknown
,
(
LPVOID
*
)
&
pOtherUnknown
);
ok_ole_success
(
hr
,
IUnknown_QueryInterface
IID_IUnknown
);
if
(
hr
==
S_OK
)
IUnknown_Release
(
pOtherUnknown
);
hr
=
IUnknown_QueryInterface
(
pProxy
,
&
IID_IClientSecurity
,
(
LPVOID
*
)
&
pOtherUnknown
);
todo_wine
{
ok_ole_success
(
hr
,
IUnknown_QueryInterface
IID_IClientSecurity
);
}
if
(
hr
==
S_OK
)
IUnknown_Release
(
pOtherUnknown
);
hr
=
IUnknown_QueryInterface
(
pProxy
,
&
IID_IMultiQI
,
(
LPVOID
*
)
&
pOtherUnknown
);
todo_wine
{
ok_ole_success
(
hr
,
IUnknown_QueryInterface
IID_IMultiQI
);
}
if
(
hr
==
S_OK
)
IUnknown_Release
(
pOtherUnknown
);
hr
=
IUnknown_QueryInterface
(
pProxy
,
&
IID_IMarshal
,
(
LPVOID
*
)
&
pOtherUnknown
);
todo_wine
{
ok_ole_success
(
hr
,
IUnknown_QueryInterface
IID_IMarshal
);
}
if
(
hr
==
S_OK
)
IUnknown_Release
(
pOtherUnknown
);
hr
=
IUnknown_QueryInterface
(
pProxy
,
&
IID_IMarshal2
,
(
LPVOID
*
)
&
pOtherUnknown
);
todo_wine
{
ok_ole_success
(
hr
,
IUnknown_QueryInterface
IID_IMarshal2
);
}
if
(
hr
==
S_OK
)
IUnknown_Release
(
pOtherUnknown
);
IUnknown_Release
(
pProxy
);
ok_no_locks
();
end_host_object
(
tid
,
thread
);
}
/* doesn't pass with Win9x COM DLLs (even though Essential COM says it should) */
#if 0
...
...
@@ -941,6 +1025,8 @@ START_TEST(marshal)
test_hresult_marshaling
();
test_proxy_used_in_wrong_thread
();
test_message_filter
();
test_bad_marshal_stream
();
test_proxy_interfaces
();
/* FIXME: test custom marshaling */
/* FIXME: test GIT */
/* FIXME: test COM re-entrancy */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment