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
0a3f4173
Commit
0a3f4173
authored
Dec 05, 2006
by
Markus Amsler
Committed by
Alexandre Julliard
Dec 06, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: Handle volume refcount forwarding in d3d8.
parent
0d725490
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
11 deletions
+23
-11
d3d8_private.h
dlls/d3d8/d3d8_private.h
+5
-0
volume.c
dlls/d3d8/volume.c
+17
-10
volumetexture.c
dlls/d3d8/volumetexture.c
+1
-1
No files found.
dlls/d3d8/d3d8_private.h
View file @
0a3f4173
...
@@ -196,6 +196,9 @@ struct IDirect3DVolume8Impl
...
@@ -196,6 +196,9 @@ struct IDirect3DVolume8Impl
/* IDirect3DVolume8 fields */
/* IDirect3DVolume8 fields */
IWineD3DVolume
*
wineD3DVolume
;
IWineD3DVolume
*
wineD3DVolume
;
/* If set forward refcounting to this object */
IUnknown
*
forwardReference
;
};
};
/* ------------------- */
/* ------------------- */
...
@@ -598,4 +601,6 @@ extern ULONG WINAPI D3D8CB_DestroyDepthStencilSurface (IWineD3DSurface *pSurface
...
@@ -598,4 +601,6 @@ extern ULONG WINAPI D3D8CB_DestroyDepthStencilSurface (IWineD3DSurface *pSurface
extern
ULONG
WINAPI
D3D8CB_DestroySurface
(
IWineD3DSurface
*
pSurface
);
extern
ULONG
WINAPI
D3D8CB_DestroySurface
(
IWineD3DSurface
*
pSurface
);
extern
ULONG
WINAPI
D3D8CB_DestroyVolume
(
IWineD3DVolume
*
pVolume
);
#endif
/* __WINE_D3DX8_PRIVATE_H */
#endif
/* __WINE_D3DX8_PRIVATE_H */
dlls/d3d8/volume.c
View file @
0a3f4173
...
@@ -41,15 +41,13 @@ static HRESULT WINAPI IDirect3DVolume8Impl_QueryInterface(LPDIRECT3DVOLUME8 ifac
...
@@ -41,15 +41,13 @@ static HRESULT WINAPI IDirect3DVolume8Impl_QueryInterface(LPDIRECT3DVOLUME8 ifac
static
ULONG
WINAPI
IDirect3DVolume8Impl_AddRef
(
LPDIRECT3DVOLUME8
iface
)
{
static
ULONG
WINAPI
IDirect3DVolume8Impl_AddRef
(
LPDIRECT3DVOLUME8
iface
)
{
IDirect3DVolume8Impl
*
This
=
(
IDirect3DVolume8Impl
*
)
iface
;
IDirect3DVolume8Impl
*
This
=
(
IDirect3DVolume8Impl
*
)
iface
;
IUnknown
*
containerParent
=
NULL
;
TRACE
(
"(%p)
\n
"
,
This
);
TRACE
(
"(%p)
\n
"
,
This
);
IWineD3DVolume_GetContainerParent
(
This
->
wineD3DVolume
,
&
containerParent
);
if
(
This
->
forwardReference
)
{
if
(
containerParent
)
{
/* Forward to the containerParent */
/* Forward to the containerParent */
TRACE
(
"(%p) : Forwarding to %p
\n
"
,
This
,
containerParent
);
TRACE
(
"(%p) : Forwarding to %p
\n
"
,
This
,
This
->
forwardReference
);
return
IUnknown_AddRef
(
containerParent
);
return
IUnknown_AddRef
(
This
->
forwardReference
);
}
else
{
}
else
{
/* No container, handle our own refcounting */
/* No container, handle our own refcounting */
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
...
@@ -60,15 +58,13 @@ static ULONG WINAPI IDirect3DVolume8Impl_AddRef(LPDIRECT3DVOLUME8 iface) {
...
@@ -60,15 +58,13 @@ static ULONG WINAPI IDirect3DVolume8Impl_AddRef(LPDIRECT3DVOLUME8 iface) {
static
ULONG
WINAPI
IDirect3DVolume8Impl_Release
(
LPDIRECT3DVOLUME8
iface
)
{
static
ULONG
WINAPI
IDirect3DVolume8Impl_Release
(
LPDIRECT3DVOLUME8
iface
)
{
IDirect3DVolume8Impl
*
This
=
(
IDirect3DVolume8Impl
*
)
iface
;
IDirect3DVolume8Impl
*
This
=
(
IDirect3DVolume8Impl
*
)
iface
;
IUnknown
*
containerParent
=
NULL
;
TRACE
(
"(%p)
\n
"
,
This
);
TRACE
(
"(%p)
\n
"
,
This
);
IWineD3DVolume_GetContainerParent
(
This
->
wineD3DVolume
,
&
containerParent
);
if
(
This
->
forwardReference
)
{
if
(
containerParent
)
{
/* Forward to the containerParent */
/* Forward to the containerParent */
TRACE
(
"(%p) : Forwarding to %p
\n
"
,
This
,
containerParent
);
TRACE
(
"(%p) : Forwarding to %p
\n
"
,
This
,
This
->
forwardReference
);
return
IUnknown_Release
(
containerParent
);
return
IUnknown_Release
(
This
->
forwardReference
);
}
}
else
{
else
{
/* No container, handle our own refcounting */
/* No container, handle our own refcounting */
...
@@ -227,7 +223,18 @@ HRESULT WINAPI D3D8CB_CreateVolume(IUnknown *pDevice, IUnknown *pSuperior, UINT
...
@@ -227,7 +223,18 @@ HRESULT WINAPI D3D8CB_CreateVolume(IUnknown *pDevice, IUnknown *pSuperior, UINT
*
ppVolume
=
NULL
;
*
ppVolume
=
NULL
;
}
else
{
}
else
{
*
ppVolume
=
(
IWineD3DVolume
*
)
object
->
wineD3DVolume
;
*
ppVolume
=
(
IWineD3DVolume
*
)
object
->
wineD3DVolume
;
object
->
forwardReference
=
pSuperior
;
}
}
TRACE
(
"(%p) Created volume %p
\n
"
,
This
,
*
ppVolume
);
TRACE
(
"(%p) Created volume %p
\n
"
,
This
,
*
ppVolume
);
return
hrc
;
return
hrc
;
}
}
ULONG
WINAPI
D3D8CB_DestroyVolume
(
IWineD3DVolume
*
pVolume
)
{
IDirect3DVolume8Impl
*
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
IDirect3DVolume8_Release
((
IDirect3DVolume8
*
)
volumeParent
);
}
dlls/d3d8/volumetexture.c
View file @
0a3f4173
...
@@ -57,7 +57,7 @@ static ULONG WINAPI IDirect3DVolumeTexture8Impl_Release(LPDIRECT3DVOLUMETEXTURE8
...
@@ -57,7 +57,7 @@ static ULONG WINAPI IDirect3DVolumeTexture8Impl_Release(LPDIRECT3DVOLUMETEXTURE8
TRACE
(
"(%p) : ReleaseRef to %d
\n
"
,
This
,
ref
);
TRACE
(
"(%p) : ReleaseRef to %d
\n
"
,
This
,
ref
);
if
(
ref
==
0
)
{
if
(
ref
==
0
)
{
IWineD3DVolumeTexture_
Release
(
This
->
wineD3DVolumeTextur
e
);
IWineD3DVolumeTexture_
Destroy
(
This
->
wineD3DVolumeTexture
,
D3D8CB_DestroyVolum
e
);
IUnknown_Release
(
This
->
parentDevice
);
IUnknown_Release
(
This
->
parentDevice
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
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