Module: wine Branch: master Commit: 8b1c1edb6b29d68ec70043eb57ac74ea7b13e73a URL: http://source.winehq.org/git/wine.git/?a=commit;h=8b1c1edb6b29d68ec70043eb57...
Author: Andrew Nguyen anguyen@codeweavers.com Date: Sun Jul 18 16:27:10 2010 -0500
ddraw/tests: Test IDirect3D::FindDevice HAL enumeration.
---
dlls/ddraw/tests/d3d.c | 29 +++++++++++++++++++++++++++++ 1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/dlls/ddraw/tests/d3d.c b/dlls/ddraw/tests/d3d.c index aa87ca6..53ef04b 100644 --- a/dlls/ddraw/tests/d3d.c +++ b/dlls/ddraw/tests/d3d.c @@ -3410,6 +3410,7 @@ static void FindDevice(void)
D3DFINDDEVICESEARCH search = {0}; D3DFINDDEVICERESULT result = {0}; + IDirect3DDevice *d3dhal; HRESULT hr; int i;
@@ -3472,6 +3473,34 @@ static void FindDevice(void) "[%d] Expected IDirect3D1::FindDevice to return DDERR_NOTFOUND, got 0x%08x\n", i, hr); }
+ /* The HAL device can only be enumerated if hardware acceleration is present. */ + search.dwSize = sizeof(search); + search.dwFlags = D3DFDS_GUID; + search.guid = IID_IDirect3DHALDevice; + result.dwSize = sizeof(result); + + hr = IDirect3D_FindDevice(Direct3D1, &search, &result); + trace("IDirect3D::FindDevice returned 0x%08x for the HAL device GUID\n", hr); + if (SUCCEEDED(hr)) + { + hr = IDirectDrawSurface_QueryInterface(Surface1, &IID_IDirect3DHALDevice, (void **)&d3dhal); + /* Currently Wine only supports the creation of one Direct3D device + * for a given DirectDraw instance. */ + todo_wine + ok(SUCCEEDED(hr), "Expected IDirectDrawSurface::QueryInterface to succeed, got 0x%08x\n", hr); + + if (SUCCEEDED(hr)) + IDirect3DDevice_Release(d3dhal); + } + else + { + hr = IDirectDrawSurface_QueryInterface(Surface1, &IID_IDirect3DHALDevice, (void **)&d3dhal); + ok(FAILED(hr), "Expected IDirectDrawSurface::QueryInterface to fail, got 0x%08x\n", hr); + + if (SUCCEEDED(hr)) + IDirect3DDevice_Release(d3dhal); + } + /* These GUIDs appear to be always present. */ for (i = 0; i < sizeof(deviceGUIDs)/sizeof(deviceGUIDs[0]); i++) {