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
2200f3e2
Commit
2200f3e2
authored
Feb 07, 2006
by
H. Verbeet
Committed by
Alexandre Julliard
Feb 07, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d/d3d9: Cleanup GetContainer for surfaces.
parent
78904aab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
43 deletions
+42
-43
surface.c
dlls/d3d9/surface.c
+27
-36
surface.c
dlls/wined3d/surface.c
+15
-7
No files found.
dlls/d3d9/surface.c
View file @
2200f3e2
...
...
@@ -114,47 +114,38 @@ D3DRESOURCETYPE WINAPI IDirect3DSurface9Impl_GetType(LPDIRECT3DSURFACE9 iface) {
/* IDirect3DSurface9 Interface follow: */
HRESULT
WINAPI
IDirect3DSurface9Impl_GetContainer
(
LPDIRECT3DSURFACE9
iface
,
REFIID
riid
,
void
**
ppContainer
)
{
IDirect3DSurface9Impl
*
This
=
(
IDirect3DSurface9Impl
*
)
iface
;
IWineD3DBase
*
wineD3DContainer
=
NULL
;
IUnknown
*
wineD3DContainerParent
=
NULL
;
HRESULT
res
;
IUnknown
*
IWineContainer
=
NULL
;
TRACE
(
"(
%p) Relay
\n
"
,
This
);
TRACE
(
"(
This %p, riid %s, ppContainer %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppContainer
);
/* The container returned from IWineD3DSurface_GetContainer is either an IWineD3DDevice,
one of the subclasses of IWineD3DBaseTexture or an IWineD3DSwapChain */
/* Get the IUnknown container. */
res
=
IWineD3DSurface_GetContainer
(
This
->
wineD3DSurface
,
&
IID_IUnknown
,
(
void
**
)
&
IWineContainer
);
if
(
res
==
D3D_OK
&&
IWineContainer
!=
NULL
)
{
/* Now find out what kind of container it is (so that we can get its parent)*/
IUnknown
*
IUnknownParent
=
NULL
;
IUnknown
*
myContainer
=
NULL
;
if
(
D3D_OK
==
IUnknown_QueryInterface
(
IWineContainer
,
&
IID_IWineD3DDevice
,
(
void
**
)
&
myContainer
)){
IWineD3DDevice_GetParent
((
IWineD3DDevice
*
)
IWineContainer
,
&
IUnknownParent
);
IUnknown_Release
(
myContainer
);
}
else
if
(
D3D_OK
==
IUnknown_QueryInterface
(
IWineContainer
,
&
IID_IWineD3DBaseTexture
,
(
void
**
)
&
myContainer
)){
IWineD3DBaseTexture_GetParent
((
IWineD3DBaseTexture
*
)
IWineContainer
,
&
IUnknownParent
);
IUnknown_Release
(
myContainer
);
}
else
if
(
D3D_OK
==
IUnknown_QueryInterface
(
IWineContainer
,
&
IID_IWineD3DSwapChain
,
(
void
**
)
&
myContainer
)){
IWineD3DSwapChain_GetParent
((
IWineD3DSwapChain
*
)
IWineContainer
,
&
IUnknownParent
);
IUnknown_Release
(
myContainer
);
}
else
{
FIXME
(
"Container is of unknown interface
\n
"
);
}
/* Tidy up.. */
IUnknown_Release
((
IWineD3DDevice
*
)
IWineContainer
);
/* Now, query the interface of the parent for the riid */
if
(
IUnknownParent
!=
NULL
){
res
=
IUnknown_QueryInterface
(
IUnknownParent
,
riid
,
ppContainer
);
/* Tidy up.. */
IUnknown_Release
(
IUnknownParent
);
}
if
(
!
ppContainer
)
{
ERR
(
"Called without a valid ppContainer
\n
"
);
}
TRACE
(
"(%p) : returning %p
\n
"
,
This
,
*
ppContainer
);
/* Get the WineD3D container. */
res
=
IWineD3DSurface_GetContainer
(
This
->
wineD3DSurface
,
&
IID_IWineD3DBase
,
(
void
**
)
&
wineD3DContainer
);
if
(
res
!=
D3D_OK
)
return
res
;
if
(
!
wineD3DContainer
)
{
ERR
(
"IWineD3DSurface_GetContainer should never return NULL
\n
"
);
}
/* Get the parent */
IWineD3DBase_GetParent
(
wineD3DContainer
,
&
wineD3DContainerParent
);
IUnknown_Release
(
wineD3DContainer
);
if
(
!
wineD3DContainerParent
)
{
ERR
(
"IWineD3DBase_GetParent should never return NULL
\n
"
);
}
/* Now, query the interface of the parent for the riid */
res
=
IUnknown_QueryInterface
(
wineD3DContainerParent
,
riid
,
ppContainer
);
IUnknown_Release
(
wineD3DContainerParent
);
TRACE
(
"Returning ppContainer %p, *ppContainer %p
\n
"
,
ppContainer
,
*
ppContainer
);
return
res
;
}
...
...
dlls/wined3d/surface.c
View file @
2200f3e2
...
...
@@ -175,19 +175,27 @@ HRESULT WINAPI IWineD3DSurfaceImpl_GetParent(IWineD3DSurface *iface, IUnknown **
HRESULT
WINAPI
IWineD3DSurfaceImpl_GetContainer
(
IWineD3DSurface
*
iface
,
REFIID
riid
,
void
**
ppContainer
)
{
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
HRESULT
hr
;
if
(
ppContainer
==
NULL
)
{
ERR
(
"Get container called witout a null ppContainer
\n
"
);
return
E_NOINTERFACE
;
IWineD3DBase
*
container
=
0
;
TRACE
(
"(This %p, riid %s, ppContainer %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppContainer
);
if
(
!
ppContainer
)
{
ERR
(
"Called without a valid ppContainer.
\n
"
);
}
TRACE
(
"(%p) : Relaying to queryInterface %p %p
\n
"
,
This
,
ppContainer
,
*
ppContainer
);
/** From MSDN:
* If the surface is created using CreateImageSurface/CreateOffscreenPlainSurface, CreateRenderTarget,
* or CreateDepthStencilSurface, the surface is considered stand alone. In this case,
* GetContainer will return the Direct3D device used to create the surface.
*/
hr
=
IUnknown_QueryInterface
(
This
->
container
,
riid
,
ppContainer
);
return
hr
;
if
(
This
->
container
)
{
container
=
This
->
container
;
}
else
{
IWineD3DSurface_GetDevice
(
iface
,
(
IWineD3DDevice
**
)
&
container
);
}
TRACE
(
"Relaying to QueryInterface
\n
"
);
return
IUnknown_QueryInterface
(
container
,
riid
,
ppContainer
);
}
HRESULT
WINAPI
IWineD3DSurfaceImpl_GetDesc
(
IWineD3DSurface
*
iface
,
WINED3DSURFACE_DESC
*
pDesc
)
{
...
...
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