Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
707f9628
Commit
707f9628
authored
May 19, 2009
by
Huw Davies
Committed by
Alexandre Julliard
May 19, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32/tests: Remove assumptions about the size of marshalled data.
parent
d769368f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
24 deletions
+17
-24
usrmarshal.c
dlls/ole32/tests/usrmarshal.c
+17
-24
No files found.
dlls/ole32/tests/usrmarshal.c
View file @
707f9628
...
...
@@ -550,13 +550,9 @@ static void marshal_WdtpInterfacePointer(DWORD umcb_ctx, DWORD ctx)
unsigned
char
*
wireip
;
HGLOBAL
h
=
GlobalAlloc
(
GMEM_MOVEABLE
,
0
);
IStream
*
stm
;
void
*
ptr
;
void
*
marshal_data
;
LARGE_INTEGER
pos
;
DWORD
h_size
,
marshal_size
,
expected_size
;
/* The marshalled data depends on the LOWORD of the ctx */
expected_size
=
(
LOWORD
(
ctx
)
==
MSHCTX_INPROC
)
?
0x4c
:
0xb4
;
DWORD
marshal_size
;
/* shows that the WdtpInterfacePointer functions don't marshal anything for
* NULL pointers, so code using these functions must handle that case
...
...
@@ -571,36 +567,33 @@ static void marshal_WdtpInterfacePointer(DWORD umcb_ctx, DWORD ctx)
wireip
=
buffer
;
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
/* Now for a non-NULL pointer. The marshalled data are two size DWORDS and then
the result of CoMarshalInterface called with the LOWORD of the ctx */
unk
=
&
Test_Unknown
;
CreateStreamOnHGlobal
(
h
,
TRUE
,
&
stm
);
CoMarshalInterface
(
stm
,
&
IID_IUnknown
,
unk
,
LOWORD
(
ctx
),
NULL
,
MSHLFLAGS_NORMAL
);
marshal_size
=
GlobalSize
(
h
);
marshal_data
=
GlobalLock
(
h
);
init_user_marshal_cb
(
&
umcb
,
&
stub_msg
,
&
rpc_msg
,
NULL
,
0
,
umcb_ctx
);
size
=
WdtpInterfacePointer_UserSize
(
&
umcb
.
Flags
,
ctx
,
0
,
unk
,
&
IID_IUnknown
);
todo_wine
ok
(
size
>=
expected_size
,
"size should be >= %x bytes, not %x
\n
"
,
expected_size
,
size
);
trace
(
"WdtpInterfacePointer_UserSize returned %d
\n
"
,
size
);
ok
(
size
>=
marshal_size
+
2
*
sizeof
(
DWORD
),
"marshal size %x got %x
\n
"
,
marshal_size
,
size
);
trace
(
"WdtpInterfacePointer_UserSize returned %x
\n
"
,
size
);
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
init_user_marshal_cb
(
&
umcb
,
&
stub_msg
,
&
rpc_msg
,
buffer
,
size
,
umcb_ctx
);
buffer_end
=
WdtpInterfacePointer_UserMarshal
(
&
umcb
.
Flags
,
ctx
,
buffer
,
unk
,
&
IID_IUnknown
);
wireip
=
buffer
;
/* Wine's standard marshalling appears to be a DWORD short */
todo_wine
ok
(
buffer_end
==
buffer
+
expected_size
,
"buffer_end %p buffer %p (diff %x)
\n
"
,
buffer_end
,
buffer
,
buffer_end
-
buffer
);
ok
(
buffer_end
==
buffer
+
marshal_size
+
2
*
sizeof
(
DWORD
),
"buffer_end %p buffer %p (diff %x)
\n
"
,
buffer_end
,
buffer
,
buffer_end
-
buffer
);
marshal_size
=
buffer_end
-
buffer
-
2
*
sizeof
(
DWORD
);
ok
(
*
(
DWORD
*
)
wireip
==
marshal_size
,
"wireip + 0x0 should be 0x44 instead of 0x%08x
\n
"
,
*
(
DWORD
*
)
wireip
);
ok
(
*
(
DWORD
*
)
wireip
==
marshal_size
,
"wireip + 0x0 should be %x instead of %x
\n
"
,
marshal_size
,
*
(
DWORD
*
)
wireip
);
wireip
+=
sizeof
(
DWORD
);
ok
(
*
(
DWORD
*
)
wireip
==
marshal_size
,
"wireip + 0x4 should be
0x44 instead of 0x%08x
\n
"
,
*
(
DWORD
*
)
wireip
);
ok
(
*
(
DWORD
*
)
wireip
==
marshal_size
,
"wireip + 0x4 should be
%x instead of %x
\n
"
,
marshal_size
,
*
(
DWORD
*
)
wireip
);
wireip
+=
sizeof
(
DWORD
);
/* The remaining 0x44/0xac bytes are the result of CoMarshalInterface */
CreateStreamOnHGlobal
(
h
,
TRUE
,
&
stm
);
CoMarshalInterface
(
stm
,
&
IID_IUnknown
,
unk
,
LOWORD
(
ctx
),
NULL
,
MSHLFLAGS_NORMAL
);
h_size
=
GlobalSize
(
h
);
ok
(
h_size
==
marshal_size
,
"size %x
\n
"
,
h_size
);
ptr
=
GlobalLock
(
h
);
ok
(
!
memcmp
(
ptr
,
wireip
,
h_size
),
"buffer mismatch
\n
"
);
ok
(
!
memcmp
(
marshal_data
,
wireip
,
marshal_size
),
"buffer mismatch
\n
"
);
GlobalUnlock
(
h
);
pos
.
QuadPart
=
0
;
IStream_Seek
(
stm
,
pos
,
STREAM_SEEK_SET
,
NULL
);
...
...
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