Markus Amsler : d3d8: Handle volume container in d3d8.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Dec 18 05:34:42 CST 2006
Module: wine
Branch: master
Commit: 87083c9d71a8b562da6b6f7b6954480618ac4332
URL: http://source.winehq.org/git/wine.git/?a=commit;h=87083c9d71a8b562da6b6f7b6954480618ac4332
Author: Markus Amsler <markus.amsler at oribi.org>
Date: Mon Dec 18 00:17:45 2006 +0100
d3d8: Handle volume container in d3d8.
---
dlls/d3d8/d3d8_private.h | 3 +++
dlls/d3d8/volume.c | 25 ++++---------------------
2 files changed, 7 insertions(+), 21 deletions(-)
diff --git a/dlls/d3d8/d3d8_private.h b/dlls/d3d8/d3d8_private.h
index be27401..fe642a6 100644
--- a/dlls/d3d8/d3d8_private.h
+++ b/dlls/d3d8/d3d8_private.h
@@ -200,6 +200,9 @@ struct IDirect3DVolume8Impl
/* IDirect3DVolume8 fields */
IWineD3DVolume *wineD3DVolume;
+ /* The volume container */
+ IUnknown *container;
+
/* If set forward refcounting to this object */
IUnknown *forwardReference;
};
diff --git a/dlls/d3d8/volume.c b/dlls/d3d8/volume.c
index 0eba97a..205c66a 100644
--- a/dlls/d3d8/volume.c
+++ b/dlls/d3d8/volume.c
@@ -111,35 +111,17 @@ static HRESULT WINAPI IDirect3DVolume8Im
static HRESULT WINAPI IDirect3DVolume8Impl_GetContainer(LPDIRECT3DVOLUME8 iface, REFIID riid, void **ppContainer) {
IDirect3DVolume8Impl *This = (IDirect3DVolume8Impl *)iface;
- IWineD3DBase *wineD3DContainer = NULL;
- IUnknown *wineD3DContainerParent = NULL;
HRESULT res;
TRACE("(This %p, riid %s, ppContainer %p)\n", This, debugstr_guid(riid), ppContainer);
+ if (!This->container) return E_NOINTERFACE;
+
if (!ppContainer) {
ERR("Called without a valid ppContainer.\n");
}
- /* Get the WineD3D container. */
- res = IWineD3DVolume_GetContainer(This->wineD3DVolume, &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);
+ res = IUnknown_QueryInterface(This->container, riid, ppContainer);
TRACE("Returning ppContainer %p, *ppContainer %p\n", ppContainer, *ppContainer);
@@ -223,6 +205,7 @@ HRESULT WINAPI D3D8CB_CreateVolume(IUnkn
*ppVolume = NULL;
} else {
*ppVolume = (IWineD3DVolume *)object->wineD3DVolume;
+ object->container = pSuperior;
object->forwardReference = pSuperior;
}
TRACE("(%p) Created volume %p\n", This, *ppVolume);
More information about the wine-cvs
mailing list