As these handles to a file don't have an unix-name attached, the
FileAllInformation query fails.
So only implement GetFileInformationByHandle() on top of queries which
don't fail.
I tested if the three ntdll calls instead of one did impact performance.
On cached handles they don't: a simple x100000 loop even shows a
~10% improvement, likely because we don't grab the filename from wineserver.
Note: that NtQueryInformationFile(FileAllInformation) (as other queries
returning file's name) will still fail on these unix-redirected handles.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51813
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1665
Code assumes that tableIndex is never 0, while GCC cannot
infer it. So include tableIndex=0 case into already handled
error cases.
GCC/Mingw complains with:
/home/eric/work/wine/dlls/inetmib1/main.c: In function 'mib2IfEntryQuery':
/home/eric/work/wine/dlls/inetmib1/main.c:646:25: warning: array subscript 4294967295 is above array bounds of 'MIB_IFROW[1]' {aka 'struct _MIB_IFROW[1]'} [-Warray-bounds]
646 | &ifTable->table[tableIndex - 1], item,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/eric/work/wine/include/ipmib.h:21,
from /home/eric/work/wine/include/iprtrmib.h:24,
from /home/eric/work/wine/include/iphlpapi.h:25,
from /home/eric/work/wine/dlls/inetmib1/main.c:30:
/home/eric/work/wine/include/ifmib.h:66:15: note: while referencing 'table'
66 | MIB_IFROW table[1];
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1764
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
The function is called a lot, I believe something like this would improve its performance in general.
--
v2: ntdll: Lookup extension from the end in hash_short_file_name.
ntdll: Use invalid char lookup table in lookup_unix_name.
ntdll: Use invalid char lookup table in nt_to_unix_file_name_no_root.
ntdll: Use invalid char lookup table in is_legal_8dot3_name.
ntdll: Use invalid char lookup table in is_invalid_dos_char.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1756
Installers based on InnoSetup use invisible window owning the main
installer window. When focus is given to the installer window popup,
window managers sometimes do not raise it as their owner is invisible
and it stays below other windows unless they are minimized.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49933
This is not a regression and it is arguably perhaps a window manager
bug, but it is also extremely annoying for users as installer windows
tend to disappear from the pager, as well as missing from the window
selector and below all other windows.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1859
This makes it possible to detect modules that weren't unmapped from
dlclose, and that we should not fixup again.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49640
This usually happens with C++ winelibs, where some C++ symbols may
be inlined into the winelib, then later resolved in preference over
other symbol definitions when libstdc++ loads.
This results in circular dependency between the winelib and libstdc++,
making dlclose no-op.
In this case, reloading the lib later and calling `map_so_dll` on it
again will fixup the RVAs again, ending up with invalid addresses.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1498