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
0946c154
Commit
0946c154
authored
Apr 16, 2014
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Apr 16, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: PropVariantClear should always reset contents of the passed in PROPVARIANT.
parent
7de7fc65
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
26 deletions
+12
-26
ole2.c
dlls/ole32/ole2.c
+8
-3
propvariant.c
dlls/ole32/tests/propvariant.c
+4
-23
No files found.
dlls/ole32/ole2.c
View file @
0946c154
...
...
@@ -2919,7 +2919,10 @@ HRESULT WINAPI PropVariantClear(PROPVARIANT * pvar) /* [in/out] */
hr
=
PROPVARIANT_ValidateType
(
pvar
->
vt
);
if
(
FAILED
(
hr
))
{
memset
(
pvar
,
0
,
sizeof
(
*
pvar
));
return
hr
;
}
switch
(
pvar
->
vt
)
{
...
...
@@ -3006,12 +3009,14 @@ HRESULT WINAPI PropVariantClear(PROPVARIANT * pvar) /* [in/out] */
}
}
else
{
WARN
(
"Invalid/unsupported type %d
\n
"
,
pvar
->
vt
);
hr
=
STG_E_INVALIDPARAMETER
;
}
}
ZeroMemory
(
pvar
,
sizeof
(
*
pvar
));
return
S_OK
;
memset
(
pvar
,
0
,
sizeof
(
*
pvar
));
return
hr
;
}
/***********************************************************************
...
...
dlls/ole32/tests/propvariant.c
View file @
0946c154
...
...
@@ -187,9 +187,7 @@ static void test_validtypes(void)
memset
(
&
propvar
,
0x55
,
sizeof
(
propvar
));
hr
=
PropVariantClear
(
&
propvar
);
ok
(
hr
==
STG_E_INVALIDPARAMETER
,
"expected STG_E_INVALIDPARAMETER, got %08x
\n
"
,
hr
);
todo_wine
ok
(
propvar
.
vt
==
0
,
"expected 0, got %d
\n
"
,
propvar
.
vt
);
todo_wine
ok
(
U
(
propvar
).
uhVal
.
QuadPart
==
0
,
"expected 0, got %#x/%#x
\n
"
,
U
(
propvar
).
uhVal
.
u
.
LowPart
,
U
(
propvar
).
uhVal
.
u
.
HighPart
);
...
...
@@ -202,25 +200,16 @@ todo_wine
vt
=
propvar
.
vt
=
i
;
hr
=
PropVariantClear
(
&
propvar
);
expect
(
hr
,
vt
);
if
(
hr
==
S_OK
)
/* FIXME: Remove once Wine is fixed */
ok
(
U
(
propvar
).
uhVal
.
QuadPart
==
0
,
"%u: expected 0, got %#x/%#x
\n
"
,
i
,
U
(
propvar
).
uhVal
.
u
.
LowPart
,
U
(
propvar
).
uhVal
.
u
.
HighPart
);
else
todo_wine
ok
(
propvar
.
vt
==
0
,
"expected 0, got %d
\n
"
,
propvar
.
vt
);
ok
(
U
(
propvar
).
uhVal
.
QuadPart
==
0
,
"%u: expected 0, got %#x/%#x
\n
"
,
i
,
U
(
propvar
).
uhVal
.
u
.
LowPart
,
U
(
propvar
).
uhVal
.
u
.
HighPart
);
memset
(
&
propvar
,
0x55
,
sizeof
(
propvar
));
U
(
propvar
).
pszVal
=
NULL
;
vt
=
propvar
.
vt
=
i
|
VT_ARRAY
;
hr
=
PropVariantClear
(
&
propvar
);
expect
(
hr
,
vt
);
if
(
hr
==
S_OK
)
/* FIXME: Remove once Wine is fixed */
ok
(
U
(
propvar
).
uhVal
.
QuadPart
==
0
,
"%u: expected 0, got %#x/%#x
\n
"
,
i
,
U
(
propvar
).
uhVal
.
u
.
LowPart
,
U
(
propvar
).
uhVal
.
u
.
HighPart
);
else
todo_wine
ok
(
propvar
.
vt
==
0
,
"expected 0, got %d
\n
"
,
propvar
.
vt
);
ok
(
U
(
propvar
).
uhVal
.
QuadPart
==
0
,
"%u: expected 0, got %#x/%#x
\n
"
,
i
,
U
(
propvar
).
uhVal
.
u
.
LowPart
,
U
(
propvar
).
uhVal
.
u
.
HighPart
);
...
...
@@ -229,11 +218,7 @@ todo_wine
vt
=
propvar
.
vt
=
i
|
VT_VECTOR
;
hr
=
PropVariantClear
(
&
propvar
);
expect
(
hr
,
vt
);
if
(
hr
==
S_OK
)
/* FIXME: Remove once Wine is fixed */
ok
(
U
(
propvar
).
uhVal
.
QuadPart
==
0
,
"%u: expected 0, got %#x/%#x
\n
"
,
i
,
U
(
propvar
).
uhVal
.
u
.
LowPart
,
U
(
propvar
).
uhVal
.
u
.
HighPart
);
else
todo_wine
ok
(
propvar
.
vt
==
0
,
"expected 0, got %d
\n
"
,
propvar
.
vt
);
ok
(
U
(
propvar
).
uhVal
.
QuadPart
==
0
,
"%u: expected 0, got %#x/%#x
\n
"
,
i
,
U
(
propvar
).
uhVal
.
u
.
LowPart
,
U
(
propvar
).
uhVal
.
u
.
HighPart
);
...
...
@@ -242,11 +227,7 @@ todo_wine
vt
=
propvar
.
vt
=
i
|
VT_BYREF
;
hr
=
PropVariantClear
(
&
propvar
);
expect
(
hr
,
vt
);
if
(
hr
==
S_OK
)
/* FIXME: Remove once Wine is fixed */
ok
(
U
(
propvar
).
uhVal
.
QuadPart
==
0
,
"%u: expected 0, got %#x/%#x
\n
"
,
i
,
U
(
propvar
).
uhVal
.
u
.
LowPart
,
U
(
propvar
).
uhVal
.
u
.
HighPart
);
else
todo_wine
ok
(
propvar
.
vt
==
0
,
"expected 0, got %d
\n
"
,
propvar
.
vt
);
ok
(
U
(
propvar
).
uhVal
.
QuadPart
==
0
,
"%u: expected 0, got %#x/%#x
\n
"
,
i
,
U
(
propvar
).
uhVal
.
u
.
LowPart
,
U
(
propvar
).
uhVal
.
u
.
HighPart
);
}
...
...
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