Signed-off-by: Jeff Smith whydoubt@gmail.com --- This series lays some ground-work for testing non-HAL devices, such as RGB, Ramp, and MMX.
dlls/ddraw/tests/ddraw7.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 5c0c5bb7c3..9d3734579e 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -344,10 +344,10 @@ static IDirectDraw7 *create_ddraw(void)
static HRESULT WINAPI enum_devtype_cb(char *desc_str, char *name, D3DDEVICEDESC7 *desc, void *ctx) { - BOOL *hal_ok = ctx; - if (IsEqualGUID(&desc->deviceGUID, &IID_IDirect3DTnLHalDevice)) + struct { REFCLSID riid; BOOL present; } *device_data = ctx; + if (IsEqualGUID(&desc->deviceGUID, device_data->riid)) { - *hal_ok = TRUE; + device_data->present = TRUE; return DDENUMRET_CANCEL; } return DDENUMRET_OK; @@ -362,7 +362,7 @@ static IDirect3DDevice7 *create_device(HWND window, DWORD coop_level) IDirectDraw7 *ddraw; IDirect3D7 *d3d7; HRESULT hr; - BOOL hal_ok = FALSE; + struct { REFCLSID riid; BOOL present; } device_data = { &IID_IDirect3DTnLHalDevice }; const GUID *devtype = &IID_IDirect3DHALDevice;
if (!(ddraw = create_ddraw())) @@ -402,9 +402,9 @@ static IDirect3DDevice7 *create_device(HWND window, DWORD coop_level) return NULL; }
- hr = IDirect3D7_EnumDevices(d3d7, enum_devtype_cb, &hal_ok); + hr = IDirect3D7_EnumDevices(d3d7, enum_devtype_cb, &device_data); ok(SUCCEEDED(hr), "Failed to enumerate devices, hr %#x.\n", hr); - if (hal_ok) devtype = &IID_IDirect3DTnLHalDevice; + if (device_data.present) devtype = device_data.riid;
memset(&z_fmt, 0, sizeof(z_fmt)); hr = IDirect3D7_EnumZBufferFormats(d3d7, devtype, enum_z_fmt, &z_fmt); @@ -5655,7 +5655,7 @@ static void test_rt_caps(void) PALETTEENTRY palette_entries[256]; IDirectDrawPalette *palette; IDirectDraw7 *ddraw; - BOOL hal_ok = FALSE; + struct { REFCLSID riid; BOOL present; } device_data = { &IID_IDirect3DTnLHalDevice }; DDPIXELFORMAT z_fmt; IDirect3D7 *d3d; unsigned int i; @@ -5853,10 +5853,10 @@ static void test_rt_caps(void) goto done; }
- hr = IDirect3D7_EnumDevices(d3d, enum_devtype_cb, &hal_ok); + hr = IDirect3D7_EnumDevices(d3d, enum_devtype_cb, &device_data); ok(SUCCEEDED(hr), "Failed to enumerate devices, hr %#x.\n", hr); - if (hal_ok) - devtype = &IID_IDirect3DTnLHalDevice; + if (device_data.present) + devtype = device_data.riid;
memset(&z_fmt, 0, sizeof(z_fmt)); hr = IDirect3D7_EnumZBufferFormats(d3d, devtype, enum_z_fmt, &z_fmt); @@ -6138,7 +6138,7 @@ static void test_surface_lock(void) DDSURFACEDESC2 ddsd; ULONG refcount; DDPIXELFORMAT z_fmt; - BOOL hal_ok = FALSE; + struct { REFCLSID riid; BOOL present; } device_data = { &IID_IDirect3DTnLHalDevice }; const GUID *devtype = &IID_IDirect3DHALDevice; D3DDEVICEDESC7 device_desc; BOOL cubemap_supported; @@ -6259,10 +6259,10 @@ static void test_surface_lock(void) goto done; }
- hr = IDirect3D7_EnumDevices(d3d, enum_devtype_cb, &hal_ok); + hr = IDirect3D7_EnumDevices(d3d, enum_devtype_cb, &device_data); ok(SUCCEEDED(hr), "Failed to enumerate devices, hr %#x.\n", hr); - if (hal_ok) - devtype = &IID_IDirect3DTnLHalDevice; + if (device_data.present) + devtype = device_data.riid;
memset(&z_fmt, 0, sizeof(z_fmt)); hr = IDirect3D7_EnumZBufferFormats(d3d, devtype, enum_z_fmt, &z_fmt);