Module: wine Branch: master Commit: 8d23f13b1655c34f1f4e524f69d251611202269a URL: http://source.winehq.org/git/wine.git/?a=commit;h=8d23f13b1655c34f1f4e524f69...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Fri Jun 13 10:01:21 2014 +0200
d3d10core: Implement d3d10_device_GetDeviceRemovedReason().
---
dlls/d3d10core/device.c | 7 +++++-- dlls/d3d10core/tests/device.c | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d10core/device.c b/dlls/d3d10core/device.c index 1aa5e8b..722b5aa 100644 --- a/dlls/d3d10core/device.c +++ b/dlls/d3d10core/device.c @@ -1007,9 +1007,12 @@ static void STDMETHODCALLTYPE d3d10_device_RSGetScissorRects(ID3D10Device1 *ifac
static HRESULT STDMETHODCALLTYPE d3d10_device_GetDeviceRemovedReason(ID3D10Device1 *iface) { - FIXME("iface %p stub!\n", iface); + TRACE("iface %p.\n", iface);
- return E_NOTIMPL; + /* In the current implementation the device is never removed, so we can + * just return S_OK here. */ + + return S_OK; }
static HRESULT STDMETHODCALLTYPE d3d10_device_SetExceptionMode(ID3D10Device1 *iface, UINT flags) diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index 8fb62a0..d761dae 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -880,6 +880,27 @@ static void test_create_predicate(void) ok(!refcount, "Device has %u references left.\n", refcount); }
+static void test_device_removed_reason(void) +{ + ID3D10Device *device; + ULONG refcount; + HRESULT hr; + + if (!(device = create_device())) + { + skip("Failed to create device, skipping tests.\n"); + return; + } + + hr = ID3D10Device_GetDeviceRemovedReason(device); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = ID3D10Device_GetDeviceRemovedReason(device); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + refcount = ID3D10Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + START_TEST(device) { test_create_texture2d(); @@ -893,4 +914,5 @@ START_TEST(device) test_create_depthstencil_state(); test_create_rasterizer_state(); test_create_predicate(); + test_device_removed_reason(); }