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
1063623d
Commit
1063623d
authored
Jan 13, 2016
by
Piotr Caban
Committed by
Alexandre Julliard
Jan 14, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32/tests: Show that VARIANT_UserUnmarshal may reuse passed in BSTR.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ba498e60
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
usrmarshal.c
dlls/oleaut32/tests/usrmarshal.c
+8
-2
No files found.
dlls/oleaut32/tests/usrmarshal.c
View file @
1063623d
...
...
@@ -767,7 +767,7 @@ static void test_marshal_VARIANT(void)
double
d
;
void
*
mem
;
DWORD
*
wirev
;
BSTR
b
;
BSTR
b
,
b2
;
WCHAR
str
[]
=
{
'm'
,
'a'
,
'r'
,
's'
,
'h'
,
'a'
,
'l'
,
' '
,
't'
,
'e'
,
's'
,
't'
,
0
};
SAFEARRAYBOUND
sab
;
LPSAFEARRAY
lpsa
,
lpsa2
,
lpsa_copy
;
...
...
@@ -1237,15 +1237,21 @@ static void test_marshal_VARIANT(void)
ok
(
*
wirev
,
"wv[6] %08x
\n
"
,
*
wirev
);
/* win2k: this is b. winxp: this is (char*)b + 1 */
wirev
++
;
check_bstr
(
wirev
,
b
);
b2
=
SysAllocString
(
str
);
b2
[
0
]
=
0
;
V_VT
(
&
v2
)
=
VT_BSTR
|
VT_BYREF
;
V_BSTRREF
(
&
v2
)
=
&
b2
;
mem
=
b2
;
VariantInit
(
&
v2
);
stubMsg
.
Buffer
=
buffer
;
next
=
VARIANT_UserUnmarshal
(
&
umcb
.
Flags
,
buffer
,
&
v2
);
ok
(
next
==
buffer
+
stubMsg
.
BufferLength
,
"got %p expect %p
\n
"
,
next
,
buffer
+
stubMsg
.
BufferLength
);
ok
(
mem
==
b2
,
"BSTR should be reused
\n
"
);
ok
(
V_VT
(
&
v
)
==
V_VT
(
&
v2
),
"got vt %d expect %d
\n
"
,
V_VT
(
&
v
),
V_VT
(
&
v2
));
ok
(
SysStringByteLen
(
*
V_BSTRREF
(
&
v
))
==
SysStringByteLen
(
*
V_BSTRREF
(
&
v2
)),
"bstr string lens differ
\n
"
);
ok
(
!
memcmp
(
*
V_BSTRREF
(
&
v
),
*
V_BSTRREF
(
&
v2
),
SysStringByteLen
(
*
V_BSTRREF
(
&
v
))),
"bstrs differ
\n
"
);
VARIANT_UserFree
(
&
umcb
.
Flags
,
&
v
2
);
SysFreeString
(
b
2
);
HeapFree
(
GetProcessHeap
(),
0
,
oldbuffer
);
SysFreeString
(
b
);
...
...
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