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
63e23995
Commit
63e23995
authored
Dec 18, 2006
by
Markus Amsler
Committed by
Alexandre Julliard
Dec 18, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Handle volume refcount forwarding in d3d9.
parent
04dcffe3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
14 deletions
+25
-14
d3d9_private.h
dlls/d3d9/d3d9_private.h
+5
-1
volume.c
dlls/d3d9/volume.c
+19
-12
volumetexture.c
dlls/d3d9/volumetexture.c
+1
-1
No files found.
dlls/d3d9/d3d9_private.h
View file @
63e23995
...
...
@@ -235,7 +235,9 @@ typedef struct IDirect3DVolume9Impl
/* IDirect3DVolume9 fields */
IWineD3DVolume
*
wineD3DVolume
;
/* If set forward refcounting to this object */
IUnknown
*
forwardReference
;
}
IDirect3DVolume9Impl
;
/* ------------------- */
...
...
@@ -548,4 +550,6 @@ extern ULONG WINAPI D3D9CB_DestroyDepthStencilSurface (IWineD3DSurface *pSurface
extern
ULONG
WINAPI
D3D9CB_DestroySurface
(
IWineD3DSurface
*
pSurface
);
extern
ULONG
WINAPI
D3D9CB_DestroyVolume
(
IWineD3DVolume
*
pVolume
);
#endif
/* __WINE_D3D9_PRIVATE_H */
dlls/d3d9/volume.c
View file @
63e23995
...
...
@@ -42,15 +42,13 @@ static HRESULT WINAPI IDirect3DVolume9Impl_QueryInterface(LPDIRECT3DVOLUME9 ifac
static
ULONG
WINAPI
IDirect3DVolume9Impl_AddRef
(
LPDIRECT3DVOLUME9
iface
)
{
IDirect3DVolume9Impl
*
This
=
(
IDirect3DVolume9Impl
*
)
iface
;
IUnknown
*
containerParent
=
NULL
;
TRACE
(
"(%p)
\n
"
,
This
);
IWineD3DVolume_GetContainerParent
(
This
->
wineD3DVolume
,
&
containerParent
);
if
(
containerParent
)
{
/* Forward to the containerParent */
TRACE
(
"(%p) : Forwarding to %p
\n
"
,
This
,
containerParent
);
return
IUnknown_AddRef
(
containerParent
);
if
(
This
->
forwardReference
)
{
/* Forward refcounting */
TRACE
(
"(%p) : Forwarding to %p
\n
"
,
This
,
This
->
forwardReference
);
return
IUnknown_AddRef
(
This
->
forwardReference
);
}
else
{
/* No container, handle our own refcounting */
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
...
...
@@ -61,15 +59,13 @@ static ULONG WINAPI IDirect3DVolume9Impl_AddRef(LPDIRECT3DVOLUME9 iface) {
static
ULONG
WINAPI
IDirect3DVolume9Impl_Release
(
LPDIRECT3DVOLUME9
iface
)
{
IDirect3DVolume9Impl
*
This
=
(
IDirect3DVolume9Impl
*
)
iface
;
IUnknown
*
containerParent
=
NULL
;
TRACE
(
"(%p)
\n
"
,
This
);
IWineD3DVolume_GetContainerParent
(
This
->
wineD3DVolume
,
&
containerParent
);
if
(
containerParent
)
{
/* Forward to the containerParent */
TRACE
(
"(%p) : Forwarding to %p
\n
"
,
This
,
containerParent
);
return
IUnknown_Release
(
containerParent
);
if
(
This
->
forwardReference
)
{
/* Forward refcounting */
TRACE
(
"(%p) : Forwarding to %p
\n
"
,
This
,
This
->
forwardReference
);
return
IUnknown_Release
(
This
->
forwardReference
);
}
else
{
/* No container, handle our own refcounting */
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
...
...
@@ -228,7 +224,18 @@ HRESULT WINAPI D3D9CB_CreateVolume(IUnknown *pDevice, IUnknown *pSuperior, UINT
*
ppVolume
=
NULL
;
}
else
{
*
ppVolume
=
(
IWineD3DVolume
*
)
object
->
wineD3DVolume
;
object
->
forwardReference
=
pSuperior
;
}
TRACE
(
"(%p) Created volume %p
\n
"
,
This
,
*
ppVolume
);
return
hrc
;
}
ULONG
WINAPI
D3D9CB_DestroyVolume
(
IWineD3DVolume
*
pVolume
)
{
IDirect3DVolume9Impl
*
volumeParent
;
IWineD3DVolume_GetParent
(
pVolume
,
(
IUnknown
**
)
&
volumeParent
);
/* GetParent's AddRef was forwarded to an object in destruction.
* Releasing it here again would cause an endless recursion. */
volumeParent
->
forwardReference
=
NULL
;
return
IDirect3DVolume9_Release
((
IDirect3DVolume9
*
)
volumeParent
);
}
dlls/d3d9/volumetexture.c
View file @
63e23995
...
...
@@ -58,7 +58,7 @@ static ULONG WINAPI IDirect3DVolumeTexture9Impl_Release(LPDIRECT3DVOLUMETEXTURE9
TRACE
(
"(%p) : ReleaseRef to %d
\n
"
,
This
,
ref
);
if
(
ref
==
0
)
{
IWineD3DVolumeTexture_
Release
(
This
->
wineD3DVolumeTextur
e
);
IWineD3DVolumeTexture_
Destroy
(
This
->
wineD3DVolumeTexture
,
D3D9CB_DestroyVolum
e
);
IUnknown_Release
(
This
->
parentDevice
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
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