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
61cb53e2
Commit
61cb53e2
authored
Mar 22, 2010
by
Andrew Nguyen
Committed by
Alexandre Julliard
Mar 23, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxdiagn: Fix return value of IDxDiagContainer::GetProp on property search failure.
parent
34577a84
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
94 additions
and
1 deletion
+94
-1
container.c
dlls/dxdiagn/container.c
+1
-1
container.c
dlls/dxdiagn/tests/container.c
+93
-0
No files found.
dlls/dxdiagn/container.c
View file @
61cb53e2
...
...
@@ -227,7 +227,7 @@ static HRESULT WINAPI IDxDiagContainerImpl_GetProp(PDXDIAGCONTAINER iface, LPCWS
}
p
=
p
->
next
;
}
return
S_OK
;
return
E_INVALIDARG
;
}
HRESULT
WINAPI
IDxDiagContainerImpl_AddProp
(
PDXDIAGCONTAINER
iface
,
LPCWSTR
pwszPropName
,
VARIANT
*
pVarProp
)
{
...
...
dlls/dxdiagn/tests/container.c
View file @
61cb53e2
...
...
@@ -22,6 +22,7 @@
#include <stdio.h>
#include "dxdiag.h"
#include "oleauto.h"
#include "wine/test.h"
static
IDxDiagProvider
*
pddp
;
...
...
@@ -527,6 +528,97 @@ cleanup:
IDxDiagProvider_Release
(
pddp
);
}
static
void
test_GetProp
(
void
)
{
HRESULT
hr
;
WCHAR
container
[
256
],
property
[
256
];
IDxDiagContainer
*
child
=
NULL
;
DWORD
count
,
index
;
VARIANT
var
;
static
const
WCHAR
emptyW
[]
=
{
0
};
static
const
WCHAR
testW
[]
=
{
't'
,
'e'
,
's'
,
't'
,
0
};
if
(
!
create_root_IDxDiagContainer
())
{
skip
(
"Unable to create the root IDxDiagContainer
\n
"
);
return
;
}
/* Find a container with a property. */
hr
=
IDxDiagContainer_GetNumberOfChildContainers
(
pddc
,
&
count
);
ok
(
hr
==
S_OK
,
"Expected IDxDiagContainer::GetNumberOfChildContainers to return S_OK, got 0x%08x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
{
skip
(
"IDxDiagContainer::GetNumberOfChildContainers failed
\n
"
);
goto
cleanup
;
}
for
(
index
=
0
;
index
<
count
;
index
++
)
{
hr
=
IDxDiagContainer_EnumChildContainerNames
(
pddc
,
index
,
container
,
sizeof
(
container
)
/
sizeof
(
WCHAR
));
ok
(
hr
==
S_OK
,
"Expected IDxDiagContainer_EnumChildContainerNames to return S_OK, got 0x%08x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
{
skip
(
"IDxDiagContainer::EnumChildContainerNames failed
\n
"
);
goto
cleanup
;
}
hr
=
IDxDiagContainer_GetChildContainer
(
pddc
,
container
,
&
child
);
ok
(
hr
==
S_OK
,
"Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IDxDiagContainer_EnumPropNames
(
child
,
0
,
property
,
sizeof
(
property
)
/
sizeof
(
WCHAR
));
ok
(
hr
==
S_OK
||
hr
==
E_INVALIDARG
,
"Expected IDxDiagContainer::EnumPropNames to return S_OK or E_INVALIDARG, got 0x%08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
break
;
else
{
IDxDiagContainer_Release
(
child
);
child
=
NULL
;
}
}
}
if
(
!
child
)
{
skip
(
"Unable to find a suitable container
\n
"
);
goto
cleanup
;
}
hr
=
IDxDiagContainer_GetProp
(
child
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Expected IDxDiagContainer::GetProp to return E_INVALIDARG, got 0x%08x
\n
"
,
hr
);
V_VT
(
&
var
)
=
0xdead
;
hr
=
IDxDiagContainer_GetProp
(
child
,
NULL
,
&
var
);
ok
(
hr
==
E_INVALIDARG
,
"Expected IDxDiagContainer::GetProp to return E_INVALIDARG, got 0x%08x
\n
"
,
hr
);
ok
(
V_VT
(
&
var
)
==
0xdead
,
"Expected the variant to be untouched, got %u
\n
"
,
V_VT
(
&
var
));
hr
=
IDxDiagContainer_GetProp
(
child
,
emptyW
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Expected IDxDiagContainer::GetProp to return E_INVALIDARG, got 0x%08x
\n
"
,
hr
);
V_VT
(
&
var
)
=
0xdead
;
hr
=
IDxDiagContainer_GetProp
(
child
,
emptyW
,
&
var
);
ok
(
hr
==
E_INVALIDARG
,
"Expected IDxDiagContainer::GetProp to return E_INVALIDARG, got 0x%08x
\n
"
,
hr
);
ok
(
V_VT
(
&
var
)
==
0xdead
,
"Expected the variant to be untouched, got %u
\n
"
,
V_VT
(
&
var
));
hr
=
IDxDiagContainer_GetProp
(
child
,
testW
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Expected IDxDiagContainer::GetProp to return E_INVALIDARG, got 0x%08x
\n
"
,
hr
);
V_VT
(
&
var
)
=
0xdead
;
hr
=
IDxDiagContainer_GetProp
(
child
,
testW
,
&
var
);
ok
(
hr
==
E_INVALIDARG
,
"Expected IDxDiagContainer::GetProp to return E_INVALIDARG, got 0x%08x
\n
"
,
hr
);
ok
(
V_VT
(
&
var
)
==
0xdead
,
"Expected the variant to be untouched, got %u
\n
"
,
V_VT
(
&
var
));
IDxDiagContainer_Release
(
child
);
cleanup:
IDxDiagContainer_Release
(
pddc
);
IDxDiagProvider_Release
(
pddp
);
}
START_TEST
(
container
)
{
CoInitialize
(
NULL
);
...
...
@@ -536,5 +628,6 @@ START_TEST(container)
test_GetChildContainer
();
test_dot_parsing
();
test_EnumPropNames
();
test_GetProp
();
CoUninitialize
();
}
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