ddraw/tests: Add some more surface GetDC() tests to test_getdc().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
77e6d98819
commit
31999bafda
|
@ -8575,13 +8575,14 @@ static void test_blt(void)
|
|||
|
||||
static void test_getdc(void)
|
||||
{
|
||||
IDirectDrawSurface *surface;
|
||||
DDSURFACEDESC surface_desc;
|
||||
IDirectDrawSurface *surface, *surface2, *tmp;
|
||||
DDSURFACEDESC surface_desc, map_desc;
|
||||
DDSCAPS caps = {DDSCAPS_COMPLEX};
|
||||
IDirectDraw *ddraw;
|
||||
unsigned int i;
|
||||
HWND window;
|
||||
HDC dc, dc2;
|
||||
HRESULT hr;
|
||||
HDC dc;
|
||||
|
||||
static const struct
|
||||
{
|
||||
|
@ -8682,6 +8683,157 @@ static void test_getdc(void)
|
|||
}
|
||||
|
||||
IDirectDrawSurface_Release(surface);
|
||||
|
||||
if (FAILED(hr))
|
||||
continue;
|
||||
|
||||
surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP;
|
||||
if (FAILED(hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL)))
|
||||
{
|
||||
skip("Failed to create mip-mapped texture for format %s (hr %#x), skipping tests.\n",
|
||||
test_data[i].name, hr);
|
||||
continue;
|
||||
}
|
||||
|
||||
hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &tmp);
|
||||
ok(SUCCEEDED(hr), "Failed to get attached surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_GetAttachedSurface(tmp, &caps, &surface2);
|
||||
ok(SUCCEEDED(hr), "Failed to get attached surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
IDirectDrawSurface_Release(tmp);
|
||||
|
||||
hr = IDirectDrawSurface_GetDC(surface, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_GetDC(surface2, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface2, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface_GetDC(surface, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
dc2 = (void *)0x1234;
|
||||
hr = IDirectDrawSurface_GetDC(surface, &dc2);
|
||||
ok(hr == DDERR_DCALREADYCREATED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
ok(dc2 == (void *)0x1234, "Got unexpected dc %p for format %s.\n", dc, test_data[i].name);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface, dc);
|
||||
ok(hr == DDERR_NODC, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
|
||||
map_desc.dwSize = sizeof(map_desc);
|
||||
hr = IDirectDrawSurface_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(hr == DDERR_SURFACEBUSY, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
hr = IDirectDrawSurface_Unlock(surface, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Unlock(surface, NULL);
|
||||
ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
|
||||
hr = IDirectDrawSurface_GetDC(surface, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(hr == DDERR_SURFACEBUSY, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_GetDC(surface, &dc);
|
||||
todo_wine ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface, dc);
|
||||
todo_wine ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Unlock(surface, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface_GetDC(surface, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_GetDC(surface2, &dc2);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface2, dc2);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface_GetDC(surface2, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_GetDC(surface, &dc2);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface, dc2);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface2, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Lock(surface2, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Unlock(surface2, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Unlock(surface, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_GetDC(surface, &dc);
|
||||
todo_wine ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface, dc);
|
||||
todo_wine ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Unlock(surface, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface_Lock(surface2, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_GetDC(surface, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Unlock(surface2, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface_GetDC(surface, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Lock(surface2, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Unlock(surface2, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface_GetDC(surface2, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Unlock(surface, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface2, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface_Unlock(surface, NULL);
|
||||
ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
hr = IDirectDrawSurface_GetDC(surface2, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Unlock(surface, NULL);
|
||||
ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface2, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Unlock(surface, NULL);
|
||||
ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
|
||||
hr = IDirectDrawSurface_Unlock(surface2, NULL);
|
||||
ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
hr = IDirectDrawSurface_GetDC(surface, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Unlock(surface2, NULL);
|
||||
ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Unlock(surface2, NULL);
|
||||
ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
|
||||
IDirectDrawSurface_Release(surface2);
|
||||
IDirectDrawSurface_Release(surface);
|
||||
}
|
||||
|
||||
IDirectDraw_Release(ddraw);
|
||||
|
|
|
@ -9682,13 +9682,14 @@ static void test_blt(void)
|
|||
|
||||
static void test_getdc(void)
|
||||
{
|
||||
IDirectDrawSurface *surface;
|
||||
DDSURFACEDESC surface_desc;
|
||||
IDirectDrawSurface *surface, *surface2, *tmp;
|
||||
DDSURFACEDESC surface_desc, map_desc;
|
||||
DDSCAPS caps = {DDSCAPS_COMPLEX};
|
||||
IDirectDraw2 *ddraw;
|
||||
unsigned int i;
|
||||
HWND window;
|
||||
HDC dc, dc2;
|
||||
HRESULT hr;
|
||||
HDC dc;
|
||||
|
||||
static const struct
|
||||
{
|
||||
|
@ -9789,6 +9790,157 @@ static void test_getdc(void)
|
|||
}
|
||||
|
||||
IDirectDrawSurface_Release(surface);
|
||||
|
||||
if (FAILED(hr))
|
||||
continue;
|
||||
|
||||
surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP;
|
||||
if (FAILED(hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL)))
|
||||
{
|
||||
skip("Failed to create mip-mapped texture for format %s (hr %#x), skipping tests.\n",
|
||||
test_data[i].name, hr);
|
||||
continue;
|
||||
}
|
||||
|
||||
hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &tmp);
|
||||
ok(SUCCEEDED(hr), "Failed to get attached surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_GetAttachedSurface(tmp, &caps, &surface2);
|
||||
ok(SUCCEEDED(hr), "Failed to get attached surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
IDirectDrawSurface_Release(tmp);
|
||||
|
||||
hr = IDirectDrawSurface_GetDC(surface, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_GetDC(surface2, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface2, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface_GetDC(surface, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
dc2 = (void *)0x1234;
|
||||
hr = IDirectDrawSurface_GetDC(surface, &dc2);
|
||||
ok(hr == DDERR_DCALREADYCREATED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
ok(dc2 == (void *)0x1234, "Got unexpected dc %p for format %s.\n", dc, test_data[i].name);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface, dc);
|
||||
ok(hr == DDERR_NODC, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
|
||||
map_desc.dwSize = sizeof(map_desc);
|
||||
hr = IDirectDrawSurface_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(hr == DDERR_SURFACEBUSY, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
hr = IDirectDrawSurface_Unlock(surface, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Unlock(surface, NULL);
|
||||
ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
|
||||
hr = IDirectDrawSurface_GetDC(surface, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(hr == DDERR_SURFACEBUSY, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_GetDC(surface, &dc);
|
||||
todo_wine ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface, dc);
|
||||
todo_wine ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Unlock(surface, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface_GetDC(surface, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_GetDC(surface2, &dc2);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface2, dc2);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface_GetDC(surface2, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_GetDC(surface, &dc2);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface, dc2);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface2, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Lock(surface2, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Unlock(surface2, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Unlock(surface, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_GetDC(surface, &dc);
|
||||
todo_wine ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface, dc);
|
||||
todo_wine ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Unlock(surface, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface_Lock(surface2, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_GetDC(surface, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Unlock(surface2, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface_GetDC(surface, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Lock(surface2, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Unlock(surface2, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface_GetDC(surface2, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Unlock(surface, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface2, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface_Unlock(surface, NULL);
|
||||
ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
hr = IDirectDrawSurface_GetDC(surface2, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Unlock(surface, NULL);
|
||||
ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface2, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Unlock(surface, NULL);
|
||||
ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
|
||||
hr = IDirectDrawSurface_Unlock(surface2, NULL);
|
||||
ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
hr = IDirectDrawSurface_GetDC(surface, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Unlock(surface2, NULL);
|
||||
ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surface, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface_Unlock(surface2, NULL);
|
||||
ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
|
||||
IDirectDrawSurface_Release(surface2);
|
||||
IDirectDrawSurface_Release(surface);
|
||||
}
|
||||
|
||||
IDirectDraw2_Release(ddraw);
|
||||
|
|
|
@ -10958,13 +10958,14 @@ static void test_color_clamping(void)
|
|||
|
||||
static void test_getdc(void)
|
||||
{
|
||||
IDirectDrawSurface4 *surface;
|
||||
DDSURFACEDESC2 surface_desc;
|
||||
DDSCAPS2 caps = {DDSCAPS_COMPLEX, 0, 0, {0}};
|
||||
IDirectDrawSurface4 *surface, *surface2, *tmp;
|
||||
DDSURFACEDESC2 surface_desc, map_desc;
|
||||
IDirectDraw4 *ddraw;
|
||||
unsigned int i;
|
||||
HWND window;
|
||||
HDC dc, dc2;
|
||||
HRESULT hr;
|
||||
HDC dc;
|
||||
|
||||
static const struct
|
||||
{
|
||||
|
@ -11066,6 +11067,158 @@ static void test_getdc(void)
|
|||
}
|
||||
|
||||
IDirectDrawSurface4_Release(surface);
|
||||
|
||||
if (FAILED(hr))
|
||||
continue;
|
||||
|
||||
surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP;
|
||||
surface_desc.ddsCaps.dwCaps2 = DDSCAPS2_TEXTUREMANAGE;
|
||||
if (FAILED(hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, NULL)))
|
||||
{
|
||||
skip("Failed to create mip-mapped texture for format %s (hr %#x), skipping tests.\n",
|
||||
test_data[i].name, hr);
|
||||
continue;
|
||||
}
|
||||
|
||||
hr = IDirectDrawSurface4_GetAttachedSurface(surface, &caps, &tmp);
|
||||
ok(SUCCEEDED(hr), "Failed to get attached surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_GetAttachedSurface(tmp, &caps, &surface2);
|
||||
ok(SUCCEEDED(hr), "Failed to get attached surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
IDirectDrawSurface4_Release(tmp);
|
||||
|
||||
hr = IDirectDrawSurface4_GetDC(surface, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_ReleaseDC(surface, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_GetDC(surface2, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_ReleaseDC(surface2, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface4_GetDC(surface, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
dc2 = (void *)0x1234;
|
||||
hr = IDirectDrawSurface4_GetDC(surface, &dc2);
|
||||
ok(hr == DDERR_DCALREADYCREATED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
ok(dc2 == (void *)0x1234, "Got unexpected dc %p for format %s.\n", dc, test_data[i].name);
|
||||
hr = IDirectDrawSurface4_ReleaseDC(surface, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_ReleaseDC(surface, dc);
|
||||
ok(hr == DDERR_NODC, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
|
||||
map_desc.dwSize = sizeof(map_desc);
|
||||
hr = IDirectDrawSurface4_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(hr == DDERR_SURFACEBUSY, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
hr = IDirectDrawSurface4_Unlock(surface, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_Unlock(surface, NULL);
|
||||
ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
|
||||
hr = IDirectDrawSurface4_GetDC(surface, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(hr == DDERR_SURFACEBUSY, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
hr = IDirectDrawSurface4_ReleaseDC(surface, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface4_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_GetDC(surface, &dc);
|
||||
todo_wine ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_ReleaseDC(surface, dc);
|
||||
todo_wine ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_Unlock(surface, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface4_GetDC(surface, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_GetDC(surface2, &dc2);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_ReleaseDC(surface2, dc2);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_ReleaseDC(surface, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface4_GetDC(surface2, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_GetDC(surface, &dc2);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_ReleaseDC(surface, dc2);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_ReleaseDC(surface2, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface4_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_Lock(surface2, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_Unlock(surface2, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_Unlock(surface, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface4_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_GetDC(surface, &dc);
|
||||
todo_wine ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_ReleaseDC(surface, dc);
|
||||
todo_wine ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_Unlock(surface, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface4_Lock(surface2, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_GetDC(surface, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_ReleaseDC(surface, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_Unlock(surface2, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface4_GetDC(surface, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_Lock(surface2, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_Unlock(surface2, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_ReleaseDC(surface, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface4_GetDC(surface2, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_Unlock(surface, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_ReleaseDC(surface2, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface4_Unlock(surface, NULL);
|
||||
ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
hr = IDirectDrawSurface4_GetDC(surface2, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_Unlock(surface, NULL);
|
||||
ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
hr = IDirectDrawSurface4_ReleaseDC(surface2, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_Unlock(surface, NULL);
|
||||
ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
|
||||
hr = IDirectDrawSurface4_Unlock(surface2, NULL);
|
||||
ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
hr = IDirectDrawSurface4_GetDC(surface, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_Unlock(surface2, NULL);
|
||||
ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
hr = IDirectDrawSurface4_ReleaseDC(surface, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface4_Unlock(surface2, NULL);
|
||||
ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
|
||||
IDirectDrawSurface4_Release(surface2);
|
||||
IDirectDrawSurface4_Release(surface);
|
||||
}
|
||||
|
||||
IDirectDraw4_Release(ddraw);
|
||||
|
|
|
@ -11224,13 +11224,14 @@ static void test_color_clamping(void)
|
|||
|
||||
static void test_getdc(void)
|
||||
{
|
||||
IDirectDrawSurface7 *surface;
|
||||
DDSURFACEDESC2 surface_desc;
|
||||
DDSCAPS2 caps = {DDSCAPS_COMPLEX, DDSCAPS2_CUBEMAP_NEGATIVEZ, 0, {0}};
|
||||
IDirectDrawSurface7 *surface, *surface2, *tmp;
|
||||
DDSURFACEDESC2 surface_desc, map_desc;
|
||||
IDirectDraw7 *ddraw;
|
||||
unsigned int i;
|
||||
HWND window;
|
||||
HDC dc, dc2;
|
||||
HRESULT hr;
|
||||
HDC dc;
|
||||
|
||||
static const struct
|
||||
{
|
||||
|
@ -11332,6 +11333,160 @@ static void test_getdc(void)
|
|||
}
|
||||
|
||||
IDirectDrawSurface7_Release(surface);
|
||||
|
||||
if (FAILED(hr))
|
||||
continue;
|
||||
|
||||
surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP;
|
||||
surface_desc.ddsCaps.dwCaps2 = DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_ALLFACES | DDSCAPS2_TEXTUREMANAGE;
|
||||
if (FAILED(hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL)))
|
||||
{
|
||||
skip("Failed to create cube texture for format %s (hr %#x), skipping tests.\n", test_data[i].name, hr);
|
||||
continue;
|
||||
}
|
||||
|
||||
hr = IDirectDrawSurface7_GetAttachedSurface(surface, &caps, &surface2);
|
||||
ok(SUCCEEDED(hr), "Failed to get attached surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_GetAttachedSurface(surface2, &caps, &tmp);
|
||||
ok(SUCCEEDED(hr), "Failed to get attached surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
IDirectDrawSurface7_Release(surface2);
|
||||
hr = IDirectDrawSurface7_GetAttachedSurface(tmp, &caps, &surface2);
|
||||
ok(SUCCEEDED(hr), "Failed to get attached surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
IDirectDrawSurface7_Release(tmp);
|
||||
|
||||
hr = IDirectDrawSurface7_GetDC(surface, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_ReleaseDC(surface, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_GetDC(surface2, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_ReleaseDC(surface2, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface7_GetDC(surface, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
dc2 = (void *)0x1234;
|
||||
hr = IDirectDrawSurface7_GetDC(surface, &dc2);
|
||||
ok(hr == DDERR_DCALREADYCREATED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
ok(dc2 == (void *)0x1234, "Got unexpected dc %p for format %s.\n", dc, test_data[i].name);
|
||||
hr = IDirectDrawSurface7_ReleaseDC(surface, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_ReleaseDC(surface, dc);
|
||||
ok(hr == DDERR_NODC, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
|
||||
map_desc.dwSize = sizeof(map_desc);
|
||||
hr = IDirectDrawSurface7_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(hr == DDERR_SURFACEBUSY, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
hr = IDirectDrawSurface7_Unlock(surface, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_Unlock(surface, NULL);
|
||||
ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
|
||||
hr = IDirectDrawSurface7_GetDC(surface, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(hr == DDERR_SURFACEBUSY, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
hr = IDirectDrawSurface7_ReleaseDC(surface, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface7_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_GetDC(surface, &dc);
|
||||
todo_wine ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_ReleaseDC(surface, dc);
|
||||
todo_wine ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_Unlock(surface, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface7_GetDC(surface, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_GetDC(surface2, &dc2);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_ReleaseDC(surface2, dc2);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_ReleaseDC(surface, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface7_GetDC(surface2, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_GetDC(surface, &dc2);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_ReleaseDC(surface, dc2);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_ReleaseDC(surface2, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface7_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_Lock(surface2, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_Unlock(surface2, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_Unlock(surface, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface7_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_GetDC(surface, &dc);
|
||||
todo_wine ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_ReleaseDC(surface, dc);
|
||||
todo_wine ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_Unlock(surface, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface7_Lock(surface2, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_GetDC(surface, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_ReleaseDC(surface, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_Unlock(surface2, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface7_GetDC(surface, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_Lock(surface2, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_Unlock(surface2, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_ReleaseDC(surface, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface7_GetDC(surface2, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_Lock(surface, NULL, &map_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to map surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_Unlock(surface, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to unmap surface for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_ReleaseDC(surface2, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
|
||||
hr = IDirectDrawSurface7_Unlock(surface, NULL);
|
||||
ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
hr = IDirectDrawSurface7_GetDC(surface2, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_Unlock(surface, NULL);
|
||||
ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
hr = IDirectDrawSurface7_ReleaseDC(surface2, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_Unlock(surface, NULL);
|
||||
ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
|
||||
hr = IDirectDrawSurface7_Unlock(surface2, NULL);
|
||||
ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
hr = IDirectDrawSurface7_GetDC(surface, &dc);
|
||||
ok(SUCCEEDED(hr), "Failed to get DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_Unlock(surface2, NULL);
|
||||
ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
hr = IDirectDrawSurface7_ReleaseDC(surface, dc);
|
||||
ok(SUCCEEDED(hr), "Failed to release DC for format %s, hr %#x.\n", test_data[i].name, hr);
|
||||
hr = IDirectDrawSurface7_Unlock(surface2, NULL);
|
||||
ok(hr == DDERR_NOTLOCKED, "Got unexpected hr %#x for format %s.\n", hr, test_data[i].name);
|
||||
|
||||
IDirectDrawSurface7_Release(surface2);
|
||||
IDirectDrawSurface7_Release(surface);
|
||||
}
|
||||
|
||||
IDirectDraw7_Release(ddraw);
|
||||
|
|
|
@ -2269,45 +2269,16 @@ static BOOL can_create_primary_surface(void)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static void dctest_surf(IDirectDrawSurface *surf, int ddsdver) {
|
||||
HRESULT hr;
|
||||
HDC dc, dc2 = (HDC) 0x1234;
|
||||
DDSURFACEDESC ddsd;
|
||||
DDSURFACEDESC2 ddsd2;
|
||||
|
||||
memset(&ddsd, 0, sizeof(ddsd));
|
||||
ddsd.dwSize = sizeof(ddsd);
|
||||
memset(&ddsd2, 0, sizeof(ddsd2));
|
||||
ddsd2.dwSize = sizeof(ddsd2);
|
||||
|
||||
hr = IDirectDrawSurface_GetDC(surf, &dc);
|
||||
ok(hr == DD_OK, "IDirectDrawSurface_GetDC failed: 0x%08x\n", hr);
|
||||
|
||||
hr = IDirectDrawSurface_GetDC(surf, &dc2);
|
||||
ok(hr == DDERR_DCALREADYCREATED, "IDirectDrawSurface_GetDC failed: 0x%08x\n", hr);
|
||||
ok(dc2 == (HDC) 0x1234, "The failed GetDC call changed the dc: %p\n", dc2);
|
||||
|
||||
hr = IDirectDrawSurface_Lock(surf, NULL, ddsdver == 1 ? &ddsd : ((DDSURFACEDESC *) &ddsd2), 0, NULL);
|
||||
ok(hr == DDERR_SURFACEBUSY, "IDirectDrawSurface_Lock returned 0x%08x, expected DDERR_ALREADYLOCKED\n", hr);
|
||||
|
||||
hr = IDirectDrawSurface_ReleaseDC(surf, dc);
|
||||
ok(hr == DD_OK, "IDirectDrawSurface_ReleaseDC failed: 0x%08x\n", hr);
|
||||
hr = IDirectDrawSurface_ReleaseDC(surf, dc);
|
||||
ok(hr == DDERR_NODC, "IDirectDrawSurface_ReleaseDC returned 0x%08x, expected DDERR_NODC\n", hr);
|
||||
}
|
||||
|
||||
static void GetDCTest(void)
|
||||
{
|
||||
DDSURFACEDESC ddsd;
|
||||
DDSURFACEDESC2 ddsd2;
|
||||
IDirectDrawSurface *surf;
|
||||
IDirectDrawSurface2 *surf2;
|
||||
IDirectDrawSurface4 *surf4;
|
||||
IDirectDrawSurface7 *surf7;
|
||||
IDirectDrawSurface *tmp;
|
||||
IDirectDrawSurface7 *tmp7;
|
||||
HRESULT hr;
|
||||
IDirectDraw2 *dd2;
|
||||
IDirectDraw4 *dd4;
|
||||
IDirectDraw7 *dd7;
|
||||
HDC dc;
|
||||
|
@ -2326,33 +2297,12 @@ static void GetDCTest(void)
|
|||
ddsd2.dwHeight = 64;
|
||||
ddsd2.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
|
||||
|
||||
hr = IDirectDraw_CreateSurface(lpDD, &ddsd, &surf, NULL);
|
||||
ok(hr == DD_OK, "IDirectDraw_CreateSurface failed: 0x%08x\n", hr);
|
||||
dctest_surf(surf, 1);
|
||||
IDirectDrawSurface_Release(surf);
|
||||
|
||||
hr = IDirectDraw_QueryInterface(lpDD, &IID_IDirectDraw2, (void **) &dd2);
|
||||
ok(hr == DD_OK, "IDirectDraw_QueryInterface failed: 0x%08x\n", hr);
|
||||
|
||||
hr = IDirectDraw2_CreateSurface(dd2, &ddsd, &surf, NULL);
|
||||
ok(hr == DD_OK, "IDirectDraw2_CreateSurface failed: 0x%08x\n", hr);
|
||||
dctest_surf(surf, 1);
|
||||
|
||||
hr = IDirectDrawSurface_QueryInterface(surf, &IID_IDirectDrawSurface2, (void **) &surf2);
|
||||
ok(hr == DD_OK, "IDirectDrawSurface_QueryInterface failed: 0x%08x\n", hr);
|
||||
dctest_surf((IDirectDrawSurface *) surf2, 1);
|
||||
|
||||
IDirectDrawSurface2_Release(surf2);
|
||||
IDirectDrawSurface_Release(surf);
|
||||
IDirectDraw2_Release(dd2);
|
||||
|
||||
hr = IDirectDraw_QueryInterface(lpDD, &IID_IDirectDraw4, (void **) &dd4);
|
||||
ok(hr == DD_OK, "IDirectDraw_QueryInterface failed: 0x%08x\n", hr);
|
||||
|
||||
surf = NULL;
|
||||
hr = IDirectDraw4_CreateSurface(dd4, &ddsd2, &surf4, NULL);
|
||||
ok(hr == DD_OK, "IDirectDraw4_CreateSurface failed: 0x%08x\n", hr);
|
||||
dctest_surf((IDirectDrawSurface *) surf4, 2);
|
||||
|
||||
hr = IDirectDrawSurface4_QueryInterface(surf4, &IID_IDirectDrawSurface, (void **)&surf);
|
||||
ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr);
|
||||
|
@ -2408,7 +2358,6 @@ static void GetDCTest(void)
|
|||
|
||||
hr = IDirectDraw7_CreateSurface(dd7, &ddsd2, &surf7, NULL);
|
||||
ok(hr == DD_OK, "IDirectDraw7_CreateSurface failed: 0x%08x\n", hr);
|
||||
dctest_surf((IDirectDrawSurface *) surf7, 2);
|
||||
|
||||
hr = IDirectDrawSurface7_GetDC(surf7, &dc);
|
||||
ok(SUCCEEDED(hr), "GetDC failed, hr %#x.\n", hr);
|
||||
|
|
Loading…
Reference in New Issue