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
f1e00541
Commit
f1e00541
authored
Mar 14, 2010
by
Andrew Nguyen
Committed by
Alexandre Julliard
Mar 15, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxdiagn: Fix return and output behavior of IDxDiagContainer::EnumPropNames.
parent
af1bcf77
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
86 additions
and
8 deletions
+86
-8
container.c
dlls/dxdiagn/container.c
+5
-8
container.c
dlls/dxdiagn/tests/container.c
+81
-0
No files found.
dlls/dxdiagn/container.c
View file @
f1e00541
...
...
@@ -187,16 +187,13 @@ static HRESULT WINAPI IDxDiagContainerImpl_EnumPropNames(PDXDIAGCONTAINER iface,
IDxDiagContainerImpl
*
This
=
(
IDxDiagContainerImpl
*
)
iface
;
IDxDiagContainerImpl_Property
*
p
=
NULL
;
DWORD
i
=
0
;
TRACE
(
"(%p, %u, %s, %u)
\n
"
,
iface
,
dwIndex
,
debugstr_w
(
pwszPropName
),
cchPropName
);
if
(
NULL
==
pwszPropName
)
{
TRACE
(
"(%p, %u, %p, %u)
\n
"
,
iface
,
dwIndex
,
pwszPropName
,
cchPropName
);
if
(
NULL
==
pwszPropName
||
0
==
cchPropName
)
{
return
E_INVALIDARG
;
}
if
(
256
>
cchPropName
)
{
return
DXDIAG_E_INSUFFICIENT_BUFFER
;
}
p
=
This
->
properties
;
while
(
NULL
!=
p
)
{
if
(
dwIndex
==
i
)
{
...
...
@@ -208,7 +205,7 @@ static HRESULT WINAPI IDxDiagContainerImpl_EnumPropNames(PDXDIAGCONTAINER iface,
}
p
=
p
->
next
;
++
i
;
}
}
return
E_INVALIDARG
;
}
...
...
dlls/dxdiagn/tests/container.c
View file @
f1e00541
...
...
@@ -387,6 +387,86 @@ cleanup:
IDxDiagProvider_Release
(
pddp
);
}
static
void
test_EnumPropNames
(
void
)
{
HRESULT
hr
;
WCHAR
container
[
256
],
property
[
256
];
IDxDiagContainer
*
child
=
NULL
;
DWORD
count
,
index
,
propcount
;
static
const
WCHAR
testW
[]
=
{
't'
,
'e'
,
's'
,
't'
,
0
};
static
const
WCHAR
zerotestW
[]
=
{
0
,
'e'
,
's'
,
't'
,
0
};
if
(
!
create_root_IDxDiagContainer
())
{
skip
(
"Unable to create the root IDxDiagContainer
\n
"
);
return
;
}
/* Find a container with a non-zero number of properties. */
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_GetNumberOfProps
(
child
,
&
propcount
);
ok
(
hr
==
S_OK
,
"Expected IDxDiagContainer::GetNumberOfProps to return S_OK, got 0x%08x
\n
"
,
hr
);
if
(
!
propcount
)
{
IDxDiagContainer_Release
(
child
);
child
=
NULL
;
}
else
break
;
}
}
if
(
!
child
)
{
skip
(
"Unable to find a container with non-zero property count
\n
"
);
goto
cleanup
;
}
hr
=
IDxDiagContainer_EnumPropNames
(
child
,
~
0
,
NULL
,
0
);
ok
(
hr
==
E_INVALIDARG
,
"Expected IDxDiagContainer::EnumPropNames to return E_INVALIDARG, got 0x%08x
\n
"
,
hr
);
memcpy
(
property
,
testW
,
sizeof
(
testW
));
hr
=
IDxDiagContainer_EnumPropNames
(
child
,
~
0
,
property
,
0
);
ok
(
hr
==
E_INVALIDARG
,
"Expected IDxDiagContainer::EnumPropNames to return E_INVALIDARG, got 0x%08x
\n
"
,
hr
);
ok
(
!
memcmp
(
property
,
testW
,
sizeof
(
testW
)),
"Expected the property buffer to be unchanged, got %s
\n
"
,
wine_dbgstr_w
(
property
));
memcpy
(
property
,
testW
,
sizeof
(
testW
));
hr
=
IDxDiagContainer_EnumPropNames
(
child
,
~
0
,
property
,
sizeof
(
property
)
/
sizeof
(
WCHAR
));
ok
(
hr
==
E_INVALIDARG
,
"Expected IDxDiagContainer::EnumPropNames to return E_INVALIDARG, got 0x%08x
\n
"
,
hr
);
ok
(
!
memcmp
(
property
,
testW
,
sizeof
(
testW
)),
"Expected the property buffer to be unchanged, got %s
\n
"
,
wine_dbgstr_w
(
property
));
IDxDiagContainer_Release
(
child
);
cleanup:
IDxDiagContainer_Release
(
pddc
);
IDxDiagProvider_Release
(
pddp
);
}
START_TEST
(
container
)
{
CoInitialize
(
NULL
);
...
...
@@ -395,5 +475,6 @@ START_TEST(container)
test_EnumChildContainerNames
();
test_GetChildContainer
();
test_dot_parsing
();
test_EnumPropNames
();
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