GCC (MingW) 12.2 rightfully warns with:
/home/eric/work/wine/dlls/kernelbase/loader.c: In function 'GetModuleHandleA':
/home/eric/work/wine/dlls/kernelbase/loader.c:332:12: warning: 'ret' may be used uninitialized [-Wmaybe-uninitialized]
332 | return ret;
| ^~~
/home/eric/work/wine/dlls/kernelbase/loader.c:329:13: note: 'ret' declared here
329 | HMODULE ret;
| ^~~
So set module to NULL on all error codepaths in GetModuleHandleExA().
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/978
Mark args local variable with volatile to tell GCC not to check
for out of bounds access.
Alternative fix: use an intermediate variable to store &fun as
an integer.
MingW/GCC 12 complains with:
In file included from /home/eric/work/wine/dlls/krnl386.exe16/thunk.c:36:
/home/eric/work/wine/dlls/krnl386.exe16/thunk.c: In function 'SSCall':
/home/eric/work/wine/include/wine/debug.h:91:4: warning: array subscript 1 is outside array bounds of 'INT_PTR (__attribute__((stdcall)) *[1])(void)' {aka 'int (__attribute__((stdcall)) *[1])(void)'} [-Warray-bounds]
91 | wine_dbg_log( __dbcl, __dbch, __func__, __VA_ARGS__); } } while(0)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/eric/work/wine/include/wine/debug.h:88:8: note: in expansion of macro '__WINE_DBG_LOG'
88 | __WINE_DBG_LOG
| ^~~~~~~~~~~~~~
/home/eric/work/wine/include/wine/debug.h:463:36: note: in expansion of macro '__WINE_DPRINTF'
463 | #define WINE_TRACE __WINE_DPRINTF(_TRACE,__wine_dbch___default)
| ^~~~~~~~~~~~~~
/home/eric/work/wine/include/wine/debug.h:506:36: note: in expansion of macro 'WINE_TRACE'
506 | #define TRACE WINE_TRACE
| ^~~~~~~~~~
/home/eric/work/wine/dlls/krnl386.exe16/thunk.c:996:32: note: in expansion of macro 'TRACE'
996 | for (i = 0; i < nr/4; i++) TRACE("0x%08lx,",args[i]);
| ^~~~~
/home/eric/work/wine/dlls/krnl386.exe16/thunk.c:989:17: note: at offset 4 into object 'fun' of size 4
989 | FARPROC fun, /* [in] function to call */
| ~~~~~~~~^~~
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1765
On Mon Feb 6 15:28:54 2023 +0000, Timo Zuccarello wrote:
> Looks great, I didn't know you were working on it already! I presume a
> fixed offset is enough then in most cases, so no need for manual
> mappings from XKB names?
Yes I believe so.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/182#note_23087
On Mon Feb 6 15:05:02 2023 +0000, Rémi Bernon wrote:
> I mean, I don't know if we need to detect VNC, but at least having an
> option to enable or disable the bogus scancode auto-detect is imho a
> good solution.
Looks great, I didn't know you were working on it already! I presume a fixed offset is enough then in most cases, so no need for manual mappings from XKB names?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/182#note_23086
On Thu Oct 6 11:55:45 2022 +0000, Timo Zuccarello wrote:
> I just went through the email thread (I'm still new to navigating
> pipermail/mailing list archives) and I see the point, although I don't
> think I can entirely grasp what VNC does. But the way I understand it is
> that even if we used XKB names for the scan codes as in this MR, those
> would be messed up just as well when using a VNC X server, as it maps
> backwards from vkeys to scan codes?
> In the XKB specification/documentation, "The key name links keys with
> similar functions or in similar positions on keyboards that report
> different scan codes", which gets me wondering how Windows actually
> handles exotic keyboards or rather what is common practice in the
> drivers for said exotic keyboards.
> In any case, I agree, I suppose optional layout detection would be the
> most compatible solution for now at least.
@rbernon Prompted by someone who also had issues with exotic or non-qwerty keyboard layouts in #winehq, I've taken another look at this. Came across a StackOverflow post about detecting whether a display is VNC (https://stackoverflow.com/questions/29371717/linux-detecting-if-youre-runni…). Would that be an option? I.e. add an override winecfg option and by default try to detect a VNC session and if it's VNC, use previous mapping/code, otherwise use XKB?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/182#note_23078