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
April 2022
----- 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
1024 discussions
Start a n
N
ew thread
Jacek Caban : win32u: Move NtUserClientToScreen implementation from user32.
by Alexandre Julliard
14 Apr '22
14 Apr '22
Module: wine Branch: master Commit: 0efb4bb92808ac18ca27afedc04b936e69bf2cea URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0efb4bb92808ac18ca27afed…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Apr 14 14:11:31 2022 +0200 win32u: Move NtUserClientToScreen implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/winpos.c | 130 +-------------------------------------------------- dlls/win32u/window.c | 22 +++++++++ include/ntuser.h | 6 +++ 3 files changed, 30 insertions(+), 128 deletions(-) diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index 14511c22d9d..63c08e5d795 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -239,120 +239,6 @@ HWND WINAPI ChildWindowFromPointEx( HWND parent, POINT pt, UINT flags ) } -/******************************************************************* - * WINPOS_GetWinOffset - * - * Calculate the offset between the origin of the two windows. Used - * to implement MapWindowPoints. - */ -static BOOL WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, BOOL *mirrored, POINT *ret_offset ) -{ - WND * wndPtr; - POINT offset; - BOOL mirror_from, mirror_to, ret; - HWND hwnd; - - offset.x = offset.y = 0; - *mirrored = mirror_from = mirror_to = FALSE; - - /* Translate source window origin to screen coords */ - if (hwndFrom) - { - if (!(wndPtr = WIN_GetPtr( hwndFrom ))) - { - SetLastError( ERROR_INVALID_WINDOW_HANDLE ); - return FALSE; - } - if (wndPtr == WND_OTHER_PROCESS) goto other_process; - if (wndPtr != WND_DESKTOP) - { - if (wndPtr->dwExStyle & WS_EX_LAYOUTRTL) - { - mirror_from = TRUE; - offset.x += wndPtr->client_rect.right - wndPtr->client_rect.left; - } - while (wndPtr->parent) - { - offset.x += wndPtr->client_rect.left; - offset.y += wndPtr->client_rect.top; - hwnd = wndPtr->parent; - WIN_ReleasePtr( wndPtr ); - if (!(wndPtr = WIN_GetPtr( hwnd ))) break; - if (wndPtr == WND_OTHER_PROCESS) goto other_process; - if (wndPtr == WND_DESKTOP) break; - if (wndPtr->flags & WIN_CHILDREN_MOVED) - { - WIN_ReleasePtr( wndPtr ); - goto other_process; - } - } - if (wndPtr && wndPtr != WND_DESKTOP) WIN_ReleasePtr( wndPtr ); - offset = point_win_to_thread_dpi( hwndFrom, offset ); - } - } - - /* Translate origin to destination window coords */ - if (hwndTo) - { - if (!(wndPtr = WIN_GetPtr( hwndTo ))) - { - SetLastError( ERROR_INVALID_WINDOW_HANDLE ); - return FALSE; - } - if (wndPtr == WND_OTHER_PROCESS) goto other_process; - if (wndPtr != WND_DESKTOP) - { - POINT pt = { 0, 0 }; - if (wndPtr->dwExStyle & WS_EX_LAYOUTRTL) - { - mirror_to = TRUE; - pt.x += wndPtr->client_rect.right - wndPtr->client_rect.left; - } - while (wndPtr->parent) - { - pt.x += wndPtr->client_rect.left; - pt.y += wndPtr->client_rect.top; - hwnd = wndPtr->parent; - WIN_ReleasePtr( wndPtr ); - if (!(wndPtr = WIN_GetPtr( hwnd ))) break; - if (wndPtr == WND_OTHER_PROCESS) goto other_process; - if (wndPtr == WND_DESKTOP) break; - if (wndPtr->flags & WIN_CHILDREN_MOVED) - { - WIN_ReleasePtr( wndPtr ); - goto other_process; - } - } - if (wndPtr && wndPtr != WND_DESKTOP) WIN_ReleasePtr( wndPtr ); - pt = point_win_to_thread_dpi( hwndTo, pt ); - offset.x -= pt.x; - offset.y -= pt.y; - } - } - - *mirrored = mirror_from ^ mirror_to; - if (mirror_from) offset.x = -offset.x; - *ret_offset = offset; - return TRUE; - - other_process: /* one of the parents may belong to another process, do it the hard way */ - SERVER_START_REQ( get_windows_offset ) - { - req->from = wine_server_user_handle( hwndFrom ); - req->to = wine_server_user_handle( hwndTo ); - req->dpi = get_thread_dpi(); - if ((ret = !wine_server_call_err( req ))) - { - ret_offset->x = reply->x; - ret_offset->y = reply->y; - *mirrored = reply->mirror; - } - } - SERVER_END_REQ; - return ret; -} - - /******************************************************************* * MapWindowPoints (USER32.@) */ @@ -365,21 +251,9 @@ INT WINAPI MapWindowPoints( HWND hwnd_from, HWND hwnd_to, POINT *points, UINT co /******************************************************************* * ClientToScreen (USER32.@) */ -BOOL WINAPI ClientToScreen( HWND hwnd, LPPOINT lppnt ) +BOOL WINAPI ClientToScreen( HWND hwnd, POINT *pt ) { - POINT offset; - BOOL mirrored; - - if (!hwnd) - { - SetLastError( ERROR_INVALID_WINDOW_HANDLE ); - return FALSE; - } - if (!WINPOS_GetWinOffset( hwnd, 0, &mirrored, &offset )) return FALSE; - lppnt->x += offset.x; - lppnt->y += offset.y; - if (mirrored) lppnt->x = -lppnt->x; - return TRUE; + return NtUserClientToScreen( hwnd, pt ); } diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 3ecbc043fc8..3df544b1bb1 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -2669,6 +2669,25 @@ other_process: /* one of the parents may belong to another process, do it the h return ret; } +/* see ClientToScreen */ +static BOOL client_to_screen( HWND hwnd, POINT *pt ) +{ + POINT offset; + BOOL mirrored; + + if (!hwnd) + { + SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + return FALSE; + } + + if (!get_windows_offset( hwnd, 0, get_thread_dpi(), &mirrored, &offset )) return FALSE; + pt->x += offset.x; + pt->y += offset.y; + if (mirrored) pt->x = -pt->x; + return TRUE; +} + /* see ScreenToClient */ BOOL screen_to_client( HWND hwnd, POINT *pt ) { @@ -5090,6 +5109,9 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code ) { switch (code) { + case NtUserCallHwndParam_ClientToScreen: + return client_to_screen( hwnd, (POINT *)param ); + case NtUserCallHwndParam_EnableWindow: return enable_window( hwnd, param ); diff --git a/include/ntuser.h b/include/ntuser.h index 41abc1e2e14..6fed7a836e0 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -832,6 +832,7 @@ static inline BOOL NtUserIsWindowVisible( HWND hwnd ) /* NtUserCallHwndParam codes, not compatible with Windows */ enum { + NtUserCallHwndParam_ClientToScreen, NtUserCallHwndParam_EnableWindow, NtUserCallHwndParam_GetClassLongA, NtUserCallHwndParam_GetClassLongW, @@ -865,6 +866,11 @@ enum NtUserSpyGetMsgName, }; +static inline BOOL NtUserClientToScreen( HWND hwnd, POINT *pt ) +{ + return NtUserCallHwndParam( hwnd, (UINT_PTR)pt, NtUserCallHwndParam_ClientToScreen ); +} + static inline BOOL NtUserEnableWindow( HWND hwnd, BOOL enable ) { return NtUserCallHwndParam( hwnd, enable, NtUserCallHwndParam_EnableWindow );
1
0
0
0
Jacek Caban : win32u: Introduce NtUserMapWindowPoints.
by Alexandre Julliard
14 Apr '22
14 Apr '22
Module: wine Branch: master Commit: 11a75a65d705bf1d732ec6e3f2ee904f54cbce9c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=11a75a65d705bf1d732ec6e3…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Apr 14 14:11:09 2022 +0200 win32u: Introduce NtUserMapWindowPoints. And use it in user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/winpos.c | 22 ++-------------------- dlls/win32u/window.c | 7 +++++++ include/ntuser.h | 18 ++++++++++++++++++ 3 files changed, 27 insertions(+), 20 deletions(-) diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index c38e0fabb1c..14511c22d9d 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -356,27 +356,9 @@ static BOOL WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, BOOL *mirrored, POI /******************************************************************* * MapWindowPoints (USER32.@) */ -INT WINAPI MapWindowPoints( HWND hwndFrom, HWND hwndTo, LPPOINT lppt, UINT count ) +INT WINAPI MapWindowPoints( HWND hwnd_from, HWND hwnd_to, POINT *points, UINT count ) { - BOOL mirrored; - POINT offset; - UINT i; - - if (!WINPOS_GetWinOffset( hwndFrom, hwndTo, &mirrored, &offset )) return 0; - - for (i = 0; i < count; i++) - { - lppt[i].x += offset.x; - lppt[i].y += offset.y; - if (mirrored) lppt[i].x = -lppt[i].x; - } - if (mirrored && count == 2) /* special case for rectangle */ - { - int tmp = lppt[0].x; - lppt[0].x = lppt[1].x; - lppt[1].x = tmp; - } - return MAKELONG( LOWORD(offset.x), LOWORD(offset.y) ); + return NtUserMapWindowPoints( hwnd_from, hwnd_to, points, count ); } diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index eefc48a7d2d..3ecbc043fc8 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -5151,6 +5151,13 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code ) case NtUserCallHwndParam_KillSystemTimer: return kill_system_timer( hwnd, param ); + case NtUserCallHwndParam_MapWindowPoints: + { + struct map_window_points_params *params = (void *)param; + return map_window_points( hwnd, params->hwnd_to, params->points, params->count, + get_thread_dpi() ); + } + case NtUserCallHwndParam_MirrorRgn: return mirror_window_region( hwnd, UlongToHandle(param) ); diff --git a/include/ntuser.h b/include/ntuser.h index d8228a521e2..41abc1e2e14 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -852,6 +852,7 @@ enum NtUserCallHwndParam_GetWindowWord, NtUserCallHwndParam_IsChild, NtUserCallHwndParam_KillSystemTimer, + NtUserCallHwndParam_MapWindowPoints, NtUserCallHwndParam_MirrorRgn, NtUserCallHwndParam_MonitorFromWindow, NtUserCallHwndParam_ScreenToClient, @@ -968,6 +969,23 @@ static inline BOOL NtUserKillSystemTimer( HWND hwnd, UINT_PTR id ) return NtUserCallHwndParam( hwnd, id, NtUserCallHwndParam_KillSystemTimer ); } +struct map_window_points_params +{ + HWND hwnd_to; + POINT *points; + UINT count; +}; + +static inline int NtUserMapWindowPoints( HWND hwnd_from, HWND hwnd_to, POINT *points, UINT count ) +{ + struct map_window_points_params params; + params.hwnd_to = hwnd_to; + params.points = points; + params.count = count; + return NtUserCallHwndParam( hwnd_from, (UINT_PTR)¶ms, + NtUserCallHwndParam_MapWindowPoints ); +} + static inline BOOL NtUserMirrorRgn( HWND hwnd, HRGN hrgn ) { return NtUserCallHwndParam( hwnd, HandleToUlong(hrgn), NtUserCallHwndParam_MirrorRgn );
1
0
0
0
Jacek Caban : win32u: Move EnableWindow implementation from user32.
by Alexandre Julliard
14 Apr '22
14 Apr '22
Module: wine Branch: master Commit: 8b6a4584b80477f5dc43d71fe2dd16f7b1a135de URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8b6a4584b80477f5dc43d71f…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Apr 14 14:10:56 2022 +0200 win32u: Move EnableWindow implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/win.c | 30 +----------------------------- dlls/win32u/window.c | 37 +++++++++++++++++++++++++++++++++++++ include/ntuser.h | 6 ++++++ 3 files changed, 44 insertions(+), 29 deletions(-) diff --git a/dlls/user32/win.c b/dlls/user32/win.c index f5c22bfbadc..d44f058d256 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -869,35 +869,7 @@ HWND WINAPI GetDesktopWindow(void) */ BOOL WINAPI EnableWindow( HWND hwnd, BOOL enable ) { - BOOL retvalue; - - if (is_broadcast(hwnd)) - { - SetLastError( ERROR_INVALID_PARAMETER ); - return FALSE; - } - - TRACE("( %p, %d )\n", hwnd, enable); - - if (enable) - { - retvalue = (WIN_SetStyle( hwnd, 0, WS_DISABLED ) & WS_DISABLED) != 0; - if (retvalue) SendMessageW( hwnd, WM_ENABLE, TRUE, 0 ); - } - else - { - SendMessageW( hwnd, WM_CANCELMODE, 0, 0 ); - - retvalue = (WIN_SetStyle( hwnd, WS_DISABLED, 0 ) & WS_DISABLED) != 0; - if (!retvalue) - { - if (hwnd == GetFocus()) - NtUserSetFocus( 0 ); /* A disabled window can't have the focus */ - - SendMessageW( hwnd, WM_ENABLE, FALSE, 0 ); - } - } - return retvalue; + return NtUserEnableWindow( hwnd, enable ); } diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 6eb272ec227..eefc48a7d2d 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -807,6 +807,40 @@ BOOL is_window_unicode( HWND hwnd ) return ret; } +/* see EnableWindow */ +static BOOL enable_window( HWND hwnd, BOOL enable ) +{ + BOOL ret; + + if (is_broadcast(hwnd)) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return FALSE; + } + + TRACE( "( %p, %d )\n", hwnd, enable ); + + if (enable) + { + ret = (set_window_style( hwnd, 0, WS_DISABLED ) & WS_DISABLED) != 0; + if (ret) send_message( hwnd, WM_ENABLE, TRUE, 0 ); + } + else + { + send_message( hwnd, WM_CANCELMODE, 0, 0 ); + + ret = (set_window_style( hwnd, WS_DISABLED, 0 ) & WS_DISABLED) != 0; + if (!ret) + { + if (hwnd == get_focus()) + NtUserSetFocus( 0 ); /* A disabled window can't have the focus */ + + send_message( hwnd, WM_ENABLE, FALSE, 0 ); + } + } + return ret; +} + /* see IsWindowEnabled */ BOOL is_window_enabled( HWND hwnd ) { @@ -5056,6 +5090,9 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code ) { switch (code) { + case NtUserCallHwndParam_EnableWindow: + return enable_window( hwnd, param ); + case NtUserCallHwndParam_GetClassLongA: return get_class_long( hwnd, param, TRUE ); diff --git a/include/ntuser.h b/include/ntuser.h index 52bc6c12c32..d8228a521e2 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -832,6 +832,7 @@ static inline BOOL NtUserIsWindowVisible( HWND hwnd ) /* NtUserCallHwndParam codes, not compatible with Windows */ enum { + NtUserCallHwndParam_EnableWindow, NtUserCallHwndParam_GetClassLongA, NtUserCallHwndParam_GetClassLongW, NtUserCallHwndParam_GetClassLongPtrA, @@ -863,6 +864,11 @@ enum NtUserSpyGetMsgName, }; +static inline BOOL NtUserEnableWindow( HWND hwnd, BOOL enable ) +{ + return NtUserCallHwndParam( hwnd, enable, NtUserCallHwndParam_EnableWindow ); +} + static inline DWORD NtUserGetClassLongA( HWND hwnd, INT offset ) { return NtUserCallHwndParam( hwnd, offset, NtUserCallHwndParam_GetClassLongA );
1
0
0
0
Jacek Caban : win32u: Move NtUserChildWindowFromPointEx implementation from user32.
by Alexandre Julliard
14 Apr '22
14 Apr '22
Module: wine Branch: master Commit: 4104b19ade7532aba5645cb7410b4c6aebe45b8e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4104b19ade7532aba5645cb7…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Apr 14 14:10:33 2022 +0200 win32u: Move NtUserChildWindowFromPointEx implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/winpos.c | 42 +++++++----------------------------------- dlls/win32u/syscall.c | 1 + dlls/win32u/win32u.spec | 2 +- dlls/win32u/window.c | 37 +++++++++++++++++++++++++++++++++++++ dlls/wow64win/syscall.h | 1 + dlls/wow64win/user.c | 10 ++++++++++ include/ntuser.h | 1 + 7 files changed, 58 insertions(+), 36 deletions(-) diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index a00686ee111..c38e0fabb1c 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -216,54 +216,26 @@ HWND WINAPI WindowFromPoint( POINT pt ) /******************************************************************* * ChildWindowFromPoint (USER32.@) */ -HWND WINAPI ChildWindowFromPoint( HWND hwndParent, POINT pt ) +HWND WINAPI ChildWindowFromPoint( HWND parent, POINT pt ) { - return ChildWindowFromPointEx( hwndParent, pt, CWP_ALL ); + return NtUserChildWindowFromPointEx( parent, pt.x, pt.y, CWP_ALL ); } /******************************************************************* * RealChildWindowFromPoint (USER32.@) */ -HWND WINAPI RealChildWindowFromPoint( HWND hwndParent, POINT pt ) +HWND WINAPI RealChildWindowFromPoint( HWND parent, POINT pt ) { - return ChildWindowFromPointEx( hwndParent, pt, CWP_SKIPTRANSPARENT | CWP_SKIPINVISIBLE ); + return NtUserChildWindowFromPointEx( parent, pt.x, pt.y, + CWP_SKIPTRANSPARENT | CWP_SKIPINVISIBLE ); } /******************************************************************* * ChildWindowFromPointEx (USER32.@) */ -HWND WINAPI ChildWindowFromPointEx( HWND hwndParent, POINT pt, UINT uFlags) +HWND WINAPI ChildWindowFromPointEx( HWND parent, POINT pt, UINT flags ) { - /* pt is in the client coordinates */ - HWND *list; - int i; - RECT rect; - HWND retvalue; - - GetClientRect( hwndParent, &rect ); - if (!PtInRect( &rect, pt )) return 0; - if (!(list = WIN_ListChildren( hwndParent ))) return hwndParent; - - for (i = 0; list[i]; i++) - { - if (!WIN_GetRectangles( list[i], COORDS_PARENT, &rect, NULL )) continue; - if (!PtInRect( &rect, pt )) continue; - if (uFlags & (CWP_SKIPINVISIBLE|CWP_SKIPDISABLED)) - { - LONG style = GetWindowLongW( list[i], GWL_STYLE ); - if ((uFlags & CWP_SKIPINVISIBLE) && !(style & WS_VISIBLE)) continue; - if ((uFlags & CWP_SKIPDISABLED) && (style & WS_DISABLED)) continue; - } - if (uFlags & CWP_SKIPTRANSPARENT) - { - if (GetWindowLongW( list[i], GWL_EXSTYLE ) & WS_EX_TRANSPARENT) continue; - } - break; - } - retvalue = list[i]; - HeapFree( GetProcessHeap(), 0, list ); - if (!retvalue) retvalue = hwndParent; - return retvalue; + return NtUserChildWindowFromPointEx( parent, pt.x, pt.y, flags ); } diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c index d19ab54fa90..4c316486099 100644 --- a/dlls/win32u/syscall.c +++ b/dlls/win32u/syscall.c @@ -106,6 +106,7 @@ static void * const syscalls[] = NtUserAddClipboardFormatListener, NtUserAttachThreadInput, NtUserBuildHwndList, + NtUserChildWindowFromPointEx, NtUserCloseDesktop, NtUserCloseWindowStation, NtUserCopyAcceleratorTable, diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 0bc95daafc8..cf419668789 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -790,7 +790,7 @@ @ stub NtUserCheckProcessForClipboardAccess @ stub NtUserCheckProcessSession @ stub NtUserCheckWindowThreadDesktop -@ stub NtUserChildWindowFromPointEx +@ stdcall -syscall NtUserChildWindowFromPointEx(long long long long) @ stub NtUserClearForeground @ stdcall NtUserClipCursor(ptr) @ stdcall NtUserCloseClipboard() diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 93c9f15afff..6eb272ec227 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -2255,6 +2255,43 @@ HWND WINAPI NtUserWindowFromPoint( LONG x, LONG y ) return window_from_point( 0, pt, &hittest ); } +/******************************************************************* + * NtUserChildWindowFromPointEx (win32u.@) + */ +HWND WINAPI NtUserChildWindowFromPointEx( HWND parent, LONG x, LONG y, UINT flags ) +{ + POINT pt = { .x = x, .y = y }; /* in the client coordinates */ + HWND *list; + int i; + RECT rect; + HWND ret; + + get_client_rect( parent, &rect ); + if (!PtInRect( &rect, pt )) return 0; + if (!(list = list_window_children( 0, parent, NULL, 0 ))) return parent; + + for (i = 0; list[i]; i++) + { + if (!get_window_rects( list[i], COORDS_PARENT, &rect, NULL, get_thread_dpi() )) continue; + if (!PtInRect( &rect, pt )) continue; + if (flags & (CWP_SKIPINVISIBLE|CWP_SKIPDISABLED)) + { + LONG style = get_window_long( list[i], GWL_STYLE ); + if ((flags & CWP_SKIPINVISIBLE) && !(style & WS_VISIBLE)) continue; + if ((flags & CWP_SKIPDISABLED) && (style & WS_DISABLED)) continue; + } + if (flags & CWP_SKIPTRANSPARENT) + { + if (get_window_long( list[i], GWL_EXSTYLE ) & WS_EX_TRANSPARENT) continue; + } + break; + } + ret = list[i]; + free( list ); + if (!ret) ret = parent; + return ret; +} + /******************************************************************* * get_work_rect * diff --git a/dlls/wow64win/syscall.h b/dlls/wow64win/syscall.h index ba921e7e543..509d5272038 100644 --- a/dlls/wow64win/syscall.h +++ b/dlls/wow64win/syscall.h @@ -93,6 +93,7 @@ SYSCALL_ENTRY( NtUserAddClipboardFormatListener ) \ SYSCALL_ENTRY( NtUserAttachThreadInput ) \ SYSCALL_ENTRY( NtUserBuildHwndList ) \ + SYSCALL_ENTRY( NtUserChildWindowFromPointEx ) \ SYSCALL_ENTRY( NtUserCloseDesktop ) \ SYSCALL_ENTRY( NtUserCloseWindowStation ) \ SYSCALL_ENTRY( NtUserCopyAcceleratorTable ) \ diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index 9d957673ceb..db4ba246866 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -416,6 +416,16 @@ NTSTATUS WINAPI wow64_NtUserGetMouseMovePointsEx( UINT *args ) return NtUserGetMouseMovePointsEx( size, ptin, ptout, count, resolution ); } +NTSTATUS WINAPI wow64_NtUserChildWindowFromPointEx( UINT *args ) +{ + HWND parent = get_handle( &args ); + LONG x = get_ulong( &args ); + LONG y = get_ulong( &args ); + UINT flags = get_ulong( &args ); + + return HandleToUlong( NtUserChildWindowFromPointEx( parent, x, y, flags )); +} + NTSTATUS WINAPI wow64_NtUserSetProcessDpiAwarenessContext( UINT *args ) { ULONG awareness = get_ulong( &args ); diff --git a/include/ntuser.h b/include/ntuser.h index efabbe64ad7..52bc6c12c32 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -403,6 +403,7 @@ ULONG_PTR WINAPI NtUserCallOneParam( ULONG_PTR arg, ULONG code ); ULONG_PTR WINAPI NtUserCallTwoParam( ULONG_PTR arg1, ULONG_PTR arg2, ULONG code ); LONG WINAPI NtUserChangeDisplaySettings( UNICODE_STRING *devname, DEVMODEW *devmode, HWND hwnd, DWORD flags, void *lparam ); +HWND WINAPI NtUserChildWindowFromPointEx( HWND parent, LONG x, LONG y, UINT flags ); BOOL WINAPI NtUserClipCursor( const RECT *rect ); BOOL WINAPI NtUserCloseClipboard(void); BOOL WINAPI NtUserCloseDesktop( HDESK handle );
1
0
0
0
Jacek Caban : win32u: Move NtUserExcludeUpdateRgn implementation from user32.
by Alexandre Julliard
14 Apr '22
14 Apr '22
Module: wine Branch: master Commit: 52ff3a3094f7a8e9d50cb0170d6d98714795c29a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=52ff3a3094f7a8e9d50cb017…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Apr 14 14:10:15 2022 +0200 win32u: Move NtUserExcludeUpdateRgn implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/painting.c | 25 ------------------------- dlls/user32/user32.spec | 2 +- dlls/win32u/dce.c | 24 ++++++++++++++++++++++++ dlls/win32u/gdiobj.c | 1 + dlls/win32u/win32u.spec | 2 +- dlls/win32u/win32u_private.h | 1 + dlls/win32u/wrappers.c | 6 ++++++ include/ntuser.h | 1 + 8 files changed, 35 insertions(+), 27 deletions(-) diff --git a/dlls/user32/painting.c b/dlls/user32/painting.c index cabfe471e9d..94e462605dd 100644 --- a/dlls/user32/painting.c +++ b/dlls/user32/painting.c @@ -240,31 +240,6 @@ BOOL WINAPI ValidateRect( HWND hwnd, const RECT *rect ) } -/*********************************************************************** - * ExcludeUpdateRgn (USER32.@) - */ -INT WINAPI ExcludeUpdateRgn( HDC hdc, HWND hwnd ) -{ - HRGN update_rgn = CreateRectRgn( 0, 0, 0, 0 ); - INT ret = NtUserGetUpdateRgn( hwnd, update_rgn, FALSE ); - - if (ret != ERROR) - { - DPI_AWARENESS_CONTEXT context; - POINT pt; - - context = SetThreadDpiAwarenessContext( GetWindowDpiAwarenessContext( hwnd )); - GetDCOrgEx( hdc, &pt ); - MapWindowPoints( 0, hwnd, &pt, 1 ); - OffsetRgn( update_rgn, -pt.x, -pt.y ); - ret = ExtSelectClipRgn( hdc, update_rgn, RGN_DIFF ); - SetThreadDpiAwarenessContext( context ); - } - DeleteObject( update_rgn ); - return ret; -} - - static INT scroll_window( HWND hwnd, INT dx, INT dy, const RECT *rect, const RECT *clipRect, HRGN hrgnUpdate, LPRECT rcUpdate, UINT flags, BOOL is_ex ) { diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index af63ae007a1..fcc17aae18e 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -237,7 +237,7 @@ @ stdcall EnumWindowStationsW(ptr long) @ stdcall EnumWindows(ptr long) @ stdcall EqualRect(ptr ptr) -@ stdcall ExcludeUpdateRgn(long long) +@ stdcall ExcludeUpdateRgn(long long) NtUserExcludeUpdateRgn @ stdcall ExitWindowsEx(long long) @ stdcall FillRect(long ptr long) @ stdcall FindWindowA(str str) diff --git a/dlls/win32u/dce.c b/dlls/win32u/dce.c index f0545c8bba4..740c7441a49 100644 --- a/dlls/win32u/dce.c +++ b/dlls/win32u/dce.c @@ -1546,3 +1546,27 @@ BOOL WINAPI NtUserGetUpdateRect( HWND hwnd, RECT *rect, BOOL erase ) if (need_erase) flags |= UPDATE_DELAYED_ERASE; return get_update_flags( hwnd, NULL, &flags ) && (flags & UPDATE_PAINT); } + +/*********************************************************************** + * NtUserExcludeUpdateRgn (win32u.@) + */ +INT WINAPI NtUserExcludeUpdateRgn( HDC hdc, HWND hwnd ) +{ + HRGN update_rgn = NtGdiCreateRectRgn( 0, 0, 0, 0 ); + INT ret = NtUserGetUpdateRgn( hwnd, update_rgn, FALSE ); + + if (ret != ERROR) + { + DPI_AWARENESS_CONTEXT context; + POINT pt; + + context = set_thread_dpi_awareness_context( get_window_dpi_awareness_context( hwnd )); + NtGdiGetDCPoint( hdc, NtGdiGetDCOrg, &pt ); + map_window_points( 0, hwnd, &pt, 1, get_thread_dpi() ); + NtGdiOffsetRgn( update_rgn, -pt.x, -pt.y ); + ret = NtGdiExtSelectClipRgn( hdc, update_rgn, RGN_DIFF ); + set_thread_dpi_awareness_context( context ); + } + NtGdiDeleteObjectApp( update_rgn ); + return ret; +} diff --git a/dlls/win32u/gdiobj.c b/dlls/win32u/gdiobj.c index d71807c8c04..d5538848a4f 100644 --- a/dlls/win32u/gdiobj.c +++ b/dlls/win32u/gdiobj.c @@ -1155,6 +1155,7 @@ static struct unix_funcs unix_funcs = NtUserEnumDisplayDevices, NtUserEnumDisplayMonitors, NtUserEnumDisplaySettings, + NtUserExcludeUpdateRgn, NtUserFlashWindowEx, NtUserGetAsyncKeyState, NtUserGetClassInfoEx, diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 8c2073d0fb1..0bc95daafc8 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -879,7 +879,7 @@ @ stdcall NtUserEnumDisplayMonitors(long ptr ptr long) @ stdcall NtUserEnumDisplaySettings(ptr long ptr long) @ stub NtUserEvent -@ stub NtUserExcludeUpdateRgn +@ stdcall NtUserExcludeUpdateRgn(long long) @ stub NtUserFillWindow @ stdcall -syscall NtUserFindExistingCursorIcon(ptr ptr ptr) @ stub NtUserFindWindowEx diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 1ebb60ad6ca..69ddcc83c47 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -217,6 +217,7 @@ struct unix_funcs BOOL (WINAPI *pNtUserEnumDisplayMonitors)( HDC hdc, RECT *rect, MONITORENUMPROC proc, LPARAM lp ); BOOL (WINAPI *pNtUserEnumDisplaySettings)( UNICODE_STRING *device, DWORD mode, DEVMODEW *dev_mode, DWORD flags ); + INT (WINAPI *pNtUserExcludeUpdateRgn)( HDC hdc, HWND hwnd ); BOOL (WINAPI *pNtUserFlashWindowEx)( FLASHWINFO *info ); SHORT (WINAPI *pNtUserGetAsyncKeyState)( INT key ); ATOM (WINAPI *pNtUserGetClassInfoEx)( HINSTANCE instance, UNICODE_STRING *name, WNDCLASSEXW *wc, diff --git a/dlls/win32u/wrappers.c b/dlls/win32u/wrappers.c index f29d78c2c52..b5c2b49ce79 100644 --- a/dlls/win32u/wrappers.c +++ b/dlls/win32u/wrappers.c @@ -852,6 +852,12 @@ BOOL WINAPI NtUserEnumDisplaySettings( UNICODE_STRING *device, DWORD mode, return unix_funcs->pNtUserEnumDisplaySettings( device, mode, dev_mode, flags ); } +INT WINAPI NtUserExcludeUpdateRgn( HDC hdc, HWND hwnd ) +{ + if (!unix_funcs) return ERROR; + return unix_funcs->pNtUserExcludeUpdateRgn( hdc, hwnd ); +} + BOOL WINAPI NtUserFlashWindowEx( FLASHWINFO *info ) { if (!unix_funcs) return FALSE; diff --git a/include/ntuser.h b/include/ntuser.h index eed7e4e78c2..efabbe64ad7 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -436,6 +436,7 @@ NTSTATUS WINAPI NtUserEnumDisplayDevices( UNICODE_STRING *device, DWORD index, BOOL WINAPI NtUserEnumDisplayMonitors( HDC hdc, RECT *rect, MONITORENUMPROC proc, LPARAM lp ); BOOL WINAPI NtUserEnumDisplaySettings( UNICODE_STRING *device, DWORD mode, DEVMODEW *dev_mode, DWORD flags ); +INT WINAPI NtUserExcludeUpdateRgn( HDC hdc, HWND hwnd ); HICON WINAPI NtUserFindExistingCursorIcon( UNICODE_STRING *module, UNICODE_STRING *res_name, void *desc ); BOOL WINAPI NtUserFlashWindowEx( FLASHWINFO *info );
1
0
0
0
Connor McAdams : webservices/tests: Add some tests for session dictionary size.
by Alexandre Julliard
14 Apr '22
14 Apr '22
Module: wine Branch: master Commit: 7b6a38b072e0f93d768ba9c3db99e7a732350b7a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7b6a38b072e0f93d768ba9c3…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Wed Apr 13 10:40:30 2022 -0400 webservices/tests: Add some tests for session dictionary size. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/tests/channel.c | 363 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 356 insertions(+), 7 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=7b6a38b072e0f93d768b…
1
0
0
0
Connor McAdams : webservices: Set proper minor version for .NET Message Framing Protocol.
by Alexandre Julliard
14 Apr '22
14 Apr '22
Module: wine Branch: master Commit: aaf02584addc0f6e73ea7077d9826e4caff6803d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=aaf02584addc0f6e73ea7077…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Wed Apr 13 10:40:29 2022 -0400 webservices: Set proper minor version for .NET Message Framing Protocol. According to MC-NMF, the .Net Framing Protocol, "An implementation conforming to this specification MUST set this field to 0x00." Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/channel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/webservices/channel.c b/dlls/webservices/channel.c index a9142bedee9..1148744346c 100644 --- a/dlls/webservices/channel.c +++ b/dlls/webservices/channel.c @@ -1415,7 +1415,7 @@ static enum known_encoding map_channel_encoding( struct channel *channel ) } #define FRAME_VERSION_MAJOR 1 -#define FRAME_VERSION_MINOR 1 +#define FRAME_VERSION_MINOR 0 static HRESULT write_preamble( struct channel *channel ) {
1
0
0
0
Paul Gofman : crypt32: Support CERT_QUERY_OBJECT_BLOB in CRYPT_QueryEmbeddedMessageObject().
by Alexandre Julliard
14 Apr '22
14 Apr '22
Module: wine Branch: master Commit: a6ea269a96f1a6b8f31d130e3f64036018974bb5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a6ea269a96f1a6b8f31d130e…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Wed Apr 13 17:00:35 2022 +0300 crypt32: Support CERT_QUERY_OBJECT_BLOB in CRYPT_QueryEmbeddedMessageObject(). Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/crypt32/object.c | 40 +++++++++++-- dlls/crypt32/tests/object.c | 140 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 175 insertions(+), 5 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=a6ea269a96f1a6b8f31d…
1
0
0
0
Alexandre Julliard : user32/tests: Fix some tests that break in UTF-8 codepage.
by Alexandre Julliard
14 Apr '22
14 Apr '22
Module: wine Branch: master Commit: 86b063c1a912beea24aeafdd94c5d4a8d2c68271 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=86b063c1a912beea24aeafdd…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Apr 14 11:34:21 2022 +0200 user32/tests: Fix some tests that break in UTF-8 codepage. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/resource.c | 8 ++++---- dlls/user32/tests/wsprintf.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/user32/tests/resource.c b/dlls/user32/tests/resource.c index 97c274c7817..fff962b955c 100644 --- a/dlls/user32/tests/resource.c +++ b/dlls/user32/tests/resource.c @@ -172,11 +172,11 @@ static void test_accel1(void) ac[n++].fVirt = (SHORT) 0xffff; ac[n].cmd = 0xfff0; - ac[n].key = 0xffff; + ac[n].key = 'B'; ac[n++].fVirt = (SHORT) 0xfff0; ac[n].cmd = 0xfff0; - ac[n].key = 0xffff; + ac[n].key = 'C'; ac[n++].fVirt = 0x0000; ac[n].cmd = 0xfff0; @@ -204,12 +204,12 @@ static void test_accel1(void) if (++n == r) goto done; ok( ac[n].cmd == 0xfff0, "cmd 2 not preserved got %x\n", ac[n].cmd); - ok( (ac[n].key & 0xff) == 0xff, "key 2 not preserved got %x\n", ac[n].key); + ok( ac[n].key == 'B', "key 2 not preserved got %x\n", ac[n].key); ok( ac[n].fVirt == 0x0070, "fVirt 2 wrong got %x\n", ac[n].fVirt); if (++n == r) goto done; ok( ac[n].cmd == 0xfff0, "cmd 3 not preserved got %x\n", ac[n].cmd); - ok( (ac[n].key & 0xff) == 0xff, "key 3 not preserved got %x\n", ac[n].key); + ok( ac[n].key == 'C', "key 3 not preserved got %x\n", ac[n].key); ok( ac[n].fVirt == 0x0000, "fVirt 3 wrong got %x\n", ac[n].fVirt); if (++n == r) goto done; diff --git a/dlls/user32/tests/wsprintf.c b/dlls/user32/tests/wsprintf.c index f46cfa5aea3..d35138f4087 100644 --- a/dlls/user32/tests/wsprintf.c +++ b/dlls/user32/tests/wsprintf.c @@ -95,7 +95,7 @@ static void wsprintfATest(void) ok(!strcmp(buf, i64_formats[i].res), "%u: wrong result [%s]\n", i, buf); } - if (!GetCPInfo(CP_ACP, &cpinfo) || cpinfo.MaxCharSize <= 1) + if (!GetCPInfo(CP_ACP, &cpinfo) || cpinfo.MaxCharSize != 2) { skip("Multi-byte wsprintfA test isn't available for the current codepage\n"); return; @@ -199,7 +199,7 @@ static void wsprintfWTest(void) ok(buf[0] == L' ', "expected \\x0020, got \\x%04x\n", buf[0]); ok(buf[1] == wc99, "expected \\x%04x, got \\x%04x\n", wc99, buf[1]); - if (!GetCPInfoExW(CP_ACP, 0, &cpinfoex) || cpinfoex.MaxCharSize <= 1) + if (!GetCPInfoExW(CP_ACP, 0, &cpinfoex) || cpinfoex.MaxCharSize != 2) { skip("Multi-byte wsprintfW test isn't available for the current codepage\n"); return;
1
0
0
0
Alexandre Julliard : user32: Pass a valid length to RtlUnicodeToMultiByteN/RtlMultiByteToUnicodeN.
by Alexandre Julliard
14 Apr '22
14 Apr '22
Module: wine Branch: master Commit: dee9a361c74d150bd04017bcc938ec49d8f5fb27 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=dee9a361c74d150bd04017bc…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Apr 14 09:44:41 2022 +0200 user32: Pass a valid length to RtlUnicodeToMultiByteN/RtlMultiByteToUnicodeN. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/winproc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/user32/winproc.c b/dlls/user32/winproc.c index 7b9b2000c06..9e90906bc5d 100644 --- a/dlls/user32/winproc.c +++ b/dlls/user32/winproc.c @@ -373,7 +373,7 @@ LRESULT WINPROC_CallProcAtoW( winproc_callback_t callback, HWND hwnd, UINT msg, if (*result >= 0) { DWORD len; - RtlUnicodeToMultiByteN( (LPSTR)lParam, ~0u, &len, + RtlUnicodeToMultiByteN( (LPSTR)lParam, 512 * 3, &len, buffer, (lstrlenW(buffer) + 1) * sizeof(WCHAR) ); *result = len - 1; } @@ -633,7 +633,7 @@ static LRESULT WINPROC_CallProcWtoA( winproc_callback_t callback, HWND hwnd, UIN if (*result >= 0) { DWORD len; - RtlMultiByteToUnicodeN( (LPWSTR)lParam, ~0u, &len, buffer, strlen(buffer) + 1 ); + RtlMultiByteToUnicodeN( (LPWSTR)lParam, 512 * 3, &len, buffer, strlen(buffer) + 1 ); *result = len / sizeof(WCHAR) - 1; } }
1
0
0
0
← Newer
1
...
50
51
52
53
54
55
56
...
103
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
Results per page:
10
25
50
100
200