winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
February 2019
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
672 discussions
Start a n
N
ew thread
Nikolay Sivov : comctl32/toolbar: Send BN_CLICKED for button that was pressed, not released.
by Alexandre Julliard
18 Feb '19
18 Feb '19
Module: wine Branch: master Commit: f3775ed2ac13ade19a4603f5fba558064311f0b7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f3775ed2ac13ade19a4603f5…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Feb 17 01:33:10 2019 +0300 comctl32/toolbar: Send BN_CLICKED for button that was pressed, not released. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=35516
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/toolbar.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index f4bdb60..b0c1fb5 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -5733,7 +5733,10 @@ TOOLBAR_LButtonUp (TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) TOOLBAR_SendNotify(&hdr, infoPtr, TBN_TOOLBARCHANGE); } - else if (infoPtr->nButtonDown >= 0) { + else if (infoPtr->nButtonDown >= 0) + { + BOOL was_clicked = nHit == infoPtr->nButtonDown; + btnPtr = &infoPtr->buttons[infoPtr->nButtonDown]; btnPtr->fsState &= ~TBSTATE_PRESSED; @@ -5775,7 +5778,7 @@ TOOLBAR_LButtonUp (TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) TOOLBAR_SendNotify ((NMHDR *) &nmtb, infoPtr, TBN_ENDDRAG); - if (btnPtr->fsState & TBSTATE_ENABLED) + if (was_clicked && btnPtr->fsState & TBSTATE_ENABLED) { SendMessageW (infoPtr->hwndNotify, WM_COMMAND, MAKEWPARAM(infoPtr->buttons[nHit].idCommand, BN_CLICKED), (LPARAM)infoPtr->hwndSelf);
1
0
0
0
Nikolay Sivov : comctl32/toolbar: Draw button in idle state when mouse is captured.
by Alexandre Julliard
18 Feb '19
18 Feb '19
Module: wine Branch: master Commit: f037019e5d3e6b4d0d8abaf59063d9d96dfb7108 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f037019e5d3e6b4d0d8abaf5…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Feb 17 01:33:09 2019 +0300 comctl32/toolbar: Draw button in idle state when mouse is captured. When captured moving cursor over other buttons should not produce hot item feedback, only pressed button appearance changes. Hot item notifications are still delivered. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/toolbar.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index ec3b498..f4bdb60 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -717,7 +717,7 @@ static void TOOLBAR_DrawMasked(HIMAGELIST himl, int index, HDC hdc, INT x, INT y static UINT -TOOLBAR_TranslateState(const TBUTTON_INFO *btnPtr) +TOOLBAR_TranslateState(const TBUTTON_INFO *btnPtr, BOOL captured) { UINT retstate = 0; @@ -725,7 +725,7 @@ TOOLBAR_TranslateState(const TBUTTON_INFO *btnPtr) retstate |= (btnPtr->fsState & TBSTATE_PRESSED) ? CDIS_SELECTED : 0; retstate |= (btnPtr->fsState & TBSTATE_ENABLED) ? 0 : CDIS_DISABLED; retstate |= (btnPtr->fsState & TBSTATE_MARKED ) ? CDIS_MARKED : 0; - retstate |= (btnPtr->bHot ) ? CDIS_HOT : 0; + retstate |= (btnPtr->bHot & !captured ) ? CDIS_HOT : 0; retstate |= ((btnPtr->fsState & (TBSTATE_ENABLED|TBSTATE_INDETERMINATE)) == (TBSTATE_ENABLED|TBSTATE_INDETERMINATE)) ? CDIS_INDETERMINATE : 0; /* NOTE: we don't set CDIS_GRAYED, CDIS_FOCUS, CDIS_DEFAULT */ return retstate; @@ -987,7 +987,7 @@ TOOLBAR_DrawButton (const TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, HDC hdc, tbcd.rcText.top = 0; tbcd.rcText.right = rcText.right - rc.left; tbcd.rcText.bottom = rcText.bottom - rc.top; - tbcd.nmcd.uItemState = TOOLBAR_TranslateState(btnPtr); + tbcd.nmcd.uItemState = TOOLBAR_TranslateState(btnPtr, infoPtr->bCaptured); tbcd.nmcd.hdc = hdc; tbcd.nmcd.rc = btnPtr->rect; tbcd.hbrMonoDither = COMCTL32_hPattern55AABrush;
1
0
0
0
Michael Stefaniuc : oleaut32/tests: Propagate the const instead of casting it away.
by Alexandre Julliard
18 Feb '19
18 Feb '19
Module: wine Branch: master Commit: e36476ff7e13fe8309bf1b057872e5df789dafce URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e36476ff7e13fe8309bf1b05…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Fri Feb 15 23:08:15 2019 +0100 oleaut32/tests: Propagate the const instead of casting it away. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/oleaut32/tests/typelib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c index 857100e..ef0c32c 100644 --- a/dlls/oleaut32/tests/typelib.c +++ b/dlls/oleaut32/tests/typelib.c @@ -4807,7 +4807,7 @@ static void test_dump_typelib(const char *name) for (func = 0; func < typeattr->cFuncs; func++) { - function_info *fn_info = (function_info *)&ti->funcs[func]; + const function_info *fn_info = &ti->funcs[func]; FUNCDESC *desc; BSTR namesTab[256]; UINT cNames;
1
0
0
0
Zebediah Figura : user32/tests: Add tests for ArrangeIconicWindows().
by Alexandre Julliard
18 Feb '19
18 Feb '19
Module: wine Branch: master Commit: 0bff174335e12b3d3bb8c367218b2e3c67e77134 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0bff174335e12b3d3bb8c367…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Thu Feb 14 21:56:23 2019 -0600 user32/tests: Add tests for ArrangeIconicWindows(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/win.c | 162 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 162 insertions(+) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 65e4b14..50dbf49 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -11337,6 +11337,167 @@ todo_wine DestroyWindow(hwnd); } +static void test_arrange_iconic_windows(void) +{ + MINIMIZEDMETRICS mm = {sizeof(mm)}, oldmm = {sizeof(oldmm)}; + RECT orig = {100, 200, 300, 400}, rect, expect, parent_rect; + POINT pt = {0}; + HWND parent, hwnds[10]; + UINT ret; + int i, row, col; + + parent = CreateWindowA("MainWindowClass", "parent", WS_OVERLAPPEDWINDOW, + 100, 200, 500, 300, NULL, 0, 0, NULL); + ok(!!parent, "failed to create window, error %u\n", GetLastError()); + + GetClientRect(parent, &parent_rect); + ClientToScreen(parent, &pt); + SystemParametersInfoA(SPI_GETMINIMIZEDMETRICS, sizeof(oldmm), &oldmm, 0); + + mm.iWidth = 100; + mm.iHorzGap = 40; + mm.iVertGap = 3; + mm.iArrange = ARW_TOPLEFT | ARW_RIGHT; + ret = SystemParametersInfoA(SPI_SETMINIMIZEDMETRICS, sizeof(mm), &mm, 0); + ok(ret, "failed to set minimized metrics, error %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = ArrangeIconicWindows(parent); +todo_wine + ok(!ret, "wrong ret %u\n", ret); + ok(GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError()); + + for (i = 0; i < ARRAY_SIZE(hwnds); ++i) + { + hwnds[i] = CreateWindowA("MainWindowClass", "child", WS_CHILD | + WS_OVERLAPPEDWINDOW, orig.left, orig.top, orig.right - orig.left, + orig.bottom - orig.top, parent, 0, 0, NULL); + ok(!!hwnds[i], "failed to create window %u, error %u\n", i, GetLastError()); + } + + SetLastError(0xdeadbeef); + ret = ArrangeIconicWindows(parent); +todo_wine + ok(!ret, "wrong ret %u\n", ret); + ok(GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError()); + + for (i = 0; i < ARRAY_SIZE(hwnds); ++i) + { + GetWindowRect(hwnds[i], &rect); + expect = orig; + OffsetRect(&expect, pt.x, pt.y); + ok(EqualRect(&rect, &expect), "hwnd %u: expected rect %s, got %s\n", i, + wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect)); + } + + ShowWindow(hwnds[0], SW_MINIMIZE); + + for (i = 0; i < ARRAY_SIZE(hwnds); ++i) + { + ret = SetWindowPos(hwnds[i], 0, orig.left, orig.top, 0, 0, + SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE); + ok(ret, "hwnd %u: failed to move window, error %u\n", i, GetLastError()); + } + + ret = ArrangeIconicWindows(parent); +todo_wine + ok(ret == 1, "wrong ret %u\n", ret); + + GetWindowRect(hwnds[0], &rect); + SetRect(&expect, 0, 0, GetSystemMetrics(SM_CXMINIMIZED), GetSystemMetrics(SM_CYMINIMIZED)); + OffsetRect(&expect, mm.iHorzGap, mm.iVertGap); + OffsetRect(&expect, pt.x, pt.y); +todo_wine + ok(EqualRect(&rect, &expect), "expected rect %s, got %s\n", + wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect)); + + for (i = 1; i < ARRAY_SIZE(hwnds); ++i) + { + GetWindowRect(hwnds[i], &rect); + expect = orig; + OffsetRect(&expect, pt.x, pt.y); + ok(EqualRect(&rect, &expect), "hwnd %u: expected rect %s, got %s\n", i, + wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect)); + } + + for (i = 0; i < ARRAY_SIZE(hwnds); ++i) + { + ShowWindow(hwnds[i], SW_MINIMIZE); + ret = SetWindowPos(hwnds[i], 0, orig.left, orig.top, 0, 0, + SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE); + ok(ret, "hwnd %u: failed to move window, error %u\n", i, GetLastError()); + } + + ret = ArrangeIconicWindows(parent); +todo_wine + ok(ret == 10, "wrong ret %u\n", ret); + + col = mm.iHorzGap; + row = mm.iVertGap; + for (i = 0; i < ARRAY_SIZE(hwnds); ++i) + { + if (col + GetSystemMetrics(SM_CXMINIMIZED) > parent_rect.right - parent_rect.left) + { + col = mm.iHorzGap; + row += GetSystemMetrics(SM_CYMINIMIZED) + mm.iVertGap; + } + + GetWindowRect(hwnds[i], &rect); + SetRect(&expect, col, row, col + GetSystemMetrics(SM_CXMINIMIZED), + row + GetSystemMetrics(SM_CYMINIMIZED)); + OffsetRect(&expect, pt.x, pt.y); +todo_wine + ok(EqualRect(&rect, &expect), "hwnd %u: expected rect %s, got %s\n", i, + wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect)); + + col += GetSystemMetrics(SM_CXMINIMIZED) + mm.iHorzGap; + } + + mm.iArrange = ARW_BOTTOMRIGHT | ARW_UP; + mm.iVertGap = 10; + ret = SystemParametersInfoA(SPI_SETMINIMIZEDMETRICS, sizeof(mm), &mm, 0); + ok(ret, "failed to set minimized metrics, error %u\n", GetLastError()); + + for (i = 0; i < ARRAY_SIZE(hwnds); ++i) + { + ret = SetWindowPos(hwnds[i], 0, orig.left, orig.top, 0, 0, + SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE); + ok(ret, "hwnd %u: failed to move window, error %u\n", i, GetLastError()); + } + + ret = ArrangeIconicWindows(parent); +todo_wine + ok(ret == 10, "wrong ret %u\n", ret); + + col = parent_rect.right - mm.iHorzGap; + row = parent_rect.bottom - mm.iVertGap; + for (i = 0; i < ARRAY_SIZE(hwnds); ++i) + { + if (row - GetSystemMetrics(SM_CYMINIMIZED) < parent_rect.top) + { + row = parent_rect.bottom - mm.iVertGap; + col -= GetSystemMetrics(SM_CXMINIMIZED) + mm.iHorzGap; + } + + GetWindowRect(hwnds[i], &rect); + SetRect(&expect, col - GetSystemMetrics(SM_CXMINIMIZED), + row - GetSystemMetrics(SM_CYMINIMIZED), col, row); + OffsetRect(&expect, pt.x, pt.y); +todo_wine + ok(EqualRect(&rect, &expect), "hwnd %u: expected rect %s, got %s\n", i, + wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect)); + + row -= GetSystemMetrics(SM_CYMINIMIZED) + mm.iVertGap; + } + + for (i = 0; i < ARRAY_SIZE(hwnds); ++i) + DestroyWindow(hwnds[i]); + DestroyWindow(parent); + + ret = SystemParametersInfoA(SPI_SETMINIMIZEDMETRICS, sizeof(oldmm), &oldmm, 0); + ok(ret, "failed to restore minimized metrics, error %u\n", GetLastError()); +} + START_TEST(win) { char **argv; @@ -11497,6 +11658,7 @@ START_TEST(win) test_destroy_quit(); test_IsWindowEnabled(); test_window_placement(); + test_arrange_iconic_windows(); /* add the tests above this line */ if (hhook) UnhookWindowsHookEx(hhook);
1
0
0
0
Zebediah Figura : user32/tests: Add tests for maximizing and minimizing MDI child windows.
by Alexandre Julliard
18 Feb '19
18 Feb '19
Module: wine Branch: master Commit: 16c054c314b3982bffa1d61d26661e37ad69a7c0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=16c054c314b3982bffa1d61d…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Thu Feb 14 21:56:22 2019 -0600 user32/tests: Add tests for maximizing and minimizing MDI child windows. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/win.c | 127 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 88d95d7..65e4b14 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -6979,6 +6979,132 @@ static void test_ShowWindow_child(HWND hwndMain) DestroyWindow(hwnd); } +static void test_ShowWindow_mdichild(HWND hwndMain) +{ + RECT rect, orig, expect; + BOOL ret; + HWND mdiclient, hwnd, hwnd2; + LONG style; + POINT pt = {0}; + CLIENTCREATESTRUCT mdi_client_cs = {0,1}; + + SetRect(&orig, 20, 20, 210, 110); + GetClientRect(hwndMain, &rect); + mdiclient = CreateWindowA("mdiclient", "MDI client", WS_CHILD, + rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, + hwndMain, 0, 0, &mdi_client_cs); + ok(!!mdiclient, "failed to create window, error %u\n", GetLastError()); + hwnd = CreateWindowExA(WS_EX_MDICHILD, "MainWindowClass", "MDI child", + WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX, + orig.left, orig.top, orig.right - orig.left, + orig.bottom - orig.top, mdiclient, 0, 0, NULL); + ok(!!hwnd, "failed to create window, error %u\n", GetLastError()); + hwnd2 = CreateWindowExA(WS_EX_MDICHILD, "MainWindowClass", "MDI child 2", + WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX, + orig.left, orig.top, orig.right - orig.left, + orig.bottom - orig.top, mdiclient, 0, 0, NULL); + ok(!!hwnd2, "failed to create window, error %u\n", GetLastError()); + + ClientToScreen(hwndMain, &pt); + OffsetRect(&orig, pt.x, pt.y); + + style = GetWindowLongA(hwnd, GWL_STYLE); + ok(!(style & WS_DISABLED), "window should not be disabled\n"); + ok(style & WS_VISIBLE, "window should not be visible\n"); + ok(!(style & WS_MINIMIZE), "window should not be minimized\n"); + ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); + GetWindowRect(hwnd, &rect); + ok(EqualRect(&orig, &rect), "expected %s, got %s\n", + wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect)); + + ret = ShowWindow(hwnd, SW_MINIMIZE); + ok(ret, "wrong ret %d\n", ret); + style = GetWindowLongA(hwnd, GWL_STYLE); + ok(!(style & WS_DISABLED), "window should not be disabled\n"); + ok(style & WS_VISIBLE, "window should be visible\n"); + ok(style & WS_MINIMIZE, "window should be minimized\n"); + ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); + GetWindowRect(hwnd, &rect); + GetClientRect(hwndMain, &expect); + SetRect(&expect, 0, expect.bottom - GetSystemMetrics(SM_CYMINIMIZED), + GetSystemMetrics(SM_CXMINIMIZED), expect.bottom); + OffsetRect(&expect, pt.x, pt.y); + todo_wine + ok(EqualRect(&expect, &rect), "expected %s, got %s\n", + wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect)); + /* shouldn't be able to resize minimized windows */ + ret = SetWindowPos(hwnd, 0, 0, 0, 200, 200, SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER); + ok(ret, "wrong ret %d\n", ret); + GetWindowRect(hwnd, &rect); + todo_wine + ok(EqualRect(&expect, &rect), "expected %s, got %s\n", + wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect)); + + /* multiple minimized children also stack; here the parent is too small to + * fit more than one per row */ + OffsetRect(&expect, 0, -GetSystemMetrics(SM_CYMINIMIZED)); + ret = ShowWindow(hwnd2, SW_MINIMIZE); + ok(ret, "wrong ret %d\n", ret); + style = GetWindowLongA(hwnd2, GWL_STYLE); + ok(!(style & WS_DISABLED), "window should not be disabled\n"); + ok(style & WS_VISIBLE, "window should be visible\n"); + ok(style & WS_MINIMIZE, "window should be minimized\n"); + ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); + GetWindowRect(hwnd2, &rect); + todo_wine + ok(EqualRect(&expect, &rect), "expected %s, got %s\n", + wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect)); + + ShowWindow(hwnd, SW_RESTORE); + ok(ret, "wrong ret %d\n", ret); + style = GetWindowLongA(hwnd, GWL_STYLE); + ok(!(style & WS_DISABLED), "window should not be disabled\n"); + ok(style & WS_VISIBLE, "window should be visible\n"); + ok(!(style & WS_MINIMIZE), "window should not be minimized\n"); + ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); + GetWindowRect(hwnd, &rect); + ok(EqualRect(&orig, &rect), "expected %s, got %s\n", + wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect)); + + ShowWindow(hwnd, SW_MAXIMIZE); + ok(ret, "wrong ret %d\n", ret); + style = GetWindowLongA(hwnd, GWL_STYLE); + ok(!(style & WS_DISABLED), "window should not be disabled\n"); + ok(style & WS_VISIBLE, "window should be visible\n"); + ok(!(style & WS_MINIMIZE), "window should be minimized\n"); + ok(style & WS_MAXIMIZE, "window should not be maximized\n"); + GetWindowRect(hwnd, &rect); + GetClientRect(hwndMain, &expect); + AdjustWindowRectEx(&expect, GetWindowLongA(hwnd, GWL_STYLE) & ~WS_BORDER, + 0, GetWindowLongA(hwnd, GWL_EXSTYLE)); + OffsetRect(&expect, pt.x, pt.y); + ok(EqualRect(&expect, &rect), "expected %s, got %s\n", + wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect)); + /* maximized windows can be resized */ + ret = SetWindowPos(hwnd, 0, 300, 300, 200, 200, SWP_NOACTIVATE | SWP_NOZORDER); + ok(ret, "wrong ret %d\n", ret); + GetWindowRect(hwnd, &rect); + SetRect(&expect, 300, 300, 500, 500); + OffsetRect(&expect, pt.x, pt.y); + ok(EqualRect(&expect, &rect), "expected %s, got %s\n", + wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect)); + + ShowWindow(hwnd, SW_RESTORE); + ok(ret, "wrong ret %d\n", ret); + style = GetWindowLongA(hwnd, GWL_STYLE); + ok(!(style & WS_DISABLED), "window should not be disabled\n"); + ok(style & WS_VISIBLE, "window should be visible\n"); + ok(!(style & WS_MINIMIZE), "window should not be minimized\n"); + ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); + GetWindowRect(hwnd, &rect); + ok(EqualRect(&orig, &rect), "expected %s, got %s\n", + wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect)); + + DestroyWindow(hwnd2); + DestroyWindow(hwnd); + DestroyWindow(mdiclient); +} + static DWORD CALLBACK enablewindow_thread(LPVOID arg) { HWND hwnd = arg; @@ -11345,6 +11471,7 @@ START_TEST(win) test_ShowWindow(); test_ShowWindow_owned(hwndMain); test_ShowWindow_child(hwndMain); + test_ShowWindow_mdichild(hwndMain); test_EnableWindow(); test_gettext(); test_GetUpdateRect();
1
0
0
0
Zebediah Figura : user32/tests: Add tests for maximizing and minimizing child windows.
by Alexandre Julliard
18 Feb '19
18 Feb '19
Module: wine Branch: master Commit: 2ebfe4c2fe38ff9e3bc10ec64c79c16b4060d0e7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2ebfe4c2fe38ff9e3bc10ec6…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Thu Feb 14 21:56:21 2019 -0600 user32/tests: Add tests for maximizing and minimizing child windows. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/win.c | 131 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 9681570..88d95d7 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -6849,6 +6849,136 @@ static void test_ShowWindow_owned(HWND hwndMain) DestroyWindow(hwnd); } +static void test_ShowWindow_child(HWND hwndMain) +{ + RECT rect, orig, expect; + BOOL ret; + HWND hwnd, hwnd2; + LONG style; + POINT pt = {0}; + + SetRect(&orig, 20, 20, 210, 110); + hwnd = CreateWindowA("MainWindowClass", "child", WS_CAPTION | WS_SYSMENU | + WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CHILD, + orig.left, orig.top, orig.right - orig.left, + orig.bottom - orig.top, hwndMain, 0, 0, NULL); + ok(!!hwnd, "failed to create window, error %u\n", GetLastError()); + hwnd2 = CreateWindowA("MainWindowClass", "child2", WS_CAPTION | WS_SYSMENU | + WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CHILD | WS_VISIBLE, + orig.left, orig.top, orig.right - orig.left, + orig.bottom - orig.top, hwndMain, 0, 0, NULL); + ok(!!hwnd2, "failed to create window, error %u\n", GetLastError()); + + ClientToScreen(hwndMain, &pt); + OffsetRect(&orig, pt.x, pt.y); + + style = GetWindowLongA(hwnd, GWL_STYLE); + ok(!(style & WS_DISABLED), "window should not be disabled\n"); + ok(!(style & WS_VISIBLE), "window should not be visible\n"); + ok(!(style & WS_MINIMIZE), "window should not be minimized\n"); + ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); + GetWindowRect(hwnd, &rect); + ok(EqualRect(&orig, &rect), "expected %s, got %s\n", + wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect)); + + ret = ShowWindow(hwnd, SW_SHOW); + ok(!ret, "wrong ret %d\n", ret); + style = GetWindowLongA(hwnd, GWL_STYLE); + ok(!(style & WS_DISABLED), "window should not be disabled\n"); + ok(style & WS_VISIBLE, "window should be visible\n"); + ok(!(style & WS_MINIMIZE), "window should not be minimized\n"); + ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); + GetWindowRect(hwnd, &rect); + ok(EqualRect(&orig, &rect), "expected %s, got %s\n", + wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect)); + + ret = ShowWindow(hwnd, SW_MINIMIZE); + ok(ret, "wrong ret %d\n", ret); + style = GetWindowLongA(hwnd, GWL_STYLE); + ok(!(style & WS_DISABLED), "window should not be disabled\n"); + ok(style & WS_VISIBLE, "window should be visible\n"); + ok(style & WS_MINIMIZE, "window should be minimized\n"); + ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); + GetWindowRect(hwnd, &rect); + GetClientRect(hwndMain, &expect); + SetRect(&expect, 0, expect.bottom - GetSystemMetrics(SM_CYMINIMIZED), + GetSystemMetrics(SM_CXMINIMIZED), expect.bottom); + OffsetRect(&expect, pt.x, pt.y); + todo_wine + ok(EqualRect(&expect, &rect), "expected %s, got %s\n", + wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect)); + /* shouldn't be able to resize minimized windows */ + ret = SetWindowPos(hwnd, 0, 0, 0, 200, 200, SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER); + ok(ret, "wrong ret %d\n", ret); + GetWindowRect(hwnd, &rect); + todo_wine + ok(EqualRect(&expect, &rect), "expected %s, got %s\n", + wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect)); + + /* multiple minimized children also stack; here the parent is too small to + * fit more than one per row */ + OffsetRect(&expect, 0, -GetSystemMetrics(SM_CYMINIMIZED)); + ret = ShowWindow(hwnd2, SW_MINIMIZE); + ok(ret, "wrong ret %d\n", ret); + style = GetWindowLongA(hwnd2, GWL_STYLE); + ok(!(style & WS_DISABLED), "window should not be disabled\n"); + ok(style & WS_VISIBLE, "window should be visible\n"); + ok(style & WS_MINIMIZE, "window should be minimized\n"); + ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); + GetWindowRect(hwnd2, &rect); + todo_wine + ok(EqualRect(&expect, &rect), "expected %s, got %s\n", + wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect)); + + ShowWindow(hwnd, SW_RESTORE); + ok(ret, "wrong ret %d\n", ret); + style = GetWindowLongA(hwnd, GWL_STYLE); + ok(!(style & WS_DISABLED), "window should not be disabled\n"); + ok(style & WS_VISIBLE, "window should be visible\n"); + ok(!(style & WS_MINIMIZE), "window should not be minimized\n"); + ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); + GetWindowRect(hwnd, &rect); + ok(EqualRect(&orig, &rect), "expected %s, got %s\n", + wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect)); + + ShowWindow(hwnd, SW_MAXIMIZE); + ok(ret, "wrong ret %d\n", ret); + style = GetWindowLongA(hwnd, GWL_STYLE); + ok(!(style & WS_DISABLED), "window should not be disabled\n"); + ok(style & WS_VISIBLE, "window should be visible\n"); + ok(!(style & WS_MINIMIZE), "window should be minimized\n"); + ok(style & WS_MAXIMIZE, "window should not be maximized\n"); + GetWindowRect(hwnd, &rect); + GetClientRect(hwndMain, &expect); + AdjustWindowRectEx(&expect, GetWindowLongA(hwnd, GWL_STYLE) & ~WS_BORDER, + 0, GetWindowLongA(hwnd, GWL_EXSTYLE)); + OffsetRect(&expect, pt.x, pt.y); + ok(EqualRect(&expect, &rect), "expected %s, got %s\n", + wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect)); + /* maximized windows can be resized */ + ret = SetWindowPos(hwnd, 0, 300, 300, 200, 200, SWP_NOACTIVATE | SWP_NOZORDER); + ok(ret, "wrong ret %d\n", ret); + GetWindowRect(hwnd, &rect); + SetRect(&expect, 300, 300, 500, 500); + OffsetRect(&expect, pt.x, pt.y); + ok(EqualRect(&expect, &rect), "expected %s, got %s\n", + wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect)); + + ShowWindow(hwnd, SW_RESTORE); + ok(ret, "wrong ret %d\n", ret); + style = GetWindowLongA(hwnd, GWL_STYLE); + ok(!(style & WS_DISABLED), "window should not be disabled\n"); + ok(style & WS_VISIBLE, "window should be visible\n"); + ok(!(style & WS_MINIMIZE), "window should not be minimized\n"); + ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); + GetWindowRect(hwnd, &rect); + ok(EqualRect(&orig, &rect), "expected %s, got %s\n", + wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect)); + + DestroyWindow(hwnd2); + DestroyWindow(hwnd); +} + static DWORD CALLBACK enablewindow_thread(LPVOID arg) { HWND hwnd = arg; @@ -11214,6 +11344,7 @@ START_TEST(win) test_set_window_style(); test_ShowWindow(); test_ShowWindow_owned(hwndMain); + test_ShowWindow_child(hwndMain); test_EnableWindow(); test_gettext(); test_GetUpdateRect();
1
0
0
0
Zebediah Figura : user32/tests: Add tests for maximizing and minimizing owned windows.
by Alexandre Julliard
18 Feb '19
18 Feb '19
Module: wine Branch: master Commit: 361de88c4f6e9c3c98b50730567be51361f60258 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=361de88c4f6e9c3c98b50730…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Thu Feb 14 21:56:20 2019 -0600 user32/tests: Add tests for maximizing and minimizing owned windows. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/win.c | 125 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 34ec39b..9681570 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -6725,6 +6725,130 @@ static void test_ShowWindow(void) flush_events(TRUE); } +static void test_ShowWindow_owned(HWND hwndMain) +{ + MONITORINFO mon_info = {sizeof(mon_info)}; + RECT rect, orig, expect; + BOOL ret; + HWND hwnd, hwnd2; + LONG style; + + GetMonitorInfoW(MonitorFromWindow(hwndMain, MONITOR_DEFAULTTOPRIMARY), &mon_info); + SetRect(&orig, 20, 20, 210, 110); + hwnd = CreateWindowA("MainWindowClass", "owned", WS_CAPTION | WS_SYSMENU | + WS_MINIMIZEBOX | WS_MAXIMIZEBOX, + orig.left, orig.top, orig.right - orig.left, + orig.bottom - orig.top, hwndMain, 0, 0, NULL); + ok(!!hwnd, "failed to create window, error %u\n", GetLastError()); + hwnd2 = CreateWindowA("MainWindowClass", "owned2", WS_CAPTION | WS_SYSMENU | + WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_VISIBLE, + orig.left, orig.top, orig.right - orig.left, + orig.bottom - orig.top, hwndMain, 0, 0, NULL); + ok(!!hwnd2, "failed to create window, error %u\n", GetLastError()); + + style = GetWindowLongA(hwnd, GWL_STYLE); + ok(!(style & WS_DISABLED), "window should not be disabled\n"); + ok(!(style & WS_VISIBLE), "window should not be visible\n"); + ok(!(style & WS_MINIMIZE), "window should not be minimized\n"); + ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); + GetWindowRect(hwnd, &rect); + ok(EqualRect(&orig, &rect), "expected %s, got %s\n", + wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect)); + + ret = ShowWindow(hwnd, SW_SHOW); + ok(!ret, "wrong ret %d\n", ret); + style = GetWindowLongA(hwnd, GWL_STYLE); + ok(!(style & WS_DISABLED), "window should not be disabled\n"); + ok(style & WS_VISIBLE, "window should be visible\n"); + ok(!(style & WS_MINIMIZE), "window should not be minimized\n"); + ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); + GetWindowRect(hwnd, &rect); + ok(EqualRect(&orig, &rect), "expected %s, got %s\n", + wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect)); + + ret = ShowWindow(hwnd, SW_MINIMIZE); + ok(ret, "wrong ret %d\n", ret); + style = GetWindowLongA(hwnd, GWL_STYLE); + ok(!(style & WS_DISABLED), "window should not be disabled\n"); + ok(style & WS_VISIBLE, "window should be visible\n"); + ok(style & WS_MINIMIZE, "window should be minimized\n"); + ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); + GetWindowRect(hwnd, &rect); + SetRect(&expect, 0, mon_info.rcWork.bottom - GetSystemMetrics(SM_CYMINIMIZED), + GetSystemMetrics(SM_CXMINIMIZED), mon_info.rcWork.bottom); + todo_wine + ok(EqualRect(&expect, &rect), "expected %s, got %s\n", + wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect)); + /* shouldn't be able to resize minimized windows */ + ret = SetWindowPos(hwnd, 0, 0, 0, 200, 200, SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER); + ok(ret, "wrong ret %d\n", ret); + GetWindowRect(hwnd, &rect); + todo_wine + ok(EqualRect(&expect, &rect), "expected %s, got %s\n", + wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect)); + + /* multiple minimized owned windows stack next to each other (and eventually + * on top of each other) */ + OffsetRect(&expect, GetSystemMetrics(SM_CXMINIMIZED), 0); + ret = ShowWindow(hwnd2, SW_MINIMIZE); + ok(ret, "wrong ret %d\n", ret); + style = GetWindowLongA(hwnd2, GWL_STYLE); + ok(!(style & WS_DISABLED), "window should not be disabled\n"); + ok(style & WS_VISIBLE, "window should be visible\n"); + ok(style & WS_MINIMIZE, "window should be minimized\n"); + ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); + GetWindowRect(hwnd2, &rect); + todo_wine + ok(EqualRect(&expect, &rect), "expected %s, got %s\n", + wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect)); + + ShowWindow(hwnd, SW_RESTORE); + ok(ret, "wrong ret %d\n", ret); + style = GetWindowLongA(hwnd, GWL_STYLE); + ok(!(style & WS_DISABLED), "window should not be disabled\n"); + ok(style & WS_VISIBLE, "window should be visible\n"); + ok(!(style & WS_MINIMIZE), "window should not be minimized\n"); + ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); + GetWindowRect(hwnd, &rect); + ok(EqualRect(&orig, &rect), "expected %s, got %s\n", + wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect)); + + ShowWindow(hwnd, SW_MAXIMIZE); + ok(ret, "wrong ret %d\n", ret); + style = GetWindowLongA(hwnd, GWL_STYLE); + ok(!(style & WS_DISABLED), "window should not be disabled\n"); + ok(style & WS_VISIBLE, "window should be visible\n"); + ok(!(style & WS_MINIMIZE), "window should be minimized\n"); + ok(style & WS_MAXIMIZE, "window should not be maximized\n"); + GetWindowRect(hwnd, &rect); + expect = mon_info.rcWork; + AdjustWindowRectEx(&expect, GetWindowLongA(hwnd, GWL_STYLE) & ~WS_BORDER, + 0, GetWindowLongA(hwnd, GWL_EXSTYLE)); + ok(EqualRect(&expect, &rect), "expected %s, got %s\n", + wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect)); + /* maximized windows can be resized */ + ret = SetWindowPos(hwnd, 0, 300, 300, 200, 200, SWP_NOACTIVATE | SWP_NOZORDER); + ok(ret, "wrong ret %d\n", ret); + GetWindowRect(hwnd, &rect); + SetRect(&expect, 300, 300, 500, 500); + ok(EqualRect(&expect, &rect), "expected %s, got %s\n", + wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect)); + + ShowWindow(hwnd, SW_RESTORE); + ok(ret, "wrong ret %d\n", ret); + style = GetWindowLongA(hwnd, GWL_STYLE); + ok(!(style & WS_DISABLED), "window should not be disabled\n"); + ok(style & WS_VISIBLE, "window should be visible\n"); + ok(!(style & WS_MINIMIZE), "window should not be minimized\n"); + ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); + GetWindowRect(hwnd, &rect); + ok(EqualRect(&orig, &rect), "expected %s, got %s\n", + wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect)); + + DestroyWindow(hwnd2); + DestroyWindow(hwnd); +} + static DWORD CALLBACK enablewindow_thread(LPVOID arg) { HWND hwnd = arg; @@ -11089,6 +11213,7 @@ START_TEST(win) test_SetWindowLong(); test_set_window_style(); test_ShowWindow(); + test_ShowWindow_owned(hwndMain); test_EnableWindow(); test_gettext(); test_GetUpdateRect();
1
0
0
0
Zebediah Figura : user32/tests: Add tests for GetWindowPlacement() and SetWindowPlacement().
by Alexandre Julliard
18 Feb '19
18 Feb '19
Module: wine Branch: master Commit: ed0568a506df3fbbcff380d6c4a8eea5e245268d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ed0568a506df3fbbcff380d6…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Thu Feb 14 21:56:19 2019 -0600 user32/tests: Add tests for GetWindowPlacement() and SetWindowPlacement(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/win.c | 192 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 192 insertions(+) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=ed0568a506df3fbbcff3…
1
0
0
0
Mark Jansen : msi: Prevent uninitialized variable usage.
by Alexandre Julliard
18 Feb '19
18 Feb '19
Module: wine Branch: master Commit: 145b4109205c385cf1bd1ecd8a18e47c9f27a9fd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=145b4109205c385cf1bd1ecd…
Author: Mark Jansen <mark.jansen(a)reactos.org> Date: Mon Feb 18 10:00:57 2019 +0100 msi: Prevent uninitialized variable usage. Observed with Lync 2010 setup in ReactOS. The embedded Silverlight setup hits this case (no LASTUSEDSOURCE in the registry). Signed-off-by: Mark Jansen <mark.jansen(a)reactos.org> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msi/source.c | 9 ++++++--- dlls/msi/tests/source.c | 46 ++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 46 insertions(+), 9 deletions(-) diff --git a/dlls/msi/source.c b/dlls/msi/source.c index e2cf7fc..3640b0d 100644 --- a/dlls/msi/source.c +++ b/dlls/msi/source.c @@ -592,8 +592,11 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid, 0, 0, NULL, &size); if (rc != ERROR_SUCCESS) { - RegCloseKey(sourcekey); - return ERROR_SUCCESS; + static WCHAR szEmpty[1] = { '\0' }; + rc = ERROR_SUCCESS; + source = NULL; + ptr = szEmpty; + goto output_out; } source = msi_alloc(size); @@ -627,7 +630,7 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid, else ptr++; } - +output_out: if (szValue) { if (strlenW(ptr) < *pcchValue) diff --git a/dlls/msi/tests/source.c b/dlls/msi/tests/source.c index 654df35..3d4a955 100644 --- a/dlls/msi/tests/source.c +++ b/dlls/msi/tests/source.c @@ -48,6 +48,8 @@ static UINT (WINAPI *pMsiSourceListEnumSourcesA) (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, DWORD, LPSTR, LPDWORD); static UINT (WINAPI *pMsiSourceListGetInfoA) (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, LPCSTR, LPSTR, LPDWORD); +static UINT (WINAPI *pMsiSourceListGetInfoW) + (LPCWSTR, LPCWSTR, MSIINSTALLCONTEXT, DWORD, LPCWSTR, LPWSTR, LPDWORD); static UINT (WINAPI *pMsiSourceListSetInfoA) (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD,LPCSTR, LPCSTR); static UINT (WINAPI *pMsiSourceListAddSourceA) @@ -69,6 +71,7 @@ static void init_functionpointers(void) GET_PROC(hmsi, MsiSourceListEnumMediaDisksA) GET_PROC(hmsi, MsiSourceListEnumSourcesA) GET_PROC(hmsi, MsiSourceListGetInfoA) + GET_PROC(hmsi, MsiSourceListGetInfoW) GET_PROC(hmsi, MsiSourceListSetInfoA) GET_PROC(hmsi, MsiSourceListAddSourceA) @@ -179,14 +182,21 @@ static void check_reg_str(HKEY prodkey, LPCSTR name, LPCSTR expected, BOOL bcase #define CHECK_REG_STR(prodkey, name, expected) \ check_reg_str(prodkey, name, expected, TRUE, __LINE__); +static inline WCHAR *strdupAW( const char *str ) +{ + int len; + WCHAR *ret; + len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 ); + if (!(ret = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return NULL; + MultiByteToWideChar( CP_ACP, 0, str, -1, ret, len ); + return ret; +} + static void test_MsiSourceListGetInfo(void) { - CHAR prodcode[MAX_PATH]; - CHAR prod_squashed[MAX_PATH]; - CHAR keypath[MAX_PATH*2]; - CHAR value[MAX_PATH]; - LPSTR usersid; - LPCSTR data; + char prodcode[MAX_PATH], prod_squashed[MAX_PATH], keypath[MAX_PATH * 2], value[MAX_PATH], *usersid; + WCHAR valueW[MAX_PATH], *usersidW, *prodcodeW; + const char *data; LONG res; UINT r; HKEY userkey, hkey, media; @@ -416,6 +426,30 @@ static void test_MsiSourceListGetInfo(void) ok(!lstrcmpA(value, "prompt"), "Expected \"prompt\", got \"%s\"\n", value); ok(size == 6, "Expected 6, got %d\n", size); + /* LastUsedSource value doesn't exist */ + RegDeleteValueA(hkey, "LastUsedSource"); + size = MAX_PATH; + memset(value, 0x55, sizeof(value)); + r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, + MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA, + value, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(value, ""), "Expected \"\", got \"%s\"\n", value); + ok(size == 0, "Expected 0, got %d\n", size); + + size = MAX_PATH; + usersidW = strdupAW(usersid); + prodcodeW = strdupAW(prodcode); + memset(valueW, 0x55, sizeof(valueW)); + r = pMsiSourceListGetInfoW(prodcodeW, usersidW, MSIINSTALLCONTEXT_USERUNMANAGED, + MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEW, + valueW, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!valueW[0], "Expected \"\""); + ok(size == 0, "Expected 0, got %d\n", size); + HeapFree(GetProcessHeap(), 0, usersidW); + HeapFree(GetProcessHeap(), 0, prodcodeW); + data = ""; res = RegSetValueExA(hkey, "LastUsedSource", 0, REG_SZ, (const BYTE *)data, lstrlenA(data) + 1);
1
0
0
0
Mark Jansen : msi: Do not leak rootkey.
by Alexandre Julliard
18 Feb '19
18 Feb '19
Module: wine Branch: master Commit: c91f254a7740dacd5cb6bc3f8817cd1806bddeb4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c91f254a7740dacd5cb6bc3f…
Author: Mark Jansen <mark.jansen(a)reactos.org> Date: Sun Feb 17 16:52:46 2019 +0100 msi: Do not leak rootkey. Signed-off-by: Mark Jansen <mark.jansen(a)reactos.org> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msi/source.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/msi/source.c b/dlls/msi/source.c index 904589e..e2cf7fc 100644 --- a/dlls/msi/source.c +++ b/dlls/msi/source.c @@ -98,6 +98,7 @@ static UINT OpenSourceKey(LPCWSTR szProduct, HKEY* key, DWORD dwOptions, if (rc != ERROR_SUCCESS) rc = ERROR_BAD_CONFIGURATION; } + RegCloseKey(rootkey); return rc; }
1
0
0
0
← Newer
1
...
29
30
31
32
33
34
35
...
68
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Results per page:
10
25
50
100
200