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
b560dbae
Commit
b560dbae
authored
Aug 24, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Fully initialize VARIANT structure in VariantInit().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7e67cc99
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
18 deletions
+12
-18
vartest.c
dlls/oleaut32/tests/vartest.c
+9
-4
variant.c
dlls/oleaut32/variant.c
+3
-14
No files found.
dlls/oleaut32/tests/vartest.c
View file @
b560dbae
...
...
@@ -673,11 +673,16 @@ static void _test_bstr_var(unsigned line, const VARIANT *v, const WCHAR *str)
static
void
test_VariantInit
(
void
)
{
VARIANT
v
;
VARIANT
v
,
v2
,
v3
;
memset
(
&
v
,
-
1
,
sizeof
(
v
));
VariantInit
(
&
v
);
ok
(
V_VT
(
&
v
)
==
VT_EMPTY
,
"VariantInit() returned vt %d
\n
"
,
V_VT
(
&
v
));
memset
(
&
v
,
-
1
,
sizeof
(
v
));
memset
(
&
v2
,
0
,
sizeof
(
v2
));
memset
(
&
v3
,
-
1
,
sizeof
(
v3
));
V_VT
(
&
v3
)
=
VT_EMPTY
;
VariantInit
(
&
v
);
ok
(
!
memcmp
(
&
v
,
&
v2
,
sizeof
(
v
))
||
broken
(
!
memcmp
(
&
v
,
&
v3
,
sizeof
(
v3
))
/* pre Win8 */
),
"Unexpected contents.
\n
"
);
}
/* All possible combinations of extra V_VT() flags */
...
...
dlls/oleaut32/variant.c
View file @
b560dbae
...
...
@@ -545,24 +545,13 @@ static inline HRESULT VARIANT_ValidateType(VARTYPE vt)
/******************************************************************************
* VariantInit [OLEAUT32.8]
*
* Initialise a variant.
*
* PARAMS
* pVarg [O] Variant to initialise
*
* RETURNS
* Nothing.
*
* NOTES
* This function simply sets the type of the variant to VT_EMPTY. It does not
* free any existing value, use VariantClear() for that.
* Since Windows 8.1 whole structure is initialized, before that only type field was reset to VT_EMPTY.
*/
void
WINAPI
VariantInit
(
VARIANTARG
*
pVarg
)
{
TRACE
(
"(%p)
\n
"
,
pVarg
);
TRACE
(
"(%p)
\n
"
,
pVarg
);
/* Win8.1 zeroes whole struct. Previous implementations don't set any other fields. */
V_VT
(
pVarg
)
=
VT_EMPTY
;
memset
(
pVarg
,
0
,
sizeof
(
*
pVarg
));
}
HRESULT
VARIANT_ClearInd
(
VARIANTARG
*
pVarg
)
...
...
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