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
5e09c298
Commit
5e09c298
authored
Jul 08, 2006
by
qingdoa daoo
Committed by
Alexandre Julliard
Jul 10, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Copying a NULL BSTR should result in an empty BSTR in VariantCopy.
parent
4598c973
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
9 deletions
+23
-9
vartest.c
dlls/oleaut32/tests/vartest.c
+17
-0
variant.c
dlls/oleaut32/variant.c
+6
-9
No files found.
dlls/oleaut32/tests/vartest.c
View file @
5e09c298
...
...
@@ -528,6 +528,23 @@ static void test_VariantCopy(void)
vt
|
ExtraFlags
[
i
],
V_VT
(
&
vDst
));
}
}
/* Test that copying a NULL BSTR results in an empty BSTR */
memset
(
&
vDst
,
0
,
sizeof
(
vDst
));
V_VT
(
&
vDst
)
=
VT_EMPTY
;
memset
(
&
vSrc
,
0
,
sizeof
(
vSrc
));
V_VT
(
&
vSrc
)
=
VT_BSTR
;
hres
=
VariantCopy
(
&
vDst
,
&
vSrc
);
ok
(
hres
==
S_OK
,
"Copy(NULL BSTR): Failed to copy a NULL BSTR
\n
"
);
if
(
hres
==
S_OK
)
{
ok
((
V_VT
(
&
vDst
)
==
VT_BSTR
)
&&
V_BSTR
(
&
vDst
),
"Copy(NULL BSTR): should have non-NULL result
\n
"
);
if
((
V_VT
(
&
vDst
)
==
VT_BSTR
)
&&
V_BSTR
(
&
vDst
))
{
ok
(
*
V_BSTR
(
&
vDst
)
==
0
,
"Copy(NULL BSTR): result not empty
\n
"
);
}
}
}
/* Determine if a vt is valid for VariantCopyInd() */
...
...
dlls/oleaut32/variant.c
View file @
5e09c298
...
...
@@ -718,15 +718,12 @@ HRESULT WINAPI VariantCopy(VARIANTARG* pvargDest, VARIANTARG* pvargSrc)
}
else
if
(
V_VT
(
pvargSrc
)
==
VT_BSTR
)
{
if
(
V_BSTR
(
pvargSrc
))
{
V_BSTR
(
pvargDest
)
=
SysAllocStringByteLen
((
char
*
)
V_BSTR
(
pvargSrc
),
SysStringByteLen
(
V_BSTR
(
pvargSrc
)));
if
(
!
V_BSTR
(
pvargDest
))
{
TRACE
(
"!V_BSTR(pvargDest), SysAllocStringByteLen() failed to allocate %d bytes
\n
"
,
SysStringByteLen
(
V_BSTR
(
pvargSrc
)));
hres
=
E_OUTOFMEMORY
;
}
}
V_BSTR
(
pvargDest
)
=
SysAllocStringByteLen
((
char
*
)
V_BSTR
(
pvargSrc
),
SysStringByteLen
(
V_BSTR
(
pvargSrc
)));
if
(
!
V_BSTR
(
pvargDest
))
{
TRACE
(
"!V_BSTR(pvargDest), SysAllocStringByteLen() failed to allocate %d bytes
\n
"
,
SysStringByteLen
(
V_BSTR
(
pvargSrc
)));
hres
=
E_OUTOFMEMORY
;
}
}
else
if
(
V_VT
(
pvargSrc
)
==
VT_RECORD
)
{
...
...
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