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
March 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
2 participants
1097 discussions
Start a n
N
ew thread
Gabriel Ivăncescu : comctl32/tests: Add tests for NM_CUSTOMDRAW buttons.
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: e09003babc0332ae993a51ba902255980c868ee9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e09003babc0332ae993a51ba…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Tue Mar 5 15:13:29 2019 +0200 comctl32/tests: Add tests for NM_CUSTOMDRAW buttons. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/tests/button.c | 244 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 226 insertions(+), 18 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=e09003babc0332ae993a…
1
0
0
0
Gabriel Ivăncescu : comctl32/button: Don' t draw the button when losing focus before invalidating it.
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: efacaf1b5a57f2005459497852e549811868d0d5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=efacaf1b5a57f20054594978…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Tue Mar 5 15:13:28 2019 +0200 comctl32/button: Don't draw the button when losing focus before invalidating it. It's already invalidated at the end so there's no reason to draw it before that. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/button.c | 1 - dlls/comctl32/tests/button.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c index 16b36d4..f7497a1 100644 --- a/dlls/comctl32/button.c +++ b/dlls/comctl32/button.c @@ -770,7 +770,6 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L case WM_KILLFOCUS: TRACE("WM_KILLFOCUS %p\n",hWnd); infoPtr->state &= ~BST_FOCUS; - paint_button( infoPtr, btn_type, ODA_FOCUS ); if ((infoPtr->state & BUTTON_BTNPRESSED) && GetCapture() == hWnd) ReleaseCapture(); diff --git a/dlls/comctl32/tests/button.c b/dlls/comctl32/tests/button.c index ce673af..753aa24 100644 --- a/dlls/comctl32/tests/button.c +++ b/dlls/comctl32/tests/button.c @@ -600,11 +600,10 @@ static void test_button_messages(void) while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok_sequence(sequences, COMBINED_SEQ_INDEX, button[i].setfocus, "SetFocus(hwnd) on a button", todo); - todo = button[i].style == BS_OWNERDRAW; SetFocus(0); SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */ while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); - ok_sequence(sequences, COMBINED_SEQ_INDEX, button[i].killfocus, "SetFocus(0) on a button", todo); + ok_sequence(sequences, COMBINED_SEQ_INDEX, button[i].killfocus, "SetFocus(0) on a button", FALSE); ok(GetFocus() == 0, "expected focus 0, got %p\n", GetFocus()); SendMessageA(hwnd, BM_SETSTYLE, button[i].style | BS_BOTTOM, TRUE);
1
0
0
0
Gabriel Ivăncescu : comctl32/button: Implement NM_CUSTOMDRAW for BS_USERBUTTON.
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: 026233c429fd30d43140302e7778290d1c9df184 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=026233c429fd30d43140302e…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Tue Mar 5 15:13:27 2019 +0200 comctl32/button: Implement NM_CUSTOMDRAW for BS_USERBUTTON. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/button.c | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c index 1637e05..16b36d4 100644 --- a/dlls/comctl32/button.c +++ b/dlls/comctl32/button.c @@ -37,7 +37,6 @@ * - BN_PAINT * + BN_SETFOCUS: is it OK? * - BN_UNPUSHED/BN_UNHILITE - * - NM_CUSTOMDRAW * * Structures/Macros/Definitions * - NMBCHOTITEM @@ -1864,7 +1863,9 @@ static void UB_Paint( const BUTTON_INFO *infoPtr, HDC hDC, UINT action ) { RECT rc; HBRUSH hBrush; + LRESULT cdrf; HFONT hFont; + NMCUSTOMDRAW nmcd; LONG state = infoPtr->state; HWND parent; @@ -1878,10 +1879,39 @@ static void UB_Paint( const BUTTON_INFO *infoPtr, HDC hDC, UINT action ) if (!hBrush) /* did the app forget to call defwindowproc ? */ hBrush = (HBRUSH)DefWindowProcW(parent, WM_CTLCOLORBTN, (WPARAM)hDC, (LPARAM)infoPtr->hwnd); + if (action == ODA_FOCUS || (state & BST_FOCUS)) + { + init_custom_draw(&nmcd, infoPtr, hDC, &rc); + + /* Send erase notifications */ + cdrf = SendMessageW(parent, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd); + if (cdrf & CDRF_SKIPDEFAULT) goto notify; + } + FillRect( hDC, &rc, hBrush ); if (action == ODA_FOCUS || (state & BST_FOCUS)) - DrawFocusRect( hDC, &rc ); + { + if (cdrf & CDRF_NOTIFYPOSTERASE) + { + nmcd.dwDrawStage = CDDS_POSTERASE; + SendMessageW(parent, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd); + } + + /* Send paint notifications */ + nmcd.dwDrawStage = CDDS_PREPAINT; + cdrf = SendMessageW(parent, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd); + if (cdrf & CDRF_SKIPDEFAULT) goto notify; + if (cdrf & CDRF_NOTIFYPOSTPAINT) + { + nmcd.dwDrawStage = CDDS_POSTPAINT; + SendMessageW(parent, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd); + } + + if (!(cdrf & CDRF_SKIPPOSTPAINT)) + DrawFocusRect( hDC, &rc ); + } +notify: switch (action) { case ODA_FOCUS:
1
0
0
0
Gabriel Ivăncescu : comctl32/button: Implement NM_CUSTOMDRAW for other themed buttons.
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: 04de7c9f05eb4deeca0f99354b25b572fb478523 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=04de7c9f05eb4deeca0f9935…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Tue Mar 5 15:13:26 2019 +0200 comctl32/button: Implement NM_CUSTOMDRAW for other themed buttons. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/button.c | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c index faf8191..1637e05 100644 --- a/dlls/comctl32/button.c +++ b/dlls/comctl32/button.c @@ -2013,7 +2013,10 @@ static void CB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in UINT btn_type = get_button_type( dwStyle ); int part = (btn_type == BS_RADIOBUTTON) || (btn_type == BS_AUTORADIOBUTTON) ? BP_RADIOBUTTON : BP_CHECKBOX; WCHAR *text = get_button_text(infoPtr); + NMCUSTOMDRAW nmcd; + LRESULT cdrf; LOGFONTW lf; + HWND parent; BOOL created_font = FALSE; HRESULT hr = GetThemeFont(theme, hDC, part, state, TMT_FONT, &lf); @@ -2036,6 +2039,7 @@ static void CB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in GetClientRect(infoPtr->hwnd, &bgRect); GetThemeBackgroundContentRect(theme, hDC, part, state, &bgRect, &textRect); + init_custom_draw(&nmcd, infoPtr, hDC, &bgRect); if (dtFlags & DT_SINGLELINE) /* Center the checkbox / radio button to the text. */ bgRect.top = bgRect.top + (textRect.bottom - textRect.top - sz.cy) / 2; @@ -2045,13 +2049,39 @@ static void CB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in bgRect.right = bgRect.left + sz.cx; textRect.left = bgRect.right + 6; - DrawThemeParentBackground(infoPtr->hwnd, hDC, NULL); + parent = GetParent(infoPtr->hwnd); + if (!parent) parent = infoPtr->hwnd; + /* Send erase notifications */ + cdrf = SendMessageW(parent, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd); + if (cdrf & CDRF_SKIPDEFAULT) goto cleanup; + + DrawThemeParentBackground(infoPtr->hwnd, hDC, NULL); DrawThemeBackground(theme, hDC, part, state, &bgRect, NULL); - if (text) + + if (cdrf & CDRF_NOTIFYPOSTERASE) { + nmcd.dwDrawStage = CDDS_POSTERASE; + SendMessageW(parent, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd); + } + + /* Send paint notifications */ + nmcd.dwDrawStage = CDDS_PREPAINT; + cdrf = SendMessageW(parent, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd); + if (cdrf & CDRF_SKIPDEFAULT) goto cleanup; + + if (!(cdrf & CDRF_DOERASE) && text) DrawThemeText(theme, hDC, part, state, text, lstrlenW(text), dtFlags, 0, &textRect); + if (cdrf & CDRF_NOTIFYPOSTPAINT) + { + nmcd.dwDrawStage = CDDS_POSTPAINT; + SendMessageW(parent, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd); + } + if (cdrf & CDRF_SKIPPOSTPAINT) goto cleanup; + + if (text) + { if (focused) { RECT focusRect; @@ -2069,6 +2099,7 @@ static void CB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in heap_free(text); } +cleanup: if (created_font) DeleteObject(font); if (hPrevFont) SelectObject(hDC, hPrevFont); }
1
0
0
0
Gabriel Ivăncescu : comctl32/button: Implement NM_CUSTOMDRAW for other buttons.
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: 8fdc9d76a96d4c3e6e0a04284c64153cfa3d6da4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8fdc9d76a96d4c3e6e0a0428…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Tue Mar 5 15:13:25 2019 +0200 comctl32/button: Implement NM_CUSTOMDRAW for other buttons. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/button.c | 129 +++++++++++++++++++++++++++++++------------------ 1 file changed, 83 insertions(+), 46 deletions(-) diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c index 9cf95a5..faf8191 100644 --- a/dlls/comctl32/button.c +++ b/dlls/comctl32/button.c @@ -1619,7 +1619,9 @@ static void CB_Paint( const BUTTON_INFO *infoPtr, HDC hDC, UINT action ) HBRUSH hBrush; int delta, text_offset, checkBoxWidth, checkBoxHeight; UINT dtFlags; + LRESULT cdrf; HFONT hFont; + NMCUSTOMDRAW nmcd; LONG state = infoPtr->state; LONG style = GetWindowLongW( infoPtr->hwnd, GWL_STYLE ); LONG ex_style = GetWindowLongW( infoPtr->hwnd, GWL_EXSTYLE ); @@ -1660,9 +1662,20 @@ static void CB_Paint( const BUTTON_INFO *infoPtr, HDC hDC, UINT action ) rbox.right = checkBoxWidth; } + init_custom_draw(&nmcd, infoPtr, hDC, &client); + + /* Send erase notifications */ + cdrf = SendMessageW(parent, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd); + if (cdrf & CDRF_SKIPDEFAULT) goto cleanup; + /* Since WM_ERASEBKGND does nothing, first prepare background */ if (action == ODA_SELECT) FillRect( hDC, &rbox, hBrush ); if (action == ODA_DRAWENTIRE) FillRect( hDC, &client, hBrush ); + if (cdrf & CDRF_NOTIFYPOSTERASE) + { + nmcd.dwDrawStage = CDDS_POSTERASE; + SendMessageW(parent, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd); + } /* Draw label */ client = labelRect; @@ -1675,57 +1688,79 @@ static void CB_Paint( const BUTTON_INFO *infoPtr, HDC hDC, UINT action ) rbox.bottom = labelRect.bottom; } + /* Send paint notifications */ + nmcd.dwDrawStage = CDDS_PREPAINT; + cdrf = SendMessageW(parent, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd); + if (cdrf & CDRF_SKIPDEFAULT) goto cleanup; + /* Draw the check-box bitmap */ - if (action == ODA_DRAWENTIRE || action == ODA_SELECT) + if (!(cdrf & CDRF_DOERASE)) { - UINT flags; - - if ((get_button_type(style) == BS_RADIOBUTTON) || - (get_button_type(style) == BS_AUTORADIOBUTTON)) flags = DFCS_BUTTONRADIO; - else if (state & BST_INDETERMINATE) flags = DFCS_BUTTON3STATE; - else flags = DFCS_BUTTONCHECK; - - if (state & (BST_CHECKED | BST_INDETERMINATE)) flags |= DFCS_CHECKED; - if (state & BST_PUSHED) flags |= DFCS_PUSHED; - - if (style & WS_DISABLED) flags |= DFCS_INACTIVE; - - /* rbox must have the correct height */ - delta = rbox.bottom - rbox.top - checkBoxHeight; - - if ((style & BS_VCENTER) == BS_TOP) { - if (delta > 0) { - rbox.bottom = rbox.top + checkBoxHeight; - } else { - rbox.top -= -delta/2 + 1; - rbox.bottom = rbox.top + checkBoxHeight; - } - } else if ((style & BS_VCENTER) == BS_BOTTOM) { - if (delta > 0) { - rbox.top = rbox.bottom - checkBoxHeight; - } else { - rbox.bottom += -delta/2 + 1; - rbox.top = rbox.bottom - checkBoxHeight; - } - } else { /* Default */ - if (delta > 0) { - int ofs = (delta / 2); - rbox.bottom -= ofs + 1; - rbox.top = rbox.bottom - checkBoxHeight; - } else if (delta < 0) { - int ofs = (-delta / 2); - rbox.top -= ofs + 1; - rbox.bottom = rbox.top + checkBoxHeight; - } - } + if (action == ODA_DRAWENTIRE || action == ODA_SELECT) + { + UINT flags; - DrawFrameControl( hDC, &rbox, DFC_BUTTON, flags ); - } + if ((get_button_type(style) == BS_RADIOBUTTON) || + (get_button_type(style) == BS_AUTORADIOBUTTON)) flags = DFCS_BUTTONRADIO; + else if (state & BST_INDETERMINATE) flags = DFCS_BUTTON3STATE; + else flags = DFCS_BUTTONCHECK; - if (dtFlags == (UINT)-1L) /* Noting to draw */ - return; + if (state & (BST_CHECKED | BST_INDETERMINATE)) flags |= DFCS_CHECKED; + if (state & BST_PUSHED) flags |= DFCS_PUSHED; + if (style & WS_DISABLED) flags |= DFCS_INACTIVE; - if (action == ODA_DRAWENTIRE) BUTTON_DrawLabel(infoPtr, hDC, dtFlags, &imageRect, &textRect); + /* rbox must have the correct height */ + delta = rbox.bottom - rbox.top - checkBoxHeight; + + if ((style & BS_VCENTER) == BS_TOP) + { + if (delta > 0) + rbox.bottom = rbox.top + checkBoxHeight; + else + { + rbox.top -= -delta / 2 + 1; + rbox.bottom = rbox.top + checkBoxHeight; + } + } + else if ((style & BS_VCENTER) == BS_BOTTOM) + { + if (delta > 0) + rbox.top = rbox.bottom - checkBoxHeight; + else + { + rbox.bottom += -delta / 2 + 1; + rbox.top = rbox.bottom - checkBoxHeight; + } + } + else /* Default */ + { + if (delta > 0) + { + int ofs = delta / 2; + rbox.bottom -= ofs + 1; + rbox.top = rbox.bottom - checkBoxHeight; + } + else if (delta < 0) + { + int ofs = -delta / 2; + rbox.top -= ofs + 1; + rbox.bottom = rbox.top + checkBoxHeight; + } + } + + DrawFrameControl(hDC, &rbox, DFC_BUTTON, flags); + } + + if (dtFlags != (UINT)-1L) /* Something to draw */ + if (action == ODA_DRAWENTIRE) BUTTON_DrawLabel(infoPtr, hDC, dtFlags, &imageRect, &textRect); + } + + if (cdrf & CDRF_NOTIFYPOSTPAINT) + { + nmcd.dwDrawStage = CDDS_POSTPAINT; + SendMessageW(parent, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd); + } + if ((cdrf & CDRF_SKIPPOSTPAINT) || dtFlags == (UINT)-1L) goto cleanup; /* ... and focus */ if (action == ODA_FOCUS || (state & BST_FOCUS)) @@ -1735,6 +1770,8 @@ static void CB_Paint( const BUTTON_INFO *infoPtr, HDC hDC, UINT action ) IntersectRect(&labelRect, &labelRect, &client); DrawFocusRect(hDC, &labelRect); } + +cleanup: SelectClipRgn( hDC, hrgn ); if (hrgn) DeleteObject( hrgn ); }
1
0
0
0
Gabriel Ivăncescu : comctl32/button: Implement NM_CUSTOMDRAW for themed Push Buttons.
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: 3062a594bd2072b53d7e14b08b6f9035defe58c0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3062a594bd2072b53d7e14b0…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Tue Mar 5 15:13:24 2019 +0200 comctl32/button: Implement NM_CUSTOMDRAW for themed Push Buttons. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=10531
Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/button.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c index f9b4368..9cf95a5 100644 --- a/dlls/comctl32/button.c +++ b/dlls/comctl32/button.c @@ -1904,19 +1904,50 @@ static void PB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in HFONT font = infoPtr->font; HFONT hPrevFont = font ? SelectObject(hDC, font) : NULL; WCHAR *text = get_button_text(infoPtr); + NMCUSTOMDRAW nmcd; + LRESULT cdrf; + HWND parent; GetClientRect(infoPtr->hwnd, &bgRect); GetThemeBackgroundContentRect(theme, hDC, BP_PUSHBUTTON, state, &bgRect, &textRect); + init_custom_draw(&nmcd, infoPtr, hDC, &bgRect); + + parent = GetParent(infoPtr->hwnd); + if (!parent) parent = infoPtr->hwnd; + + /* Send erase notifications */ + cdrf = SendMessageW(parent, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd); + if (cdrf & CDRF_SKIPDEFAULT) goto cleanup; if (IsThemeBackgroundPartiallyTransparent(theme, BP_PUSHBUTTON, state)) DrawThemeParentBackground(infoPtr->hwnd, hDC, NULL); DrawThemeBackground(theme, hDC, BP_PUSHBUTTON, state, &bgRect, NULL); + + if (cdrf & CDRF_NOTIFYPOSTERASE) + { + nmcd.dwDrawStage = CDDS_POSTERASE; + SendMessageW(parent, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd); + } + + /* Send paint notifications */ + nmcd.dwDrawStage = CDDS_PREPAINT; + cdrf = SendMessageW(parent, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd); + if (cdrf & CDRF_SKIPDEFAULT) goto cleanup; + if (text) { - DrawThemeText(theme, hDC, BP_PUSHBUTTON, state, text, lstrlenW(text), dtFlags, 0, &textRect); + if (!(cdrf & CDRF_DOERASE)) + DrawThemeText(theme, hDC, BP_PUSHBUTTON, state, text, lstrlenW(text), dtFlags, 0, &textRect); heap_free(text); } + if (cdrf & CDRF_NOTIFYPOSTPAINT) + { + nmcd.dwDrawStage = CDDS_POSTPAINT; + SendMessageW(parent, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd); + } + if (cdrf & CDRF_SKIPPOSTPAINT) goto cleanup; + if (focused) { MARGINS margins; @@ -1932,6 +1963,7 @@ static void PB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in DrawFocusRect( hDC, &focusRect ); } +cleanup: if (hPrevFont) SelectObject(hDC, hPrevFont); }
1
0
0
0
Gabriel Ivăncescu : comctl32/button: Implement NM_CUSTOMDRAW for Push Buttons.
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: 4b85740ebf94a05aafb8e6c55c3b5a2826ac2b69 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4b85740ebf94a05aafb8e6c5…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Tue Mar 5 15:13:23 2019 +0200 comctl32/button: Implement NM_CUSTOMDRAW for Push Buttons. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=10531
Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/button.c | 103 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 77 insertions(+), 26 deletions(-) diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c index 56a4730..f9b4368 100644 --- a/dlls/comctl32/button.c +++ b/dlls/comctl32/button.c @@ -237,6 +237,28 @@ static inline WCHAR *get_button_text( const BUTTON_INFO *infoPtr ) return buffer; } +static void init_custom_draw(NMCUSTOMDRAW *nmcd, const BUTTON_INFO *infoPtr, HDC hdc, const RECT *rc) +{ + nmcd->hdr.hwndFrom = infoPtr->hwnd; + nmcd->hdr.idFrom = GetWindowLongPtrW(infoPtr->hwnd, GWLP_ID); + nmcd->hdr.code = NM_CUSTOMDRAW; + nmcd->hdc = hdc; + nmcd->rc = *rc; + nmcd->dwDrawStage = CDDS_PREERASE; + nmcd->dwItemSpec = 0; + nmcd->lItemlParam = 0; + nmcd->uItemState = IsWindowEnabled(infoPtr->hwnd) ? 0 : CDIS_DISABLED; + if (infoPtr->state & BST_PUSHED) nmcd->uItemState |= CDIS_SELECTED; + if (infoPtr->state & BST_FOCUS) nmcd->uItemState |= CDIS_FOCUS; + if (infoPtr->state & BST_HOT) nmcd->uItemState |= CDIS_HOT; + if (infoPtr->state & BST_INDETERMINATE) + nmcd->uItemState |= CDIS_INDETERMINATE; + + /* Windows doesn't seem to send CDIS_CHECKED (it fails the tests) */ + /* CDIS_SHOWKEYBOARDCUES is misleading, as the meaning is reversed */ + /* FIXME: Handle it properly when we support keyboard cues? */ +} + HRGN set_control_clipping( HDC hdc, const RECT *rect ) { RECT rc = *rect; @@ -1476,7 +1498,9 @@ static void PB_Paint( const BUTTON_INFO *infoPtr, HDC hDC, UINT action ) HBRUSH hOldBrush; INT oldBkMode; COLORREF oldTxtColor; + LRESULT cdrf; HFONT hFont; + NMCUSTOMDRAW nmcd; LONG state = infoPtr->state; LONG style = GetWindowLongW( infoPtr->hwnd, GWL_STYLE ); BOOL pushedState = (state & BST_PUSHED); @@ -1498,6 +1522,12 @@ static void PB_Paint( const BUTTON_INFO *infoPtr, HDC hDC, UINT action ) hOldBrush = SelectObject(hDC,GetSysColorBrush(COLOR_BTNFACE)); oldBkMode = SetBkMode(hDC, TRANSPARENT); + init_custom_draw(&nmcd, infoPtr, hDC, &rc); + + /* Send erase notifications */ + cdrf = SendMessageW(parent, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd); + if (cdrf & CDRF_SKIPDEFAULT) goto cleanup; + if (get_button_type(style) == BS_DEFPUSHBUTTON) { if (action != ODA_FOCUS) @@ -1505,44 +1535,65 @@ static void PB_Paint( const BUTTON_INFO *infoPtr, HDC hDC, UINT action ) InflateRect( &rc, -1, -1 ); } - /* completely skip the drawing if only focus has changed */ - if (action == ODA_FOCUS) goto draw_focus; + /* Skip the frame drawing if only focus has changed */ + if (action != ODA_FOCUS) + { + uState = DFCS_BUTTONPUSH; - uState = DFCS_BUTTONPUSH; + if (style & BS_FLAT) + uState |= DFCS_MONO; + else if (pushedState) + { + if (get_button_type(style) == BS_DEFPUSHBUTTON ) + uState |= DFCS_FLAT; + else + uState |= DFCS_PUSHED; + } - if (style & BS_FLAT) - uState |= DFCS_MONO; - else if (pushedState) - { - if (get_button_type(style) == BS_DEFPUSHBUTTON ) - uState |= DFCS_FLAT; - else - uState |= DFCS_PUSHED; + if (state & (BST_CHECKED | BST_INDETERMINATE)) + uState |= DFCS_CHECKED; + + DrawFrameControl( hDC, &rc, DFC_BUTTON, uState ); } - if (state & (BST_CHECKED | BST_INDETERMINATE)) - uState |= DFCS_CHECKED; + if (cdrf & CDRF_NOTIFYPOSTERASE) + { + nmcd.dwDrawStage = CDDS_POSTERASE; + SendMessageW(parent, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd); + } - DrawFrameControl( hDC, &rc, DFC_BUTTON, uState ); + /* Send paint notifications */ + nmcd.dwDrawStage = CDDS_PREPAINT; + cdrf = SendMessageW(parent, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd); + if (cdrf & CDRF_SKIPDEFAULT) goto cleanup; - /* draw button label */ - labelRect = rc; - /* Shrink label rect at all sides by 2 so that the content won't touch the surrounding frame */ - InflateRect(&labelRect, -2, -2); - dtFlags = BUTTON_CalcLayoutRects(infoPtr, hDC, &labelRect, &imageRect, &textRect); + if (!(cdrf & CDRF_DOERASE) && action != ODA_FOCUS) + { + /* draw button label */ + labelRect = rc; + /* Shrink label rect at all sides by 2 so that the content won't touch the surrounding frame */ + InflateRect(&labelRect, -2, -2); + dtFlags = BUTTON_CalcLayoutRects(infoPtr, hDC, &labelRect, &imageRect, &textRect); - if (dtFlags == (UINT)-1L) - goto cleanup; + if (dtFlags != (UINT)-1L) + { + if (pushedState) OffsetRect(&labelRect, 1, 1); - if (pushedState) OffsetRect(&labelRect, 1, 1); + oldTxtColor = SetTextColor( hDC, GetSysColor(COLOR_BTNTEXT) ); - oldTxtColor = SetTextColor( hDC, GetSysColor(COLOR_BTNTEXT) ); + BUTTON_DrawLabel(infoPtr, hDC, dtFlags, &imageRect, &textRect); - BUTTON_DrawLabel(infoPtr, hDC, dtFlags, &imageRect, &textRect); + SetTextColor( hDC, oldTxtColor ); + } + } - SetTextColor( hDC, oldTxtColor ); + if (cdrf & CDRF_NOTIFYPOSTPAINT) + { + nmcd.dwDrawStage = CDDS_POSTPAINT; + SendMessageW(parent, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd); + } + if ((cdrf & CDRF_SKIPPOSTPAINT) || dtFlags == (UINT)-1L) goto cleanup; -draw_focus: if (action == ODA_FOCUS || (state & BST_FOCUS)) { InflateRect( &rc, -2, -2 );
1
0
0
0
Jactry Zeng : riched20: Handle REO_IOB_SELECTION in IRichEditOle:: GetObject().
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: 74b17a353a6a8d270a7009adbbf0fd77be62f97c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=74b17a353a6a8d270a7009ad…
Author: Jactry Zeng <jzeng(a)codeweavers.com> Date: Tue Mar 5 17:49:13 2019 +0800 riched20: Handle REO_IOB_SELECTION in IRichEditOle::GetObject(). Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/riched20/richole.c | 10 ++++++++ dlls/riched20/tests/richole.c | 55 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c index 447e7d4..93003eb 100644 --- a/dlls/riched20/richole.c +++ b/dlls/riched20/richole.c @@ -1391,6 +1391,16 @@ IRichEditOle_fnGetObject(IRichEditOle *me, LONG iob, else reobj = cursor.pRun->member.run.reobj; } + else if (iob == REO_IOB_SELECTION) + { + ME_Cursor *from, *to; + + ME_GetSelection(This->editor, &from, &to); + if (!from->pRun->member.run.reobj) + return E_INVALIDARG; + else + reobj = from->pRun->member.run.reobj; + } else { if (iob > IRichEditOle_GetObjectCount(me)) diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c index 5239904..d9c7fa1 100644 --- a/dlls/riched20/tests/richole.c +++ b/dlls/riched20/tests/richole.c @@ -3328,6 +3328,61 @@ static void test_InsertObject(void) /* received_reo4 didn't be zeroed in E_INVALIDARG case */ CHECK_REOBJECT_STRUCT(received_reo4, NULL, NULL, reo2.polesite, 2); + SendMessageA(hwnd, EM_SETSEL, 0, 1); + received_reo4.cbStruct = sizeof(received_reo4); + received_reo4.cp = 1; + hr = IRichEditOle_GetObject(reole, REO_IOB_SELECTION, &received_reo4, REO_GETOBJ_ALL_INTERFACES); + ok(hr == S_OK, "IRichEditOle_GetObject failed: 0x%08x\n", hr); + CHECK_REOBJECT_STRUCT(received_reo4, NULL, NULL, reo1.polesite, 1); + + SendMessageA(hwnd, EM_SETSEL, 1, 2); + received_reo4.cbStruct = sizeof(received_reo4); + received_reo4.cp = 0; + hr = IRichEditOle_GetObject(reole, REO_IOB_SELECTION, &received_reo4, REO_GETOBJ_ALL_INTERFACES); + ok(hr == S_OK, "IRichEditOle_GetObject failed: 0x%08x\n", hr); + CHECK_REOBJECT_STRUCT(received_reo4, NULL, NULL, reo3.polesite, 3); + + SendMessageA(hwnd, EM_SETSEL, 2, 3); + received_reo4.cbStruct = sizeof(received_reo4); + received_reo4.cp = 0; + hr = IRichEditOle_GetObject(reole, REO_IOB_SELECTION, &received_reo4, REO_GETOBJ_ALL_INTERFACES); + ok(hr == S_OK, "IRichEditOle_GetObject failed: 0x%08x\n", hr); + CHECK_REOBJECT_STRUCT(received_reo4, NULL, NULL, reo2.polesite, 2); + + SendMessageA(hwnd, EM_SETSEL, 0, 2); + received_reo4.cbStruct = sizeof(received_reo4); + received_reo4.cp = 0; + hr = IRichEditOle_GetObject(reole, REO_IOB_SELECTION, &received_reo4, REO_GETOBJ_ALL_INTERFACES); + ok(hr == S_OK, "IRichEditOle_GetObject failed: 0x%08x\n", hr); + CHECK_REOBJECT_STRUCT(received_reo4, NULL, NULL, reo1.polesite, 1); + + SendMessageA(hwnd, EM_SETSEL, 1, 3); + received_reo4.cbStruct = sizeof(received_reo4); + received_reo4.cp = 0; + hr = IRichEditOle_GetObject(reole, REO_IOB_SELECTION, &received_reo4, REO_GETOBJ_ALL_INTERFACES); + ok(hr == S_OK, "IRichEditOle_GetObject failed: 0x%08x\n", hr); + CHECK_REOBJECT_STRUCT(received_reo4, NULL, NULL, reo3.polesite, 3); + + SendMessageA(hwnd, EM_SETSEL, 2, 0); + received_reo4.cbStruct = sizeof(received_reo4); + received_reo4.cp = 0; + hr = IRichEditOle_GetObject(reole, REO_IOB_SELECTION, &received_reo4, REO_GETOBJ_ALL_INTERFACES); + ok(hr == S_OK, "IRichEditOle_GetObject failed: 0x%08x\n", hr); + CHECK_REOBJECT_STRUCT(received_reo4, NULL, NULL, reo1.polesite, 1); + + SendMessageA(hwnd, EM_SETSEL, 0, 6); + received_reo4.cbStruct = sizeof(received_reo4); + received_reo4.cp = 0; + hr = IRichEditOle_GetObject(reole, REO_IOB_SELECTION, &received_reo4, REO_GETOBJ_ALL_INTERFACES); + ok(hr == S_OK, "IRichEditOle_GetObject failed: 0x%08x\n", hr); + CHECK_REOBJECT_STRUCT(received_reo4, NULL, NULL, reo1.polesite, 1); + + SendMessageA(hwnd, EM_SETSEL, 4, 5); + received_reo4.cbStruct = sizeof(received_reo4); + received_reo4.cp = 0; + hr = IRichEditOle_GetObject(reole, REO_IOB_SELECTION, &received_reo4, REO_GETOBJ_ALL_INTERFACES); + ok(hr == E_INVALIDARG, "IRichEditOle_GetObject should fail: 0x%08x\n", hr); + release_interfaces(&hwnd, &reole, &doc, NULL); }
1
0
0
0
Paul Gofman : ntdll: Return STATUS_PENDING from NtReadFile() for async read with regular file.
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: 730b47e5309618fdb563f299b3dbebecb5a39af8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=730b47e5309618fdb563f299…
Author: Paul Gofman <gofmanp(a)gmail.com> Date: Thu Mar 7 12:28:35 2019 +0300 ntdll: Return STATUS_PENDING from NtReadFile() for async read with regular file. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=43071
Signed-off-by: Paul Gofman <gofmanp(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/file.c | 2 +- dlls/ntdll/tests/file.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c index 7ecde56..e8775a3 100644 --- a/dlls/ntdll/file.c +++ b/dlls/ntdll/file.c @@ -1013,7 +1013,7 @@ err: if (status != STATUS_PENDING && hEvent) NtResetEvent( hEvent, NULL ); } - ret_status = async_read && (options & FILE_NO_INTERMEDIATE_BUFFERING) && status == STATUS_SUCCESS + ret_status = async_read && type == FD_TYPE_FILE && status == STATUS_SUCCESS ? STATUS_PENDING : status; if (send_completion) NTDLL_AddCompletion( hFile, cvalue, status, total, ret_status == STATUS_PENDING ); diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index 5058439..d107c2e 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -635,7 +635,7 @@ static void read_file_test(void) offset.QuadPart = 0; ResetEvent( event ); status = pNtReadFile( handle, event, apc, &apc_count, &iosb, buffer, strlen(text) + 10, &offset, NULL ); - todo_wine ok(status == STATUS_PENDING + ok(status == STATUS_PENDING || broken(status == STATUS_SUCCESS) /* before Vista */, "wrong status %x.\n", status); if (status == STATUS_PENDING) WaitForSingleObject( event, 1000 ); @@ -4450,7 +4450,7 @@ static void test_read_write(void) bytes = 0xdeadbeef; SetLastError(0xdeadbeef); ret = ReadFile(hfile, buf, 0, &bytes, &ovl); - todo_wine ok((!ret && GetLastError() == ERROR_IO_PENDING) || broken(ret) /* before Vista */, + ok((!ret && GetLastError() == ERROR_IO_PENDING) || broken(ret) /* before Vista */, "Unexpected result, ret %#x, GetLastError() %u.\n", ret, GetLastError()); ret = GetLastError(); ok(bytes == 0, "bytes %u\n", bytes); @@ -4479,7 +4479,7 @@ static void test_read_write(void) bytes = 0xdeadbeef; SetLastError(0xdeadbeef); ret = ReadFile(hfile, NULL, 0, &bytes, &ovl); - todo_wine ok((!ret && GetLastError() == ERROR_IO_PENDING) || broken(ret) /* before Vista */, + ok((!ret && GetLastError() == ERROR_IO_PENDING) || broken(ret) /* before Vista */, "Unexpected result, ret %#x, GetLastError() %u.\n", ret, GetLastError()); ret = GetLastError(); ok(bytes == 0, "bytes %u\n", bytes); @@ -4524,7 +4524,7 @@ static void test_read_write(void) iob.Information = -1; offset.QuadPart = sizeof(contents); status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, 0, &offset, NULL); - todo_wine ok(status == STATUS_PENDING || broken(status == STATUS_SUCCESS) /* before Vista */, + ok(status == STATUS_PENDING || broken(status == STATUS_SUCCESS) /* before Vista */, "expected STATUS_PENDING, got %#x.\n", status); if (status == STATUS_PENDING) { @@ -4550,7 +4550,7 @@ static void test_read_write(void) bytes = 0; SetLastError(0xdeadbeef); ret = ReadFile(hfile, buf, sizeof(buf), &bytes, &ovl); - todo_wine ok((!ret && GetLastError() == ERROR_IO_PENDING) || broken(ret) /* before Vista */, + ok((!ret && GetLastError() == ERROR_IO_PENDING) || broken(ret) /* before Vista */, "Unexpected result, ret %#x, GetLastError() %u.\n", ret, GetLastError()); if (!ret) ok(bytes == 0, "bytes %u\n", bytes); @@ -4598,7 +4598,7 @@ static void test_read_write(void) iob.Information = -1; offset.QuadPart = 0; status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, sizeof(buf), &offset, NULL); - todo_wine ok(status == STATUS_PENDING || broken(status == STATUS_SUCCESS) /* before Vista */, + ok(status == STATUS_PENDING || broken(status == STATUS_SUCCESS) /* before Vista */, "expected STATUS_PENDING, got %#x.\n", status); if (status == STATUS_PENDING) { @@ -4658,7 +4658,7 @@ static void test_read_write(void) bytes = 0; SetLastError(0xdeadbeef); ret = ReadFile(hfile, buf, sizeof(buf), &bytes, &ovl); - todo_wine ok((!ret && GetLastError() == ERROR_IO_PENDING) || broken(ret) /* before Vista */, + ok((!ret && GetLastError() == ERROR_IO_PENDING) || broken(ret) /* before Vista */, "Unexpected result %#x, GetLastError() %u.\n", ret, GetLastError()); if (!ret) {
1
0
0
0
Paul Gofman : ntdll/tests: Mark sync NtReadFile() result for async regular file as broken.
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: fb5bf0ec8a2f746e1d6931f06607f068efdce3b4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fb5bf0ec8a2f746e1d6931f0…
Author: Paul Gofman <gofmanp(a)gmail.com> Date: Thu Mar 7 12:28:34 2019 +0300 ntdll/tests: Mark sync NtReadFile() result for async regular file as broken. Signed-off-by: Paul Gofman <gofmanp(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/file.c | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index a23c3ed..5058439 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -635,9 +635,9 @@ static void read_file_test(void) offset.QuadPart = 0; ResetEvent( event ); status = pNtReadFile( handle, event, apc, &apc_count, &iosb, buffer, strlen(text) + 10, &offset, NULL ); - ok( status == STATUS_SUCCESS || - status == STATUS_PENDING, /* vista */ - "wrong status %x\n", status ); + todo_wine ok(status == STATUS_PENDING + || broken(status == STATUS_SUCCESS) /* before Vista */, + "wrong status %x.\n", status); if (status == STATUS_PENDING) WaitForSingleObject( event, 1000 ); ok( U(iosb).Status == STATUS_SUCCESS, "wrong status %x\n", U(iosb).Status ); ok( iosb.Information == strlen(text), "wrong info %lu\n", iosb.Information ); @@ -4450,9 +4450,8 @@ static void test_read_write(void) bytes = 0xdeadbeef; SetLastError(0xdeadbeef); ret = ReadFile(hfile, buf, 0, &bytes, &ovl); - /* ReadFile return value depends on Windows version and testing it is not practical */ - if (!ret) - ok(GetLastError() == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got %d\n", GetLastError()); + todo_wine ok((!ret && GetLastError() == ERROR_IO_PENDING) || broken(ret) /* before Vista */, + "Unexpected result, ret %#x, GetLastError() %u.\n", ret, GetLastError()); ret = GetLastError(); ok(bytes == 0, "bytes %u\n", bytes); @@ -4480,9 +4479,8 @@ static void test_read_write(void) bytes = 0xdeadbeef; SetLastError(0xdeadbeef); ret = ReadFile(hfile, NULL, 0, &bytes, &ovl); - /* ReadFile return value depends on Windows version and testing it is not practical */ - if (!ret) - ok(GetLastError() == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got %d\n", GetLastError()); + todo_wine ok((!ret && GetLastError() == ERROR_IO_PENDING) || broken(ret) /* before Vista */, + "Unexpected result, ret %#x, GetLastError() %u.\n", ret, GetLastError()); ret = GetLastError(); ok(bytes == 0, "bytes %u\n", bytes); @@ -4526,6 +4524,8 @@ static void test_read_write(void) iob.Information = -1; offset.QuadPart = sizeof(contents); status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, 0, &offset, NULL); + todo_wine ok(status == STATUS_PENDING || broken(status == STATUS_SUCCESS) /* before Vista */, + "expected STATUS_PENDING, got %#x.\n", status); if (status == STATUS_PENDING) { ret = WaitForSingleObject(hfile, 3000); @@ -4535,7 +4535,6 @@ static void test_read_write(void) } else { - ok(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", status); ok(U(iob).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", U(iob).Status); ok(iob.Information == 0, "expected 0, got %lu\n", iob.Information); } @@ -4551,13 +4550,12 @@ static void test_read_write(void) bytes = 0; SetLastError(0xdeadbeef); ret = ReadFile(hfile, buf, sizeof(buf), &bytes, &ovl); - /* ReadFile return value depends on Windows version and testing it is not practical */ + todo_wine ok((!ret && GetLastError() == ERROR_IO_PENDING) || broken(ret) /* before Vista */, + "Unexpected result, ret %#x, GetLastError() %u.\n", ret, GetLastError()); if (!ret) - { - ok(GetLastError() == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got %d\n", GetLastError()); ok(bytes == 0, "bytes %u\n", bytes); - } - else ok(bytes == 14, "bytes %u\n", bytes); + else + ok(bytes == 14, "bytes %u\n", bytes); ok((NTSTATUS)ovl.Internal == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#lx\n", ovl.Internal); ok(ovl.InternalHigh == sizeof(contents), "expected sizeof(contents), got %lu\n", ovl.InternalHigh); @@ -4600,7 +4598,8 @@ static void test_read_write(void) iob.Information = -1; offset.QuadPart = 0; status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, sizeof(buf), &offset, NULL); - ok(status == STATUS_PENDING || status == STATUS_SUCCESS, "expected STATUS_PENDING or STATUS_SUCCESS, got %#x\n", status); + todo_wine ok(status == STATUS_PENDING || broken(status == STATUS_SUCCESS) /* before Vista */, + "expected STATUS_PENDING, got %#x.\n", status); if (status == STATUS_PENDING) { ret = WaitForSingleObject(hfile, 3000); @@ -4659,10 +4658,10 @@ static void test_read_write(void) bytes = 0; SetLastError(0xdeadbeef); ret = ReadFile(hfile, buf, sizeof(buf), &bytes, &ovl); - /* ReadFile return value depends on Windows version and testing it is not practical */ + todo_wine ok((!ret && GetLastError() == ERROR_IO_PENDING) || broken(ret) /* before Vista */, + "Unexpected result %#x, GetLastError() %u.\n", ret, GetLastError()); if (!ret) { - ok(GetLastError() == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got %d\n", GetLastError()); ok(bytes == 0, "bytes %u\n", bytes); ret = WaitForSingleObject(hfile, 3000); ok(ret == WAIT_OBJECT_0, "WaitForSingleObject error %d\n", ret);
1
0
0
0
← Newer
1
...
74
75
76
77
78
79
80
...
110
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
Results per page:
10
25
50
100
200