Module: wine Branch: master Commit: 421b7a17adbb06924332a25e959319d68323e18d URL: http://source.winehq.org/git/wine.git/?a=commit;h=421b7a17adbb06924332a25e95...
Author: Stefan Dösinger stefan@codeweavers.com Date: Mon Aug 26 02:01:26 2013 +0200
wined3d: Enforce volume mapping restrictions.
---
dlls/d3dx9_36/tests/volume.c | 2 +- dlls/wined3d/volume.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/dlls/d3dx9_36/tests/volume.c b/dlls/d3dx9_36/tests/volume.c index f3976c0..eb2877f 100644 --- a/dlls/d3dx9_36/tests/volume.c +++ b/dlls/d3dx9_36/tests/volume.c @@ -184,7 +184,7 @@ static void test_D3DXLoadVolumeFromMemory(IDirect3DDevice9 *device) set_box(&src_box, 0, 0, 4, 1, 0, 4); set_box(&dst_box, 0, 0, 4, 1, 0, 4); hr = D3DXLoadVolumeFromMemory(volume, NULL, &dst_box, pixels, D3DFMT_A8R8G8B8, 16, 16, NULL, &src_box, D3DX_DEFAULT, 0); - todo_wine ok(hr == D3DERR_INVALIDCALL, "D3DXLoadVolumeFromMemory returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL); + ok(hr == D3DERR_INVALIDCALL, "D3DXLoadVolumeFromMemory returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL);
IDirect3DVolume9_Release(volume); IDirect3DVolumeTexture9_Release(volume_texture); diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c index 71b2937..0369f54 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c @@ -373,6 +373,13 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, TRACE("volume %p, map_desc %p, box %p, flags %#x.\n", volume, map_desc, box, flags);
+ if (!(volume->resource.access_flags & WINED3D_RESOURCE_ACCESS_CPU)) + { + WARN("Volume %p is not CPU accessible.\n", volume); + map_desc->data = NULL; + return WINED3DERR_INVALIDCALL; + } + if (!volume_prepare_system_memory(volume)) { WARN("Out of memory.\n");