Module: wine Branch: master Commit: 4277b055dec37fb8da85d6b674e9b522c8bdbfd6 URL: http://source.winehq.org/git/wine.git/?a=commit;h=4277b055dec37fb8da85d6b674...
Author: Józef Kucia jkucia@codeweavers.com Date: Wed Aug 17 13:56:09 2016 +0200
user32: Prevent resetting WS_MINIMIZE through SetWindowLong.
Signed-off-by: Józef Kucia jkucia@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/user32/tests/win.c | 9 ++------- dlls/user32/win.c | 2 ++ 2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index f7ed6d5..2ba5f76 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -6281,7 +6281,6 @@ static LRESULT WINAPI check_style_wnd_proc(HWND hwnd, UINT message, WPARAM wPara { ok(got->styleOld == expected[1].styleOld, "expected old style %#x, got %#x\n", expected[1].styleOld, got->styleOld); - todo_wine_if(expected[0].styleOld & WS_MINIMIZE) ok(got->styleNew == expected[1].styleNew, "expected new style %#x, got %#x\n", expected[1].styleNew, got->styleNew); } @@ -6330,13 +6329,9 @@ static void test_set_window_style(void)
for (i = 0; i < sizeof(tests) / sizeof(*tests); i++) { - BOOL todo = FALSE; expected_style = tests[i].style; - if ((tests[i].creation_style & WS_MINIMIZE) && !(tests[i].style & WS_MINIMIZE)) - { - todo = TRUE; + if (tests[i].creation_style & WS_MINIMIZE) expected_style |= WS_MINIMIZE; - }
expected_stylestruct[0].styleOld = tests[i].creation_style; expected_stylestruct[0].styleNew = tests[i].style; @@ -6352,7 +6347,7 @@ static void test_set_window_style(void) ok(old_style == tests[i].creation_style, "expected old style %#x, got %#x\n", tests[i].creation_style, old_style); new_style = GetWindowLongA(hwnd, GWL_STYLE); - todo_wine_if(todo) ok(new_style == expected_style, "expected new style %#x, got %#x\n", + ok(new_style == expected_style, "expected new style %#x, got %#x\n", expected_style, new_style);
SetWindowLongPtrA(hwnd, GWLP_USERDATA, 0); diff --git a/dlls/user32/win.c b/dlls/user32/win.c index f69297c..8ece6a1 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -2367,6 +2367,8 @@ LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, UINT size, LONG_PTR newval, B newval = style.styleNew; /* WS_CLIPSIBLINGS can't be reset on top-level windows */ if (wndPtr->parent == GetDesktopWindow()) newval |= WS_CLIPSIBLINGS; + /* WS_MINIMIZE can't be reset */ + if (wndPtr->dwStyle & WS_MINIMIZE) newval |= WS_MINIMIZE; /* FIXME: changing WS_DLGFRAME | WS_THICKFRAME is supposed to change WS_EX_WINDOWEDGE too */ break;