Henri Verbeet : wined3d: Handle client storage in surface_init_sysmem().
Alexandre Julliard
julliard at winehq.org
Wed Dec 21 12:38:07 CST 2011
Module: wine
Branch: master
Commit: 317d5406d57ad5d3c9e2243e69f38ba044a558b6
URL: http://source.winehq.org/git/wine.git/?a=commit;h=317d5406d57ad5d3c9e2243e69f38ba044a558b6
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Tue Dec 20 21:42:11 2011 +0100
wined3d: Handle client storage in surface_init_sysmem().
---
dlls/wined3d/surface.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 998d28e..48d271f 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3956,13 +3956,21 @@ BOOL surface_init_sysmem(struct wined3d_surface *surface)
{
if (!surface->resource.allocatedMemory)
{
- surface->resource.heapMemory = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
- surface->resource.size + RESOURCE_ALIGNMENT);
if (!surface->resource.heapMemory)
{
- ERR("Out of memory\n");
- return FALSE;
+ if (!(surface->resource.heapMemory = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
+ surface->resource.size + RESOURCE_ALIGNMENT)))
+ {
+ ERR("Failed to allocate memory.\n");
+ return FALSE;
+ }
+ }
+ else if (!(surface->flags & SFLAG_CLIENT))
+ {
+ ERR("Surface %p has heapMemory %p and flags %#x.\n",
+ surface, surface->resource.heapMemory, surface->flags);
}
+
surface->resource.allocatedMemory =
(BYTE *)(((ULONG_PTR)surface->resource.heapMemory + (RESOURCE_ALIGNMENT - 1)) & ~(RESOURCE_ALIGNMENT - 1));
}
More information about the wine-cvs
mailing list