Commit 7f7844a7 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3d10core: Implement d3d10_device_SetPrivateDataInterface().

parent c9fd72d8
...@@ -1301,9 +1301,17 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_SetPrivateData(ID3D10Device1 *ifac ...@@ -1301,9 +1301,17 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_SetPrivateData(ID3D10Device1 *ifac
static HRESULT STDMETHODCALLTYPE d3d10_device_SetPrivateDataInterface(ID3D10Device1 *iface, static HRESULT STDMETHODCALLTYPE d3d10_device_SetPrivateDataInterface(ID3D10Device1 *iface,
REFGUID guid, const IUnknown *data) REFGUID guid, const IUnknown *data)
{ {
FIXME("iface %p, guid %s, data %p stub!\n", iface, debugstr_guid(guid), data); IDXGIDevice *dxgi_device;
HRESULT hr;
return E_NOTIMPL; TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
if (FAILED(hr = ID3D10Device1_QueryInterface(iface, &IID_IDXGIDevice, (void **)&dxgi_device)))
return hr;
hr = IDXGIDevice_SetPrivateDataInterface(dxgi_device, guid, data);
IDXGIDevice_Release(dxgi_device);
return hr;
} }
static void STDMETHODCALLTYPE d3d10_device_ClearState(ID3D10Device1 *iface) static void STDMETHODCALLTYPE d3d10_device_ClearState(ID3D10Device1 *iface)
......
...@@ -2551,14 +2551,14 @@ static void test_private_data(void) ...@@ -2551,14 +2551,14 @@ static void test_private_data(void)
hr = ID3D10Device_SetPrivateData(device, &test_guid, 0, NULL); hr = ID3D10Device_SetPrivateData(device, &test_guid, 0, NULL);
ok(hr == S_FALSE, "Got unexpected hr %#x.\n", hr); ok(hr == S_FALSE, "Got unexpected hr %#x.\n", hr);
hr = ID3D10Device_SetPrivateDataInterface(device, &test_guid, NULL); hr = ID3D10Device_SetPrivateDataInterface(device, &test_guid, NULL);
todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
hr = ID3D10Device_SetPrivateData(device, &test_guid, ~0u, NULL); hr = ID3D10Device_SetPrivateData(device, &test_guid, ~0u, NULL);
todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
hr = ID3D10Device_SetPrivateData(device, &test_guid, ~0u, NULL); hr = ID3D10Device_SetPrivateData(device, &test_guid, ~0u, NULL);
ok(hr == S_FALSE, "Got unexpected hr %#x.\n", hr); ok(hr == S_FALSE, "Got unexpected hr %#x.\n", hr);
hr = ID3D10Device_SetPrivateDataInterface(device, &test_guid, NULL); hr = ID3D10Device_SetPrivateDataInterface(device, &test_guid, NULL);
todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
size = sizeof(ptr) * 2; size = sizeof(ptr) * 2;
ptr = (IUnknown *)0xdeadbeef; ptr = (IUnknown *)0xdeadbeef;
hr = ID3D10Device_GetPrivateData(device, &test_guid, &size, &ptr); hr = ID3D10Device_GetPrivateData(device, &test_guid, &size, &ptr);
...@@ -2571,33 +2571,33 @@ static void test_private_data(void) ...@@ -2571,33 +2571,33 @@ static void test_private_data(void)
size = sizeof(ptr) * 2; size = sizeof(ptr) * 2;
ptr = (IUnknown *)0xdeadbeef; ptr = (IUnknown *)0xdeadbeef;
hr = IDXGIDevice_GetPrivateData(dxgi_device, &test_guid, &size, &ptr); hr = IDXGIDevice_GetPrivateData(dxgi_device, &test_guid, &size, &ptr);
todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
todo_wine ok(!ptr, "Got unexpected pointer %p.\n", ptr); ok(!ptr, "Got unexpected pointer %p.\n", ptr);
todo_wine ok(size == sizeof(IUnknown *), "Got unexpected size %u.\n", size); ok(size == sizeof(IUnknown *), "Got unexpected size %u.\n", size);
IDXGIDevice_Release(dxgi_device); IDXGIDevice_Release(dxgi_device);
refcount = get_refcount((IUnknown *)test_object); refcount = get_refcount((IUnknown *)test_object);
hr = ID3D10Device_SetPrivateDataInterface(device, &test_guid, hr = ID3D10Device_SetPrivateDataInterface(device, &test_guid,
(IUnknown *)test_object); (IUnknown *)test_object);
todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
expected_refcount = refcount + 1; expected_refcount = refcount + 1;
refcount = get_refcount((IUnknown *)test_object); refcount = get_refcount((IUnknown *)test_object);
todo_wine ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount);
hr = ID3D10Device_SetPrivateDataInterface(device, &test_guid, hr = ID3D10Device_SetPrivateDataInterface(device, &test_guid,
(IUnknown *)test_object); (IUnknown *)test_object);
todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
refcount = get_refcount((IUnknown *)test_object); refcount = get_refcount((IUnknown *)test_object);
todo_wine ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount);
hr = ID3D10Device_SetPrivateDataInterface(device, &test_guid, NULL); hr = ID3D10Device_SetPrivateDataInterface(device, &test_guid, NULL);
todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
--expected_refcount; --expected_refcount;
refcount = get_refcount((IUnknown *)test_object); refcount = get_refcount((IUnknown *)test_object);
ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount);
hr = ID3D10Device_SetPrivateDataInterface(device, &test_guid, hr = ID3D10Device_SetPrivateDataInterface(device, &test_guid,
(IUnknown *)test_object); (IUnknown *)test_object);
todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
size = sizeof(data); size = sizeof(data);
hr = ID3D10Device_SetPrivateData(device, &test_guid, size, data); hr = ID3D10Device_SetPrivateData(device, &test_guid, size, data);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
...@@ -2610,7 +2610,7 @@ static void test_private_data(void) ...@@ -2610,7 +2610,7 @@ static void test_private_data(void)
hr = ID3D10Device_SetPrivateDataInterface(device, &test_guid, hr = ID3D10Device_SetPrivateDataInterface(device, &test_guid,
(IUnknown *)test_object); (IUnknown *)test_object);
todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
++expected_refcount; ++expected_refcount;
size = 2 * sizeof(ptr); size = 2 * sizeof(ptr);
ptr = NULL; ptr = NULL;
...@@ -2634,7 +2634,7 @@ static void test_private_data(void) ...@@ -2634,7 +2634,7 @@ static void test_private_data(void)
todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
todo_wine ok(size == sizeof(device), "Got unexpected size %u.\n", size); todo_wine ok(size == sizeof(device), "Got unexpected size %u.\n", size);
refcount = get_refcount((IUnknown *)test_object); refcount = get_refcount((IUnknown *)test_object);
todo_wine ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount);
size = 1; size = 1;
hr = ID3D10Device_GetPrivateData(device, &test_guid, &size, &ptr); hr = ID3D10Device_GetPrivateData(device, &test_guid, &size, &ptr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment