On Sat Mar 1 21:59:13 2025 +0000, Brendan McGrath wrote:
> I took a look at the linux-32 results, but I missed the mf failures (I
> thought they were all ddraw). Why would linux-32 fail but not linux-64?
> Anyway, it's the same test failing twice:
> ```
> $ xmllint --xpath 'testsuites/testsuite/testcase[failure and
> @classname="mf:transform"]/@name' winetest.xml
> name="mf:transform transform.c:2587 Test failed: aacdec:
> "MF_MT_USER_DATA": SetInputType returned 0."
> name="mf:transform transform.c:2587 Test failed: aacdec:
> "MF_MT_USER_DATA": SetInputType returned 0."
> ```
> The test checks that a call to `SetInputType` on the AAC decoder returns
> an error when `MF_MT_USER_DATA` is missing. It does so by relying on the
> return value of `MFCreateWaveFormatExFromMFMediaType`. So it's dependent
> on what was the broken behavior. I suspect it should also be checking
> `cbSize`. I'll add tests to confirm as much and then fix.
> Note, I have confirmed that we now have the correct behavior for
> `MFCreateWaveFormatExFromMFMediaType` by adding (locally) the following
> two tests:
> ```
> @@ -5958,6 +5958,8 @@ static void test_MFCreateWaveFormatExFromMFMediaType(void)
> { &MFAudioFormat_Float, WAVE_FORMAT_IEEE_FLOAT,
> sizeof(WAVEFORMATEX), 0, },
> { &MFAudioFormat_MP3, WAVE_FORMAT_MPEGLAYER3,
> sizeof(WAVEFORMATEX), 0, },
> { &DUMMY_GUID3, WAVE_FORMAT_EXTENSIBLE,
> sizeof(WAVEFORMATEXTENSIBLE), 22, },
> + { &MFAudioFormat_AAC, WAVE_FORMAT_MPEG_HEAAC,
> sizeof(WAVEFORMATEX), 0, },
> + { &MFAudioFormat_RAW_AAC, WAVE_FORMAT_RAW_AAC1,
> sizeof(WAVEFORMATEX), 0, },
> ```
> Test bot passes:
> https://testbot.winehq.org/JobDetails.pl?Key=151559
> Well Windows did, Debian crashed.
I've raised MR !7465 to fix the failing test. I also add new tests that seem to indicate we are still missing some validation in the aac decoder around `MF_MT_USER_DATA`. For example, in one of the tests, I send a value of 44.1KHz in `MF_MT_AUDIO_SAMPLES_PER_SECOND`, but a value of 48KHz in `MF_MT_USER_DATA`. Windows returns `MF_E_INVALIDMEDIATYPE`, but we return `S_OK`. So this test is currently marked as todo.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7417#note_96490
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
--
v2: windowscodecs: Implement GetPreferredVendorGUID().
windowscodecs/metadata: Implement GetClassID().
windowscodecs/tests: Add some tests for metadata handler GetClassID().
windowscodecs/metadata: Replicate original stream position when creating writer instances from readers.
windowscodecs/metadata: Restore original stream position on GetStream().
windowscodecs/tests: Add some tests for stream position handling when nested readers are used.
windowscodecs: Implement CreateQueryWriterFromReader().
windowscodecs/metadata: Do not decorate 'wstr' items with a type name in returned queries.
windowscodecs/tests: Add some more tests for query enumeration.
windowscodecs: Implement query strings enumerator.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7407
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
--
v3: d2d1: Update DC target surface with current HDC contents on BeginDraw().
d2d1/tests: Add some tests for device context handling in the DC target.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7443
There is no ([not yet?](https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requ…) dedicated protocol for requesting pointer warps, but it's possible to request one with `zwp_locked_pointer_v1.set_cursor_position_hint` which may be performed when the pointer is unlocked. The idea is to quickly lock/set position/unlock. This is used by SDL (in some cases: [SDL_MOUSE_EMULATE_WARP_WITH_RELATIVE](https://wiki.libsdl.org/SDL3/SDL_HINT…) and Xwayland. The limitation is/will be that the compositor will ignore requests to warp the pointer outside of surface bounds.
What I'd like to have working is the auto cursor placement feature of some applications, where they just want to call SetCursorPos towards specific UI elements inside their single window, and usually they'll be unclipped and have a visible cursor while doing this.
This patch also happens to allow mouselook to work in applications which use SetCursorPos for mouselook and aren't getting covered by the heuristics that turn on Wayland relative motion (for some reason the driver thinks the cursor is visible). Seems to affect Half-Life (GoldSrc) on my system. Though force enabling relative motion with an environment variable in a custom build or somehow improving the heuristics will also fix that.
~~A suface/pointer can only have one lock or confinement, and this implementation depends on the pointer lock. So if needed, I temporarily unlock/unconfine in order to do the warp then relock/reconfine. I modified `wayland_pointer_update_constraint` so I don't have to temporarily disable relative motion during this in case it's enabled. I think it's safe/a no-op to attempt pointer warps while using relative motion, as according to the protocol the warp will not generate a relative motion event, and while there will be a wl_pointer motion event, they're ignored while relative motion is being used.~~
--
v5: winewayland: Implement SetCursorPos via pointer lock.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7353
Having a pointer lock implies that relative motion is also used. When
refocusing on a mouselook application which the driver is using relative
motion for, an absolute motion hardware input is sent because of
handling the wl_pointer.enter event. This can result in an unwanted
warp/jerk.
The need to handle enter motion isn't applicable to mouselook or cases
where the pointer is locked because the application is drawing its own
cursor while covering vscreen, so it can be ignored during pointer lock.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7457
On Sat Mar 1 10:14:45 2025 +0000, Nikolay Sivov wrote:
> Sorry, I didn't check linux-32 results.
I took a look at the linux-32 results, but I missed the mf failures (I thought they were all ddraw). Why would linux-32 fail but not linux-64?
Anyway, it's the same test failing twice:
```
$ xmllint --xpath 'testsuites/testsuite/testcase[failure and @classname="mf:transform"]/@name' winetest.xml
name="mf:transform transform.c:2587 Test failed: aacdec: "MF_MT_USER_DATA": SetInputType returned 0."
name="mf:transform transform.c:2587 Test failed: aacdec: "MF_MT_USER_DATA": SetInputType returned 0."
```
The test checks that a call to `SetInputType` on the AAC decoder returns an error when `MF_MT_USER_DATA` is missing. It does so by relying on the return value of `MFCreateWaveFormatExFromMFMediaType`. So it's dependent on what was the broken behavior. I suspect it should also be checking `cbSize`. I'll add tests to confirm as much and then fix.
Note, I have confirmed that we now have the correct behavior for `MFCreateWaveFormatExFromMFMediaType` by adding (locally) the following two tests:
```
@@ -5958,6 +5958,8 @@ static void test_MFCreateWaveFormatExFromMFMediaType(void)
{ &MFAudioFormat_Float, WAVE_FORMAT_IEEE_FLOAT, sizeof(WAVEFORMATEX), 0, },
{ &MFAudioFormat_MP3, WAVE_FORMAT_MPEGLAYER3, sizeof(WAVEFORMATEX), 0, },
{ &DUMMY_GUID3, WAVE_FORMAT_EXTENSIBLE, sizeof(WAVEFORMATEXTENSIBLE), 22, },
+ { &MFAudioFormat_AAC, WAVE_FORMAT_MPEG_HEAAC, sizeof(WAVEFORMATEX), 0, },
+ { &MFAudioFormat_RAW_AAC, WAVE_FORMAT_RAW_AAC1, sizeof(WAVEFORMATEX), 0, },
```
Test bot passes:
https://testbot.winehq.org/JobDetails.pl?Key=151559
Well Windows did, Debian crashed.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7417#note_96328
The spec says if the passed pointer is NULL then return E_POINTER
and not to just unconditionally deref then set NULL.
Signed-off-by: Edward O'Callaghan <edward(a)antitrust.cc>
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7451
This is an attempt at generating the font metrics from publicly
downloadable data.
The Windows metrics are generated from the AFM sources instead of
being copied from some unrelated TrueType fonts as done in
a3b562f74eeb6a5abc3013e57ff489107677b743. It's not clear if that
matters, neither seem to match the values on Windows.
It would be possible to simplify things further, and to use more
up-to-date source data, but for now the goal is to minimize the diff
to the generated files.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7444
Trivial, small set of cleanups patches to start with, non-controversial and NOP functionally speaking.
These are to help get the review process going in making ways towards the bar being lowered for contributing to the oleaut32 implementation.
Signed-off-by: Edward O'Callaghan <edward(a)antitrust.cc>
--
v4: dlls/oleaut32: Invert if-stmt in ITypeLib2_fnRelease()
dlls/oleaut32: Invert if stmt for clarity
dlls/oleaut32: Consistently use TLB_REF_NOT_FOUND
https://gitlab.winehq.org/wine/wine/-/merge_requests/7375
- Clean up method implementations to be consistent and pass tests.
- Factor out common code.
- Validate arguments.
- Correctly match szNameBuf user passed strings as case-insensitive as per documentation.
- Match method parameter identifiers to be as per documentation.
- Rewrite where required to use common helpers.
Signed-off-by: Edward O'Callaghan <edward(a)antitrust.cc>
--
v3: oleaut32: Factor out TLB_get_typeinfo_by_guid()
https://gitlab.winehq.org/wine/wine/-/merge_requests/7449
- Clean up method implementations to be consistent and pass tests.
- Factor out common code.
- Validate arguments.
- Correctly match szNameBuf user passed strings as case-insensitive as per documentation.
- Match method parameter identifiers to be as per documentation.
- Rewrite where required to use common helpers.
Signed-off-by: Edward O'Callaghan <edward(a)antitrust.cc>
--
v2: oleaut32: Factor out TLB_get_typeinfo_by_guid()
oleaut32: Rewrite ITypeInfo_fnGetIDsOfNames()
https://gitlab.winehq.org/wine/wine/-/merge_requests/7449
- Clean up method implementations to be consistent and pass tests.
- Factor out common code.
- Validate arguments.
- Correctly match szNameBuf user passed strings as case-insensitive as per documentation.
- Match method parameter identifiers to be as per documentation.
- Rewrite where required to use common helpers.
Signed-off-by: Edward O'Callaghan <edward(a)antitrust.cc>
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7449
Partial, as per documentation, implement fixing as the default
locale.
Signed-off-by: Edward O'Callaghan <edward(a)antitrust.cc>
--
v3: oleaut32: Implement (S|G)etVarConversionLocaleSetting()
https://gitlab.winehq.org/wine/wine/-/merge_requests/7447
Partial, as per documentation, implement fixing as the default
locale.
Signed-off-by: Edward O'Callaghan <edward(a)antitrust.cc>
--
v2: oleaut32: Implement (S|G)etVarConversionLocaleSetting()
https://gitlab.winehq.org/wine/wine/-/merge_requests/7447
On Fri Feb 28 22:41:11 2025 +0000, Bernhard Übelacker wrote:
> I am not sure if I understand you right. Before this patch `res ==
> STATUS_INVALID_PARAMETER` was part of the ok and the if condition around
> the skip. After my patch the ok should never get reached with `res ==
> STATUS_INVALID_PARAMETER`, so isn't checking for it superfluous?
> I am happy with either way, should I add it again?
Maybe I have misread part of the patch, sorry for that.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7445#note_96273
Since 9b8409fce4da18e3d9a914a9e5831d10eb9052de, a PE compiler is required for 32 bit arm.
That can either be supplied by using plain Clang (from a distro), or llvm-mingw. However when using plain Clang (in MSVC mode), we're lacking compiler builtin functions that either would be provided by MSVC libraries or by compiler-rt libraries bundled in llvm-mingw.
Vendor a copy of the relevant files from compiler-rt and include them when building for arm in MSVC mode.
This allows building a functional wine for 32 bit arm without requiring third party tools such as llvm-mingw.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7205
## Context
This is a problem discovered when running "Max: The Curse of Brotherhood" under proton. This game writes 4MB a piece into `wg_transform`, which contains about 4 seconds of compressed video. `wg_transform` calls `gst_pad_push` in `transform_ProcessOutput`, which takes \~300ms (i.e. 20 frames @ 60fps) to decode this buffer of video. So the end result is the game hitches every 4 seconds while playing cut scene videos.
Proton currently has a special case for this particular game, for which it breaks up the buffer into small chunks to avoid long blocks. This MR adopts that and applies it generally.
One concern raised by @redmcg is:
> The only issue I can think of is if there are any decoders which don't have a parser; then they might not know how to deal with an arbitrary 4096 byte buffer (the parser is generally responsible for taking arbitrary buffers and producing something the decoder can work with, for example: a full frame).
So this MR only enables this strategy when there is a parser element.
--
v8: winegstreamer: Avoid large buffer pushes in wg_transform.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7288
This adds to the basic infrastructure needed for device inquiry/scanning.
Also, fixes radio properties being incorrectly updated.
--
v4: winebth.sys: Update properties for tracked remote devices on receiving PropertiesChanged for org.bluez.Device1 objects from BlueZ.
winebth.sys: Only set the updated properties for local radios on BLUETOOTH_WATCHER_EVENT_TYPE_RADIO_PROPERTIES_CHANGED.
winebth.sys: Set the device class for remote devices from BlueZ's "Class" property.
winebth.sys: Use the "Trusted" property from BlueZ device objects to set BDIF_PERSONAL.
winebth.sys: Use the "Name" property of a BlueZ adapter for the local radio name.
winebth.sys: Don't iterate over the remaining radios once a local device has been removed.
winebth.sys: Initially set numOfDevices to 0 in IOCTL_BTH_GET_DEVICE_INFO.
winebth.sys: Use the correct DBus property name in IOCTL_WINEBTH_RADIO_SET_FLAG.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7424
This is an alternative proposal to !5830. It fixes the same glitches in Horizon Zero Dawn, but attempts to do that by implementing the proper behavior expected from the swapchain. More precisely, it fixes a few mistakes I had made the last time I touched this code, it implements the frame latency waitable with a semaphore instead of an event (as it should be) and at last it uses the frame latency waitable to implement an appropriate wait after presentation when the client didn't request to manage the waitable directly.
This implementation is not yet complete, because the semaphore should be released when the frame is presented. Knowing when this is the case would require using `VK_KHR_present_wait`. We currently approximate that with the moment in which the frame is submitted for presentation to Vulkan, which as far as I can tell is good enough. Eventually I'll try to write the proper thing.
This MR depends on https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1343, which has been submitted in the meantime to vkd3d. The vkd3d change is included in the first commit, so this MR is already functional.
--
v6: dxgi/tests: Use an explicit frame latency waitable when testing the back buffer index.
dxgi: Wait on the frame latency semaphore when the client doesn't do it.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7152
--
v3: d3d11/tests: Extend NV12 tests.
wined3d: Implement planar NV12 in the Vulkan renderer.
wined3d: Enable KHR_sampler_ycbcr_conversion.
wined3d: Implement planar Vulkan blits.
wined3d: Implement planar Vulkan downloads.
wined3d: Implement planar Vulkan uploads.
wined3d: Separate a wined3d_texture_vk_download_plane() helper.
wined3d: Separate a wined3d_texture_vk_upload_plane() helper.
wined3d: Use a separate format value for d3d10+ NV12.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7378
This MR:
- adds tests for additional subtypes when `MF_MT_USER_DATA` is missing; and
- modifies MFCreateWaveFormatExFromMFMediaType to pass these tests
--
v5: mfplat: Allow MF_MT_USER_DATA to be missing for all subtypes.
mfplat/tests: Add additional MFCreateWaveFormatExFromMFMediaType tests.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7417
This MR adds clipboard support to the winewayland driver.
Under Wayland only applications that have the keyboard focus can interact with the clipboard (a.k.a. `wl_data_device`). Such constraints are not a natural fit for Wine's current clipboard infrastructure, which uses a separate thread and window in the desktop process to act as the win32-side clipboard proxy for all native windows.
This MR tries to work within the current Wine clipboard Wine by forwarding relevant clipboard messages to the foreground window which is likely to have the keyboard focus and that can actually handle them. This works well in practice (although there are some edge cases this fails), but I am open to different ideas about implementing the clipboard integration.
Some notes about the MR:
1. Some formats that require special treatment (e.g., CF_HTML, CF_HDROP) are not implemented in this MR to keep the size reasonable (and also to not distract from the goal of this MR which is to propose/discuss the basic design of clipboard integration).
2. Dynamic registration of newly-seen/unknown formats is not supported at the moment. It's not clear to what degree that's useful, since many (most?) Windows clipboard format strings are free-form and don't use the MIME type standard. But perhaps enough Windows apps know about MIME types nowadays to make this addition worth it?
3. Since access to the Wayland clipboard data is performed from the focused window threads (rather than the dedicated clipboard thread), any blocking while waiting for data to be sent/received has more potential to affect the applications. I have implemented reasonable timeouts which are hopefully enough to make this a non-issue. A (more complex) alternative would be a different design that attempts to offload any potentially blocking work to the dedicated clipboard thread (or is there some kind of async read/write mechanism we can use?). I am not convinced the extra complexity is worth it, though.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7236
Current code requires entering a newline character in order to continue past DIR /P prompts. This change allows any key to be pressed instead.
Code to handle this was similar to existing WCMD_pause() so we leveraged that code for this purpose as well. Key to the fix was the removal of ENABLE_LINE_INPUT from the console flags, and ENABLE_PROCESSED_INPUT was added in order to preserve the ability to abort the operation via Ctrl-C.
--
v24: cmd: Allow any key to continue past DIR /P pauses.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7400
This MR:
- adds tests for additional subtypes when `MF_MT_USER_DATA` is missing; and
- modifies MFCreateWaveFormatExFromMFMediaType to pass these tests
--
v4: mfplat: Allow MF_MT_USER_DATA to be missing for all subtypes.
mfplat/tests: Add additional MFCreateWaveFormatExFromMFMediaType tests.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7417
On Thu Feb 27 18:51:13 2025 +0000, eric pouech wrote:
> the attached patch (on top of what you sent earlier on) should work as expected:
> * the annoying parts: console handles don't support overlapped mode, and
> input console handles are signaled when there's a pending event... but a
> pending event could be mouse move, window resize, ctrl key down & up...
> maybe that's the reason you always check it as signaled
> * so the attached patch waits on both console input handle and control c
> event, but has to discriminate when the console input handle is signaled
> whether there's an actual character or some other things
> * it's still racy at some places, but given the API I don't see a clean
> way to do it
> * [wait-con.patch](/uploads/a537c394d4b98165b791a7979ad3f8ca/wait-con.patch)
Thanks for the patch. Will check it out here.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7400#note_96144
On Thu Feb 27 16:00:21 2025 +0000, Joe Souza wrote:
> I'll answer #2 first:
> Under Windows, Ctrl-C definitely does break out of a DIR /P pause.
> Regarding the second part, I completely agree that the proper way to
> handle this would be to wait on both input and the Ctrl-C event. I have
> tried this. You may recall in an earlier iteration of my changes for a
> prior merge request, I left some code commented out which I then removed
> after you raised issue with it. This code was a call to
> WaitForMultipleObjects, waiting on both the input handle and the Ctrl-C
> event. The problem here which I believe I had stated at the time is
> that with Wine, the input handle is always signaled, even if there is no
> input waiting. The result was that the wait was always being satisfied
> immediately and DIR /P was not pausing at all. So that approach was
> abandoned in favor of what we have now.
> #1:
> This code here is based on the previous code for WCMD_Pause. That code
> was setting console mode flags to 0. I'm guessing that PAUSE has
> operated this way for many years. My changes use the new
> WCMD_wait_for_input for both PAUSE and DIR /P, and I did not want to
> break PAUSE behavior. Further, ENABLE_ECHO_INPUT is on by default, and
> counter to Microsoft's docs for SetConsoleMode, on Wine the character is
> echoed even if ENABLE_LINE_INPUT is disabled. The end result here is
> that DIR /P was echoing the character that the user pressed, whereas
> Windows does not exhibit that behavior.
> All that said, based on shortcomings in Wine that I discuss above, I
> believe that my changes here are currently the best approach.
the attached patch (on top of what you sent earlier on) should work as expected:
* the annoying parts: console handles don't support overlapped mode, and input console handles are signaled when there's a pending event... but a pending event could be mouse move, window resize, ctrl key down & up... maybe that's the reason you always check it as signaled
* so the attached patch waits on both console input handle and control c event, but has to discriminate when the console input handle is signaled whether there's an actual character or some other things
* it's still racy at some places, but given the API I don't see a clean way to do it
* [wait-con.patch](/uploads/a537c394d4b98165b791a7979ad3f8ca/wait-con.patch)
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7400#note_96140
This MR adds clipboard support to the winewayland driver by using the wlr-data-control-unstable-v1 protocol. Note that this protocol was recently merged into wayland-protocols as ext-data-control-v1, but it's not yet widely supported, so I preferred to use the wlr version for now.
This MR has many similarities to https://gitlab.winehq.org/wine/wine/-/merge_requests/7236, but due to the unconstrained nature of wlr-data-control-unstable-v1 the implementation is simpler and more robust. It can neatly fit into the existing Wine clipboard design (single proxy window in the desktop process) without requiring any event forwarding etc.
Since wlr-data-control-unstable-v1/ext-data-control-v1 is considered privileged, it may not be available in all situations, e.g., in sandboxes, and there are also a couple of compositors that may not implement it at all. It is therefore useful to have a simple fallback using the core wl_data_device interface. This fallback is not part of this MR, but I have pushed a WIP implementation based on this MR at: https://gitlab.winehq.org/afrantzis/wine/-/commits/wayland-copy-paste-data-… (note: only the win32 -> wayland direction implemented at the moment). The new fallback approach is different from https://gitlab.winehq.org/wine/wine/-/merge_requests/7236 in that when using wl_data_device it creates per-process clipboard windows instead of forwarding messages from the desktop clipboard window. This allows it to work within the design of this MR with minimal changes and maximum code reuse.
--
v3: winewayland: Normalize received MIME type strings.
winewayland: Support copying data from native clipboard to win32 apps.
winewayland: Support exporting various clipboard formats.
winewayland: Generalize support for exporting clipboard formats.
winewayland: Support copying text from win32 clipboard to native apps.
winewayland: Implement zwlr_data_control_device_v1 initialization.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7336
On Thu Feb 27 10:01:08 2025 +0000, eric pouech wrote:
> 1) concerning the mode for waiting a key,
> * ENABLE_PROCESS_INPUT is already set... default mode is 0x1f7 (so all
> flags except ENABLE_WINDOW_INPUT and ENABLE_VIRTUAL_TERMINAL_PROCESSING)
> * so IMO you just need to clear the ENABLE_LINE_INPUT flag to get key
> press without wating for end of line
> 2) for ctrl-c handling
> * likely the ctrl-c is reported through the ctrl-c handler and it's not
> clear to me if native does break the read operation in this case and
> whether we should wait on both read operation & ctrl-c event
I'll answer #2 first:
Under Windows, Ctrl-C definitely does break out of a DIR /P pause. Regarding the second part, I completely agree that the proper way to handle this would be to wait on both input and the Ctrl-C event. I have tried this. You may recall in an earlier iteration of my changes for a prior merge request, I left some code commented out which I then removed after you raised issue with it. This code was a call to WaitForMultipleObjects, waiting on both the input handle and the Ctrl-C event. The problem here which I believe I had stated at the time is that with Wine, the input handle is always signaled, even if there is no input waiting. The result was that the wait was always being satisfied immediately and DIR /P was not pausing at all. So that approach was abandoned in favor of what we have now.
#1:
This code here is based on the previous code for WCMD_Pause. That code was setting console mode flags to 0. I'm guessing that PAUSE has operated this way for many years. My changes use the new WCMD_wait_for_input for both PAUSE and DIR /P, and I did not want to break PAUSE behavior. Further, ENABLE_ECHO_INPUT is on by default, and counter to Microsoft's docs for SetConsoleMode, on Wine the character is echoed even if ENABLE_LINE_INPUT is disabled. The end result here is that DIR /P was echoing the character that the user pressed, whereas Windows does not exhibit that behavior.
All that said, based on shortcomings in Wine that I discuss above, I believe that my changes here are currently the best approach.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7400#note_96130
This is the refactoring of the tests in !7160. I submit a new seperate MR because I want to get the tests upstreamed first, otherwise making changes to tests patches needs rebasing the implementation patches. So plz review the tests MR first.
--
v2: mfreadwrite/tests: Test sample processing for writer.
mfreadwrite/tests: Test AddStream and SetInputMediaType for writer.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7332
Related Wine issue: https://bugs.winehq.org/show_bug.cgi?id=52714
I'm starting work on updating/extending Linux force feedback API and one of my goals is to expose the number and an array that contains the device's ffb-enabled axes. As I'm mainly working with USB PID driver, I already have a POC of obtaining this data.
What prompted this is that currently Wine always creates virtual joysticks with two PID ffb axes. This causes issues with [Richard Burns Rally](https://github.com/ValveSoftware/Proton/issues/6702#issuecomment-267…, as this game incorrectly initializes a `CONSTANT_FORCE` effect with all the FFB axes that contain `DIDOI_FFACTUATOR` flag and then trying to update `cAxes` and `rgdwAxes` values which leads to `DIERR_INVALIDPARAM`.
Now, this flag is set by wine while enumerating virtual device's axes and while `(axis index < FFB axes)`, flag is applied. This means, that every device which has FFB functionality and at least two axes, will report FFB on `X`, `Y`.
While updated API would mean a lot of steering wheels would correctly report only 1 axis, a lot of USB PID wheels still include `X` and `Y` in their `AXES_ENABLE` and `DIRECTION` usages. This, again, would lead to broken FFB (in affected games).
On Windows, there's a possibility of overwriting some joystick capabilities with registry entries, which ends up removing `DIDOI_FFACTUATOR` flag from a selected axis. This doesn't work in Wine.
This MR allows Wine to add an arbitrary number (up to `PID_AXES_MAX`) of axes to the PID descriptor, based on the value of Haptic Axes from SDL or from Linux FF api in the future (I'm working on it). Additionally, to work around RBR and other games with similar, wrong FFB handling, I introduced a [hint](https://github.com/libsdl-org/SDL/issues/12341) to SDL that allows a dynamic overwrite of the number of haptic axes. For the Linux API, I'll figure out a nice way to override when the number of axes will be exposed.
With these changes, I was able to successfully get force feedback on my Moza Racing R9 with all axes usable. With additional traces in the dinput code, I confirmed that with one axis defined in the PID descriptor, the game created a constant force effect with just one axis and `cAxes = 1`.
--
v5: dinput/tests: Fix the 3-axis joystick descriptor
winebus: Get the number of haptic axes from SDL
winebus: Support creation of arbitrary number of PID axes
https://gitlab.winehq.org/wine/wine/-/merge_requests/7422
Related Wine issue: https://bugs.winehq.org/show_bug.cgi?id=52714
I'm starting work on updating/extending Linux force feedback API and one of my goals is to expose the number and an array that contains the device's ffb-enabled axes. As I'm mainly working with USB PID driver, I already have a POC of obtaining this data.
What prompted this is that currently Wine always creates virtual joysticks with two PID ffb axes. This causes issues with [Richard Burns Rally](https://github.com/ValveSoftware/Proton/issues/6702#issuecomment-267…, as this game incorrectly initializes a `CONSTANT_FORCE` effect with all the FFB axes that contain `DIDOI_FFACTUATOR` flag and then trying to update `cAxes` and `rgdwAxes` values which leads to `DIERR_INVALIDPARAM`.
Now, this flag is set by wine while enumerating virtual device's axes and while `(axis index < FFB axes)`, flag is applied. This means, that every device which has FFB functionality and at least two axes, will report FFB on `X`, `Y`.
While updated API would mean a lot of steering wheels would correctly report only 1 axis, a lot of USB PID wheels still include `X` and `Y` in their `AXES_ENABLE` and `DIRECTION` usages. This, again, would lead to broken FFB (in affected games).
On Windows, there's a possibility of overwriting some joystick capabilities with registry entries, which ends up removing `DIDOI_FFACTUATOR` flag from a selected axis. This doesn't work in Wine.
This MR allows Wine to add an arbitrary number (up to `PID_AXES_MAX`) of axes to the PID descriptor, based on the value of Haptic Axes from SDL or from Linux FF api in the future (I'm working on it). Additionally, to work around RBR and other games with similar, wrong FFB handling, I introduced a [hint](https://github.com/libsdl-org/SDL/issues/12341) to SDL that allows a dynamic overwrite of the number of haptic axes. For the Linux API, I'll figure out a nice way to override when the number of axes will be exposed.
With these changes, I was able to successfully get force feedback on my Moza Racing R9 with all axes usable. With additional traces in the dinput code, I confirmed that with one axis defined in the PID descriptor, the game created a constant force effect with just one axis and `cAxes = 1`.
--
v4: dinput/tests: Fix the 3-axis joystick descriptor
winebus: Get the number of haptic axes from SDL
winebus: Support creation of arbitrary number of PID axes
https://gitlab.winehq.org/wine/wine/-/merge_requests/7422
--
v5: d3dx9: Link versions 42 and 43 to the corresponding d3dcompiler DLL.
d3dx9: Reimplement D3DXCompileShader() for versions before 42.
d3dcompiler: Use D3DCompile2VKD3D() from vkd3d-utils.
d3dcompiler: Use D3DPreprocess() from vkd3d-utils.
vkd3d: Import vkd3d-utils.
d3dx9/tests: Test implicit truncation warnings.
d3dx9/tests: Define D3DX_SDK_VERSION=36 for d3dx9_36.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5814
On Thu Feb 27 10:01:08 2025 +0000, Joe Souza wrote:
> OK, latest change should fix it. Key was adding ENABLE_PROCESSED_INPUT
> in the call to SetConsoleMode. However, although this now allows Ctrl-C
> to break out of dir /p prompts, the user is still required to press a
> key to exit. This seems like a bug in wine to me. I haven't tried
> similar code on Windows and I don't have time to investigate further at
> the moment.
1) concerning the mode for waiting a key,
* ENABLE_PROCESS_INPUT is already set... default mode is 0x1f7 (so all flags except ENABLE_WINDOW_INPUT and ENABLE_VIRTUAL_TERMINAL_PROCESSING)
* so IMO you just need to clear the ENABLE_LINE_INPUT flag to get key press without wating for end of line
2) for ctrl-c handling
* likely the ctrl-c is reported through the ctrl-c handler and it's not clear to me if native does break the read operation in this case and whether we should wait on both read operation & ctrl-c event
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7400#note_96106
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 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. If run under older versions of Windows the test suite will detect that this functionality is not supported, and will not run the updated tests.
--
v14: ntdll.dll: Update NtQueryDirectoryFile to align with current Windows behaviour
ntdll: Test updated NtQueryDirectoryFile mask reset behaviour
https://gitlab.winehq.org/wine/wine/-/merge_requests/6904