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
9d7d35c1
Commit
9d7d35c1
authored
Jun 15, 2011
by
Andrew Nguyen
Committed by
Alexandre Julliard
Jun 15, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxdiagn: Unconditionally initialize the passed variant in IDxDiagContainer::GetProp.
parent
d54f4fc3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
container.c
dlls/dxdiagn/container.c
+1
-4
container.c
dlls/dxdiagn/tests/container.c
+15
-1
No files found.
dlls/dxdiagn/container.c
View file @
9d7d35c1
...
...
@@ -222,10 +222,7 @@ static HRESULT WINAPI IDxDiagContainerImpl_GetProp(PDXDIAGCONTAINER iface, LPCWS
LIST_FOR_EACH_ENTRY
(
p
,
&
This
->
cont
->
properties
,
IDxDiagContainerImpl_Property
,
entry
)
{
if
(
0
==
lstrcmpW
(
p
->
propName
,
pwszPropName
))
{
HRESULT
hr
=
VariantClear
(
pvarProp
);
if
(
hr
==
DISP_E_ARRAYISLOCKED
||
hr
==
DISP_E_BADVARTYPE
)
VariantInit
(
pvarProp
);
VariantInit
(
pvarProp
);
return
VariantCopy
(
pvarProp
,
&
p
->
vProp
);
}
}
...
...
dlls/dxdiagn/tests/container.c
View file @
9d7d35c1
...
...
@@ -568,6 +568,7 @@ static void test_GetProp(void)
VARIANT
var
;
SAFEARRAY
*
sa
;
SAFEARRAYBOUND
bound
;
ULONG
ref
;
static
const
WCHAR
emptyW
[]
=
{
0
};
static
const
WCHAR
testW
[]
=
{
't'
,
'e'
,
's'
,
't'
,
0
};
...
...
@@ -680,8 +681,21 @@ static void test_GetProp(void)
ok
(
hr
==
S_OK
,
"Expected SafeArrayUnlock to return S_OK, got 0x%08x
\n
"
,
hr
);
hr
=
SafeArrayDestroy
(
sa
);
ok
(
hr
==
S_OK
,
"Expected SafeArrayDestroy to return S_OK, got 0x%08x
\n
"
,
hr
);
IDxDiagContainer_Release
(
child
);
/* Determine whether GetProp calls VariantClear on the passed variant. */
V_VT
(
&
var
)
=
VT_UNKNOWN
;
V_UNKNOWN
(
&
var
)
=
(
IUnknown
*
)
child
;
IDxDiagContainer_AddRef
(
child
);
hr
=
IDxDiagContainer_GetProp
(
child
,
property
,
&
var
);
ok
(
hr
==
S_OK
,
"Expected IDxDiagContainer::GetProp to return S_OK, got 0x%08x
\n
"
,
hr
);
ok
(
V_VT
(
&
var
)
!=
VT_UNKNOWN
,
"Expected the variant to be modified
\n
"
);
IDxDiagContainer_AddRef
(
child
);
ref
=
IDxDiagContainer_Release
(
child
);
ok
(
ref
==
2
,
"Expected reference count to be 2, got %u
\n
"
,
ref
);
IDxDiagContainer_Release
(
child
);
cleanup:
IDxDiagContainer_Release
(
pddc
);
IDxDiagProvider_Release
(
pddp
);
...
...
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