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
May 2024
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
705 discussions
Start a n
N
ew thread
Alexandre Julliard : msvcrt: Unify call_copy_ctor/call_dtor implementations.
by Alexandre Julliard
21 May '24
21 May '24
Module: wine Branch: master Commit: 4f0c07acea299b9929eddd2250bd539745932a91 URL:
https://gitlab.winehq.org/wine/wine/-/commit/4f0c07acea299b9929eddd2250bd53…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue May 21 20:33:25 2024 +0200 msvcrt: Unify call_copy_ctor/call_dtor implementations. --- dlls/msvcrt/cppexcept.h | 17 +++++++++++++++++ dlls/msvcrt/except.c | 8 +------- dlls/msvcrt/except_i386.c | 3 --- dlls/msvcrt/exception_ptr.c | 44 +++++++++----------------------------------- 4 files changed, 27 insertions(+), 45 deletions(-) diff --git a/dlls/msvcrt/cppexcept.h b/dlls/msvcrt/cppexcept.h index adde30b6d15..550033d1da0 100644 --- a/dlls/msvcrt/cppexcept.h +++ b/dlls/msvcrt/cppexcept.h @@ -101,6 +101,23 @@ static inline void *get_this_pointer( const this_ptr_offsets *off, void *object return object; } +#ifdef __ASM_USE_THISCALL_WRAPPER +extern void call_copy_ctor( void *func, void *this, void *src, int has_vbase ); +extern void call_dtor( void *func, void *this ); +#else +static inline void call_copy_ctor( void *func, void *this, void *src, int has_vbase ) +{ + if (has_vbase) + ((void (__thiscall*)(void*, void*, BOOL))func)(this, src, 1); + else + ((void (__thiscall*)(void*, void*))func)(this, src); +} +static inline void call_dtor( void *func, void *this ) +{ + ((void (__thiscall*)(void*))func)( this ); +} +#endif + #if _MSVCR_VER >= 80 #define EXCEPTION_MANGLED_NAME ".?AVexception@std@@" #else diff --git a/dlls/msvcrt/except.c b/dlls/msvcrt/except.c index e61e1e74e54..a7f0ed8e852 100644 --- a/dlls/msvcrt/except.c +++ b/dlls/msvcrt/except.c @@ -448,13 +448,7 @@ void CDECL __DestructExceptionObject(EXCEPTION_RECORD *rec) if (!info || !info->destructor) return; -#if defined(__i386__) - __asm__ __volatile__("call *%0" : : "r" (info->destructor), "c" (object) : "eax", "edx", "memory" ); -#elif defined(__x86_64__) - ((void (__cdecl*)(void*))(info->destructor+rec->ExceptionInformation[3]))(object); -#else - ((void (__cdecl*)(void*))info->destructor)(object); -#endif + call_dtor( rtti_rva( info->destructor, rec->ExceptionInformation[3] ), object ); } /********************************************************************* diff --git a/dlls/msvcrt/except_i386.c b/dlls/msvcrt/except_i386.c index 1bba898d1da..780c81a1327 100644 --- a/dlls/msvcrt/except_i386.c +++ b/dlls/msvcrt/except_i386.c @@ -148,9 +148,6 @@ DWORD CDECL cxx_frame_handler( PEXCEPTION_RECORD rec, cxx_exception_frame* frame const cxx_function_descr *descr, catch_func_nested_frame* nested_frame ); -/* call a copy constructor */ -extern void call_copy_ctor( void *func, void *this, void *src, int has_vbase ); - /* continue execution to the specified address after exception is caught */ extern void DECLSPEC_NORETURN continue_after_catch( cxx_exception_frame* frame, void *addr ); diff --git a/dlls/msvcrt/exception_ptr.c b/dlls/msvcrt/exception_ptr.c index b84c76822d2..d4f86d713ca 100644 --- a/dlls/msvcrt/exception_ptr.c +++ b/dlls/msvcrt/exception_ptr.c @@ -28,10 +28,8 @@ #include "msvcrt.h" #include "cppexcept.h" -#ifdef __i386__ - -extern void call_copy_ctor( void *func, void *this, void *src, int has_vbase ); - +/* call a copy constructor */ +#ifdef __ASM_USE_THISCALL_WRAPPER __ASM_GLOBAL_FUNC( call_copy_ctor, "pushl %ebp\n\t" __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t") @@ -45,18 +43,11 @@ __ASM_GLOBAL_FUNC( call_copy_ctor, "leave\n" __ASM_CFI(".cfi_def_cfa %esp,4\n\t") __ASM_CFI(".cfi_same_value %ebp\n\t") - "ret" ); - -#elif _MSVCR_VER >= 100 - -static inline void call_copy_ctor( void *func, void *this, void *src, int has_vbase ) -{ - if (has_vbase) - ((void (__cdecl*)(void*, void*, BOOL))func)(this, src, 1); - else - ((void (__cdecl*)(void*, void*))func)(this, src); -} - + "ret" ) +__ASM_GLOBAL_FUNC( call_dtor, + "movl 8(%esp),%ecx\n\t" + "call *4(%esp)\n\t" + "ret" ) #endif #if _MSVCR_VER >= 100 @@ -75,24 +66,6 @@ void __cdecl __ExceptionPtrCreate(exception_ptr *ep) ep->ref = NULL; } -#ifdef __ASM_USE_THISCALL_WRAPPER -extern void call_dtor(const cxx_exception_type *type, void *func, void *object); - -__ASM_GLOBAL_FUNC( call_dtor, - "movl 12(%esp),%ecx\n\t" - "call *8(%esp)\n\t" - "ret" ); -#elif __x86_64__ -static inline void call_dtor(const cxx_exception_type *type, unsigned int dtor, void *object) -{ - char *base = RtlPcToFileHeader((void*)type, (void**)&base); - void (__cdecl *func)(void*) = (void*)(base + dtor); - func(object); -} -#else -#define call_dtor(type, func, object) ((void (__thiscall*)(void*))(func))(object) -#endif - /********************************************************************* * ?__ExceptionPtrDestroy@@YAXPAX@Z * ?__ExceptionPtrDestroy@@YAXPEAX@Z @@ -110,8 +83,9 @@ void __cdecl __ExceptionPtrDestroy(exception_ptr *ep) { const cxx_exception_type *type = (void*)ep->rec->ExceptionInformation[2]; void *obj = (void*)ep->rec->ExceptionInformation[1]; + uintptr_t base = rtti_rva_base( type ); - if (type && type->destructor) call_dtor(type, type->destructor, obj); + if (type && type->destructor) call_dtor( rtti_rva(type->destructor, base), obj ); HeapFree(GetProcessHeap(), 0, obj); }
1
0
0
0
Alexandre Julliard : msvcrt: Unify exception_ptr_from_record implementation.
by Alexandre Julliard
21 May '24
21 May '24
Module: wine Branch: master Commit: f25a4043dd56f3f1892314b263155cc5257edcce URL:
https://gitlab.winehq.org/wine/wine/-/commit/f25a4043dd56f3f1892314b263155c…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue May 21 20:33:09 2024 +0200 msvcrt: Unify exception_ptr_from_record implementation. --- dlls/msvcrt/exception_ptr.c | 60 +++++---------------------------------------- 1 file changed, 6 insertions(+), 54 deletions(-) diff --git a/dlls/msvcrt/exception_ptr.c b/dlls/msvcrt/exception_ptr.c index d191115a66d..b84c76822d2 100644 --- a/dlls/msvcrt/exception_ptr.c +++ b/dlls/msvcrt/exception_ptr.c @@ -173,7 +173,6 @@ void __cdecl __ExceptionPtrRethrow(const exception_ptr *ep) ep->rec->NumberParameters, ep->rec->ExceptionInformation); } -#ifndef __x86_64__ void exception_ptr_from_record(exception_ptr *ep, EXCEPTION_RECORD *rec) { TRACE("(%p)\n", ep); @@ -193,59 +192,13 @@ void exception_ptr_from_record(exception_ptr *ep, EXCEPTION_RECORD *rec) if (ep->rec->ExceptionCode == CXX_EXCEPTION) { + void *obj = (void*)ep->rec->ExceptionInformation[1]; const cxx_exception_type *et = (void*)ep->rec->ExceptionInformation[2]; - const cxx_type_info *ti; - void **data, *obj; + uintptr_t base = rtti_rva_base( et ); + const cxx_type_info_table *table = rtti_rva( et->type_info_table, base ); + const cxx_type_info *ti = rtti_rva( table->info[0], base ); + void **data = HeapAlloc(GetProcessHeap(), 0, ti->size); - ti = et->type_info_table->info[0]; - data = HeapAlloc(GetProcessHeap(), 0, ti->size); - - obj = (void*)ep->rec->ExceptionInformation[1]; - if (ti->flags & CLASS_IS_SIMPLE_TYPE) - { - memcpy(data, obj, ti->size); - if (ti->size == sizeof(void *)) *data = get_this_pointer(&ti->offsets, *data); - } - else if (ti->copy_ctor) - { - call_copy_ctor(ti->copy_ctor, data, get_this_pointer(&ti->offsets, obj), - ti->flags & CLASS_HAS_VIRTUAL_BASE_CLASS); - } - else - memcpy(data, get_this_pointer(&ti->offsets, obj), ti->size); - ep->rec->ExceptionInformation[1] = (ULONG_PTR)data; - } - return; -} -#else -void exception_ptr_from_record(exception_ptr *ep, EXCEPTION_RECORD *rec) -{ - TRACE("(%p)\n", ep); - - if (!rec) - { - ep->rec = NULL; - ep->ref = NULL; - return; - } - - ep->rec = HeapAlloc(GetProcessHeap(), 0, sizeof(EXCEPTION_RECORD)); - ep->ref = HeapAlloc(GetProcessHeap(), 0, sizeof(int)); - - *ep->rec = *rec; - *ep->ref = 1; - - if (ep->rec->ExceptionCode == CXX_EXCEPTION) - { - const cxx_exception_type *et = (void*)ep->rec->ExceptionInformation[2]; - const cxx_type_info *ti; - void **data, *obj; - char *base = RtlPcToFileHeader((void*)et, (void**)&base); - - ti = (const cxx_type_info*)(base + ((const cxx_type_info_table*)(base + et->type_info_table))->info[0]); - data = HeapAlloc(GetProcessHeap(), 0, ti->size); - - obj = (void*)ep->rec->ExceptionInformation[1]; if (ti->flags & CLASS_IS_SIMPLE_TYPE) { memcpy(data, obj, ti->size); @@ -253,7 +206,7 @@ void exception_ptr_from_record(exception_ptr *ep, EXCEPTION_RECORD *rec) } else if (ti->copy_ctor) { - call_copy_ctor(base + ti->copy_ctor, data, get_this_pointer(&ti->offsets, obj), + call_copy_ctor(rtti_rva(ti->copy_ctor, base), data, get_this_pointer(&ti->offsets, obj), ti->flags & CLASS_HAS_VIRTUAL_BASE_CLASS); } else @@ -262,7 +215,6 @@ void exception_ptr_from_record(exception_ptr *ep, EXCEPTION_RECORD *rec) } return; } -#endif #ifndef _CONCRT
1
0
0
0
Alexandre Julliard : msvcrt: Unify __ExceptionPtrCopyException implementation.
by Alexandre Julliard
21 May '24
21 May '24
Module: wine Branch: master Commit: 68acc35acbcbb31916d110b8dc1567a53261470f URL:
https://gitlab.winehq.org/wine/wine/-/commit/68acc35acbcbb31916d110b8dc1567…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue May 21 20:32:59 2024 +0200 msvcrt: Unify __ExceptionPtrCopyException implementation. --- dlls/msvcrt/exception_ptr.c | 55 +++++++++------------------------------------ 1 file changed, 11 insertions(+), 44 deletions(-) diff --git a/dlls/msvcrt/exception_ptr.c b/dlls/msvcrt/exception_ptr.c index 3db417e107f..d191115a66d 100644 --- a/dlls/msvcrt/exception_ptr.c +++ b/dlls/msvcrt/exception_ptr.c @@ -291,12 +291,13 @@ bool __cdecl __ExceptionPtrToBool(exception_ptr *ep) * ?__ExceptionPtrCopyException@@YAXPAXPBX1@Z * ?__ExceptionPtrCopyException@@YAXPEAXPEBX1@Z */ -#ifndef __x86_64__ void __cdecl __ExceptionPtrCopyException(exception_ptr *ep, exception *object, const cxx_exception_type *type) { + const cxx_type_info_table *table; const cxx_type_info *ti; void **data; + uintptr_t base = rtti_rva_base( type ); __ExceptionPtrDestroy(ep); @@ -307,11 +308,13 @@ void __cdecl __ExceptionPtrCopyException(exception_ptr *ep, memset(ep->rec, 0, sizeof(EXCEPTION_RECORD)); ep->rec->ExceptionCode = CXX_EXCEPTION; ep->rec->ExceptionFlags = EXCEPTION_NONCONTINUABLE; - ep->rec->NumberParameters = 3; + ep->rec->NumberParameters = CXX_EXCEPTION_PARAMS; ep->rec->ExceptionInformation[0] = CXX_FRAME_MAGIC_VC6; ep->rec->ExceptionInformation[2] = (ULONG_PTR)type; + if (CXX_EXCEPTION_PARAMS == 4) ep->rec->ExceptionInformation[3] = base; - ti = type->type_info_table->info[0]; + table = rtti_rva( type->type_info_table, base ); + ti = rtti_rva( table->info[0], base ); data = HeapAlloc(GetProcessHeap(), 0, ti->size); if (ti->flags & CLASS_IS_SIMPLE_TYPE) { @@ -320,54 +323,18 @@ void __cdecl __ExceptionPtrCopyException(exception_ptr *ep, } else if (ti->copy_ctor) { - call_copy_ctor(ti->copy_ctor, data, get_this_pointer(&ti->offsets, object), + call_copy_ctor( rtti_rva(ti->copy_ctor, base), data, get_this_pointer(&ti->offsets, object), ti->flags & CLASS_HAS_VIRTUAL_BASE_CLASS); } else memcpy(data, get_this_pointer(&ti->offsets, object), ti->size); ep->rec->ExceptionInformation[1] = (ULONG_PTR)data; } -#else -void __cdecl __ExceptionPtrCopyException(exception_ptr *ep, - exception *object, const cxx_exception_type *type) -{ - const cxx_type_info *ti; - void **data; - char *base; - - RtlPcToFileHeader((void*)type, (void**)&base); - __ExceptionPtrDestroy(ep); - - ep->rec = HeapAlloc(GetProcessHeap(), 0, sizeof(EXCEPTION_RECORD)); - ep->ref = HeapAlloc(GetProcessHeap(), 0, sizeof(int)); - *ep->ref = 1; - - memset(ep->rec, 0, sizeof(EXCEPTION_RECORD)); - ep->rec->ExceptionCode = CXX_EXCEPTION; - ep->rec->ExceptionFlags = EXCEPTION_NONCONTINUABLE; - ep->rec->NumberParameters = 4; - ep->rec->ExceptionInformation[0] = CXX_FRAME_MAGIC_VC6; - ep->rec->ExceptionInformation[2] = (ULONG_PTR)type; - ep->rec->ExceptionInformation[3] = (ULONG_PTR)base; - - ti = (const cxx_type_info*)(base + ((const cxx_type_info_table*)(base + type->type_info_table))->info[0]); - data = HeapAlloc(GetProcessHeap(), 0, ti->size); - if (ti->flags & CLASS_IS_SIMPLE_TYPE) - { - memcpy(data, object, ti->size); - if (ti->size == sizeof(void *)) *data = get_this_pointer(&ti->offsets, *data); - } - else if (ti->copy_ctor) - { - call_copy_ctor(base + ti->copy_ctor, data, get_this_pointer(&ti->offsets, object), - ti->flags & CLASS_HAS_VIRTUAL_BASE_CLASS); - } - else - memcpy(data, get_this_pointer(&ti->offsets, object), ti->size); - ep->rec->ExceptionInformation[1] = (ULONG_PTR)data; -} -#endif +/********************************************************************* + * ?__ExceptionPtrCompare@@YA_NPBX0@Z + * ?__ExceptionPtrCompare@@YA_NPEBX0@Z + */ bool __cdecl __ExceptionPtrCompare(const exception_ptr *ep1, const exception_ptr *ep2) { return ep1->rec == ep2->rec;
1
0
0
0
Alexandros Frantzis : winewayland.drv: Populate vkey to wchar entry for VK_DECIMAL.
by Alexandre Julliard
21 May '24
21 May '24
Module: wine Branch: master Commit: 2d44cbdd6928b89f44f4c44e9e0247232d81f147 URL:
https://gitlab.winehq.org/wine/wine/-/commit/2d44cbdd6928b89f44f4c44e9e0247…
Author: Alexandros Frantzis <alexandros.frantzis(a)collabora.com> Date: Wed May 1 13:33:09 2024 +0300 winewayland.drv: Populate vkey to wchar entry for VK_DECIMAL. --- dlls/winewayland.drv/wayland_keyboard.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/dlls/winewayland.drv/wayland_keyboard.c b/dlls/winewayland.drv/wayland_keyboard.c index 55b14b1dfd5..bdef56e8f0c 100644 --- a/dlls/winewayland.drv/wayland_keyboard.c +++ b/dlls/winewayland.drv/wayland_keyboard.c @@ -358,7 +358,7 @@ static void add_xkb_layout(const char *xkb_layout, struct xkb_keymap *xkb_keymap unsigned int mod, keyc, len, names_len, min_keycode, max_keycode; struct xkb_state *xkb_state = xkb_state_new(xkb_keymap); - xkb_mod_mask_t shift_mask, control_mask, altgr_mask, capslock_mask; + xkb_mod_mask_t shift_mask, control_mask, altgr_mask, capslock_mask, numlock_mask; VSC_LPWSTR *names_entry, *names_ext_entry; VSC_VK *vsc2vk_e0_entry, *vsc2vk_e1_entry; VK_TO_WCHARS8 *vk2wchars_entry; @@ -493,6 +493,7 @@ static void add_xkb_layout(const char *xkb_layout, struct xkb_keymap *xkb_keymap control_mask = 1 << xkb_keymap_mod_get_index(xkb_keymap, XKB_MOD_NAME_CTRL); capslock_mask = 1 << xkb_keymap_mod_get_index(xkb_keymap, XKB_MOD_NAME_CAPS); altgr_mask = 1 << xkb_keymap_mod_get_index(xkb_keymap, "Mod5"); + numlock_mask = 1 << xkb_keymap_mod_get_index(xkb_keymap, XKB_MOD_NAME_NUM); for (keyc = min_keycode; keyc <= max_keycode; keyc++) { @@ -502,6 +503,19 @@ static void add_xkb_layout(const char *xkb_layout, struct xkb_keymap *xkb_keymap uint32_t caps_ret, shift_ret; unsigned int mod; + if ((vkey & KBDNUMPAD) && (vkey & 0xff) == VK_DELETE) + { + VK_TO_WCHARS8 num_vkey2wch = {.VirtualKey = VK_DECIMAL}; + + xkb_state_update_mask(xkb_state, 0, 0, numlock_mask, 0, 0, xkb_group); + if (!(num_vkey2wch.wch[0] = xkb_state_key_get_utf32(xkb_state, keyc))) + num_vkey2wch.wch[0] = WCH_NONE; + for (mod = 1; mod < 8; ++mod) num_vkey2wch.wch[mod] = WCH_NONE; + num_vkey2wch.Attributes = 0; + TRACE("vkey %#06x -> %s\n", num_vkey2wch.VirtualKey, debugstr_wn(num_vkey2wch.wch, 8)); + *vk2wchars_entry++ = num_vkey2wch; + } + for (mod = 0; mod < 8; ++mod) { xkb_mod_mask_t mod_mask = 0;
1
0
0
0
Alexandros Frantzis : user32/tests: Add tests for SendInput with numpad scancodes.
by Alexandre Julliard
21 May '24
21 May '24
Module: wine Branch: master Commit: a5dc752b22fb1ae04b813af86c3c0abf6da5b3f5 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a5dc752b22fb1ae04b813af86c3c0a…
Author: Alexandros Frantzis <alexandros.frantzis(a)collabora.com> Date: Fri May 17 14:44:05 2024 +0300 user32/tests: Add tests for SendInput with numpad scancodes. --- dlls/user32/tests/input.c | 72 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 69 insertions(+), 3 deletions(-) diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 8fad3305f3e..f332aeddd08 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -615,15 +615,38 @@ static void check_keyboard_state_( int line, const BYTE expect_state[256], const } } +static void clear_keyboard_state( void ) +{ + static BYTE empty_state[256] = {0}; + INPUT input = {.type = INPUT_KEYBOARD}; + BYTE lock_keys[] = {VK_NUMLOCK, VK_CAPITAL, VK_SCROLL}; + UINT i; + + for (i = 0; i < ARRAY_SIZE(lock_keys); ++i) + { + if (GetKeyState( lock_keys[i] ) & 0x0001) + { + input.ki.wVk = lock_keys[i]; + SendInput( 1, &input, sizeof(input) ); + input.ki.dwFlags = KEYEVENTF_KEYUP; + SendInput( 1, &input, sizeof(input) ); + wait_messages( 5, FALSE ); + memset( current_sequence, 0, sizeof(current_sequence) ); + current_sequence_len = 0; + } + } + + SetKeyboardState( empty_state ); +} + #define check_send_input_keyboard_test( a, b ) check_send_input_keyboard_test_( a, #a, b ) static void check_send_input_keyboard_test_( const struct send_input_keyboard_test *test, const char *context, BOOL peeked ) { - static BYTE empty_state[256] = {0}; INPUT input = {.type = INPUT_KEYBOARD}; UINT i; winetest_push_context( "%s", context ); - SetKeyboardState( empty_state ); + clear_keyboard_state(); for (i = 0; test->vkey || test->scan; i++, test++) { @@ -641,7 +664,7 @@ static void check_send_input_keyboard_test_( const struct send_input_keyboard_te winetest_pop_context(); } - SetKeyboardState( empty_state ); + clear_keyboard_state(); winetest_pop_context(); } @@ -1146,6 +1169,45 @@ static void test_SendInput_keyboard_messages( WORD vkey, WORD scan, WCHAR wch, W {0}, }; + struct send_input_keyboard_test numpad_scan[] = + { + {.scan = 0x4b, .flags = KEYEVENTF_SCANCODE, .expect_state = {[VK_LEFT] = 0x80}, + .expect = {KEY_HOOK(WM_KEYDOWN, 0x4b, VK_LEFT), KEY_MSG(WM_KEYDOWN, 0x4b, VK_LEFT), {0}}}, + {.scan = 0x4b, .flags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP, + .expect = {KEY_HOOK(WM_KEYUP, 0x4b, VK_LEFT), KEY_MSG(WM_KEYUP, 0x4b, VK_LEFT), {0}}}, + {0}, + }; + + struct send_input_keyboard_test numpad_scan_numlock[] = + { + {.scan = 0x45, .flags = KEYEVENTF_SCANCODE, .expect_state = {[VK_NUMLOCK] = 0x80}, + .expect = {KEY_HOOK(WM_KEYDOWN, 0x45, VK_NUMLOCK), KEY_MSG(WM_KEYDOWN, 0x45, VK_NUMLOCK), {0}}}, + {.scan = 0x45, .flags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP, .expect_state = {[VK_NUMLOCK] = 0x01}, + .expect = {KEY_HOOK(WM_KEYUP, 0x45, VK_NUMLOCK), KEY_MSG(WM_KEYUP, 0x45, VK_NUMLOCK), {0}}}, + { + .scan = 0x4b, .flags = KEYEVENTF_SCANCODE, + .expect_state = {[VK_NUMPAD4] = 0x80, [VK_NUMLOCK] = 0x01}, + .todo_state = {[VK_NUMPAD4] = TRUE, [VK_LEFT] = TRUE}, + .expect = + { + KEY_HOOK(WM_KEYDOWN, 0x4b, VK_NUMPAD4, .todo_value = TRUE), + KEY_MSG(WM_KEYDOWN, 0x4b, VK_NUMPAD4, .todo_value = TRUE), + WIN_MSG(WM_CHAR, '4', MAKELONG(1, 0x4b), .todo_value = TRUE), + {0} + } + }, + { + .scan = 0x4b, .flags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP, .expect_state = {[VK_NUMLOCK] = 0x01}, + .expect = + { + KEY_HOOK(WM_KEYUP, 0x4b, VK_NUMPAD4, .todo_value = TRUE), + KEY_MSG(WM_KEYUP, 0x4b, VK_NUMPAD4, .todo_value = TRUE), + {0} + } + }, + {0}, + }; + #undef WIN_MSG #undef KBD_HOOK #undef KEY_HOOK_ @@ -1226,6 +1288,8 @@ static void test_SendInput_keyboard_messages( WORD vkey, WORD scan, WCHAR wch, W check_send_input_keyboard_test( unicode, TRUE ); check_send_input_keyboard_test( lmenu_unicode_peeked, TRUE ); check_send_input_keyboard_test( unicode_vkey, TRUE ); + check_send_input_keyboard_test( numpad_scan, TRUE ); + check_send_input_keyboard_test( numpad_scan_numlock, TRUE ); winetest_pop_context(); wait_messages( 100, FALSE ); @@ -1269,6 +1333,8 @@ static void test_SendInput_keyboard_messages( WORD vkey, WORD scan, WCHAR wch, W check_send_input_keyboard_test( unicode, FALSE ); check_send_input_keyboard_test( lmenu_unicode, FALSE ); check_send_input_keyboard_test( unicode_vkey, FALSE ); + check_send_input_keyboard_test( numpad_scan, FALSE ); + check_send_input_keyboard_test( numpad_scan_numlock, FALSE ); winetest_pop_context(); ok_ret( 1, DestroyWindow( hwnd ) );
1
0
0
0
Alexandros Frantzis : server: Send numpad virtual keys if NumLock is active.
by Alexandre Julliard
21 May '24
21 May '24
Module: wine Branch: master Commit: 11ef7af768427a8fe38a43351377100086357388 URL:
https://gitlab.winehq.org/wine/wine/-/commit/11ef7af768427a8fe38a4335137710…
Author: Alexandros Frantzis <alexandros.frantzis(a)collabora.com> Date: Wed May 8 12:52:08 2024 +0300 server: Send numpad virtual keys if NumLock is active. If the hardware keyboard event has KBD virtual key information, use it to detect numpad key events and translate them to the appropriate virtual keys depending on NumLock (and Shift) state. --- dlls/win32u/input.c | 25 +++++++++++++++++++++++++ dlls/win32u/message.c | 2 +- dlls/win32u/win32u_private.h | 1 + server/queue.c | 27 +++++++++++++++++++++++++-- 4 files changed, 52 insertions(+), 3 deletions(-) diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 333c0c1e4f7..84bd26379f5 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -1112,6 +1112,31 @@ UINT WINAPI NtUserMapVirtualKeyEx( UINT code, UINT type, HKL layout ) return ret; } +/*********************************************************************** + * map_scan_to_kbd_vkey + * + * Map a scancode to a virtual key with KBD information. + */ +USHORT map_scan_to_kbd_vkey( USHORT scan, HKL layout ) +{ + const KBDTABLES *kbd_tables; + USHORT vsc2vk[0x300]; + UINT vkey; + + if ((vkey = user_driver->pMapVirtualKeyEx( scan, MAPVK_VSC_TO_VK_EX, layout )) != -1) return vkey; + + if (!(kbd_tables = user_driver->pKbdLayerDescriptor( layout ))) kbd_tables = &kbdus_tables; + + kbd_tables_init_vsc2vk( kbd_tables, vsc2vk ); + if (scan & 0xe000) scan -= 0xdf00; + if (scan >= ARRAY_SIZE(vsc2vk)) vkey = 0; + else vkey = vsc2vk[scan]; + + if (kbd_tables != &kbdus_tables) user_driver->pReleaseKbdTables( kbd_tables ); + + return vkey; +} + /**************************************************************************** * NtUserGetKeyNameText (win32u.@) */ diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index ddc9658f087..531cb8d0649 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -3569,7 +3569,7 @@ NTSTATUS send_hardware_message( HWND hwnd, UINT flags, const INPUT *input, LPARA scan = scan & 0xff; if (input->ki.dwFlags & KEYEVENTF_EXTENDEDKEY) scan |= 0xe000; } - req->input.kbd.vkey = NtUserMapVirtualKeyEx( scan, MAPVK_VSC_TO_VK_EX, layout ); + req->input.kbd.vkey = map_scan_to_kbd_vkey( scan, layout ); req->input.kbd.scan = input->ki.wScan & 0xff; } else diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 24e8b1b498d..94b9d00b4fb 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -108,6 +108,7 @@ extern void update_mouse_tracking_info( HWND hwnd ); extern BOOL get_clip_cursor( RECT *rect ); extern BOOL process_wine_clipcursor( HWND hwnd, UINT flags, BOOL reset ); extern BOOL clip_fullscreen_window( HWND hwnd, BOOL reset ); +extern USHORT map_scan_to_kbd_vkey( USHORT scan, HKL layout ); /* menu.c */ extern HMENU create_menu( BOOL is_popup ); diff --git a/server/queue.c b/server/queue.c index cc10d0254eb..c4b9389695f 100644 --- a/server/queue.c +++ b/server/queue.c @@ -36,6 +36,7 @@ #include "winternl.h" #include "ntuser.h" #include "hidusage.h" +#include "kbd.h" #include "handle.h" #include "file.h" @@ -1763,7 +1764,7 @@ static int send_hook_ll_message( struct desktop *desktop, struct message *hardwa if (input->type == INPUT_KEYBOARD) { - unsigned short vkey = input->kbd.vkey; + unsigned short vkey = input->kbd.vkey & 0xff; if (input->kbd.flags & KEYEVENTF_UNICODE) vkey = VK_PACKET; msg->lparam = (input->kbd.scan << 16) | vkey; } @@ -2102,6 +2103,7 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c struct message *msg; struct thread *foreground; unsigned char vkey = input->kbd.vkey; + hw_input_t hook_input = *input; unsigned int message_code, time; int wait; @@ -2171,6 +2173,27 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c break; } + /* send numpad vkeys if NumLock is active */ + if ((input->kbd.vkey & KBDNUMPAD) && (desktop->keystate[VK_NUMLOCK] & 0x01) && + !(desktop->keystate[VK_SHIFT] & 0x80)) + { + switch (vkey) + { + case VK_INSERT: hook_input.kbd.vkey = vkey = VK_NUMPAD0; break; + case VK_END: hook_input.kbd.vkey = vkey = VK_NUMPAD1; break; + case VK_DOWN: hook_input.kbd.vkey = vkey = VK_NUMPAD2; break; + case VK_NEXT: hook_input.kbd.vkey = vkey = VK_NUMPAD3; break; + case VK_LEFT: hook_input.kbd.vkey = vkey = VK_NUMPAD4; break; + case VK_CLEAR: hook_input.kbd.vkey = vkey = VK_NUMPAD5; break; + case VK_RIGHT: hook_input.kbd.vkey = vkey = VK_NUMPAD6; break; + case VK_HOME: hook_input.kbd.vkey = vkey = VK_NUMPAD7; break; + case VK_UP: hook_input.kbd.vkey = vkey = VK_NUMPAD8; break; + case VK_PRIOR: hook_input.kbd.vkey = vkey = VK_NUMPAD9; break; + case VK_DELETE: hook_input.kbd.vkey = vkey = VK_DECIMAL; break; + default: break; + } + } + if ((foreground = get_foreground_thread( desktop, win ))) { struct rawinput_message raw_msg = {0}; @@ -2217,7 +2240,7 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c msg_data->flags |= (flags & (KF_EXTENDED | KF_ALTDOWN | KF_UP)) >> 8; } - if (!(wait = send_hook_ll_message( desktop, msg, input, sender ))) + if (!(wait = send_hook_ll_message( desktop, msg, &hook_input, sender ))) queue_hardware_message( desktop, msg, 1 ); return wait;
1
0
0
0
Alexandros Frantzis : win32u: Store the full KBD vkey information in kbd_tables_init_vsc2vk.
by Alexandre Julliard
21 May '24
21 May '24
Module: wine Branch: master Commit: f5f62c945c2af93001ecf5bd2ad60110c9d25978 URL:
https://gitlab.winehq.org/wine/wine/-/commit/f5f62c945c2af93001ecf5bd2ad601…
Author: Alexandros Frantzis <alexandros.frantzis(a)collabora.com> Date: Wed May 8 10:28:34 2024 +0300 win32u: Store the full KBD vkey information in kbd_tables_init_vsc2vk. --- dlls/win32u/input.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 38350861c6b..333c0c1e4f7 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -410,27 +410,27 @@ LONG global_key_state_counter = 0; BOOL grab_pointer = TRUE; BOOL grab_fullscreen = FALSE; -static void kbd_tables_init_vsc2vk( const KBDTABLES *tables, BYTE vsc2vk[0x300] ) +static void kbd_tables_init_vsc2vk( const KBDTABLES *tables, USHORT vsc2vk[0x300] ) { const VSC_VK *entry; WORD vsc; - memset( vsc2vk, 0, 0x300 ); + memset( vsc2vk, 0, 0x300 * sizeof(USHORT) ); for (vsc = 0; tables->pusVSCtoVK && vsc <= tables->bMaxVSCtoVK; ++vsc) { if (tables->pusVSCtoVK[vsc] == VK__none_) continue; - vsc2vk[vsc] = (BYTE)tables->pusVSCtoVK[vsc]; + vsc2vk[vsc] = tables->pusVSCtoVK[vsc]; } for (entry = tables->pVSCtoVK_E0; entry && entry->Vsc; entry++) { if (entry->Vk == VK__none_) continue; - vsc2vk[entry->Vsc + 0x100] = (BYTE)entry->Vk; + vsc2vk[entry->Vsc + 0x100] = entry->Vk; } for (entry = tables->pVSCtoVK_E1; entry && entry->Vsc; entry++) { if (entry->Vk == VK__none_) continue; - vsc2vk[entry->Vsc + 0x200] = (BYTE)entry->Vk; + vsc2vk[entry->Vsc + 0x200] = entry->Vk; } } @@ -1033,7 +1033,8 @@ WORD WINAPI NtUserVkKeyScanEx( WCHAR chr, HKL layout ) */ UINT WINAPI NtUserMapVirtualKeyEx( UINT code, UINT type, HKL layout ) { - BYTE vsc2vk[0x300], vk2char[0x100]; + USHORT vsc2vk[0x300]; + BYTE vk2char[0x100]; const KBDTABLES *kbd_tables; UINT ret = 0; @@ -1066,7 +1067,7 @@ UINT WINAPI NtUserMapVirtualKeyEx( UINT code, UINT type, HKL layout ) } kbd_tables_init_vsc2vk( kbd_tables, vsc2vk ); - for (ret = 0; ret < ARRAY_SIZE(vsc2vk); ++ret) if (vsc2vk[ret] == code) break; + for (ret = 0; ret < ARRAY_SIZE(vsc2vk); ++ret) if ((vsc2vk[ret] & 0xff) == code) break; if (ret >= ARRAY_SIZE(vsc2vk)) ret = 0; if (type == MAPVK_VK_TO_VSC) @@ -1082,7 +1083,7 @@ UINT WINAPI NtUserMapVirtualKeyEx( UINT code, UINT type, HKL layout ) if (code & 0xe000) code -= 0xdf00; if (code >= ARRAY_SIZE(vsc2vk)) ret = 0; - else ret = vsc2vk[code]; + else ret = vsc2vk[code] & 0xff; if (type == MAPVK_VSC_TO_VK) { @@ -1130,15 +1131,15 @@ INT WINAPI NtUserGetKeyNameText( LONG lparam, WCHAR *buffer, INT size ) if (lparam & 0x2000000) { - BYTE vsc2vk[0x300]; + USHORT vsc2vk[0x300]; kbd_tables_init_vsc2vk( kbd_tables, vsc2vk ); - switch ((vkey = vsc2vk[code])) + switch ((vkey = vsc2vk[code] & 0xff)) { case VK_RSHIFT: case VK_RCONTROL: case VK_RMENU: for (code = 0; code < ARRAY_SIZE(vsc2vk); ++code) - if (vsc2vk[code] == (vkey - 1)) break; + if ((vsc2vk[code] & 0xff) == (vkey - 1)) break; break; } }
1
0
0
0
Alexandros Frantzis : win32u: Allow drivers to send only the scan code for keyboard events.
by Alexandre Julliard
21 May '24
21 May '24
Module: wine Branch: master Commit: c288c28eafd6f8bbb3b2020a1b756c297f4a4923 URL:
https://gitlab.winehq.org/wine/wine/-/commit/c288c28eafd6f8bbb3b2020a1b756c…
Author: Alexandros Frantzis <alexandros.frantzis(a)collabora.com> Date: Fri May 3 15:43:08 2024 +0300 win32u: Allow drivers to send only the scan code for keyboard events. The implementation will map the scan code to a virtual key code internally. --- dlls/user32/tests/input.c | 31 +++++++++++++++++++++++-------- dlls/win32u/message.c | 23 ++++++++++++++++++++--- dlls/winewayland.drv/wayland_keyboard.c | 9 ++++----- 3 files changed, 47 insertions(+), 16 deletions(-) diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index d84d543bed8..8fad3305f3e 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -1063,16 +1063,26 @@ static void test_SendInput_keyboard_messages( WORD vkey, WORD scan, WCHAR wch, W struct send_input_keyboard_test rshift_scan[] = { {.scan = 0x36, .flags = KEYEVENTF_SCANCODE, .expect_state = {[VK_SHIFT] = 0x80, [VK_LSHIFT] = 0x80}, - .todo_state = {[0] = TRUE, [VK_SHIFT] = TRUE, [VK_LSHIFT] = TRUE}, - .expect = {KEY_HOOK(WM_KEYDOWN, 0x36, VK_RSHIFT, .todo_value = TRUE), KEY_MSG(WM_KEYDOWN, 0x36, VK_SHIFT, .todo_value = TRUE), {0}}}, + .expect = {KEY_HOOK(WM_KEYDOWN, 0x36, VK_RSHIFT), KEY_MSG(WM_KEYDOWN, 0x36, VK_SHIFT), {0}}}, {.scan = scan, .flags = KEYEVENTF_SCANCODE, .expect_state = {[VK_SHIFT] = 0x80, [VK_LSHIFT] = 0x80, /*[vkey] = 0x80*/}, - .todo_state = {[0] = TRUE, [VK_SHIFT] = TRUE, [VK_LSHIFT] = TRUE, /*[vkey] = TRUE*/}, - .expect = {KEY_HOOK(WM_KEYDOWN, scan, vkey, .todo_value = TRUE), KEY_MSG(WM_KEYDOWN, scan, vkey, .todo_value = TRUE), WIN_MSG(WM_CHAR, wch_shift, MAKELONG(1, scan), .todo = TRUE), {0}}}, + .expect = {KEY_HOOK(WM_KEYDOWN, scan, vkey), KEY_MSG(WM_KEYDOWN, scan, vkey), WIN_MSG(WM_CHAR, wch_shift, MAKELONG(1, scan)), {0}}}, {.scan = scan, .flags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP, .expect_state = {[VK_SHIFT] = 0x80, [VK_LSHIFT] = 0x80}, - .todo_state = {[VK_SHIFT] = TRUE, [VK_LSHIFT] = TRUE}, - .expect = {KEY_HOOK(WM_KEYUP, scan, vkey, .todo_value = TRUE), KEY_MSG(WM_KEYUP, scan, vkey, .todo_value = TRUE), {0}}}, + .expect = {KEY_HOOK(WM_KEYUP, scan, vkey), KEY_MSG(WM_KEYUP, scan, vkey), {0}}}, {.scan = 0x36, .flags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP, - .expect = {KEY_HOOK(WM_KEYUP, 0x36, VK_RSHIFT, .todo_value = TRUE), KEY_MSG(WM_KEYUP, 0x36, VK_SHIFT, .todo_value = TRUE), {0}}}, + .expect = {KEY_HOOK(WM_KEYUP, 0x36, VK_RSHIFT), KEY_MSG(WM_KEYUP, 0x36, VK_SHIFT), {0}}}, + {0}, + }; + + struct send_input_keyboard_test rctrl_scan[] = + { + {.scan = 0xe01d, .flags = KEYEVENTF_SCANCODE, .expect_state = {[VK_CONTROL] = 0x80, [VK_LCONTROL] = 0x80}, + .expect = {KEY_HOOK(WM_KEYDOWN, 0x1d, VK_LCONTROL), KEY_MSG(WM_KEYDOWN, 0x1d, VK_CONTROL), {0}}}, + {.scan = 0xe01d, .flags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP, + .expect = {KEY_HOOK(WM_KEYUP, 0x1d, VK_LCONTROL), KEY_MSG(WM_KEYUP, 0x1d, VK_CONTROL), {0}}}, + {.scan = 0x1d, .flags = KEYEVENTF_SCANCODE | KEYEVENTF_EXTENDEDKEY, .expect_state = {[VK_CONTROL] = 0x80, [VK_RCONTROL] = 0x80}, + .expect = {KEY_HOOK_(WM_KEYDOWN, 0x1d, VK_RCONTROL, LLKHF_EXTENDED, .todo_value = TRUE), KEY_MSG(WM_KEYDOWN, 0x11d, VK_CONTROL), {0}}}, + {.scan = 0x1d, .flags = KEYEVENTF_SCANCODE | KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, + .expect = {KEY_HOOK_(WM_KEYUP, 0x1d, VK_RCONTROL, LLKHF_EXTENDED, .todo_value = TRUE), KEY_MSG(WM_KEYUP, 0x11d, VK_CONTROL), {0}}}, {0}, }; @@ -1179,7 +1189,6 @@ static void test_SendInput_keyboard_messages( WORD vkey, WORD scan, WCHAR wch, W lmenu_lcontrol_vkey[2].expect_state[vkey] = 0x80; shift_vkey[1].expect_state[vkey] = 0x80; rshift_scan[1].expect_state[vkey] = 0x80; - rshift_scan[1].todo_state[vkey] = TRUE; unicode_vkey[0].expect_state[vkey] = 0x80; /* test peeked messages */ @@ -1211,6 +1220,9 @@ static void test_SendInput_keyboard_messages( WORD vkey, WORD scan, WCHAR wch, W else check_send_input_keyboard_test( menu_ext_peeked, TRUE ); check_send_input_keyboard_test( lrshift_ext, TRUE ); check_send_input_keyboard_test( rshift_scan, TRUE ); + /* Skip on Korean layouts since they map the right control key to VK_HANJA */ + if (hkl == (HKL)0x04120412) skip( "skipping rctrl_scan test on Korean layout" ); + else check_send_input_keyboard_test( rctrl_scan, TRUE ); check_send_input_keyboard_test( unicode, TRUE ); check_send_input_keyboard_test( lmenu_unicode_peeked, TRUE ); check_send_input_keyboard_test( unicode_vkey, TRUE ); @@ -1251,6 +1263,9 @@ static void test_SendInput_keyboard_messages( WORD vkey, WORD scan, WCHAR wch, W else check_send_input_keyboard_test( menu_ext, FALSE ); check_send_input_keyboard_test( lrshift_ext, FALSE ); check_send_input_keyboard_test( rshift_scan, FALSE ); + /* Skip on Korean layouts since they map the right control key to VK_HANJA */ + if (hkl == (HKL)0x04120412) skip( "skipping rctrl_scan test on Korean layout" ); + else check_send_input_keyboard_test( rctrl_scan, FALSE ); check_send_input_keyboard_test( unicode, FALSE ); check_send_input_keyboard_test( lmenu_unicode, FALSE ); check_send_input_keyboard_test( unicode_vkey, FALSE ); diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index 4a368ffb589..ddc9658f087 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -3558,9 +3558,26 @@ NTSTATUS send_hardware_message( HWND hwnd, UINT flags, const INPUT *input, LPARA MOUSEEVENTF_XDOWN | MOUSEEVENTF_XUP)); break; case INPUT_KEYBOARD: - req->input.kbd.vkey = input->ki.wVk; - req->input.kbd.scan = input->ki.wScan; - req->input.kbd.flags = input->ki.dwFlags; + if (input->ki.dwFlags & KEYEVENTF_SCANCODE) + { + UINT scan = input->ki.wScan; + /* TODO: Use the keyboard layout of the target hwnd, once + * NtUserGetKeyboardLayout supports non-current threads. */ + HKL layout = NtUserGetKeyboardLayout( 0 ); + if (flags & SEND_HWMSG_INJECTED) + { + scan = scan & 0xff; + if (input->ki.dwFlags & KEYEVENTF_EXTENDEDKEY) scan |= 0xe000; + } + req->input.kbd.vkey = NtUserMapVirtualKeyEx( scan, MAPVK_VSC_TO_VK_EX, layout ); + req->input.kbd.scan = input->ki.wScan & 0xff; + } + else + { + req->input.kbd.vkey = input->ki.wVk; + req->input.kbd.scan = input->ki.wScan; + } + req->input.kbd.flags = input->ki.dwFlags & ~KEYEVENTF_SCANCODE; req->input.kbd.time = input->ki.time; req->input.kbd.info = input->ki.dwExtraInfo; affects_key_state = TRUE; diff --git a/dlls/winewayland.drv/wayland_keyboard.c b/dlls/winewayland.drv/wayland_keyboard.c index 04a1c0a9fc3..55b14b1dfd5 100644 --- a/dlls/winewayland.drv/wayland_keyboard.c +++ b/dlls/winewayland.drv/wayland_keyboard.c @@ -801,9 +801,8 @@ static void send_right_control(HWND hwnd, uint32_t state) { INPUT input = {0}; input.type = INPUT_KEYBOARD; - input.ki.wScan = key2scan(KEY_RIGHTCTRL); - input.ki.wVk = VK_RCONTROL; - input.ki.dwFlags |= KEYEVENTF_EXTENDEDKEY; + input.ki.wScan = 0xe000 | (key2scan(KEY_RIGHTCTRL) & 0xff); + input.ki.dwFlags = KEYEVENTF_SCANCODE | KEYEVENTF_EXTENDEDKEY; if (state == WL_KEYBOARD_KEY_STATE_RELEASED) input.ki.dwFlags |= KEYEVENTF_KEYUP; NtUserSendHardwareInput(hwnd, 0, &input, 0); } @@ -824,8 +823,8 @@ static void keyboard_handle_key(void *data, struct wl_keyboard *wl_keyboard, if (key == KEY_RIGHTALT) send_right_control(hwnd, state); input.type = INPUT_KEYBOARD; - input.ki.wScan = scan & 0xff; - input.ki.wVk = NtUserMapVirtualKeyEx(scan, MAPVK_VSC_TO_VK_EX, keyboard_hkl); + input.ki.wScan = (scan & 0x300) ? scan + 0xdf00 : scan; + input.ki.dwFlags = KEYEVENTF_SCANCODE; if (scan & ~0xff) input.ki.dwFlags |= KEYEVENTF_EXTENDEDKEY; if (state == WL_KEYBOARD_KEY_STATE_RELEASED) input.ki.dwFlags |= KEYEVENTF_KEYUP;
1
0
0
0
Alexandros Frantzis : win32u: Emit number characters for numpad virtual keys.
by Alexandre Julliard
21 May '24
21 May '24
Module: wine Branch: master Commit: c4e636425aeb6c3eed201c679666474864158652 URL:
https://gitlab.winehq.org/wine/wine/-/commit/c4e636425aeb6c3eed201c67966647…
Author: Alexandros Frantzis <alexandros.frantzis(a)collabora.com> Date: Fri May 3 10:50:00 2024 +0300 win32u: Emit number characters for numpad virtual keys. --- dlls/win32u/input.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 04532e7d015..38350861c6b 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -521,6 +521,7 @@ static WCHAR kbd_tables_vkey_to_wchar( const KBDTABLES *tables, UINT vkey, const if (vkey >= 'A' && vkey <= 'Z') return vkey - 'A' + 1; tables = &kbdus_tables; } + if (vkey >= VK_NUMPAD0 && vkey <= VK_NUMPAD9) tables = &kbdus_tables; mod = caps_mod = kbd_tables_get_mod_num( tables, state, FALSE ); if (caps) caps_mod = kbd_tables_get_mod_num( tables, state, TRUE );
1
0
0
0
Daniel Lehman : odbc32: Allow null handle for SQLSetEnvAttr.
by Alexandre Julliard
21 May '24
21 May '24
Module: wine Branch: master Commit: 2e13067cc6c28626c1f2b662ec7e2a8f9be5b42e URL:
https://gitlab.winehq.org/wine/wine/-/commit/2e13067cc6c28626c1f2b662ec7e2a…
Author: Daniel Lehman <dlehman25(a)gmail.com> Date: Mon May 20 20:18:21 2024 -0700 odbc32: Allow null handle for SQLSetEnvAttr. It can be null for SQL_ATTR_CONNECTION_POOLING. --- dlls/odbc32/proxyodbc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index c1c43ab8641..d5c271bdfa2 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -1273,9 +1273,7 @@ SQLRETURN WINAPI SQLSetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, TRACE("(EnvironmentHandle %p, Attribute %d, Value %p, StringLength %d)\n", EnvironmentHandle, Attribute, Value, StringLength); - if (!handle) return SQL_INVALID_HANDLE; - - params.EnvironmentHandle = handle->unix_handle; + params.EnvironmentHandle = handle ? handle->unix_handle : 0; ret = ODBC_CALL( SQLSetEnvAttr, ¶ms ); TRACE("Returning %d\n", ret); return ret;
1
0
0
0
← Newer
1
...
24
25
26
27
28
29
30
...
71
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
Results per page:
10
25
50
100
200