The practical issue I am trying to solve is the following scenario (encountered with a game using some Uplay plugin) which has regressed with apisets implementation in Wine. The game imports ucrtbase.dll. Then, a plugin calls GetModuleHandle("api-ms-win-crt-runtime-l1-1-0.dll") and expects GetProcAddress("\_crt_atexit") to succeed on the returned handle. The problem is that the game has ucrtbase.dll in its .exe directory. That one currently gets loaded. Then, find_dll_file() resolves api-ms-win-crt-runtime-l1-1-0.dll to the ucrtbase with a full path in system32 and tries to find that one (this part matches Windows behaviour as far as tests show). Since we have ucrtbase loaded with another path this results in NULL module handle.
Windows maintains the list of "Known DLLs" (probably aimed for speeding up processes startup by using pre-mapped dll images for commonly used system dlls). On Windows, known dlls have specifics in load path resolution when dll name doesn't contain path (relative or full):
- they are loaded from system directory even if there is another dll with the same name in priority search path;
- they are found even if library search paths do not contain system directory;
Those "Known DLLs" are basically listed in HKLM\\System\\CurrentControlSet\\Control\\Session Manager\KnownDLLs registry key. But the actual list of "known dlls" is bigger (probably includes all dependencies of those listed under registry key). The full actual list of "known dlls" is in '\\KnownDlls\' directory object which contains image sections under dll names. Most notably, ucrtbase.dll (which is of the concern in the regression) is not listed in registry but is present in \\KnownDlls. Technically nothing prevents us from implementing these mechanics and creating directory object with mapped load dlls, also resolving the explicitly listed dlls' dependencies. But it is not apparent to me if that is going to improve load times noticably in Wine, and also that is worth the inherent complications until anything actually depends on that \\KnownDlls sections. So instead of implementing all of that throughout the loader I added a few missing dlls to registry. The current list in this pat
chset corresponds to the contents of \\KnownDlls directory on an up to date Windows 10.
--
v4: ntdll: Load known dlls from system directory.
loader/wine.inf: Add known dlls key.
ntdll: Factor out prepend_system_dir() function.
kernel32/tests: Add tests for known dlls load specifics.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2127
This MR uses the cursor-shapes-v1 protocol to tell the compositor which system
cursor shape to use. If a shape match is not found (or cursor-shapes-v1
is not available) we fall back to setting the cursor buffer from the
Windows cursor data as before.
The second commit implements support for a "UseSystemCursors" driver option, similar
to what winex11 has. Since this is the first winewayland driver option we also introduce
all the related registry reading code.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57648
--
Side note: The registry code is a copy from winex11, and is the third copy in the
codebase (x11, mac, wayland). Perhaps it's worth introducing a common
ntuser function to perform the option reading for the drivers, something like
`NtUserGetDriverOption("X11 Driver", buffer, buffer_size, TRUE /* whether to read app specific option if present */)`.
With such a function there is the concern about each call reopening the registry, but we can see if that's actually a problem and how a different API (or some sort of caching) may help.
--
v4: winewayland: Support "UseSystemCursors" driver option.
winewayland: Use system cursor shapes when possible.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7678
For https://gitlab.winehq.org/wine/wine/-/merge_requests/7512 to use it to locate window shared objects.
--
v16: win32u: Use the session shared object for user handle entries.
win32u: Use the session shared object to implement is_window.
server: Move the user object handle table to the shared memory.
server: Allocate a session shared memory header structure.
server: Use NTUSER_OBJ constants for user object types.
include: Implement ReadAcquire64.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7610
This fixes Trials Fusion often crashing when disconnecting a controller while there are more still connected.
--
v4: hidclass: Set Status for pending IRPs of removed devices to STATUS_DEVICE_NOT_CONNECTED.
ntdll/tests: Add more NtCancelIoFile[Ex]() tests.
ntdll: Wait for all pending operations to be cancelled in NtCancelIoFile[Ex]().
https://gitlab.winehq.org/wine/wine/-/merge_requests/7797
This MR fixes seek in VRChat by copying the sequence of flushes/stop/starts that Windows does.
The order on Windows is:
1. Stop sources;
2. Flush MFTs;
3. Start sources;
4. Request output down the chain of sink inputs;
6. Flush sinks; and
7. Start the clock
This takes place whether we pause before we seek or seek without pause.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7932