[PATCH 4/4] wined3d: Properly recreate the sysmem resource location in IWineD3DSurfaceImpl_SetMem().

Henri Verbeet hverbeet at codeweavers.com
Mon Nov 15 06:43:35 CST 2010


Otherwise we could end up with surfaces that have SFLAG_INSYSMEM set, but no
actual system memory allocated. This was exposed by
3bbe658ef1b2a992ad44cd9503ad65889a1c6896.
---
 dlls/wined3d/surface.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 485f255..69a9efd 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2631,10 +2631,13 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_SetMem(IWineD3DSurface *iface, void *M
         /* HeapMemory should be NULL already */
         if (This->resource.heapMemory)
             ERR("User pointer surface has heap memory allocated.\n");
-        This->flags &= ~SFLAG_USERPTR;
+        This->flags &= ~(SFLAG_USERPTR | SFLAG_INSYSMEM);
 
         if (This->flags & SFLAG_CLIENT)
             surface_release_client_storage(This);
+
+        surface_prepare_system_memory(This);
+        surface_modify_location(This, SFLAG_INSYSMEM, TRUE);
     }
     return WINED3D_OK;
 }
-- 
1.7.2.2




More information about the wine-patches mailing list