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 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
1138 discussions
Start a n
N
ew thread
Jacek Caban : win32u: Implement NtUserDispatchMessage.
by Alexandre Julliard
23 Mar '22
23 Mar '22
Module: wine Branch: master Commit: 1e5dc840f7c36928cdcfb42736283d55afa62def URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1e5dc840f7c36928cdcfb427…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Mar 23 14:01:18 2022 +0100 win32u: Implement NtUserDispatchMessage. 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/message.c | 50 +-------------------- dlls/user32/user_main.c | 1 + dlls/user32/user_private.h | 1 + dlls/user32/winproc.c | 9 +++- dlls/win32u/gdiobj.c | 1 + dlls/win32u/message.c | 105 +++++++++++++++++++++++++++++++++++++++++++ dlls/win32u/sysparams.c | 2 + dlls/win32u/win32u.spec | 2 +- dlls/win32u/win32u_private.h | 2 + dlls/win32u/wrappers.c | 6 +++ include/ntuser.h | 3 ++ 11 files changed, 131 insertions(+), 51 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=1e5dc840f7c36928cdcf…
1
0
0
0
Jacek Caban : win32u: Move init_win_proc_params implementation from user32.
by Alexandre Julliard
23 Mar '22
23 Mar '22
Module: wine Branch: master Commit: c1a9b0b6a98faddf5b64ac99f3fed759b0199f46 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c1a9b0b6a98faddf5b64ac99…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Mar 23 14:00:56 2022 +0100 win32u: Move init_win_proc_params 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/winproc.c | 46 ++++++++------------------------------------ dlls/win32u/class.c | 21 +++++++++++++++++++- dlls/win32u/message.c | 22 +++++++++++++++++++++ dlls/win32u/ntuser_private.h | 1 + include/ntuser.h | 1 + 5 files changed, 52 insertions(+), 39 deletions(-) diff --git a/dlls/user32/winproc.c b/dlls/user32/winproc.c index c46cd373b4e..f3d5d913ac5 100644 --- a/dlls/user32/winproc.c +++ b/dlls/user32/winproc.c @@ -851,40 +851,6 @@ BOOL WINPROC_call_window( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, } -static void init_win_proc_params( struct win_proc_params *info, WNDPROC func, HWND hwnd, UINT msg, - WPARAM wparam, LPARAM lparam, LRESULT *result, BOOL ansi ) -{ - WINDOWPROC *proc; - - USER_CheckNotLock(); - - info->hwnd = WIN_GetFullHandle( hwnd ); - info->msg = msg; - info->wparam = wparam; - info->lparam = lparam; - info->result = result; - info->ansi = info->ansi_dst = ansi; - info->is_dialog = FALSE; - info->mapping = WMCHAR_MAP_CALLWINDOWPROC; - info->dpi_awareness = GetWindowDpiAwarenessContext( info->hwnd ); - info->func = func; - - if (!(proc = handle_to_proc( func ))) - { - info->procW = info->procA = NULL; - } - else if (proc == WINPROC_PROC16) - { - info->procW = info->procA = WINPROC_PROC16; - } - else - { - info->procA = proc->procA; - info->procW = proc->procW; - } -} - - /********************************************************************** * CallWindowProcA (USER32.@) * @@ -914,8 +880,10 @@ LRESULT WINAPI CallWindowProcA( WNDPROC func, HWND hwnd, UINT msg, WPARAM wParam struct win_proc_params params; LRESULT result; - if (!func) return 0; - init_win_proc_params( ¶ms, func, hwnd, msg, wParam, lParam, &result, TRUE ); + params.func = func; + params.result = &result; + if (!NtUserMessageCall( hwnd, msg, wParam, lParam, (ULONG_PTR)¶ms, FNID_CALLWNDPROC, TRUE )) + return 0; dispatch_win_proc_params( ¶ms ); return result; } @@ -931,8 +899,10 @@ LRESULT WINAPI CallWindowProcW( WNDPROC func, HWND hwnd, UINT msg, WPARAM wParam struct win_proc_params params; LRESULT result; - if (!func) return 0; - init_win_proc_params( ¶ms, func, hwnd, msg, wParam, lParam, &result, FALSE ); + params.func = func; + params.result = &result; + if (!NtUserMessageCall( hwnd, msg, wParam, lParam, (ULONG_PTR)¶ms, FNID_CALLWNDPROC, FALSE )) + return 0; dispatch_win_proc_params( ¶ms ); return result; } diff --git a/dlls/win32u/class.c b/dlls/win32u/class.c index 9ac402025b0..a030f5d6c0d 100644 --- a/dlls/win32u/class.c +++ b/dlls/win32u/class.c @@ -37,7 +37,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(class); WINE_DECLARE_DEBUG_CHANNEL(win); #define MAX_WINPROCS 4096 -#define WINPROC_PROC16 ((WINDOWPROC *)1) /* placeholder for 16-bit window procs */ +#define WINPROC_PROC16 ((void *)1) /* placeholder for 16-bit window procs */ typedef struct tagCLASS { @@ -184,6 +184,25 @@ BOOL is_winproc_unicode( WNDPROC proc, BOOL def_val ) return ptr->procW != NULL; } +void get_winproc_params( struct win_proc_params *params ) +{ + WINDOWPROC *proc = get_winproc_ptr( params->func ); + + if (!proc) + { + params->procW = params->procA = NULL; + } + else if (proc == WINPROC_PROC16) + { + params->procW = params->procA = WINPROC_PROC16; + } + else + { + params->procA = proc->procA; + params->procW = proc->procW; + } +} + /*********************************************************************** * NtUserInitializeClientPfnArrays (win32u.@) */ diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index 7730de22fef..b9f9f22378e 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -32,6 +32,25 @@ WINE_DEFAULT_DEBUG_CHANNEL(msg); +static BOOL init_win_proc_params( struct win_proc_params *params, HWND hwnd, UINT msg, + WPARAM wparam, LPARAM lparam, BOOL ansi ) +{ + if (!params->func) return FALSE; + + user_check_not_lock(); + + params->hwnd = get_full_window_handle( hwnd ); + params->msg = msg; + params->wparam = wparam; + params->lparam = lparam; + params->ansi = params->ansi_dst = ansi; + params->is_dialog = FALSE; + params->mapping = WMCHAR_MAP_CALLWINDOWPROC; + params->dpi_awareness = get_window_dpi_awareness_context( params->hwnd ); + get_winproc_params( params ); + return TRUE; +} + /*********************************************************************** * handle_internal_message * @@ -269,6 +288,9 @@ BOOL WINAPI NtUserMessageCall( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam { switch (type) { + case FNID_CALLWNDPROC: + return init_win_proc_params( (struct win_proc_params *)result_info, hwnd, msg, + wparam, lparam, ansi ); case FNID_SENDMESSAGE: return send_window_message( hwnd, msg, wparam, lparam, (LRESULT *)result_info, ansi ); case FNID_SENDNOTIFYMESSAGE: diff --git a/dlls/win32u/ntuser_private.h b/dlls/win32u/ntuser_private.h index 14bd98a307b..7c03474286d 100644 --- a/dlls/win32u/ntuser_private.h +++ b/dlls/win32u/ntuser_private.h @@ -243,6 +243,7 @@ ULONG_PTR get_class_long_ptr( HWND hwnd, INT offset, BOOL ansi ) DECLSPEC_HIDDEN WORD get_class_word( HWND hwnd, INT offset ) DECLSPEC_HIDDEN; ATOM get_int_atom_value( UNICODE_STRING *name ) DECLSPEC_HIDDEN; WNDPROC get_winproc( WNDPROC proc, BOOL ansi ) DECLSPEC_HIDDEN; +void get_winproc_params( struct win_proc_params *params ) DECLSPEC_HIDDEN; struct dce *get_class_dce( struct tagCLASS *class ) DECLSPEC_HIDDEN; struct dce *set_class_dce( struct tagCLASS *class, struct dce *dce ) DECLSPEC_HIDDEN; diff --git a/include/ntuser.h b/include/ntuser.h index 12e9b5b3025..e50dcf078ad 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -220,6 +220,7 @@ enum /* NtUserMessageCall codes */ enum { + FNID_CALLWNDPROC = 0x02ab, FNID_SENDMESSAGE = 0x02b1, FNID_SENDNOTIFYMESSAGE = 0x02b7, /* Wine-specific exports */
1
0
0
0
Jacek Caban : user32: Move more code out of call_window_proc.
by Alexandre Julliard
23 Mar '22
23 Mar '22
Module: wine Branch: master Commit: b8a805e2f2c2411aa3ed6a4650d6ab3a5a852f78 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b8a805e2f2c2411aa3ed6a46…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Mar 23 14:00:43 2022 +0100 user32: Move more code out of call_window_proc. 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/winproc.c | 20 ++++++++++++-------- include/ntuser.h | 1 + 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/dlls/user32/winproc.c b/dlls/user32/winproc.c index b3da8d26cb3..c46cd373b4e 100644 --- a/dlls/user32/winproc.c +++ b/dlls/user32/winproc.c @@ -119,18 +119,12 @@ static WPARAM map_wparam_char_WtoA( WPARAM wParam, DWORD len ) /* call a 32-bit window procedure */ static LRESULT call_window_proc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp, LRESULT *result, void *arg ) { - DPI_AWARENESS_CONTEXT context; WNDPROC proc = arg; - USER_CheckNotLock(); - - hwnd = WIN_GetFullHandle( hwnd ); TRACE_(relay)( "\1Call window proc %p (hwnd=%p,msg=%s,wp=%08lx,lp=%08lx)\n", proc, hwnd, SPY_GetMsgName(msg, hwnd), wp, lp ); - context = SetThreadDpiAwarenessContext( GetWindowDpiAwarenessContext( hwnd )); *result = WINPROC_wrapper( proc, hwnd, msg, wp, lp ); - SetThreadDpiAwarenessContext( context ); TRACE_(relay)( "\1Ret window proc %p (hwnd=%p,msg=%s,wp=%08lx,lp=%08lx) retval=%08lx\n", proc, hwnd, SPY_GetMsgName(msg, hwnd), wp, lp, *result ); @@ -711,6 +705,10 @@ static LRESULT WINPROC_CallProcWtoA( winproc_callback_t callback, HWND hwnd, UIN static void dispatch_win_proc_params( struct win_proc_params *params ) { + DPI_AWARENESS_CONTEXT context = SetThreadDpiAwarenessContext( params->dpi_awareness ); + + USER_CheckNotLock(); + if (!params->ansi) { if (params->procW == WINPROC_PROC16) @@ -789,6 +787,8 @@ static void dispatch_win_proc_params( struct win_proc_params *params ) call_window_proc( params->hwnd, params->msg, params->wparam, params->lparam, params->result, params->func ); } + + SetThreadDpiAwarenessContext( context ); } @@ -818,13 +818,14 @@ BOOL WINPROC_call_window( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, params.is_dialog = wndPtr->dlgInfo != NULL; WIN_ReleasePtr( wndPtr ); - params.hwnd = hwnd; + params.hwnd = WIN_GetFullHandle( hwnd ); params.msg = msg; params.wparam = wParam; params.lparam = lParam; params.result = result; params.ansi = !unicode; params.mapping = mapping; + params.dpi_awareness = GetWindowDpiAwarenessContext( params.hwnd ); if (!proc) { @@ -855,7 +856,9 @@ static void init_win_proc_params( struct win_proc_params *info, WNDPROC func, HW { WINDOWPROC *proc; - info->hwnd = hwnd; + USER_CheckNotLock(); + + info->hwnd = WIN_GetFullHandle( hwnd ); info->msg = msg; info->wparam = wparam; info->lparam = lparam; @@ -863,6 +866,7 @@ static void init_win_proc_params( struct win_proc_params *info, WNDPROC func, HW info->ansi = info->ansi_dst = ansi; info->is_dialog = FALSE; info->mapping = WMCHAR_MAP_CALLWINDOWPROC; + info->dpi_awareness = GetWindowDpiAwarenessContext( info->hwnd ); info->func = func; if (!(proc = handle_to_proc( func ))) diff --git a/include/ntuser.h b/include/ntuser.h index 19f303f0dae..12e9b5b3025 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -87,6 +87,7 @@ struct win_proc_params BOOL ansi_dst; BOOL is_dialog; enum wm_char_mapping mapping; + DPI_AWARENESS_CONTEXT dpi_awareness; WNDPROC procA; WNDPROC procW; };
1
0
0
0
Jacek Caban : user32: Use dispatch_win_proc_params in CallWindowProc.
by Alexandre Julliard
23 Mar '22
23 Mar '22
Module: wine Branch: master Commit: afddda2ce6596d864efd0228eb2f69bb0348ae37 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=afddda2ce6596d864efd0228…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Mar 23 14:06:49 2022 +0100 user32: Use dispatch_win_proc_params in CallWindowProc. 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/winproc.c | 70 +++++++++++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 30 deletions(-) diff --git a/dlls/user32/winproc.c b/dlls/user32/winproc.c index adbd5aeb8f6..b3da8d26cb3 100644 --- a/dlls/user32/winproc.c +++ b/dlls/user32/winproc.c @@ -850,6 +850,37 @@ BOOL WINPROC_call_window( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, } +static void init_win_proc_params( struct win_proc_params *info, WNDPROC func, HWND hwnd, UINT msg, + WPARAM wparam, LPARAM lparam, LRESULT *result, BOOL ansi ) +{ + WINDOWPROC *proc; + + info->hwnd = hwnd; + info->msg = msg; + info->wparam = wparam; + info->lparam = lparam; + info->result = result; + info->ansi = info->ansi_dst = ansi; + info->is_dialog = FALSE; + info->mapping = WMCHAR_MAP_CALLWINDOWPROC; + info->func = func; + + if (!(proc = handle_to_proc( func ))) + { + info->procW = info->procA = NULL; + } + else if (proc == WINPROC_PROC16) + { + info->procW = info->procA = WINPROC_PROC16; + } + else + { + info->procA = proc->procA; + info->procW = proc->procW; + } +} + + /********************************************************************** * CallWindowProcA (USER32.@) * @@ -874,27 +905,14 @@ BOOL WINPROC_call_window( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, * * ECMA-234, Win32 */ -LRESULT WINAPI CallWindowProcA( - WNDPROC func, /* [in] window procedure */ - HWND hwnd, /* [in] target window */ - UINT msg, /* [in] message */ - WPARAM wParam, /* [in] message dependent parameter */ - LPARAM lParam /* [in] message dependent parameter */ -) { - WINDOWPROC *proc; +LRESULT WINAPI CallWindowProcA( WNDPROC func, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) +{ + struct win_proc_params params; LRESULT result; if (!func) return 0; - - if (!(proc = handle_to_proc( func ))) - call_window_proc( hwnd, msg, wParam, lParam, &result, func ); - else if (proc == WINPROC_PROC16) - wow_handlers.call_window_proc( hwnd, msg, wParam, lParam, &result, func ); - else if (proc->procA) - call_window_proc( hwnd, msg, wParam, lParam, &result, proc->procA ); - else - WINPROC_CallProcAtoW( call_window_proc, hwnd, msg, wParam, lParam, &result, - proc->procW, WMCHAR_MAP_CALLWINDOWPROC ); + init_win_proc_params( ¶ms, func, hwnd, msg, wParam, lParam, &result, TRUE ); + dispatch_win_proc_params( ¶ms ); return result; } @@ -904,22 +922,14 @@ LRESULT WINAPI CallWindowProcA( * * See CallWindowProcA. */ -LRESULT WINAPI CallWindowProcW( WNDPROC func, HWND hwnd, UINT msg, - WPARAM wParam, LPARAM lParam ) +LRESULT WINAPI CallWindowProcW( WNDPROC func, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) { - WINDOWPROC *proc; + struct win_proc_params params; LRESULT result; if (!func) return 0; - - if (!(proc = handle_to_proc( func ))) - call_window_proc( hwnd, msg, wParam, lParam, &result, func ); - else if (proc == WINPROC_PROC16) - WINPROC_CallProcWtoA( wow_handlers.call_window_proc, hwnd, msg, wParam, lParam, &result, func ); - else if (proc->procW) - call_window_proc( hwnd, msg, wParam, lParam, &result, proc->procW ); - else - WINPROC_CallProcWtoA( call_window_proc, hwnd, msg, wParam, lParam, &result, proc->procA ); + init_win_proc_params( ¶ms, func, hwnd, msg, wParam, lParam, &result, FALSE ); + dispatch_win_proc_params( ¶ms ); return result; }
1
0
0
0
Jacek Caban : user32: Factor out dispatch_win_proc_params.
by Alexandre Julliard
23 Mar '22
23 Mar '22
Module: wine Branch: master Commit: a821155f21425b91e392bc67ace5e5904281f7e5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a821155f21425b91e392bc67…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Mar 23 14:00:21 2022 +0100 user32: Factor out dispatch_win_proc_params. 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/user_private.h | 13 ---- dlls/user32/winproc.c | 174 ++++++++++++++++++++++++++++----------------- include/ntuser.h | 30 ++++++++ 3 files changed, 140 insertions(+), 77 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=a821155f21425b91e392…
1
0
0
0
Matteo Bruni : d3d10: Do not accept any compute shader in D3D10ReflectShader().
by Alexandre Julliard
23 Mar '22
23 Mar '22
Module: wine Branch: master Commit: c36a25897c23e6353065335bbb900b5010e7ac76 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c36a25897c23e6353065335b…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Wed Mar 23 13:58:17 2022 +0100 d3d10: Do not accept any compute shader in D3D10ReflectShader(). Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dcompiler_43/reflection.c | 11 ++++++++-- dlls/d3dcompiler_43/tests/reflection.c | 39 +++++++++++++++++++++++++++++----- 2 files changed, 43 insertions(+), 7 deletions(-) diff --git a/dlls/d3dcompiler_43/reflection.c b/dlls/d3dcompiler_43/reflection.c index 096efc91bd4..0fa0dc16839 100644 --- a/dlls/d3dcompiler_43/reflection.c +++ b/dlls/d3dcompiler_43/reflection.c @@ -52,6 +52,8 @@ enum D3DCOMPILER_SIGNATURE_ELEMENT_SIZE #define D3DCOMPILER_SHADER_TARGET_SHADERTYPE_MASK 0xffff0000 #define D3DCOMPILER_SHADER_TARGET_SHADERTYPE_SHIFT 16 +#define D3DCOMPILER_SHDR_SHADER_TYPE_CS 0x4353 + enum d3dcompiler_shader_type { D3DCOMPILER_SHADER_TYPE_CS = 5, @@ -1487,6 +1489,9 @@ static HRESULT d3dcompiler_parse_rdef(struct d3dcompiler_shader_reflection *r, c size_t size = data_size >> 2; uint32_t target_version; const char *ptr = data; +#if D3D_COMPILER_VERSION < 47 + uint32_t shader_type; +#endif HRESULT hr; TRACE("Size %Iu.\n", size); @@ -1508,8 +1513,10 @@ static HRESULT d3dcompiler_parse_rdef(struct d3dcompiler_shader_reflection *r, c target_version = r->target & D3DCOMPILER_SHADER_TARGET_VERSION_MASK; #if D3D_COMPILER_VERSION < 47 - if (target_version >= 0x501 && (!D3D_COMPILER_VERSION || ((r->target & D3DCOMPILER_SHADER_TARGET_SHADERTYPE_MASK) - >> D3DCOMPILER_SHADER_TARGET_SHADERTYPE_SHIFT) != 0x4353 /* CS */)) + shader_type = (r->target & D3DCOMPILER_SHADER_TARGET_SHADERTYPE_MASK) + >> D3DCOMPILER_SHADER_TARGET_SHADERTYPE_SHIFT; + if ((target_version >= 0x501 && shader_type != D3DCOMPILER_SHDR_SHADER_TYPE_CS) + || (!D3D_COMPILER_VERSION && shader_type == D3DCOMPILER_SHDR_SHADER_TYPE_CS)) { WARN("Target version %#x is not supported in d3dcompiler %u.\n", target_version, D3D_COMPILER_VERSION); return E_INVALIDARG; diff --git a/dlls/d3dcompiler_43/tests/reflection.c b/dlls/d3dcompiler_43/tests/reflection.c index bfd79d04618..70f3a51683a 100644 --- a/dlls/d3dcompiler_43/tests/reflection.c +++ b/dlls/d3dcompiler_43/tests/reflection.c @@ -1198,9 +1198,32 @@ static const D3D12_SHADER_INPUT_BIND_DESC test_reflection_bound_resources_result {"c2", D3D_SIT_CBUFFER, 1, 1, 0, 0, D3D_SRV_DIMENSION_UNKNOWN, 0, 0, 1}, }; -#if D3D_COMPILER_VERSION static void test_reflection_cs(void) { + /* + * fxc.exe /T cs_4_0 /Fo + */ +#if 0 + [numthreads(16, 8, 4)] + void main( uint3 DTid : SV_DispatchThreadID ) + { + } +#endif + static const DWORD test_blob_cs_4_0[] = + { + 0x43425844, 0x698a31ca, 0x8c6eee35, 0x2377107a, 0xe1e69066, 0x00000001, 0x00000150, 0x00000005, + 0x00000034, 0x0000008c, 0x0000009c, 0x000000ac, 0x000000d4, 0x46454452, 0x00000050, 0x00000000, + 0x00000000, 0x00000000, 0x0000001c, 0x43530400, 0x00000100, 0x0000001c, 0x7263694d, 0x666f736f, + 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, 0x39207265, 0x2e39322e, + 0x2e323539, 0x31313133, 0xababab00, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, + 0x00000008, 0x00000000, 0x00000008, 0x58454853, 0x00000020, 0x00050040, 0x00000008, 0x0100086a, + 0x0400009b, 0x00000010, 0x00000008, 0x00000004, 0x0100003e, 0x54415453, 0x00000074, 0x00000001, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + }; + /* * fxc.exe /T cs_5_1 /Fo */ @@ -1228,10 +1251,17 @@ static void test_reflection_cs(void) }; UINT size_x, size_y, size_z, size_total; ID3D11ShaderReflection *ref11; - HRESULT hr; + HRESULT hr, expected; + + expected = D3D_COMPILER_VERSION ? S_OK : E_INVALIDARG; + hr = call_reflect(test_blob_cs_4_0, test_blob_cs_4_0[6], &IID_ID3D11ShaderReflection, (void **)&ref11); + ok(hr == expected, "Unexpected hr %#lx.\n", hr); + + if (SUCCEEDED(hr)) + ref11->lpVtbl->Release(ref11); hr = call_reflect(test_blob, test_blob[6], &IID_ID3D11ShaderReflection, (void **)&ref11); - ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(hr == expected, "Unexpected hr %#lx.\n", hr); if (FAILED(hr)) return; size_total = ref11->lpVtbl->GetThreadGroupSize(ref11, &size_x, &size_y, &size_z); @@ -1242,7 +1272,6 @@ static void test_reflection_cs(void) ref11->lpVtbl->Release(ref11); } -#endif static void test_reflection_bound_resources(const DWORD *blob, const D3D12_SHADER_INPUT_BIND_DESC *result, unsigned int result_count, unsigned int target_version) @@ -2208,10 +2237,10 @@ START_TEST(reflection) #if D3D_COMPILER_VERSION test_reflection_references(); test_reflection_interfaces(); - test_reflection_cs(); #else test_d3d10_interfaces(); #endif + test_reflection_cs(); test_reflection_desc_vs(); test_reflection_desc_ps(); test_reflection_desc_ps_output();
1
0
0
0
Paul Gofman : d3dcompiler: Allow cs5.1 shaders on earlier d3dcompiler versions.
by Alexandre Julliard
23 Mar '22
23 Mar '22
Module: wine Branch: master Commit: af454773929dd01844326c8756cdce438ead2df9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=af454773929dd01844326c87…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Wed Mar 23 13:58:16 2022 +0100 d3dcompiler: Allow cs5.1 shaders on earlier d3dcompiler versions. Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dcompiler_43/reflection.c | 4 ++-- dlls/d3dcompiler_43/tests/reflection.c | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/d3dcompiler_43/reflection.c b/dlls/d3dcompiler_43/reflection.c index 787d0388f93..096efc91bd4 100644 --- a/dlls/d3dcompiler_43/reflection.c +++ b/dlls/d3dcompiler_43/reflection.c @@ -1507,9 +1507,9 @@ static HRESULT d3dcompiler_parse_rdef(struct d3dcompiler_shader_reflection *r, c TRACE("Target: %#x.\n", r->target); target_version = r->target & D3DCOMPILER_SHADER_TARGET_VERSION_MASK; - #if D3D_COMPILER_VERSION < 47 - if (target_version >= 0x501) + if (target_version >= 0x501 && (!D3D_COMPILER_VERSION || ((r->target & D3DCOMPILER_SHADER_TARGET_SHADERTYPE_MASK) + >> D3DCOMPILER_SHADER_TARGET_SHADERTYPE_SHIFT) != 0x4353 /* CS */)) { WARN("Target version %#x is not supported in d3dcompiler %u.\n", target_version, D3D_COMPILER_VERSION); return E_INVALIDARG; diff --git a/dlls/d3dcompiler_43/tests/reflection.c b/dlls/d3dcompiler_43/tests/reflection.c index e4261ad0d79..bfd79d04618 100644 --- a/dlls/d3dcompiler_43/tests/reflection.c +++ b/dlls/d3dcompiler_43/tests/reflection.c @@ -1231,7 +1231,6 @@ static void test_reflection_cs(void) HRESULT hr; hr = call_reflect(test_blob, test_blob[6], &IID_ID3D11ShaderReflection, (void **)&ref11); - todo_wine_if(D3D_COMPILER_VERSION < 47) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); if (FAILED(hr)) return;
1
0
0
0
Paul Gofman : d3dcompiler: Implement d3dcompiler_shader_reflection_GetThreadGroupSize().
by Alexandre Julliard
23 Mar '22
23 Mar '22
Module: wine Branch: master Commit: 47b9c450c6cc7f41205ad40cdd6942d4bc782b47 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=47b9c450c6cc7f41205ad40c…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Wed Mar 23 13:58:15 2022 +0100 d3dcompiler: Implement d3dcompiler_shader_reflection_GetThreadGroupSize(). Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dcompiler_43/reflection.c | 92 ++++++++++++++++++++++++++++++++-- dlls/d3dcompiler_43/tests/reflection.c | 60 ++++++++++++++++++++++ 2 files changed, 148 insertions(+), 4 deletions(-) diff --git a/dlls/d3dcompiler_43/reflection.c b/dlls/d3dcompiler_43/reflection.c index 91cc20cdded..787d0388f93 100644 --- a/dlls/d3dcompiler_43/reflection.c +++ b/dlls/d3dcompiler_43/reflection.c @@ -50,6 +50,12 @@ enum D3DCOMPILER_SIGNATURE_ELEMENT_SIZE #define D3DCOMPILER_SHADER_TARGET_VERSION_MASK 0xffff #define D3DCOMPILER_SHADER_TARGET_SHADERTYPE_MASK 0xffff0000 +#define D3DCOMPILER_SHADER_TARGET_SHADERTYPE_SHIFT 16 + +enum d3dcompiler_shader_type +{ + D3DCOMPILER_SHADER_TYPE_CS = 5, +}; struct d3dcompiler_shader_signature { @@ -158,6 +164,9 @@ struct d3dcompiler_shader_reflection D3D_TESSELLATOR_OUTPUT_PRIMITIVE hs_output_primitive; D3D_TESSELLATOR_PARTITIONING hs_partitioning; D3D_TESSELLATOR_DOMAIN tessellator_domain; + UINT thread_group_size_x; + UINT thread_group_size_y; + UINT thread_group_size_z; struct d3dcompiler_shader_signature *isgn; struct d3dcompiler_shader_signature *osgn; @@ -707,9 +716,21 @@ static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetMinFeatureLeve static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetThreadGroupSize( ID3D11ShaderReflection *iface, UINT *sizex, UINT *sizey, UINT *sizez) { - FIXME("iface %p, sizex %p, sizey %p, sizez %p stub!\n", iface, sizex, sizey, sizez); + struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D11ShaderReflection(iface); - return 0; + TRACE("iface %p, sizex %p, sizey %p, sizez %p.\n", iface, sizex, sizey, sizez); + + if (!sizex || !sizey || !sizez) + { + WARN("Invalid argument specified.\n"); + return E_INVALIDARG; + } + + *sizex = reflection->thread_group_size_x; + *sizey = reflection->thread_group_size_y; + *sizez = reflection->thread_group_size_z; + + return *sizex * *sizey * *sizez; } static UINT64 STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetRequiresFlags( @@ -1754,15 +1775,79 @@ static HRESULT d3dcompiler_parse_signature(struct d3dcompiler_shader_signature * return S_OK; } +#define SM4_OPCODE_MASK 0xff +#define SM4_INSTRUCTION_LENGTH_SHIFT 24 +#define SM4_INSTRUCTION_LENGTH_MASK (0x1fu << SM4_INSTRUCTION_LENGTH_SHIFT) + +enum sm4_opcode +{ + SM5_OP_DCL_THREAD_GROUP = 0x9b, +}; + static HRESULT d3dcompiler_parse_shdr(struct d3dcompiler_shader_reflection *r, const char *data, size_t data_size) { + uint32_t opcode_token, opcode; + uint32_t size, shader_type; const char *ptr = data; + const uint32_t *u_ptr; + unsigned int len; r->version = read_u32(&ptr); TRACE("Shader version: %u\n", r->version); - /* todo: Check if anything else is needed from the shdr or shex blob. */ + shader_type = (r->version & D3DCOMPILER_SHADER_TARGET_SHADERTYPE_MASK) + >> D3DCOMPILER_SHADER_TARGET_SHADERTYPE_SHIFT; + if (shader_type != D3DCOMPILER_SHADER_TYPE_CS) + { + /* TODO: Check if anything else is needed from the SHDR or SHEX blob. */ + return S_OK; + } + + size = read_u32(&ptr); + TRACE("size %u.\n", size); + if (size * sizeof(uint32_t) != data_size || size < 2) + { + WARN("Invalid size %u.\n", size); + return E_FAIL; + } + size -= 2; + u_ptr = (uint32_t *)ptr; + while (size) + { + opcode_token = *u_ptr; + opcode = opcode_token & SM4_OPCODE_MASK; + len = (opcode_token & SM4_INSTRUCTION_LENGTH_MASK) >> SM4_INSTRUCTION_LENGTH_SHIFT; + if (!len) + { + if (size < 2) + { + WARN("End of byte-code, failed to read length token.\n"); + return E_FAIL; + } + len = u_ptr[1]; + } + if (!len || size < len) + { + WARN("Invalid instruction length %u, size %u.\n", len, size); + return E_FAIL; + } + if (opcode == SM5_OP_DCL_THREAD_GROUP) + { + if (len != 4) + { + WARN("Invalid dcl_thread_group opcode length %u.\n", len); + return E_FAIL; + } + r->thread_group_size_x = u_ptr[1]; + r->thread_group_size_y = u_ptr[2]; + r->thread_group_size_z = u_ptr[3]; + TRACE("Found dcl_thread_group %u, %u, %u.\n", + r->thread_group_size_x, r->thread_group_size_y, r->thread_group_size_z); + } + size -= len; + u_ptr += len; + } return S_OK; } @@ -1972,7 +2057,6 @@ HRESULT WINAPI D3DReflect(const void *data, SIZE_T data_size, REFIID riid, void } *reflector = object; - TRACE("Created ID3D11ShaderReflection %p\n", object); return S_OK; diff --git a/dlls/d3dcompiler_43/tests/reflection.c b/dlls/d3dcompiler_43/tests/reflection.c index f2b7f094de6..e4261ad0d79 100644 --- a/dlls/d3dcompiler_43/tests/reflection.c +++ b/dlls/d3dcompiler_43/tests/reflection.c @@ -777,6 +777,7 @@ static void test_reflection_desc_ps(void) D3D_NAME expected; unsigned int i; #if D3D_COMPILER_VERSION + UINT size_x, size_y, size_z, size_total; UINT ret; #endif @@ -920,6 +921,17 @@ static void test_reflection_desc_ps(void) ok(!desc.Stream, "(%u): got unexpected Stream %u.\n", i, desc.Stream); } +#if D3D_COMPILER_VERSION + size_x = 0xdeadbeef; + size_y = 0xdeadbeef; + size_z = 0xdeadbeef; + size_total = ref11->lpVtbl->GetThreadGroupSize(ref11, &size_x, &size_y, &size_z); + ok(!size_x, "Unexpected size %u.\n", size_x); + ok(!size_y, "Unexpected size %u.\n", size_y); + ok(!size_z, "Unexpected size %u.\n", size_z); + ok(!size_total, "Unexpected size %u.\n", size_total); +#endif + count = ref11->lpVtbl->Release(ref11); ok(!count, "Got unexpected count %lu.\n", count); } @@ -1186,6 +1198,53 @@ static const D3D12_SHADER_INPUT_BIND_DESC test_reflection_bound_resources_result {"c2", D3D_SIT_CBUFFER, 1, 1, 0, 0, D3D_SRV_DIMENSION_UNKNOWN, 0, 0, 1}, }; +#if D3D_COMPILER_VERSION +static void test_reflection_cs(void) +{ + /* + * fxc.exe /T cs_5_1 /Fo + */ +#if 0 + [numthreads(16, 8, 4)] + void main( uint3 DTid : SV_DispatchThreadID ) + { + } +#endif + static const DWORD test_blob[] = + { + 0x43425844, 0x77a220d9, 0xfebd5b9c, 0x14a86e30, 0x57537394, 0x00000001, 0x00000184, 0x00000005, + 0x00000034, 0x000000a0, 0x000000b0, 0x000000c0, 0x000000e8, 0x46454452, 0x00000064, 0x00000000, + 0x00000000, 0x00000000, 0x0000003c, 0x43530501, 0x00000500, 0x0000003c, 0x25441313, 0x0000003c, + 0x00000018, 0x00000028, 0x00000028, 0x00000024, 0x0000000c, 0x00000000, 0x7263694d, 0x666f736f, + 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, 0x31207265, 0x00312e30, + 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, 0x00000008, 0x00000000, 0x00000008, + 0x58454853, 0x00000020, 0x00050051, 0x00000008, 0x0100086a, 0x0400009b, 0x00000010, 0x00000008, + 0x00000004, 0x0100003e, 0x54415453, 0x00000094, 0x00000001, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, + }; + UINT size_x, size_y, size_z, size_total; + ID3D11ShaderReflection *ref11; + HRESULT hr; + + hr = call_reflect(test_blob, test_blob[6], &IID_ID3D11ShaderReflection, (void **)&ref11); + todo_wine_if(D3D_COMPILER_VERSION < 47) + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (FAILED(hr)) + return; + size_total = ref11->lpVtbl->GetThreadGroupSize(ref11, &size_x, &size_y, &size_z); + ok(size_x == 16, "Unexpected size %u.\n", size_x); + ok(size_y == 8, "Unexpected size %u.\n", size_y); + ok(size_z == 4, "Unexpected size %u.\n", size_z); + ok(size_total == size_x * size_y * size_z, "Unexpected size %u.\n", size_total); + + ref11->lpVtbl->Release(ref11); +} +#endif + static void test_reflection_bound_resources(const DWORD *blob, const D3D12_SHADER_INPUT_BIND_DESC *result, unsigned int result_count, unsigned int target_version) { @@ -2150,6 +2209,7 @@ START_TEST(reflection) #if D3D_COMPILER_VERSION test_reflection_references(); test_reflection_interfaces(); + test_reflection_cs(); #else test_d3d10_interfaces(); #endif
1
0
0
0
Alexandre Julliard : kernel32/tests: Fix codepage test for UTF-8 default codepage.
by Alexandre Julliard
23 Mar '22
23 Mar '22
Module: wine Branch: master Commit: 273ab6c774ee41908b38eb6b2ca03f686eb44085 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=273ab6c774ee41908b38eb6b…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Mar 23 18:31:12 2022 +0100 kernel32/tests: Fix codepage test for UTF-8 default codepage. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/codepage.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/kernel32/tests/codepage.c b/dlls/kernel32/tests/codepage.c index 33eeebcc617..b0dbd812346 100644 --- a/dlls/kernel32/tests/codepage.c +++ b/dlls/kernel32/tests/codepage.c @@ -1152,7 +1152,8 @@ static void test_threadcp(void) ret = GetCPInfoExA(CP_THREAD_ACP, 0, &cpi); ok(ret, "GetCPInfoExA failed for lcid %04lx, error %ld\n", lcids[i].lcid, GetLastError()); if (lcids[i].threadcp) - ok(cpi.CodePage == lcids[i].threadcp, "wrong codepage %u for lcid %04lx, should be %u\n", + ok(cpi.CodePage == lcids[i].threadcp || cpi.CodePage == CP_UTF8 /* Win10 1809+ */, + "wrong codepage %u for lcid %04lx, should be %u\n", cpi.CodePage, lcids[i].lcid, lcids[i].threadcp); else ok(cpi.CodePage == acp || cpi.CodePage == CP_UTF8 /* Win10 1809+ */, @@ -1185,8 +1186,10 @@ static void test_threadcp(void) { SetThreadLocale(isleads[i].lcid); + GetCPInfoExA(CP_THREAD_ACP, 0, &cpi); islead = IsDBCSLeadByteEx(CP_THREAD_ACP, isleads[i].testchar); - ok(islead == isleads[i].islead, "wrong islead %i for test char %x in lcid %04lx. should be %i\n", + ok(islead == isleads[i].islead || (cpi.CodePage == CP_UTF8 && !islead), + "wrong islead %i for test char %x in lcid %04lx. should be %i\n", islead, isleads[i].testchar, isleads[i].lcid, isleads[i].islead); }
1
0
0
0
Alexandre Julliard : ntdll/tests: Fix string test for UTF-8 default codepage.
by Alexandre Julliard
23 Mar '22
23 Mar '22
Module: wine Branch: master Commit: 63d7591b3cf510f32353ea7aa9bed07afcb57fa0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=63d7591b3cf510f32353ea7a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Mar 23 18:31:31 2022 +0100 ntdll/tests: Fix string test for UTF-8 default codepage. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/string.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/tests/string.c b/dlls/ntdll/tests/string.c index eabbe86792b..3d9ae94c79a 100644 --- a/dlls/ntdll/tests/string.c +++ b/dlls/ntdll/tests/string.c @@ -1837,7 +1837,7 @@ static void test_toupper(void) { int i, ret, exp_ret; - char str[2], *p; + char str[3], *p; WCHAR wc; ok(ptoupper != NULL, "toupper is not available\n"); @@ -1846,17 +1846,20 @@ static void test_toupper(void) { str[0] = i; str[1] = i >> 8; + str[2] = 0; p = str; wc = RtlAnsiCharToUnicodeChar( &p ); wc = RtlUpcaseUnicodeChar( wc ); ret = WideCharToMultiByte( CP_ACP, 0, &wc, 1, str, 2, NULL, NULL ); - ok(ret == 1 || ret == 2, "WideCharToMultiByte returned %d\n", ret); + ok(!ret || ret == 1 || ret == 2, "WideCharToMultiByte returned %d\n", ret); if (ret == 2) exp_ret = (unsigned char)str[1] + ((unsigned char)str[0] << 8); - else + else if (ret == 1) exp_ret = (unsigned char)str[0]; + else + exp_ret = (WCHAR)i; - ret = ptoupper(i); + ret = (WCHAR)ptoupper(i); ok(ret == exp_ret, "toupper(%x) = %x, expected %x\n", i, ret, exp_ret); } }
1
0
0
0
← Newer
1
...
25
26
27
28
29
30
31
...
114
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
111
112
113
114
Results per page:
10
25
50
100
200