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
1fe904bd
Commit
1fe904bd
authored
Feb 01, 2011
by
Andrew Nguyen
Committed by
Alexandre Julliard
Feb 01, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxdiagn: Avoid caching a single instance of the root container.
parent
c99e0fbc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
10 deletions
+19
-10
dxdiag_private.h
dlls/dxdiagn/dxdiag_private.h
+0
-1
provider.c
dlls/dxdiagn/provider.c
+11
-8
provider.c
dlls/dxdiagn/tests/provider.c
+8
-1
No files found.
dlls/dxdiagn/dxdiag_private.h
View file @
1fe904bd
...
...
@@ -48,7 +48,6 @@ struct IDxDiagProviderImpl {
/* IDxDiagProvider fields */
BOOL
init
;
DXDIAG_INIT_PARAMS
params
;
IDxDiagContainer
*
pRootContainer
;
};
/* ---------------- */
...
...
dlls/dxdiagn/provider.c
View file @
1fe904bd
...
...
@@ -107,21 +107,24 @@ static HRESULT WINAPI IDxDiagProviderImpl_Initialize(PDXDIAGPROVIDER iface, DXDI
}
static
HRESULT
WINAPI
IDxDiagProviderImpl_GetRootContainer
(
PDXDIAGPROVIDER
iface
,
IDxDiagContainer
**
ppInstance
)
{
HRESULT
hr
=
S_OK
;
HRESULT
hr
;
IDxDiagProviderImpl
*
This
=
(
IDxDiagProviderImpl
*
)
iface
;
IDxDiagContainer
*
root
;
TRACE
(
"(%p,%p)
\n
"
,
iface
,
ppInstance
);
if
(
FALSE
==
This
->
init
)
{
return
CO_E_NOTINITIALIZED
;
}
if
(
NULL
==
This
->
pRootContainer
)
{
hr
=
DXDiag_CreateDXDiagContainer
(
&
IID_IDxDiagContainer
,
(
void
**
)
&
This
->
pRootContainer
);
if
(
FAILED
(
hr
))
{
return
hr
;
}
hr
=
DXDiag_InitRootDXDiagContainer
(
This
->
pRootContainer
);
hr
=
DXDiag_CreateDXDiagContainer
(
&
IID_IDxDiagContainer
,
(
void
**
)
&
root
);
if
(
FAILED
(
hr
))
{
return
hr
;
}
return
IDxDiagContainerImpl_QueryInterface
((
PDXDIAGCONTAINER
)
This
->
pRootContainer
,
&
IID_IDxDiagContainer
,
(
void
**
)
ppInstance
);
DXDiag_InitRootDXDiagContainer
(
root
);
return
IDxDiagContainerImpl_QueryInterface
(
root
,
&
IID_IDxDiagContainer
,
(
void
**
)
ppInstance
);
}
static
const
IDxDiagProviderVtbl
DxDiagProvider_Vtbl
=
...
...
dlls/dxdiagn/tests/provider.c
View file @
1fe904bd
...
...
@@ -94,7 +94,7 @@ static void test_GetRootContainer(void)
{
HRESULT
hr
;
IDxDiagProvider
*
pddp
;
IDxDiagContainer
*
pddc
;
IDxDiagContainer
*
pddc
,
*
pddc2
;
DXDIAG_INIT_PARAMS
params
;
hr
=
CoCreateInstance
(
&
CLSID_DxDiagProvider
,
NULL
,
CLSCTX_INPROC_SERVER
,
...
...
@@ -140,6 +140,13 @@ static void test_GetRootContainer(void)
hr
=
IDxDiagProvider_GetRootContainer
(
pddp
,
&
pddc
);
ok
(
hr
==
S_OK
,
"Expected IDxDiagProvider::GetRootContainer to return S_OK, got %x
\n
"
,
hr
);
/* IDxDiagProvider::GetRootContainer creates new instances of the root
* container rather than maintain a static root container. */
hr
=
IDxDiagProvider_GetRootContainer
(
pddp
,
&
pddc2
);
ok
(
hr
==
S_OK
,
"Expected IDxDiagProvider::GetRootContainer to return S_OK, got %x
\n
"
,
hr
);
ok
(
pddc
!=
pddc2
,
"Expected the two pointers (%p vs. %p) to be unequal
\n
"
,
pddc
,
pddc2
);
IDxDiagContainer_Release
(
pddc2
);
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