This MR implements `NtContinueEx(PCONTEXT, PCONTINUE_OPTIONS)` which was added in Windows 10 20H1.
Also added basic test reusing existing `test_continue()` (included from !4720)
League of Legends game hooks `NtContinue()` and `NtContinueEx()` by putting `jmp` instruction in front of it.
Note that LoL doesn't actually use `NtContinueEx()` itself and game will work fine without it but if game doesn't find `NtContinueEx()` it will permanently ban your account due to detecting "scripting program"
--
v6: ntdll/tests: Implement APC test for NtContinue()
ntdll/tests: Add basic test for NtContinueEx()
ntdll: Implement NtContinueEx()
https://gitlab.winehq.org/wine/wine/-/merge_requests/4761
These changes are the documented way to implement IMFMediaEventGenerator for a media source. On top of !6783 it seems to greatly reduce the chance of hanging while switching characters in Killsquad if tracing is not enabled.
--
v3: winegstreamer: Enqueue an event if a media source start/pause/stop async command fails due to shutdown.
mf: Handle media source Start() failure due to source shutdown.
mf: Handle media source event subscription failure due to source shutdown.
mf: Handle media source BeginGetEvent() failure due to shutdown.
mf: Handle media source EndGetEvent() failure due to shutdown.
mf/tests: Add tests for shutting down a media source used in a session.
winegstreamer: Return the result code from media_source_Pause().
rtworkq: Do not cancel pending callbacks when closing a thread pool.
mfplat/tests: Add a test for calling MFUnlockWorkQueue() with pending items.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6800
The main motivation is to enable it for debug traces too, but for that we need !6852 merged first.
Clang is too strict about `%I` using the same type as `size_t`, which is `int` on 32-bit Windows targets. Ideally, it would be fixed in Clang, but we already have a hack for it in mingw mode, so I just extended it for now.
Changing type of `LONG_PTR` is pretty invasive, especially for C++ code (I'd expect it to break @rbernon's libc++ builds). We could probably guard it with `__cplusplus`. I restricted it even further with `__WINESRC__` under the assumption that external header users are less likely to care about this particular warning problem than about underlying type in general.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6886
This PR updates the behaviour of `NtQueryDirectoryFile`, bringing it in line with current Windows behaviour. The need for this update was discovered when attempting to build the Unreal Engine with MSVC under Wine. In certain cases conditional include statements do not behave as expected, due to MSVC depending on undocumented behaviour of `NtQueryDirectoryFile`.
We ran tests on multiple versions of Windows, and discovered that the behaviour has changed since the original Wine implementation, but the documentation has not. The source code for our test tool, and a set of results can be found [here](https://github.com/TensorWorks/NtQueryDirectoryFile-Test). As of Windows 8, calling `NtQueryDirectoryFile` with a re-used handle, a new mask, and setting the `RestartScan` flag to True, causes the cached results to be erased and a new scan to be performed with the updated mask. Currently, Wine performs as did earlier versions of Windows, where the changed mask is ignored, and the cache is reused. This can cause `NtQueryDirectoryFile` under Wine to falsely report that files exist, when they do not.
This PR corrects this behaviour, invalidating the cache when required. Implementing this exposed further undocumented behaviour of `NtQueryDirectoryFile`, where a search for a non-existent file will return either `STATUS_NO_MORE_FILES` or `STATUS_NO_SUCH_FILE`, depending on whether or not the handle had been previously used regardless of the value of `RestartScan`. This was reflected in a `winetest` which allowed for the response to be either `STATUS_SUCCESS` or `STATUS_NO_MORE_FILES`. This test has been updated to only allow current Windows behaviour, and `NtQueryDirectoryFile` will return either `STATUS_NO_MORE_FILES` or `STATUS_NO_SUCH_FILE` as appropriate.
This patch also adds unit tests for the new behaviour of `NtQueryDirectoryFile`. These tests pass when running `winetest` under Windows, and under Wine with these changes in place, but they will fail under older versions of Wine.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6904