[12/13] WineD3D: Make sure volumes have memory allocated

Stefan Dösinger stefan at codeweavers.com
Tue Feb 20 16:02:30 CST 2007


This patch should fix potential crashes when locking volumes in 
WINED3DPOOL_DEFAULT. No app was found yet using that because putting volumes 
into the default pool isn't such a good idea.

Volumes locking needs some more work to be able to free the system memory copy 
once the data is in the opengl textures. This should help memory usage as 
volumes are rather huge.
-------------- next part --------------
From 824f5c00fde924c370b469325a46680281f78c15 Mon Sep 17 00:00:00 2001
From: Stefan Doesinger <stefan at codeweavers.com>
Date: Tue, 20 Feb 2007 21:54:13 +0100
Subject: [PATCH] WineD3D: Make sure volumes have memory allocated

---
 dlls/wined3d/volume.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index dc768e1..3fb3036 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -141,6 +141,10 @@ static HRESULT WINAPI IWineD3DVolumeImpl_LockBox(IWineD3DVolume *iface, WINED3DL
     IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface;
     FIXME("(%p) : pBox=%p stub\n", This, pBox);
 
+    if(!This->resource.allocatedMemory) {
+        This->resource.allocatedMemory = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->resource.size);
+    }
+
     /* fixme: should we really lock as such? */
     TRACE("(%p) : box=%p, output pbox=%p, allMem=%p\n", This, pBox, pLockedVolume, This->resource.allocatedMemory);
 
-- 
1.4.4.3



More information about the wine-patches mailing list