diff --git a/dlls/d3dx9_36/tests/volume.c b/dlls/d3dx9_36/tests/volume.c index f3976c08b71..eb2877f7f2a 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 71b29375fab..0369f54c04a 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");