Signed-off-by: Rémi Bernon rbernon@codeweavers.com ---
These tests are checking composition outcode of window surfaces, child and layered windows, as well as drawing API interactions.
They seem to consistently pass on the testbot but I'm not completely sure about them. They are a bit brittle as screen capture and window rendering is heavily dependent on the WM on Linux.
Still, I believe they are useful, and they show that we currently do several things incorrectly so I'm sending them anyway.
dlls/user32/tests/Makefile.in | 2 +- dlls/user32/tests/win.c | 640 ++++++++++++++++++++++++++++++++++ 2 files changed, 641 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/tests/Makefile.in b/dlls/user32/tests/Makefile.in index dd101d69f3c..5b058b7d914 100644 --- a/dlls/user32/tests/Makefile.in +++ b/dlls/user32/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = user32.dll -IMPORTS = user32 gdi32 advapi32 hid +IMPORTS = user32 gdi32 advapi32 hid dwmapi
C_SRCS = \ broadcast.c \ diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index a37afd2dc5e..92fc9449245 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -31,6 +31,7 @@ #include "wingdi.h" #include "winuser.h" #include "winreg.h" +#include "dwmapi.h"
#include "wine/test.h"
@@ -12004,6 +12005,643 @@ static void test_cancel_mode(void) DestroyWindow(hwnd2); }
+#define capture_surface(hdc, x, y, width, height, surface, surface_size) capture_surface_(__LINE__, hdc, x, y, width, height, surface, surface_size) +static SIZE_T capture_surface_(int line, HDC hdc, int x, int y, int width, int height, DWORD *surface, SIZE_T surface_size) +{ + BITMAPINFOHEADER info; + HBITMAP bmp_obj; + SIZE_T data_size; + BITMAP bmp; + DWORD count; + BOOL ret; + HDC hdc_dst; + + hdc_dst = CreateCompatibleDC(hdc); + ok_(__FILE__, line)(hdc_dst != 0, "CreateCompatibleDC failed, last error %u\n", GetLastError()); + bmp_obj = CreateCompatibleBitmap(hdc, width, height); + ok_(__FILE__, line)(bmp_obj != 0, "CreateCompatibleBitmap failed, last error %u\n", GetLastError()); + +#ifndef CAPTUREBLT +#define CAPTUREBLT 0x40000000 +#endif + + SelectObject(hdc_dst, bmp_obj); + ret = BitBlt(hdc_dst, 0, 0, width, height, hdc, x, y, SRCCOPY | CAPTUREBLT); + ok_(__FILE__, line)(ret, "BitBlt failed, last error %u\n", GetLastError()); + count = GetObjectW(bmp_obj, sizeof(BITMAP), &bmp); + ok_(__FILE__, line)(count == sizeof(BITMAP), "GetObjectW failed, last error %u\n", GetLastError()); + + info.biSize = sizeof(BITMAPINFOHEADER); + info.biWidth = bmp.bmWidth; + info.biHeight = bmp.bmHeight; + info.biPlanes = 1; + info.biBitCount = 32; + info.biCompression = BI_RGB; + info.biSizeImage = 0; + info.biXPelsPerMeter = 0; + info.biYPelsPerMeter = 0; + info.biClrUsed = 0; + info.biClrImportant = 0; + + data_size = ((bmp.bmWidth * info.biBitCount + 31) / 32) * 4 * bmp.bmHeight; + ok_(__FILE__, line)( data_size == surface_size, "Got %Iu bytes, expected %Iu\n", data_size, surface_size ); + count = GetDIBits(hdc_dst, bmp_obj, 0, bmp.bmHeight, surface, (BITMAPINFO*)&info, DIB_RGB_COLORS); + ok_(__FILE__, line)(count == bmp.bmHeight, "GetDIBits failed, last error %u\n", GetLastError()); + + DeleteObject(bmp_obj); + DeleteDC(hdc_dst); + +#if 0 + { + BITMAPFILEHEADER header; + HANDLE file; + + header.bfType = 0x4d42; + header.bfSize = sizeof(header) + sizeof(info) + data_size; + header.bfOffBits = sizeof(header) + sizeof(info); + + file = CreateFileW(L"surface.bmp", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + ok(file != INVALID_HANDLE_VALUE, "CreateFileW failed, error %u\n", GetLastError()); + ret = WriteFile(file, &header, sizeof(header), &count, NULL); + ok(ret && count == sizeof(header), "WriteFile failed, error %u\n", GetLastError()); + ret = WriteFile(file, &info, sizeof(info), &count, NULL); + ok(ret && count == sizeof(info), "WriteFile failed, error %u\n", GetLastError()); + ret = WriteFile(file, surface, data_size, &count, NULL); + ok(ret && count == data_size, "WriteFile failed, error %u\n", GetLastError()); + CloseHandle(file); + } +#endif + + return data_size; +} + +#define capture_screen_surface(hwnd, surface, surface_size) capture_screen_surface_(__LINE__, hwnd, surface, surface_size) +static SIZE_T capture_screen_surface_(int line, HWND hwnd, DWORD *surface, SIZE_T surface_size) +{ + SIZE_T data_size, i; + RECT rect, rect_win; + HDC hdc; + + GetWindowRect(hwnd, &rect_win); + GetClientRect(hwnd, &rect); + OffsetRect(&rect, -rect.left, -rect.top); + + hdc = GetDC(NULL); + ok_(__FILE__, line)(hdc != 0, "GetDC failed, last error %u\n", GetLastError()); + if (DwmFlush() == E_NOTIMPL) flush_events( TRUE ); + data_size = capture_surface_(line, hdc, rect_win.left, rect_win.top, rect.right, rect.bottom, surface, surface_size); + ReleaseDC(NULL, hdc); + + for (i = data_size / 4; i != 0; i--) surface[i - 1] &= 0xffffff; + return data_size; +} + +#define check_screen_surface(hwnd, expect, expect_size, todo) check_screen_surface_(__LINE__, hwnd, expect, expect_size, todo) +static void check_screen_surface_(int line, HWND hwnd, const DWORD *expect, SIZE_T expect_size, BOOL todo) +{ + SIZE_T data_size; + DWORD *data; + + data = malloc(expect_size); + ok_(__FILE__, line)(data != NULL, "Failed to allocate %Iu bytes\n", expect_size); + data_size = capture_screen_surface_(line, hwnd, data, expect_size); + if (data_size != expect_size) + todo_wine_if(todo) ok_(__FILE__, line)(0, "Unexpected screen surface size %Iu, expected %Iu", data_size, expect_size); + else if (memcmp( data, expect, data_size )) + todo_wine_if(todo) ok_(__FILE__, line)(0, "Unexpected screen surface data\n"); + else if (todo) + todo_wine ok_(__FILE__, line)(1, "Got expected screen surface data\n"); + free(data); +} + +#define capture_client_surface(hwnd, surface, surface_size) capture_client_surface_(__LINE__, hwnd, surface, surface_size) +static SIZE_T capture_client_surface_(int line, HWND hwnd, DWORD *surface, SIZE_T surface_size) +{ + SIZE_T data_size; + RECT rect; + HDC hdc; + + GetClientRect(hwnd, &rect); + OffsetRect(&rect, -rect.left, -rect.top); + + hdc = GetDC(hwnd); + ok_(__FILE__, line)(hdc != 0, "GetDC failed, last error %u\n", GetLastError()); + data_size = capture_surface_(line, hdc, 0, 0, rect.right, rect.bottom, surface, surface_size); + ReleaseDC(hwnd, hdc); + + return data_size; +} + +#define check_client_surface(hwnd, expect, expect_size, todo) check_client_surface_(__LINE__, hwnd, expect, expect_size, todo) +static void check_client_surface_(int line, HWND hwnd, const DWORD *expect, SIZE_T expect_size, BOOL todo) +{ + SIZE_T data_size; + DWORD *data; + + data = malloc(expect_size); + ok_(__FILE__, line)(data != NULL, "Failed to allocate %Iu bytes\n", expect_size); + data_size = capture_client_surface_(line, hwnd, data, expect_size); + if (data_size != expect_size) + todo_wine_if(todo) ok_(__FILE__, line)(0, "Unexpected client surface size %Iu, expected %Iu", data_size, expect_size); + else if (memcmp( data, expect, data_size )) + todo_wine_if(todo) ok_(__FILE__, line)(0, "Unexpected client surface data\n"); + else if (todo) + todo_wine ok_(__FILE__, line)(1, "Got expected client surface data\n"); + free(data); +} + +static void paint_client_rect(HWND hwnd, COLORREF color) +{ + HDC hdc = GetDC(hwnd); + HPEN pen = CreatePen(PS_SOLID, 0, color); + HBRUSH brush = CreateSolidBrush(color); + RECT rect; + GetClientRect(hwnd, &rect); + + SelectObject(hdc, pen); + SelectObject(hdc, brush); + Rectangle(hdc, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top); + DeleteObject(brush); + DeleteObject(pen); + DeleteDC(hdc); +} + +LRESULT WINAPI test_surface_composition_winproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + switch (msg) + { + case WM_ERASEBKGND: return 0; + case WM_NCPAINT: + case WM_PAINT: + { + BeginPaint(hwnd, NULL); + EndPaint(hwnd, NULL); + return 0; + } + default: + return DefWindowProcW(hwnd, msg, wparam, lparam); + } +} + +static void test_surface_composition(void) +{ +#define COLOR1 0x00ff0000 +#define COLOR2 0x0000ffff +#define BGRA2RGB(x) RGB((x >> 16) & 0xff, (x >> 8) & 0xff, x & 0xff) + static const DWORD minimized_surface[] = + { + 0x00000000 + }; + static const DWORD hidden_surface[] = + { + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + }; + static const DWORD partial_surface[] = + { + 0x00000000, 0x00000000, COLOR1, COLOR1, + 0x00000000, 0x00000000, COLOR1, COLOR1, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + }; + static const DWORD painted_surface[] = + { + COLOR1, COLOR1, COLOR1, COLOR1, + COLOR1, COLOR1, COLOR1, COLOR1, + COLOR1, COLOR1, COLOR1, COLOR1, + COLOR1, COLOR1, COLOR1, COLOR1, + }; + static const DWORD painted_child_surface[] = { + COLOR1, COLOR1, COLOR1, COLOR1, + COLOR1, COLOR2, COLOR2, COLOR1, + COLOR1, COLOR2, COLOR2, COLOR1, + COLOR1, COLOR1, COLOR1, COLOR1, + }; + + DWORD screen_surface[ARRAY_SIZE(painted_surface)]; + DWORD layered_const_surface[ARRAY_SIZE(painted_surface)]; + DWORD layered_child_surface[ARRAY_SIZE(painted_child_surface)]; + DWORD layered_child_const_surface[ARRAY_SIZE(painted_child_surface)]; + DWORD layered_child_alpha_surface[ARRAY_SIZE(painted_child_surface)]; + + BLENDFUNCTION blend_cst_alpha = { AC_SRC_OVER, 0, 0x7f, 0 }; + BLENDFUNCTION blend_src_alpha = { AC_SRC_OVER, 0, 0xff, AC_SRC_ALPHA }; + WNDCLASSEXW wc; + BITMAPINFO info; + HBITMAP bmp_obj; + HRESULT hres; + SIZE_T i; + DWORD *data; + HWND hwnd, hwnd_child; + RECT rect; + BOOL ret; + HDC hdc_dst, hdc_src; + + wc.cbSize = sizeof(WNDCLASSEXW); + wc.style = CS_HREDRAW | CS_VREDRAW; + wc.lpfnWndProc = test_surface_composition_winproc; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = GetModuleHandleW(NULL); + wc.hIcon = 0; + wc.hCursor = 0; + wc.hbrBackground = 0; + wc.lpszMenuName = NULL; + wc.lpszClassName = L"surface"; + wc.hIconSm = 0; + RegisterClassExW(&wc); + + + hres = DwmFlush(); + todo_wine ok(hres == S_OK || broken(hres == DWM_E_COMPOSITIONDISABLED), "DwmFlush returned %#x\n", hres); + if (hres == DWM_E_COMPOSITIONDISABLED) + { + win_skip("Cannot reliably capture screen surfaces, skipping tests\n"); + return; + } + + hwnd = CreateWindowW(L"surface", L"", WS_POPUP, 0, 0, 4, 4, NULL, NULL, NULL, NULL); + ok(hwnd != 0, "CreateWindowW failed, last error %u\n", GetLastError()); + flush_events( TRUE ); + + capture_screen_surface(hwnd, screen_surface, sizeof(screen_surface)); + + for (i = 0; i < ARRAY_SIZE(painted_surface); i++) + { + BYTE sr = (screen_surface[i] >> 16) & 0xff, dr = (painted_surface[i] >> 16) & 0xff; + BYTE sg = (screen_surface[i] >> 8) & 0xff, dg = (painted_surface[i] >> 8) & 0xff; + BYTE sb = (screen_surface[i] >> 0) & 0xff, db = (painted_surface[i] >> 0) & 0xff; + BYTE da = 0x7f; + dr = min(max((sr * (0xff - da) + dr * da + 0x7f) / 0xff, 0), 0xff); + dg = min(max((sg * (0xff - da) + dg * da + 0x7f) / 0xff, 0), 0xff); + db = min(max((sb * (0xff - da) + db * da + 0x7f) / 0xff, 0), 0xff); + layered_const_surface[i] = BGRA2RGB(RGB(dr, dg, db)); + } + + memcpy(layered_child_surface, screen_surface, sizeof(screen_surface)); + for (i = 0; i < ARRAY_SIZE(painted_child_surface); i++) + { + if (painted_child_surface[i] == painted_surface[i]) + layered_child_surface[i] = painted_surface[i]; + } + + for (i = 0; i < ARRAY_SIZE(painted_child_surface); i++) + { + BYTE sr = (screen_surface[i] >> 16) & 0xff, dr = (painted_child_surface[i] >> 16) & 0xff; + BYTE sg = (screen_surface[i] >> 8) & 0xff, dg = (painted_child_surface[i] >> 8) & 0xff; + BYTE sb = (screen_surface[i] >> 0) & 0xff, db = (painted_child_surface[i] >> 0) & 0xff; + BYTE da = 0x7f; + dr = min(max((sr * (0xff - da) + dr * da + 0x7f) / 0xff, 0), 0xff); + dg = min(max((sg * (0xff - da) + dg * da + 0x7f) / 0xff, 0), 0xff); + db = min(max((sb * (0xff - da) + db * da + 0x7f) / 0xff, 0), 0xff); + layered_child_const_surface[i] = BGRA2RGB(RGB(dr, dg, db)); + } + + for (i = 0; i < ARRAY_SIZE(painted_child_surface); i++) + { + BYTE sr = (screen_surface[i] >> 16) & 0xff, dr = (painted_child_surface[i] >> 16) & 0xff; + BYTE sg = (screen_surface[i] >> 8) & 0xff, dg = (painted_child_surface[i] >> 8) & 0xff; + BYTE sb = (screen_surface[i] >> 0) & 0xff, db = (painted_child_surface[i] >> 0) & 0xff; + BYTE sa = painted_child_surface[i] == COLOR2 ? 0xff : 0x00; + dr = min(max((sr * (0xff - sa) + dr * 0xff + 0x7f) / 0xff, 0), 0xff); + dg = min(max((sg * (0xff - sa) + dg * 0xff + 0x7f) / 0xff, 0), 0xff); + db = min(max((sb * (0xff - sa) + db * 0xff + 0x7f) / 0xff, 0), 0xff); + layered_child_alpha_surface[i] = BGRA2RGB(RGB(dr, dg, db)); + } + + + ShowWindow(hwnd, SW_SHOW); + flush_events( TRUE ); + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + check_screen_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + + ShowWindow(hwnd, SW_HIDE); + flush_events( TRUE ); + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, hidden_surface, sizeof(hidden_surface), TRUE); + check_screen_surface(hwnd, screen_surface, sizeof(screen_surface), FALSE); + + ShowWindow(hwnd, SW_SHOW); + flush_events( TRUE ); + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + check_screen_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + + ShowWindow(hwnd, SW_MINIMIZE); + flush_events( TRUE ); + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, minimized_surface, sizeof(minimized_surface), FALSE); + check_screen_surface(hwnd, minimized_surface, sizeof(minimized_surface), FALSE); + + ShowWindow(hwnd, SW_RESTORE); + flush_events( TRUE ); + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + check_screen_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + + SetWindowPos(hwnd, 0, -100, -100, 0, 0, SWP_NOSIZE); + flush_events( TRUE ); + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, painted_surface, sizeof(painted_surface), TRUE); + check_screen_surface(hwnd, hidden_surface, sizeof(hidden_surface), FALSE); + + SetWindowPos(hwnd, 0, -2, -2, 0, 0, SWP_NOSIZE); + flush_events( TRUE ); + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + check_screen_surface(hwnd, partial_surface, sizeof(partial_surface), TRUE); + + SetWindowPos(hwnd, 0, 0, 0, 0, 0, SWP_NOSIZE); + flush_events( TRUE ); + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + check_screen_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + + hwnd_child = CreateWindowW(L"surface", L"", WS_CHILD | WS_VISIBLE, 1, 1, 2, 2, hwnd, NULL, NULL, NULL); + ok(hwnd_child != 0, "CreateWindowW failed, last error %u\n", GetLastError()); + + flush_events( TRUE ); + check_client_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + check_screen_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + paint_client_rect(hwnd_child, BGRA2RGB(COLOR2)); + check_client_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), FALSE); + check_screen_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), FALSE); + + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + check_screen_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + + SetWindowLongW(hwnd, GWL_STYLE, GetWindowLongW(hwnd, GWL_STYLE) | WS_CLIPCHILDREN); + + paint_client_rect(hwnd_child, BGRA2RGB(COLOR2)); + check_client_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), FALSE); + check_screen_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), FALSE); + + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), FALSE); + check_screen_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), FALSE); + + DestroyWindow(hwnd_child); + check_client_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), FALSE); + check_screen_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), FALSE); + + DestroyWindow(hwnd); + + + /* WS_EX_LAYERED */ + + hwnd = CreateWindowW(L"surface", L"", WS_POPUP | WS_VISIBLE, 0, 0, 4, 4, 0, NULL, NULL, NULL); + ok(hwnd != 0, "CreateWindowW failed, last error %u\n", GetLastError()); + flush_events( TRUE ); + + SetWindowLongW(hwnd, GWL_EXSTYLE, GetWindowLongW(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED); + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + check_screen_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + + ShowWindow(hwnd, SW_HIDE); + flush_events( TRUE ); + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, painted_surface, sizeof(painted_surface), TRUE); + check_screen_surface(hwnd, screen_surface, sizeof(screen_surface), FALSE); + + ShowWindow(hwnd, SW_SHOW); + flush_events( TRUE ); + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + check_screen_surface(hwnd, painted_surface, sizeof(painted_surface), TRUE); + + hwnd_child = CreateWindowW(L"surface", L"", WS_CHILD | WS_VISIBLE, 1, 1, 2, 2, hwnd, NULL, NULL, NULL); + ok(hwnd_child != 0, "CreateWindowW failed, last error %u\n", GetLastError()); + + flush_events( TRUE ); + check_client_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + check_screen_surface(hwnd, painted_surface, sizeof(painted_surface), TRUE); + + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + paint_client_rect(hwnd_child, BGRA2RGB(COLOR2)); + check_client_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), FALSE); + check_screen_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), TRUE); + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + check_screen_surface(hwnd, painted_surface, sizeof(painted_surface), TRUE); + + SetWindowLongW(hwnd, GWL_STYLE, GetWindowLongW(hwnd, GWL_STYLE) | WS_CLIPCHILDREN); + + paint_client_rect(hwnd_child, BGRA2RGB(COLOR2)); + check_client_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), FALSE); + check_screen_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), TRUE); + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), FALSE); + check_screen_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), TRUE); + + DestroyWindow(hwnd_child); + check_client_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), FALSE); + check_screen_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), TRUE); + + DestroyWindow(hwnd); + + + /* SetLayeredWindowAttributes / LWA_ALPHA */ + + hwnd = CreateWindowW(L"surface", L"", WS_POPUP, 0, 0, 4, 4, 0, NULL, NULL, NULL); + ok(hwnd != 0, "CreateWindowW failed, last error %u\n", GetLastError()); + + SetWindowLongW(hwnd, GWL_EXSTYLE, GetWindowLongW(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED); + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, hidden_surface, sizeof(hidden_surface), FALSE); + check_screen_surface(hwnd, screen_surface, sizeof(screen_surface), FALSE); + + ShowWindow(hwnd, SW_SHOW); + flush_events( TRUE ); + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, hidden_surface, sizeof(hidden_surface), TRUE); + check_screen_surface(hwnd, screen_surface, sizeof(screen_surface), FALSE); + + ret = SetLayeredWindowAttributes(hwnd, 0, 0x7f, LWA_ALPHA); + ok(ret, "SetLayeredWindowAttributes failed, last error %u\n", GetLastError()); + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + check_screen_surface(hwnd, layered_const_surface, sizeof(layered_const_surface), TRUE); + + hwnd_child = CreateWindowW(L"surface", L"", WS_CHILD | WS_VISIBLE, 1, 1, 2, 2, hwnd, NULL, NULL, NULL); + ok(hwnd_child != 0, "CreateWindowW failed, last error %u\n", GetLastError()); + + flush_events( TRUE ); + check_client_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + check_screen_surface(hwnd, layered_const_surface, sizeof(layered_const_surface), TRUE); + + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + paint_client_rect(hwnd_child, BGRA2RGB(COLOR2)); + check_client_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), FALSE); + check_screen_surface(hwnd, layered_child_const_surface, sizeof(layered_child_const_surface), TRUE); + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + check_screen_surface(hwnd, layered_const_surface, sizeof(layered_const_surface), TRUE); + + SetWindowLongW(hwnd, GWL_STYLE, GetWindowLongW(hwnd, GWL_STYLE) | WS_CLIPCHILDREN); + + paint_client_rect(hwnd_child, BGRA2RGB(COLOR2)); + check_client_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), FALSE); + check_screen_surface(hwnd, layered_child_const_surface, sizeof(layered_child_const_surface), TRUE); + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), FALSE); + check_screen_surface(hwnd, layered_child_const_surface, sizeof(layered_child_const_surface), TRUE); + + DestroyWindow(hwnd_child); + check_client_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), FALSE); + check_screen_surface(hwnd, layered_child_const_surface, sizeof(layered_child_const_surface), TRUE); + + DestroyWindow(hwnd); + + + /* SetLayeredWindowAttributes / LWA_COLORKEY */ + + hwnd = CreateWindowW(L"surface", L"", WS_POPUP, 0, 0, 4, 4, 0, NULL, NULL, NULL); + ok(hwnd != 0, "CreateWindowW failed, last error %u\n", GetLastError()); + + SetWindowLongW(hwnd, GWL_EXSTYLE, GetWindowLongW(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED); + ret = SetLayeredWindowAttributes(hwnd, BGRA2RGB(COLOR2), 0, LWA_COLORKEY); + ok(ret, "SetLayeredWindowAttributes failed, last error %u\n", GetLastError()); + ShowWindow(hwnd, SW_SHOW); + flush_events( TRUE ); + + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + check_screen_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + + hwnd_child = CreateWindowW(L"surface", L"", WS_CHILD | WS_VISIBLE, 1, 1, 2, 2, hwnd, NULL, NULL, NULL); + ok(hwnd_child != 0, "CreateWindowW failed, last error %u\n", GetLastError()); + flush_events( TRUE ); + check_client_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + check_screen_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + paint_client_rect(hwnd_child, BGRA2RGB(COLOR2)); + check_client_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), FALSE); + check_screen_surface(hwnd, layered_child_surface, sizeof(layered_child_surface), FALSE); + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + check_screen_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + + SetWindowLongW(hwnd, GWL_STYLE, GetWindowLongW(hwnd, GWL_STYLE) | WS_CLIPCHILDREN); + + paint_client_rect(hwnd_child, BGRA2RGB(COLOR2)); + check_client_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), FALSE); + check_screen_surface(hwnd, layered_child_surface, sizeof(layered_child_surface), FALSE); + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), FALSE); + check_screen_surface(hwnd, layered_child_surface, sizeof(layered_child_surface), FALSE); + + DestroyWindow(hwnd_child); + check_client_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), FALSE); + check_screen_surface(hwnd, layered_child_surface, sizeof(layered_child_surface), FALSE); + + GetClientRect(hwnd, &rect); + OffsetRect(&rect, -rect.left, -rect.top); + + memset(&info, 0, sizeof(info)); + info.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + info.bmiHeader.biWidth = rect.right; + info.bmiHeader.biHeight = rect.bottom; + info.bmiHeader.biPlanes = 1; + info.bmiHeader.biBitCount = 32; + info.bmiHeader.biCompression = BI_RGB; + info.bmiHeader.biSizeImage = rect.right * rect.bottom * 4; + + hdc_dst = GetDC(hwnd); + ok(hdc_dst != 0, "GetDC failed, last error %u\n", GetLastError()); + hdc_src = CreateCompatibleDC(hdc_dst); + ok(hdc_src != 0, "CreateCompatibleDC failed, last error %u\n", GetLastError()); + bmp_obj = CreateDIBSection(hdc_src, &info, DIB_RGB_COLORS, (void **)&data, NULL, 0x0); + ok(bmp_obj != 0, "CreateBitmap failed, last error %u\n", GetLastError()); + SelectObject(hdc_src, bmp_obj); + ret = BitBlt(hdc_src, 0, 0, rect.right, rect.bottom, hdc_dst, 0, 0, SRCCOPY); + ok(ret, "BitBlt failed, last error %u\n", GetLastError()); + ReleaseDC(hwnd, hdc_dst); + + for (i = rect.bottom * rect.right; i != 0; i--) + if (data[i - 1] == COLOR2) data[i - 1] |= 0xff000000; + + DestroyWindow(hwnd); + + + /* UpdateLayeredWindow */ + + hdc_dst = GetDC(NULL); + hwnd = CreateWindowW(L"surface", L"", WS_POPUP, 0, 0, 4, 4, 0, NULL, NULL, NULL); + ok(hwnd != 0, "CreateWindowW failed, last error %u\n", GetLastError()); + + SetWindowLongW(hwnd, GWL_EXSTYLE, GetWindowLongW(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED); + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, hidden_surface, sizeof(hidden_surface), FALSE); + check_screen_surface(hwnd, screen_surface, sizeof(screen_surface), FALSE); + + ret = UpdateLayeredWindow(hwnd, hdc_dst, NULL, (SIZE *)&rect.right, hdc_src, (POINT *)&rect.left, 0, NULL, ULW_OPAQUE); + ok(ret, "UpdateLayeredWindow failed, last error %u\n", GetLastError()); + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, hidden_surface, sizeof(hidden_surface), TRUE); + check_screen_surface(hwnd, screen_surface, sizeof(screen_surface), FALSE); + + ShowWindow(hwnd, SW_SHOW); + flush_events( TRUE ); + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, hidden_surface, sizeof(hidden_surface), TRUE); + check_screen_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), TRUE); + + ret = UpdateLayeredWindow(hwnd, hdc_dst, NULL, (SIZE *)&rect.right, hdc_src, (POINT *)&rect.left, BGRA2RGB(COLOR2), NULL, ULW_COLORKEY); + ok(ret, "UpdateLayeredWindow failed, last error %u\n", GetLastError()); + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, hidden_surface, sizeof(hidden_surface), TRUE); + check_screen_surface(hwnd, layered_child_surface, sizeof(layered_child_surface), TRUE); + + ret = UpdateLayeredWindow(hwnd, hdc_dst, NULL, (SIZE *)&rect.right, hdc_src, (POINT *)&rect.left, 0, &blend_cst_alpha, ULW_ALPHA); + ok(ret, "UpdateLayeredWindow failed, last error %u\n", GetLastError()); + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, hidden_surface, sizeof(hidden_surface), TRUE); + check_screen_surface(hwnd, layered_child_const_surface, sizeof(layered_child_const_surface), TRUE); + + ret = UpdateLayeredWindow(hwnd, hdc_dst, NULL, (SIZE *)&rect.right, hdc_src, (POINT *)&rect.left, 0, &blend_src_alpha, ULW_ALPHA); + ok(ret, "UpdateLayeredWindow failed, last error %u\n", GetLastError()); + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, hidden_surface, sizeof(hidden_surface), TRUE); + check_screen_surface(hwnd, layered_child_alpha_surface, sizeof(layered_child_alpha_surface), TRUE); + + DeleteObject(bmp_obj); + DeleteDC(hdc_src); + ReleaseDC(NULL, hdc_dst); + + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, hidden_surface, sizeof(hidden_surface), TRUE); + check_screen_surface(hwnd, layered_child_alpha_surface, sizeof(layered_child_alpha_surface), TRUE); + + hwnd_child = CreateWindowW(L"surface", L"", WS_CHILD | WS_VISIBLE, 1, 1, 2, 2, hwnd, NULL, NULL, NULL); + ok(hwnd_child != 0, "CreateWindowW failed, last error %u\n", GetLastError()); + flush_events( TRUE ); + check_client_surface(hwnd, hidden_surface, sizeof(hidden_surface), TRUE); + check_screen_surface(hwnd, layered_child_alpha_surface, sizeof(layered_child_alpha_surface), TRUE); + + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + paint_client_rect(hwnd_child, BGRA2RGB(COLOR2)); + check_client_surface(hwnd, hidden_surface, sizeof(hidden_surface), TRUE); + check_screen_surface(hwnd, layered_child_alpha_surface, sizeof(layered_child_alpha_surface), TRUE); + + DestroyWindow(hwnd_child); + DestroyWindow(hwnd); + + + UnregisterClassW(L"surface", NULL); + +#undef BGRA2RGB +#undef COLOR1 +#undef COLOR2 +} + START_TEST(win) { char **argv; @@ -12178,6 +12816,8 @@ START_TEST(win) DestroyWindow(hwndMain2); DestroyWindow(hwndMain);
+ test_surface_composition(); + /* Make sure that following tests are executed last, under Windows they * tend to break the tests which are sensitive to z-order and activation * state of hwndMain and hwndMain2 windows.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/user32/tests/Makefile.in | 2 +- dlls/user32/tests/win.c | 216 +++++++++++++++++++++++++++++++++- 2 files changed, 213 insertions(+), 5 deletions(-)
diff --git a/dlls/user32/tests/Makefile.in b/dlls/user32/tests/Makefile.in index 5b058b7d914..326c44528ec 100644 --- a/dlls/user32/tests/Makefile.in +++ b/dlls/user32/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = user32.dll -IMPORTS = user32 gdi32 advapi32 hid dwmapi +IMPORTS = user32 gdi32 advapi32 hid dwmapi d3d9
C_SRCS = \ broadcast.c \ diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 92fc9449245..0300b3745a8 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -32,6 +32,7 @@ #include "winuser.h" #include "winreg.h" #include "dwmapi.h" +#include "d3d9.h"
#include "wine/test.h"
@@ -12150,6 +12151,57 @@ static void check_client_surface_(int line, HWND hwnd, const DWORD *expect, SIZE free(data); }
+struct d3d9_context +{ + IDirect3D9 *d3d; + IDirect3DDevice9 *device; +}; + +static struct d3d9_context *create_d3d9_context(HWND hwnd) +{ + D3DPRESENT_PARAMETERS params; + struct d3d9_context *ctx; + HRESULT hr; + RECT rect; + + if (!(ctx = malloc(sizeof(struct d3d9_context)))) return NULL; + ctx->d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(ctx->d3d != NULL, "Direct3DCreate9 failed, last error %u\n", GetLastError()); + + GetClientRect(hwnd, &rect); + OffsetRect(&rect, -rect.left, -rect.top); + + memset(¶ms, 0, sizeof(params)); + params.Windowed = TRUE; + params.SwapEffect = D3DSWAPEFFECT_DISCARD; + params.hDeviceWindow = hwnd; + params.BackBufferFormat = D3DFMT_X8R8G8B8; + params.BackBufferWidth = rect.right; + params.BackBufferHeight = rect.bottom; + + hr = IDirect3D9_CreateDevice(ctx->d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, + D3DCREATE_SOFTWARE_VERTEXPROCESSING, ¶ms, &ctx->device); + ok(hr == S_OK, "IDirect3D9_CreateDevice returned %#x\n", hr); + + return ctx; +} + +static void paint_d3d9_client_rect(struct d3d9_context *ctx, DWORD color) +{ + HRESULT hr; + hr = IDirect3DDevice9_Clear(ctx->device, 0, NULL, D3DCLEAR_TARGET, color, 1.0f, 0); + ok(hr == S_OK, "IDirect3DDevice9_Clear returned %#x\n", hr); + hr = IDirect3DDevice9_Present(ctx->device, NULL, NULL, NULL, NULL); + ok(hr == S_OK, "IDirect3DDevice9_Present returned %#x\n", hr); +} + +static void destroy_d3d9_context(struct d3d9_context *ctx) +{ + IDirect3DDevice9_Release(ctx->device); + IDirect3D9_Release(ctx->d3d); + free(ctx); +} + static void paint_client_rect(HWND hwnd, COLORREF color) { HDC hdc = GetDC(hwnd); @@ -12187,6 +12239,8 @@ static void test_surface_composition(void) { #define COLOR1 0x00ff0000 #define COLOR2 0x0000ffff +#define COLOR3 0x00ff00ff +#define COLOR4 0x00ffff00 #define BGRA2RGB(x) RGB((x >> 16) & 0xff, (x >> 8) & 0xff, x & 0xff) static const DWORD minimized_surface[] = { @@ -12213,6 +12267,27 @@ static void test_surface_composition(void) COLOR1, COLOR1, COLOR1, COLOR1, COLOR1, COLOR1, COLOR1, COLOR1, }; + static const DWORD painted_surface2[] = + { + COLOR2, COLOR2, COLOR2, COLOR2, + COLOR2, COLOR2, COLOR2, COLOR2, + COLOR2, COLOR2, COLOR2, COLOR2, + COLOR2, COLOR2, COLOR2, COLOR2, + }; + static const DWORD painted_surface3[] = + { + COLOR3, COLOR3, COLOR3, COLOR3, + COLOR3, COLOR3, COLOR3, COLOR3, + COLOR3, COLOR3, COLOR3, COLOR3, + COLOR3, COLOR3, COLOR3, COLOR3, + }; + static const DWORD painted_surface4[] = + { + COLOR4, COLOR4, COLOR4, COLOR4, + COLOR4, COLOR4, COLOR4, COLOR4, + COLOR4, COLOR4, COLOR4, COLOR4, + COLOR4, COLOR4, COLOR4, COLOR4, + }; static const DWORD painted_child_surface[] = { COLOR1, COLOR1, COLOR1, COLOR1, COLOR1, COLOR2, COLOR2, COLOR1, @@ -12222,10 +12297,14 @@ static void test_surface_composition(void)
DWORD screen_surface[ARRAY_SIZE(painted_surface)]; DWORD layered_const_surface[ARRAY_SIZE(painted_surface)]; + DWORD layered_const_surface2[ARRAY_SIZE(painted_surface2)]; + DWORD layered_const_surface3[ARRAY_SIZE(painted_surface3)]; + DWORD layered_const_surface4[ARRAY_SIZE(painted_surface4)]; DWORD layered_child_surface[ARRAY_SIZE(painted_child_surface)]; DWORD layered_child_const_surface[ARRAY_SIZE(painted_child_surface)]; DWORD layered_child_alpha_surface[ARRAY_SIZE(painted_child_surface)];
+ struct d3d9_context *d3d9_ctx1, *d3d9_ctx2; BLENDFUNCTION blend_cst_alpha = { AC_SRC_OVER, 0, 0x7f, 0 }; BLENDFUNCTION blend_src_alpha = { AC_SRC_OVER, 0, 0xff, AC_SRC_ALPHA }; WNDCLASSEXW wc; @@ -12280,6 +12359,42 @@ static void test_surface_composition(void) layered_const_surface[i] = BGRA2RGB(RGB(dr, dg, db)); }
+ for (i = 0; i < ARRAY_SIZE(painted_surface2); i++) + { + BYTE sr = (screen_surface[i] >> 16) & 0xff, dr = (painted_surface2[i] >> 16) & 0xff; + BYTE sg = (screen_surface[i] >> 8) & 0xff, dg = (painted_surface2[i] >> 8) & 0xff; + BYTE sb = (screen_surface[i] >> 0) & 0xff, db = (painted_surface2[i] >> 0) & 0xff; + BYTE da = 0x7f; + dr = min(max((sr * (0xff - da) + dr * da + 0x7f) / 0xff, 0), 0xff); + dg = min(max((sg * (0xff - da) + dg * da + 0x7f) / 0xff, 0), 0xff); + db = min(max((sb * (0xff - da) + db * da + 0x7f) / 0xff, 0), 0xff); + layered_const_surface2[i] = BGRA2RGB(RGB(dr, dg, db)); + } + + for (i = 0; i < ARRAY_SIZE(painted_surface3); i++) + { + BYTE sr = (screen_surface[i] >> 16) & 0xff, dr = (painted_surface3[i] >> 16) & 0xff; + BYTE sg = (screen_surface[i] >> 8) & 0xff, dg = (painted_surface3[i] >> 8) & 0xff; + BYTE sb = (screen_surface[i] >> 0) & 0xff, db = (painted_surface3[i] >> 0) & 0xff; + BYTE da = 0x7f; + dr = min(max((sr * (0xff - da) + dr * da + 0x7f) / 0xff, 0), 0xff); + dg = min(max((sg * (0xff - da) + dg * da + 0x7f) / 0xff, 0), 0xff); + db = min(max((sb * (0xff - da) + db * da + 0x7f) / 0xff, 0), 0xff); + layered_const_surface3[i] = BGRA2RGB(RGB(dr, dg, db)); + } + + for (i = 0; i < ARRAY_SIZE(painted_surface4); i++) + { + BYTE sr = (screen_surface[i] >> 16) & 0xff, dr = (painted_surface4[i] >> 16) & 0xff; + BYTE sg = (screen_surface[i] >> 8) & 0xff, dg = (painted_surface4[i] >> 8) & 0xff; + BYTE sb = (screen_surface[i] >> 0) & 0xff, db = (painted_surface4[i] >> 0) & 0xff; + BYTE da = 0x7f; + dr = min(max((sr * (0xff - da) + dr * da + 0x7f) / 0xff, 0), 0xff); + dg = min(max((sg * (0xff - da) + dg * da + 0x7f) / 0xff, 0), 0xff); + db = min(max((sb * (0xff - da) + db * da + 0x7f) / 0xff, 0), 0xff); + layered_const_surface4[i] = BGRA2RGB(RGB(dr, dg, db)); + } + memcpy(layered_child_surface, screen_surface, sizeof(screen_surface)); for (i = 0; i < ARRAY_SIZE(painted_child_surface); i++) { @@ -12612,10 +12727,6 @@ static void test_surface_composition(void) check_client_surface(hwnd, hidden_surface, sizeof(hidden_surface), TRUE); check_screen_surface(hwnd, layered_child_alpha_surface, sizeof(layered_child_alpha_surface), TRUE);
- DeleteObject(bmp_obj); - DeleteDC(hdc_src); - ReleaseDC(NULL, hdc_dst); - paint_client_rect(hwnd, BGRA2RGB(COLOR1)); check_client_surface(hwnd, hidden_surface, sizeof(hidden_surface), TRUE); check_screen_surface(hwnd, layered_child_alpha_surface, sizeof(layered_child_alpha_surface), TRUE); @@ -12635,11 +12746,108 @@ static void test_surface_composition(void) DestroyWindow(hwnd);
+ /* D3D / GDI interactions */ + + hwnd = CreateWindowW(L"surface", L"", WS_POPUP | WS_VISIBLE, 0, 0, 4, 4, 0, NULL, NULL, NULL); + ok(hwnd != 0, "CreateWindowW failed, last error %u\n", GetLastError()); + d3d9_ctx1 = create_d3d9_context(hwnd); + d3d9_ctx2 = create_d3d9_context(hwnd); + flush_events( TRUE ); + + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, painted_surface, sizeof(painted_surface), TRUE); + check_screen_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + + paint_d3d9_client_rect(d3d9_ctx1, COLOR2); + check_client_surface(hwnd, painted_surface2, sizeof(painted_surface2), TRUE); + check_screen_surface(hwnd, painted_surface2, sizeof(painted_surface2), FALSE); + + paint_d3d9_client_rect(d3d9_ctx2, COLOR3); + check_client_surface(hwnd, painted_surface3, sizeof(painted_surface3), TRUE); + check_screen_surface(hwnd, painted_surface3, sizeof(painted_surface3), FALSE); + + paint_client_rect(hwnd, BGRA2RGB(COLOR4)); + check_client_surface(hwnd, painted_surface4, sizeof(painted_surface4), TRUE); + check_screen_surface(hwnd, painted_surface4, sizeof(painted_surface4), FALSE); + + destroy_d3d9_context(d3d9_ctx1); + destroy_d3d9_context(d3d9_ctx2); + DestroyWindow(hwnd); + + + /* D3D / SLWA interactions */ + + hwnd = CreateWindowW(L"surface", L"", WS_POPUP, 0, 0, 4, 4, 0, NULL, NULL, NULL); + ok(hwnd != 0, "CreateWindowW failed, last error %u\n", GetLastError()); + d3d9_ctx1 = create_d3d9_context(hwnd); + d3d9_ctx2 = create_d3d9_context(hwnd); + + SetWindowLongW(hwnd, GWL_EXSTYLE, GetWindowLongW(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED); + ret = SetLayeredWindowAttributes(hwnd, 0, 0x7f, LWA_ALPHA); + ok(ret, "SetLayeredWindowAttributes failed, last error %u\n", GetLastError()); + + ShowWindow(hwnd, SW_SHOW); + flush_events( TRUE ); + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + check_screen_surface(hwnd, layered_const_surface, sizeof(layered_const_surface), TRUE); + + paint_d3d9_client_rect(d3d9_ctx1, COLOR2); + check_client_surface(hwnd, painted_surface2, sizeof(painted_surface2), TRUE); + check_screen_surface(hwnd, layered_const_surface2, sizeof(layered_const_surface2), TRUE); + + paint_d3d9_client_rect(d3d9_ctx2, COLOR3); + check_client_surface(hwnd, painted_surface3, sizeof(painted_surface3), TRUE); + check_screen_surface(hwnd, layered_const_surface3, sizeof(layered_const_surface3), TRUE); + + paint_client_rect(hwnd, BGRA2RGB(COLOR4)); + check_client_surface(hwnd, painted_surface4, sizeof(painted_surface4), FALSE); + check_screen_surface(hwnd, layered_const_surface4, sizeof(layered_const_surface4), TRUE); + + destroy_d3d9_context(d3d9_ctx1); + destroy_d3d9_context(d3d9_ctx2); + DestroyWindow(hwnd); + + + /* D3D / ULW interactions */ + + hwnd = CreateWindowW(L"surface", L"", WS_POPUP, 0, 0, 4, 4, 0, NULL, NULL, NULL); + ok(hwnd != 0, "CreateWindowW failed, last error %u\n", GetLastError()); + d3d9_ctx1 = create_d3d9_context(hwnd); + + SetWindowLongW(hwnd, GWL_EXSTYLE, GetWindowLongW(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED); + ret = UpdateLayeredWindow(hwnd, hdc_dst, NULL, (SIZE *)&rect.right, hdc_src, (POINT *)&rect.left, 0, NULL, ULW_OPAQUE); + ok(ret, "UpdateLayeredWindow failed, last error %u\n", GetLastError()); + + ShowWindow(hwnd, SW_SHOW); + flush_events( TRUE ); + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, hidden_surface, sizeof(hidden_surface), TRUE); + check_screen_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), TRUE); + + paint_d3d9_client_rect(d3d9_ctx1, COLOR2); + check_client_surface(hwnd, hidden_surface, sizeof(hidden_surface), TRUE); + check_screen_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), TRUE); + + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, hidden_surface, sizeof(hidden_surface), TRUE); + check_screen_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), TRUE); + + destroy_d3d9_context(d3d9_ctx1); + DestroyWindow(hwnd); + + + DeleteObject(bmp_obj); + DeleteDC(hdc_src); + ReleaseDC(NULL, hdc_dst); + UnregisterClassW(L"surface", NULL);
#undef BGRA2RGB #undef COLOR1 #undef COLOR2 +#undef COLOR3 +#undef COLOR4 }
START_TEST(win)
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=89849
Your paranoid android.
=== build (build log) ===
WineRunBuild.pl:error: The build timed out
=== debiant2 (32 bit report) ===
user32: win.c:12792: Test failed: Unexpected client surface data win.c:12804: Test failed: Unexpected client surface data
=== debiant2 (32 bit French report) ===
user32: win.c:11548: Test failed: got normal pos (200,88)-(400,288) win.c:11551: Test failed: got window rect (200,88)-(400,288) win.c:11564: Test failed: got normal pos (200,88)-(400,288) win.c:12792: Test failed: Unexpected client surface data win.c:12804: Test failed: Unexpected client surface data
=== debiant2 (64 bit WoW report) ===
user32: win.c:12792: Test failed: Unexpected client surface data win.c:12804: Test failed: Unexpected client surface data
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/user32/tests/Makefile.in | 2 +- dlls/user32/tests/win.c | 144 +++++++++++++++++++++++++++++++++- 2 files changed, 143 insertions(+), 3 deletions(-)
diff --git a/dlls/user32/tests/Makefile.in b/dlls/user32/tests/Makefile.in index 326c44528ec..e7f9883896f 100644 --- a/dlls/user32/tests/Makefile.in +++ b/dlls/user32/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = user32.dll -IMPORTS = user32 gdi32 advapi32 hid dwmapi d3d9 +IMPORTS = user32 gdi32 advapi32 hid dwmapi d3d9 opengl32
C_SRCS = \ broadcast.c \ diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 0300b3745a8..20f3e2ede18 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -34,6 +34,7 @@ #include "dwmapi.h" #include "d3d9.h"
+#include "wine/wgl.h" #include "wine/test.h"
#ifndef SPI_GETDESKWALLPAPER @@ -12121,6 +12122,7 @@ static SIZE_T capture_client_surface_(int line, HWND hwnd, DWORD *surface, SIZE_ SIZE_T data_size; RECT rect; HDC hdc; + int i;
GetClientRect(hwnd, &rect); OffsetRect(&rect, -rect.left, -rect.top); @@ -12130,6 +12132,9 @@ static SIZE_T capture_client_surface_(int line, HWND hwnd, DWORD *surface, SIZE_ data_size = capture_surface_(line, hdc, 0, 0, rect.right, rect.bottom, surface, surface_size); ReleaseDC(hwnd, hdc);
+ /* clear inconsistent alpha channel (D3D R5G6B5 clear sets it, other paint ops clear it) */ + for (i = 0; i < data_size / 4; i++) surface[i] &= 0xffffff; + return data_size; }
@@ -12175,7 +12180,7 @@ static struct d3d9_context *create_d3d9_context(HWND hwnd) params.Windowed = TRUE; params.SwapEffect = D3DSWAPEFFECT_DISCARD; params.hDeviceWindow = hwnd; - params.BackBufferFormat = D3DFMT_X8R8G8B8; + params.BackBufferFormat = D3DFMT_R5G6B5; /* something incompatible with GL */ params.BackBufferWidth = rect.right; params.BackBufferHeight = rect.bottom;
@@ -12202,6 +12207,67 @@ static void destroy_d3d9_context(struct d3d9_context *ctx) free(ctx); }
+struct gl_context +{ + HWND hwnd; + HDC hdc; + HGLRC hrc; + IDirect3D9 *d3d; + IDirect3DDevice9 *device; +}; + +static struct gl_context *create_gl_context(HWND hwnd) +{ + PIXELFORMATDESCRIPTOR desc; + struct gl_context *ctx; + RECT rect; + BOOL ret; + INT pixel_format; + + if (!(ctx = malloc(sizeof(struct gl_context)))) return NULL; + + GetClientRect(hwnd, &rect); + OffsetRect(&rect, -rect.left, -rect.top); + + memset(&desc, 0, sizeof(desc)); + desc.nSize = sizeof(PIXELFORMATDESCRIPTOR); + desc.nVersion = 1; + desc.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; + desc.iPixelType = PFD_TYPE_RGBA; + desc.cColorBits = 32; + + ctx->hwnd = hwnd; + ctx->hdc = GetDC(hwnd); + pixel_format = ChoosePixelFormat(ctx->hdc, &desc); + ok(pixel_format, "ChoosePixelFormat returned 0, last error %u\n", GetLastError()); + ret = SetPixelFormat(ctx->hdc, pixel_format, &desc); + ok(ret, "SetPixelFormat failed, last error %u\n", GetLastError()); + ctx->hrc = wglCreateContext(ctx->hdc); + wglMakeCurrent(ctx->hdc, ctx->hrc); + glViewport(0, 0, (GLint)rect.right, (GLint)rect.bottom); + + return ctx; +} + +static void paint_gl_client_rect(struct gl_context *ctx, DWORD color) +{ + BOOL ret; + ret = wglMakeCurrent(ctx->hdc, ctx->hrc); + ok(ret, "wglMakeCurrent failed\n"); + glClearColor((color >> 16) & 0xff, (color >> 8) & 0xff, (color >> 0) & 0xff, 0); + glClear(GL_COLOR_BUFFER_BIT); + ret = SwapBuffers(ctx->hdc); + ok(ret, "SwapBuffers failed\n"); +} + +static void destroy_gl_context(struct gl_context *ctx) +{ + wglMakeCurrent(NULL, NULL); + wglDeleteContext(ctx->hrc); + ReleaseDC(ctx->hwnd, ctx->hdc); + free(ctx); +} + static void paint_client_rect(HWND hwnd, COLORREF color) { HDC hdc = GetDC(hwnd); @@ -12305,6 +12371,7 @@ static void test_surface_composition(void) DWORD layered_child_alpha_surface[ARRAY_SIZE(painted_child_surface)];
struct d3d9_context *d3d9_ctx1, *d3d9_ctx2; + struct gl_context *gl_ctx1, *gl_ctx2; BLENDFUNCTION blend_cst_alpha = { AC_SRC_OVER, 0, 0x7f, 0 }; BLENDFUNCTION blend_src_alpha = { AC_SRC_OVER, 0, 0xff, AC_SRC_ALPHA }; WNDCLASSEXW wc; @@ -12746,7 +12813,7 @@ static void test_surface_composition(void) DestroyWindow(hwnd);
- /* D3D / GDI interactions */ + /* D3D / GL / GDI interactions */
hwnd = CreateWindowW(L"surface", L"", WS_POPUP | WS_VISIBLE, 0, 0, 4, 4, 0, NULL, NULL, NULL); ok(hwnd != 0, "CreateWindowW failed, last error %u\n", GetLastError()); @@ -12770,6 +12837,44 @@ static void test_surface_composition(void) check_client_surface(hwnd, painted_surface4, sizeof(painted_surface4), TRUE); check_screen_surface(hwnd, painted_surface4, sizeof(painted_surface4), FALSE);
+ gl_ctx1 = create_gl_context(hwnd); + gl_ctx2 = create_gl_context(hwnd); + flush_events( TRUE ); + + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, painted_surface, sizeof(painted_surface), TRUE); + check_screen_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + + paint_gl_client_rect(gl_ctx1, COLOR2); + check_client_surface(hwnd, painted_surface2, sizeof(painted_surface2), TRUE); + check_screen_surface(hwnd, painted_surface2, sizeof(painted_surface2), FALSE); + + paint_gl_client_rect(gl_ctx2, COLOR3); + check_client_surface(hwnd, painted_surface3, sizeof(painted_surface3), TRUE); + check_screen_surface(hwnd, painted_surface3, sizeof(painted_surface3), FALSE); + + paint_d3d9_client_rect(d3d9_ctx1, COLOR4); + check_client_surface(hwnd, painted_surface4, sizeof(painted_surface4), TRUE); + check_screen_surface(hwnd, painted_surface4, sizeof(painted_surface4), TRUE); + + paint_gl_client_rect(gl_ctx2, COLOR2); + check_client_surface(hwnd, painted_surface2, sizeof(painted_surface2), TRUE); + check_screen_surface(hwnd, painted_surface2, sizeof(painted_surface2), FALSE); + + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, painted_surface, sizeof(painted_surface), TRUE); + check_screen_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + + paint_d3d9_client_rect(d3d9_ctx2, COLOR3); + check_client_surface(hwnd, painted_surface3, sizeof(painted_surface3), TRUE); + check_screen_surface(hwnd, painted_surface3, sizeof(painted_surface3), TRUE); + + paint_gl_client_rect(gl_ctx1, COLOR4); + check_client_surface(hwnd, painted_surface4, sizeof(painted_surface4), TRUE); + check_screen_surface(hwnd, painted_surface4, sizeof(painted_surface4), FALSE); + + destroy_gl_context(gl_ctx1); + destroy_gl_context(gl_ctx2); destroy_d3d9_context(d3d9_ctx1); destroy_d3d9_context(d3d9_ctx2); DestroyWindow(hwnd); @@ -12804,6 +12909,35 @@ static void test_surface_composition(void) check_client_surface(hwnd, painted_surface4, sizeof(painted_surface4), FALSE); check_screen_surface(hwnd, layered_const_surface4, sizeof(layered_const_surface4), TRUE);
+ gl_ctx1 = create_gl_context(hwnd); + gl_ctx2 = create_gl_context(hwnd); + flush_events( TRUE ); + paint_client_rect(hwnd, BGRA2RGB(COLOR1)); + check_client_surface(hwnd, painted_surface, sizeof(painted_surface), FALSE); + check_screen_surface(hwnd, layered_const_surface, sizeof(layered_const_surface), TRUE); + + paint_gl_client_rect(gl_ctx1, COLOR2); + check_client_surface(hwnd, painted_surface2, sizeof(painted_surface2), FALSE); + check_screen_surface(hwnd, layered_const_surface2, sizeof(layered_const_surface2), TRUE); + + paint_d3d9_client_rect(d3d9_ctx1, COLOR3); + check_client_surface(hwnd, painted_surface3, sizeof(painted_surface3), TRUE); + check_screen_surface(hwnd, layered_const_surface3, sizeof(layered_const_surface3), TRUE); + + paint_gl_client_rect(gl_ctx2, COLOR4); + check_client_surface(hwnd, painted_surface4, sizeof(painted_surface4), FALSE); + check_screen_surface(hwnd, layered_const_surface4, sizeof(layered_const_surface4), TRUE); + + paint_client_rect(hwnd, BGRA2RGB(COLOR2)); + check_client_surface(hwnd, painted_surface2, sizeof(painted_surface2), FALSE); + check_screen_surface(hwnd, layered_const_surface2, sizeof(layered_const_surface2), TRUE); + + paint_d3d9_client_rect(d3d9_ctx2, COLOR1); + check_client_surface(hwnd, painted_surface, sizeof(painted_surface), TRUE); + check_screen_surface(hwnd, layered_const_surface, sizeof(layered_const_surface), TRUE); + + destroy_gl_context(gl_ctx1); + destroy_gl_context(gl_ctx2); destroy_d3d9_context(d3d9_ctx1); destroy_d3d9_context(d3d9_ctx2); DestroyWindow(hwnd); @@ -12814,6 +12948,7 @@ static void test_surface_composition(void) hwnd = CreateWindowW(L"surface", L"", WS_POPUP, 0, 0, 4, 4, 0, NULL, NULL, NULL); ok(hwnd != 0, "CreateWindowW failed, last error %u\n", GetLastError()); d3d9_ctx1 = create_d3d9_context(hwnd); + gl_ctx1 = create_gl_context(hwnd);
SetWindowLongW(hwnd, GWL_EXSTYLE, GetWindowLongW(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED); ret = UpdateLayeredWindow(hwnd, hdc_dst, NULL, (SIZE *)&rect.right, hdc_src, (POINT *)&rect.left, 0, NULL, ULW_OPAQUE); @@ -12825,6 +12960,10 @@ static void test_surface_composition(void) check_client_surface(hwnd, hidden_surface, sizeof(hidden_surface), TRUE); check_screen_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), TRUE);
+ paint_gl_client_rect(gl_ctx1, COLOR1); + check_client_surface(hwnd, hidden_surface, sizeof(hidden_surface), TRUE); + check_screen_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), TRUE); + paint_d3d9_client_rect(d3d9_ctx1, COLOR2); check_client_surface(hwnd, hidden_surface, sizeof(hidden_surface), TRUE); check_screen_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), TRUE); @@ -12833,6 +12972,7 @@ static void test_surface_composition(void) check_client_surface(hwnd, hidden_surface, sizeof(hidden_surface), TRUE); check_screen_surface(hwnd, painted_child_surface, sizeof(painted_child_surface), TRUE);
+ destroy_gl_context(gl_ctx1); destroy_d3d9_context(d3d9_ctx1); DestroyWindow(hwnd);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=89850
Your paranoid android.
=== w1064 (32 bit report) ===
user32: clipboard.c:402: Test failed: GlobalGetAtomNameA should fail clipboard.c:403: Test failed: err -559038737
=== w10pro64_ar (64 bit report) ===
user32: clipboard.c:781: Test failed: 0: CF_LOCALE 00000c01/00000409 clipboard.c:781: Test failed: 1: CF_LOCALE 00000c01/00000409 clipboard.c:781: Test failed: 2: CF_LOCALE 00000c01/00000409
=== w10pro64_he (64 bit report) ===
user32: clipboard.c:781: Test failed: 0: CF_LOCALE 0000040d/00000409 clipboard.c:781: Test failed: 1: CF_LOCALE 0000040d/00000409 clipboard.c:781: Test failed: 2: CF_LOCALE 0000040d/00000409
=== w1064v1507 (32 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064v1809 (32 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064 (32 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w10pro64 (32 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064v1507 (64 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064v1809 (64 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064 (64 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064_2qxl (64 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w10pro64 (64 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w10pro64_ar (64 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w10pro64_he (64 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w10pro64_ja (64 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w10pro64_zh_CN (64 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w7u_2qxl (32 bit report) ===
user32: input.c:757: Test failed: 0 (a4/0): 00 from 00 -> 80 unexpected input.c:757: Test failed: 0 (a4/0): 41 from 01 -> 00 unexpected
=== w8adm (32 bit report) ===
user32: input.c:3299: Test failed: expected WM_LBUTTONDOWN message input.c:3300: Test failed: expected WM_LBUTTONUP message input.c:3327: Test failed: expected WM_NCHITTEST message input.c:3328: Test failed: expected WM_RBUTTONDOWN message input.c:3329: Test failed: expected WM_RBUTTONUP message input.c:3357: Test failed: expected WM_NCHITTEST message input.c:3358: Test failed: expected WM_LBUTTONDOWN message input.c:3359: Test failed: expected WM_LBUTTONUP message input.c:3385: Test failed: expected WM_NCHITTEST message input.c:3412: Test failed: expected loop with WM_NCHITTEST messages input.c:3465: Test failed: expected WM_LBUTTONDOWN message input.c:3466: Test failed: expected WM_LBUTTONUP message
=== wvistau64 (64 bit report) ===
user32: input.c:757: Test failed: 0 (a4/0): 01 from 01 -> 00 unexpected input.c:757: Test failed: 0 (a4/0): 11 from 01 -> 00 unexpected input.c:757: Test failed: 0 (a4/0): a2 from 01 -> 00 unexpected
=== w10pro64_zh_CN (64 bit report) ===
user32: input.c:3299: Test failed: expected WM_LBUTTONDOWN message input.c:3300: Test failed: expected WM_LBUTTONUP message input.c:3327: Test failed: expected WM_NCHITTEST message input.c:3328: Test failed: expected WM_RBUTTONDOWN message input.c:3329: Test failed: expected WM_RBUTTONUP message input.c:3358: Test failed: expected WM_LBUTTONDOWN message input.c:3359: Test failed: expected WM_LBUTTONUP message input.c:3412: Test failed: expected loop with WM_NCHITTEST messages input.c:3465: Test failed: expected WM_LBUTTONDOWN message input.c:3466: Test failed: expected WM_LBUTTONUP message
=== w7u_adm (32 bit report) ===
user32: listbox.c:1140: Test failed: SendMessage(LB_DIR, DDL_DRIVES, *) filled with 11 entries, expected 10 listbox.c:1272: Test failed: SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE) filled with 6 entries, expected 7 listbox.c:1315: Test failed: SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE) filled with 8 entries, expected 9
=== w7u_el (32 bit report) ===
user32: listbox.c:1140: Test failed: SendMessage(LB_DIR, DDL_DRIVES, *) filled with 13 entries, expected 14 listbox.c:1272: Test failed: SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE) filled with 7 entries, expected 6 listbox.c:1315: Test failed: SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE) filled with 9 entries, expected 8
=== w10pro64_ar (64 bit report) ===
user32: menu.c:2337: Test failed: test 6 menu.c:2337: Test failed: test 8 menu.c:2337: Test failed: test 10 menu.c:2337: Test failed: test 12 menu.c:2337: Test failed: test 14 menu.c:2337: Test failed: test 16
=== w10pro64_he (64 bit report) ===
user32: menu.c:2337: Test failed: test 6 menu.c:2337: Test failed: test 8 menu.c:2337: Test failed: test 10 menu.c:2337: Test failed: test 12 menu.c:2337: Test failed: test 14 menu.c:2337: Test failed: test 16
=== w10pro64 (32 bit report) ===
user32: msg.c:9009: Test failed: MsgWaitForMultipleObjects failed 102 msg.c:9013: Test failed: WaitForSingleObject failed 102 msg.c:9017: Test failed: WaitForSingleObject failed ffffffff msg.c:9023: Test failed: destroy child on thread exit: 0: the msg 0x0082 was expected, but got msg 0x0081 instead msg.c:9023: Test failed: destroy child on thread exit: 1: the msg 0x000f was expected, but got msg 0x0083 instead msg.c:9023: Test failed: destroy child on thread exit: 2: the msg 0x0014 was expected, but got msg 0x0001 instead msg.c:9023: Test failed: destroy child on thread exit: 3: the msg sequence is not complete: expected 0000 - actual 0005 msg.c:8829: Test failed: Failed to create child window msg.c:8865: Test failed: WaitForSingleObject failed ffffffff
=== w8 (32 bit report) ===
user32: sysparams.c:2508: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2519: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w8adm (32 bit report) ===
user32: sysparams.c:2508: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2519: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w864 (32 bit report) ===
user32: sysparams.c:2508: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2519: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w1064v1809 (32 bit report) ===
user32: sysparams.c:2508: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2519: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w1064 (32 bit report) ===
user32: sysparams.c:2508: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2519: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w1064_tsign (32 bit report) ===
user32: sysparams.c:224: Test failed: Unexpected WM_DISPLAYCHANGE message sysparams.c:2508: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2519: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w10pro64 (32 bit report) ===
user32: sysparams.c:2508: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2519: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== debiant2 (32 bit French report) ===
user32: win.c:12897: Test failed: Unexpected client surface data win.c:12909: Test failed: Unexpected client surface data win.c:12916: Test failed: Unexpected client surface data win.c:12920: Test failed: Unexpected client surface data win.c:12928: Test failed: Unexpected client surface data win.c:12932: Test failed: Unexpected client surface data
=== debiant2 (32 bit Chinese:China report) ===
user32: msg: Timeout
Report validation errors: win: Timeout
=== debiant2 (build log) ===
WineRunWineTest.pl:error: The task timed out
=== debiant2 (32 bit WoW report) ===
user32: msg.c:12605: Test failed: coords not changed: (639 100) (639 105) msg.c:12623: Test failed: coords not changed: (639 105) (639 110)
=== debiant2 (64 bit WoW report) ===
user32: win.c:10158: Test failed: Expected foreground window 0, got 0000000000D1009C win.c:10164: Test failed: Expected foreground window 0000000000470118, got 0000000000D1009C
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=89848
Your paranoid android.
=== w1064 (32 bit report) ===
user32: clipboard.c:402: Test failed: GlobalGetAtomNameA should fail clipboard.c:403: Test failed: err -559038737
=== w10pro64_ar (64 bit report) ===
user32: clipboard.c:781: Test failed: 0: CF_LOCALE 00000c01/00000409 clipboard.c:781: Test failed: 1: CF_LOCALE 00000c01/00000409 clipboard.c:781: Test failed: 2: CF_LOCALE 00000c01/00000409
=== w10pro64_he (64 bit report) ===
user32: clipboard.c:781: Test failed: 0: CF_LOCALE 0000040d/00000409 clipboard.c:781: Test failed: 1: CF_LOCALE 0000040d/00000409 clipboard.c:781: Test failed: 2: CF_LOCALE 0000040d/00000409
=== w1064v1507 (32 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064v1809 (32 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064 (32 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w10pro64 (32 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064v1507 (64 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064v1809 (64 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064 (64 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064_2qxl (64 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w10pro64 (64 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w10pro64_ar (64 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w10pro64_he (64 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w10pro64_ja (64 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w10pro64_zh_CN (64 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w7u_2qxl (32 bit report) ===
user32: input.c:757: Test failed: 0 (a4/0): 00 from 00 -> 80 unexpected input.c:757: Test failed: 0 (a4/0): 41 from 01 -> 00 unexpected
=== w1064v1809 (32 bit report) ===
user32: input.c:2748: Test failed: 0: expected WM_MOUSEMOVE message input.c:2748: Test failed: 1: expected WM_MOUSEMOVE message input.c:2748: Test failed: 2: expected WM_MOUSEMOVE message
=== wvistau64 (64 bit report) ===
user32: input.c:757: Test failed: 0 (a4/0): 01 from 01 -> 00 unexpected input.c:757: Test failed: 0 (a4/0): 11 from 01 -> 00 unexpected input.c:757: Test failed: 0 (a4/0): a2 from 01 -> 00 unexpected
=== w10pro64_ar (64 bit report) ===
user32: menu.c:2337: Test failed: test 6 menu.c:2337: Test failed: test 8 menu.c:2337: Test failed: test 10 menu.c:2337: Test failed: test 12 menu.c:2337: Test failed: test 14 menu.c:2337: Test failed: test 16
=== w10pro64_he (64 bit report) ===
user32: menu.c:2337: Test failed: test 6 menu.c:2337: Test failed: test 8 menu.c:2337: Test failed: test 10 menu.c:2337: Test failed: test 12 menu.c:2337: Test failed: test 14 menu.c:2337: Test failed: test 16
=== w10pro64_zh_CN (64 bit report) ===
user32: msg.c:5564: Test failed: RedrawWindow:show_popup_extreme_location: 24: the msg 0x0085 was expected, but got msg 0x0047 instead msg.c:5564: Test failed: RedrawWindow:show_popup_extreme_location: 25: the msg sequence is not complete: expected 0014 - actual 0000
=== w8 (32 bit report) ===
user32: sysparams.c:2508: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2519: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w8adm (32 bit report) ===
user32: sysparams.c:2508: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2519: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w864 (32 bit report) ===
user32: sysparams.c:2508: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2519: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w1064v1809 (32 bit report) ===
user32: sysparams.c:2508: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2519: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w1064 (32 bit report) ===
user32: sysparams.c:2508: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2519: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w1064_tsign (32 bit report) ===
user32: sysparams.c:2508: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2519: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w10pro64 (32 bit report) ===
user32: sysparams.c:2508: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2519: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w10pro64_ar (64 bit report) ===
user32: sysparams.c:245: Test failed: too many changes counter=1 last change=42 sysparams.c:286: Test failed: Wrong action got 33 expected 42
=== w1064_tsign (32 bit report) ===
user32: win.c:3869: Test failed: hwnd 00020178/00020178 message 0200 win.c:3873: Test failed: hwnd 00020178/00020178 message 0201 win.c:3882: Test failed: hwnd 0041023A/0041023A message 0202 win.c:3885: Test failed: hwnd 0041023A/0041023A message 0200
=== w7u_adm (32 bit report) ===
user32: winstation.c:426: Test failed: Could not open desktop new_desk! winstation.c:452: Test failed: LastError is set to 00000002
=== debiant2 (32 bit French report) ===
user32: msg: Timeout