Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
c245c6ed
Commit
c245c6ed
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: Initialize output pointer to NULL in IDxDiagContainer::GetChildContainer.
parent
fa9af5b6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
2 deletions
+73
-2
container.c
dlls/dxdiagn/container.c
+2
-2
container.c
dlls/dxdiagn/tests/container.c
+71
-0
No files found.
dlls/dxdiagn/container.c
View file @
c245c6ed
...
...
@@ -129,7 +129,7 @@ static HRESULT IDxDiagContainerImpl_GetChildContainerInternal(PDXDIAGCONTAINER i
static
HRESULT
WINAPI
IDxDiagContainerImpl_GetChildContainer
(
PDXDIAGCONTAINER
iface
,
LPCWSTR
pwszContainer
,
IDxDiagContainer
**
ppInstance
)
{
IDxDiagContainerImpl
*
This
=
(
IDxDiagContainerImpl
*
)
iface
;
IDxDiagContainer
*
pContainer
=
NULL
;
IDxDiagContainer
*
pContainer
=
(
PDXDIAGCONTAINER
)
This
;
LPWSTR
tmp
,
orig_tmp
;
INT
tmp_len
;
WCHAR
*
cur
;
...
...
@@ -141,7 +141,7 @@ static HRESULT WINAPI IDxDiagContainerImpl_GetChildContainer(PDXDIAGCONTAINER if
return
E_INVALIDARG
;
}
pContainer
=
(
PDXDIAGCONTAINER
)
This
;
*
ppInstance
=
NULL
;
tmp_len
=
strlenW
(
pwszContainer
)
+
1
;
orig_tmp
=
tmp
=
HeapAlloc
(
GetProcessHeap
(),
0
,
tmp_len
*
sizeof
(
WCHAR
));
...
...
dlls/dxdiagn/tests/container.c
View file @
c245c6ed
...
...
@@ -219,11 +219,82 @@ cleanup:
IDxDiagProvider_Release
(
pddp
);
}
static
void
test_GetChildContainer
(
void
)
{
HRESULT
hr
;
WCHAR
container
[
256
]
=
{
0
};
IDxDiagContainer
*
child
;
if
(
!
create_root_IDxDiagContainer
())
{
skip
(
"Unable to create the root IDxDiagContainer
\n
"
);
return
;
}
/* Test various combinations of invalid parameters. */
hr
=
IDxDiagContainer_GetChildContainer
(
pddc
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Expected IDxDiagContainer::GetChildContainer to return E_INVALIDARG, got 0x%08x
\n
"
,
hr
);
child
=
(
void
*
)
0xdeadbeef
;
hr
=
IDxDiagContainer_GetChildContainer
(
pddc
,
NULL
,
&
child
);
ok
(
hr
==
E_INVALIDARG
,
"Expected IDxDiagContainer::GetChildContainer to return E_INVALIDARG, got 0x%08x
\n
"
,
hr
);
ok
(
child
==
(
void
*
)
0xdeadbeef
,
"Expected output pointer to be unchanged, got %p
\n
"
,
child
);
hr
=
IDxDiagContainer_GetChildContainer
(
pddc
,
container
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Expected IDxDiagContainer::GetChildContainer to return E_INVALIDARG, got 0x%08x
\n
"
,
hr
);
child
=
(
void
*
)
0xdeadbeef
;
hr
=
IDxDiagContainer_GetChildContainer
(
pddc
,
container
,
&
child
);
ok
(
hr
==
E_INVALIDARG
,
"Expected IDxDiagContainer::GetChildContainer to return E_INVALIDARG, got 0x%08x
\n
"
,
hr
);
ok
(
child
==
NULL
,
"Expected output pointer to be NULL, got %p
\n
"
,
child
);
/* Get the name of a suitable child container. */
hr
=
IDxDiagContainer_EnumChildContainerNames
(
pddc
,
0
,
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
;
}
child
=
(
void
*
)
0xdeadbeef
;
hr
=
IDxDiagContainer_GetChildContainer
(
pddc
,
container
,
&
child
);
ok
(
hr
==
S_OK
,
"Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x
\n
"
,
hr
);
ok
(
child
!=
NULL
&&
child
!=
(
void
*
)
0xdeadbeef
,
"Expected a valid output pointer, got %p
\n
"
,
child
);
if
(
SUCCEEDED
(
hr
))
{
IDxDiagContainer
*
ptr
;
/* Show that IDxDiagContainer::GetChildContainer returns a different pointer
* for multiple calls for the same container name. */
hr
=
IDxDiagContainer_GetChildContainer
(
pddc
,
container
,
&
ptr
);
ok
(
hr
==
S_OK
,
"Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
todo_wine
ok
(
ptr
!=
child
,
"Expected the two pointers (%p vs. %p) to be unequal"
,
child
,
ptr
);
IDxDiagContainer_Release
(
ptr
);
IDxDiagContainer_Release
(
child
);
}
cleanup:
IDxDiagContainer_Release
(
pddc
);
IDxDiagProvider_Release
(
pddp
);
}
START_TEST
(
container
)
{
CoInitialize
(
NULL
);
test_GetNumberOfChildContainers
();
test_GetNumberOfProps
();
test_EnumChildContainerNames
();
test_GetChildContainer
();
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