From 0868bed1805c1fdb49cae43f8954b4995d3bbe57 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Fri, 19 Aug 2022 17:00:25 +0800 Subject: [PATCH] ddraw/tests: Add more capability tests for enumerated devices. Add tests for D3DDEVCAPS_HWTRANSFORMANDLIGHT and D3DDEVCAPS_DRAWPRIMITIVES2EX. Signed-off-by: Zhiyi Zhang --- dlls/ddraw/tests/ddraw1.c | 51 +++++++++++++++++++++++++++++++++++++ dlls/ddraw/tests/ddraw2.c | 51 +++++++++++++++++++++++++++++++++++++ dlls/ddraw/tests/ddraw4.c | 51 +++++++++++++++++++++++++++++++++++++ dlls/ddraw/tests/ddraw7.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 218 insertions(+) diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index c4d8a1398cd..c9702bbfaf8 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -15173,6 +15173,19 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d ok(hal->dwFlags == 0, "RGB Device hal caps has hardware flags %#lx\n", hal->dwFlags); ok(hel->dwFlags != 0, "RGB Device hel caps has hardware flags %#lx\n", hel->dwFlags); + + todo_wine + ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, + "RGB Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + todo_wine + ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, + "RGB Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + todo_wine + ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, + "RGB Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); + todo_wine + ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, + "RGB Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); } else if(IsEqualGUID(&IID_IDirect3DHALDevice, guid)) { @@ -15181,6 +15194,17 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d ok(hal->dwFlags != 0, "HAL Device hal caps has hardware flags %#lx\n", hal->dwFlags); ok(hel->dwFlags != 0, "HAL Device hel caps has hardware flags %#lx\n", hel->dwFlags); + + ok(hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT, + "HAL Device hal device caps does not have D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + todo_wine + ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, + "RGB Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + ok(hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX, + "HAL Device hal device caps does not have D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); + todo_wine + ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, + "RGB Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); } else if(IsEqualGUID(&IID_IDirect3DRefDevice, guid)) { @@ -15201,6 +15225,15 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d "REF Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n"); ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE, "REF Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n"); + + ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, + "REF Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, + "REF Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, + "REF Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); + ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, + "REF Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); } else if(IsEqualGUID(&IID_IDirect3DRampDevice, guid)) { @@ -15228,6 +15261,15 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d ok(hal->dwFlags == 0, "Ramp Device hal caps has hardware flags %#lx\n", hal->dwFlags); ok(hel->dwFlags != 0, "Ramp Device hel caps has hardware flags %#lx\n", hel->dwFlags); + + ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, + "Ramp Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, + "Ramp Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, + "Ramp Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); + ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, + "Ramp Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); } else if(IsEqualGUID(&IID_IDirect3DMMXDevice, guid)) { @@ -15254,6 +15296,15 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d ok(hal->dwFlags == 0, "MMX Device hal caps has hardware flags %#lx\n", hal->dwFlags); ok(hel->dwFlags != 0, "MMX Device hel caps has hardware flags %#lx\n", hel->dwFlags); + + ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, + "MMX Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, + "MMX Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, + "MMX Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); + ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, + "MMX Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); } else { diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index d46598ce05a..eae41eb77ae 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -16119,6 +16119,19 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d ok(hal->dwFlags == 0, "RGB Device hal caps has hardware flags %#lx\n", hal->dwFlags); ok(hel->dwFlags != 0, "RGB Device hel caps has hardware flags %#lx\n", hel->dwFlags); + + todo_wine + ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, + "RGB Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + todo_wine + ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, + "RGB Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + todo_wine + ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, + "RGB Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); + todo_wine + ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, + "RGB Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); } else if(IsEqualGUID(&IID_IDirect3DHALDevice, guid)) { @@ -16127,6 +16140,17 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d ok(hal->dwFlags != 0, "HAL Device hal caps has hardware flags %#lx\n", hal->dwFlags); ok(hel->dwFlags != 0, "HAL Device hel caps has hardware flags %#lx\n", hel->dwFlags); + + ok(hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT, + "HAL Device hal device caps does not have D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + todo_wine + ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, + "RGB Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + ok(hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX, + "HAL Device hal device caps does not have D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); + todo_wine + ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, + "RGB Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); } else if(IsEqualGUID(&IID_IDirect3DRefDevice, guid)) { @@ -16147,6 +16171,15 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d "REF Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n"); ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE, "REF Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n"); + + ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, + "REF Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, + "REF Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, + "REF Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); + ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, + "REF Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); } else if(IsEqualGUID(&IID_IDirect3DRampDevice, guid)) { @@ -16174,6 +16207,15 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d ok(hal->dwFlags == 0, "Ramp Device hal caps has hardware flags %#lx\n", hal->dwFlags); ok(hel->dwFlags != 0, "Ramp Device hel caps has hardware flags %#lx\n", hel->dwFlags); + + ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, + "Ramp Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, + "Ramp Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, + "Ramp Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); + ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, + "Ramp Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); } else if(IsEqualGUID(&IID_IDirect3DMMXDevice, guid)) { @@ -16200,6 +16242,15 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d ok(hal->dwFlags == 0, "MMX Device hal caps has hardware flags %#lx\n", hal->dwFlags); ok(hel->dwFlags != 0, "MMX Device hel caps has hardware flags %#lx\n", hel->dwFlags); + + ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, + "MMX Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, + "MMX Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, + "MMX Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); + ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, + "MMX Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); } else { diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index 6df91c957af..eb1852e0832 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -19188,6 +19188,19 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d ok(hal->dwFlags == 0, "RGB Device hal caps has hardware flags %#lx\n", hal->dwFlags); ok(hel->dwFlags != 0, "RGB Device hel caps has hardware flags %#lx\n", hel->dwFlags); + + todo_wine + ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, + "RGB Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + todo_wine + ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, + "RGB Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + todo_wine + ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, + "RGB Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); + todo_wine + ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, + "RGB Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); } else if(IsEqualGUID(&IID_IDirect3DHALDevice, guid)) { @@ -19196,6 +19209,17 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d ok(hal->dwFlags != 0, "HAL Device hal caps has hardware flags %#lx\n", hal->dwFlags); ok(hel->dwFlags != 0, "HAL Device hel caps has hardware flags %#lx\n", hel->dwFlags); + + ok(hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT, + "HAL Device hal device caps does not have D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + todo_wine + ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, + "RGB Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + ok(hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX, + "HAL Device hal device caps does not have D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); + todo_wine + ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, + "RGB Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); } else if(IsEqualGUID(&IID_IDirect3DRefDevice, guid)) { @@ -19216,6 +19240,15 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d "REF Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n"); ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE, "REF Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n"); + + ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, + "REF Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, + "REF Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, + "REF Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); + ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, + "REF Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); } else if(IsEqualGUID(&IID_IDirect3DRampDevice, guid)) { @@ -19243,6 +19276,15 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d ok(hal->dwFlags == 0, "Ramp Device hal caps has hardware flags %#lx\n", hal->dwFlags); ok(hel->dwFlags != 0, "Ramp Device hel caps has hardware flags %#lx\n", hel->dwFlags); + + ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, + "Ramp Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, + "Ramp Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, + "Ramp Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); + ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, + "Ramp Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); } else if(IsEqualGUID(&IID_IDirect3DMMXDevice, guid)) { @@ -19269,6 +19311,15 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d ok(hal->dwFlags == 0, "MMX Device hal caps has hardware flags %#lx\n", hal->dwFlags); ok(hel->dwFlags != 0, "MMX Device hel caps has hardware flags %#lx\n", hel->dwFlags); + + ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, + "MMX Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, + "MMX Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, + "MMX Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); + ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, + "MMX Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); } else { diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index c72ea64c17d..99c9c7df2bc 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -19390,6 +19390,70 @@ static void test_filling_convention(void) DestroyWindow(window); } +static HRESULT WINAPI test_enum_devices_caps_callback(char *device_desc, char *device_name, + D3DDEVICEDESC7 *device_desc7, void *ctx) +{ + if (IsEqualGUID(&device_desc7->deviceGUID, &IID_IDirect3DTnLHalDevice)) + { + ok(device_desc7->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT, + "TnLHal Device device caps does not have D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + ok(device_desc7->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX, + "TnLHal Device device caps does not have D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); + } + else if (IsEqualGUID(&device_desc7->deviceGUID, &IID_IDirect3DHALDevice)) + { + todo_wine + ok((device_desc7->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, + "HAL Device device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + ok(device_desc7->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX, + "HAL Device device caps does not have D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); + } + else if (IsEqualGUID(&device_desc7->deviceGUID, &IID_IDirect3DRGBDevice)) + { + todo_wine + ok((device_desc7->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, + "RGB Device device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); + todo_wine + ok((device_desc7->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, + "RGB Device device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); + } + else + { + ok(FALSE, "Unexpected device enumerated: \"%s\" \"%s\"\n", device_desc, device_name); + } + + return DDENUMRET_OK; +} + +static void test_enum_devices(void) +{ + IDirectDraw7 *ddraw; + IDirect3D7 *d3d; + ULONG refcount; + HRESULT hr; + + ddraw = create_ddraw(); + ok(!!ddraw, "Failed to create a ddraw object.\n"); + + hr = IDirectDraw7_QueryInterface(ddraw, &IID_IDirect3D7, (void **)&d3d); + if (FAILED(hr)) + { + skip("D3D interface is not available, skipping test.\n"); + IDirectDraw7_Release(ddraw); + return; + } + + hr = IDirect3D7_EnumDevices(d3d, NULL, NULL); + ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr); + + hr = IDirect3D7_EnumDevices(d3d, test_enum_devices_caps_callback, NULL); + ok(hr == D3D_OK, "Got hr %#lx.\n", hr); + + IDirect3D7_Release(d3d); + refcount = IDirectDraw7_Release(ddraw); + ok(!refcount, "Device has %lu references left.\n", refcount); +} + static void run_for_each_device_type(void (*test_func)(const GUID *)) { test_func(hw_device_guid); @@ -19568,4 +19632,5 @@ START_TEST(ddraw7) test_get_display_mode(); run_for_each_device_type(test_texture_wrong_caps); test_filling_convention(); + test_enum_devices(); } -- 2.11.4.GIT