ddraw/tests: Test IDirect3D::FindDevice HAL enumeration.
This commit is contained in:
parent
14744c44b1
commit
8b1c1edb6b
|
@ -3410,6 +3410,7 @@ static void FindDevice(void)
|
||||||
|
|
||||||
D3DFINDDEVICESEARCH search = {0};
|
D3DFINDDEVICESEARCH search = {0};
|
||||||
D3DFINDDEVICERESULT result = {0};
|
D3DFINDDEVICERESULT result = {0};
|
||||||
|
IDirect3DDevice *d3dhal;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -3472,6 +3473,34 @@ static void FindDevice(void)
|
||||||
"[%d] Expected IDirect3D1::FindDevice to return DDERR_NOTFOUND, got 0x%08x\n", i, hr);
|
"[%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. */
|
/* These GUIDs appear to be always present. */
|
||||||
for (i = 0; i < sizeof(deviceGUIDs)/sizeof(deviceGUIDs[0]); i++)
|
for (i = 0; i < sizeof(deviceGUIDs)/sizeof(deviceGUIDs[0]); i++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue