This is the continuation of https://gitlab.winehq.org/wine/wine/-/merge_requests/7317.
There are a lot of smaller commits (some even no-op renames), because there are some inconsistencies in the codebase currently of what an NT thread priority vs a base thread priority should be and I hope that this clears that up a bit.
I tried making the commits as atomic as possible I hope this is fine... There are still a few tiny details missing like fixing up the `list_processes` request and `KeSetPriorityThread` and friends which are either stubs or not correctly working as well.
There are also probably a few tests that can be written here (after thread priority boosting has been disabled, cause that makes the behavior on windows very flaky and dynamic). In fact on windows there is some thread priority boost decay going on after the message has been processed (and probably other boosting mechanisms), which this MR does not properly capture, but are also probably not reasonable to implement.
This also reverts the commits of https://gitlab.winehq.org/wine/wine/-/merge_requests/1232, which are being effectively overwritten anyways.
The `get_thread_priority_info` request was added, because the reply in `get_thread_info` would be otherwise larger than 64 bytes, so it had to be split.
--
v4: ntdll/tests: Add tests for process and thread priority.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7516
This is the continuation of https://gitlab.winehq.org/wine/wine/-/merge_requests/7317.
There are a lot of smaller commits (some even no-op renames), because there are some inconsistencies in the codebase currently of what an NT thread priority vs a base thread priority should be and I hope that this clears that up a bit.
I tried making the commits as atomic as possible I hope this is fine... There are still a few tiny details missing like fixing up the `list_processes` request and `KeSetPriorityThread` and friends which are either stubs or not correctly working as well.
There are also probably a few tests that can be written here (after thread priority boosting has been disabled, cause that makes the behavior on windows very flaky and dynamic). In fact on windows there is some thread priority boost decay going on after the message has been processed (and probably other boosting mechanisms), which this MR does not properly capture, but are also probably not reasonable to implement.
This also reverts the commits of https://gitlab.winehq.org/wine/wine/-/merge_requests/1232, which are being effectively overwritten anyways.
The `get_thread_priority_info` request was added, because the reply in `get_thread_info` would be otherwise larger than 64 bytes, so it had to be split.
--
v3: ntdll/tests: Add tests for process and thread priority.
server, ntdll: Fetch both process priority and base_priority.
server: Add process base priority helper.
kernelbase: Use ProcessPriorityClass info class in GetPriorityClass.
kernelbase: Use correct priority in GetThreadPriority.
server, ntdll: Fetch both thread priority and base_priority.
server, ntdll: Move last thread information to get_thread_info flags.
ntdll: Implement ThreadPriority class in NtSetInformationThread.
server: Implement setting thread priority directly.
server: Add set_thread_priority helper.
server: Rename thread priority to base_priority.
server: Rename base_priority to effective_priority in apply_thread_priority.
server: Infer process priority class in set_thread_priority.
include: Use correct PROCESS_PRIORITY_CLASS_* names.
include: Add thread priority constants.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7516
This MR adds support for creating file mapping objects backed by large pages on Linux, by making the following changes:
## wineserver
* On Linux, `create_temp_file` will first attempt to use memfds as the backing fd. If it fails, it'll return to the current codepath, creating a temporary file in either the server or config directory.
* The created memfd will be sealed against writes, if the caller requesting the appropriate page protection flags.
* This removes the requirement that FDs be only created on filesystems/directories that aren't `noexec`.
* In the server method `create_mapping` , if large pages have been requested by the caller, hold that the calling thread's token holds `SeLockMemoryPrivilege` .
* Additionally, add `SeLockMemoryPrivilege` to the list of privileges enabled for the Administrator.
## `ntdll`
* Add `virtual_get_min_large_page_size` and its exported wrapper `wine_unix_get_min_large_page_size`.
* On Linux, the minimum page size is determined by going through `/sys/kernel/mm/hugepages`. If hugepage support was not detected, `STATUS_NOT_SUPPORTED` is returned instead. On other platforms, the older hard-coded value of 2\*1024\*1024 is returned instead.
* `NtCreateSection` will validate certain parameters if large pages are requested. Specifically, it will return STATUS_INVALID_PARAMETER if the requested mapping is not anonymous/unnamed, or the size is not a multiple of the minimum supported page size.
## `kernelbase`
* `GetLargePageMinimum` will use `wine_unix_get_min_large_page_size`.
## `kernel32/tests`
* Add new test test_large_page_file_mapping, which validates privilege enforcements and parameter validation while creating large pages backed file mapping obejcts. The tests are skipped if `GetLargePageMinimum` returns 0.
--
v36: advapi32: Fake the SeLockMemoryPrivilege right in LsaEnumerateAccountRights.
psapi: Add tests for querying information for large pages.
ntdll: Use PAGEMAP_SCAN ioctl to implement get_working_set_ex, if available.
kernel32: Add tests for large pages support.
ntdll: Support allocating virtual memory, creating and mapping files backed by large/huge pages.
server: Use memfd to back anonymous mappings on Linux.
kernelbase: Implement GetLargePageMinimum by returning the value of LargePageMinimum in _KUSER_SHARED_DATA.
server: Set LargePageMinimum in _KUSER_SHARED_DATA on Linux.
server: Require SeLockMemoryPrivilege to create large page mappings.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5769
Track the xdg state we have requested from the compositor and take
it into account when sending xdg state update requests.
This fixes a race which would cause us to miss a state update if
we haven't yet processed the compositor's configure reply to a
previous state request. For example:
0. Initial state: win32 fullscreen, xdg fullscreen
1. Window becomes windowed, we send xdg unset_fullscreen request
2. Window becomes fullscreen, before compositor's xdg "not fullscreen"
reply arrives, so we still consider the current xdg state to be
fullscreen and thus do not request an xdg fullscreen state
3. Compositor xdg configure "not fullscreen" arrives
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7525
This is the continuation of https://gitlab.winehq.org/wine/wine/-/merge_requests/7317.
There are a lot of smaller commits (some even no-op renames), because there are some inconsistencies in the codebase currently of what an NT thread priority vs a base thread priority should be and I hope that this clears that up a bit.
I tried making the commits as atomic as possible I hope this is fine... There are still a few tiny details missing like fixing up the `list_processes` request and `KeSetPriorityThread` and friends which are either stubs or not correctly working as well.
There are also probably a few tests that can be written here (after thread priority boosting has been disabled, cause that makes the behavior on windows very flaky and dynamic). In fact on windows there is some thread priority boost decay going on after the message has been processed (and probably other boosting mechanisms), which this MR does not properly capture, but are also probably not reasonable to implement.
This also reverts the commits of https://gitlab.winehq.org/wine/wine/-/merge_requests/1232, which are being effectively overwritten anyways.
The `get_thread_priority_info` request was added, because the reply in `get_thread_info` would be otherwise larger than 64 bytes, so it had to be split.
--
v2: Revert "ntdll: Set the QoS class of the main Wine thread on macOS."
Revert "ntdll: Fix runtime availability check for pthread_attr_set_qos_class_np."
This merge request has too many patches to be relayed via email.
Please visit the URL below to see the contents of the merge request.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7516
This WIP branch prototypes the usage of virtual display devices (through "virtual desktop" mode at the moment) to support display mode emulation in the Wayland driver.
It works by allowing the driver to mark each host adapter with a virtual_id, which, if present, signals to win32u that it should include the adapter in the virtual display configuration. The virtual configuration (along with the virtual ids) is reported back to the driver though a new user driver function. If none of the host adapters is marked with a virtual id (i.e., all other drivers) we fall back to the single virtual display mode as before.
Some deficiencies and open questions with the prototype:
1. Virtual desktop mode implies a lot of behavior that we don't want at this point the Wayland driver (e.g., taskbar window, changing the display mode to the virtual desktop resolution at startup, some changes in fsclip behavior). One way forward would be to have a "virtual display devices" mode separate from the "virtual desktop" mode, so that drivers can opt in only to the desired behavior (virtual desktop would imply virtual devices, to maintain the current behavior).
2. It's not clear to me what would be the best way for a driver to opt in or out of certain core behavior. Perhaps the driver would change some volatile registry key which other components would consult? Or introduce a user driver function for core to query the driver about such features on demand? Is there some precedence I can get inspiration from?
3. At the moment, the prototype calls the new "NotifyVirtualDevices" user driver callback only in the process which the display update occurred. This means that other processes don't get notified of the virtual devices mapping to host devices, so, in the Wayland driver case, we are not able to scale windows from those processes properly. One approach would be for core to ensure that the NotifyVirtualDevices callback is called once in all processes, but I am not sure what's the best way to achieve this (or even if this is the preferred approach). Another way would be to have a mechanism for the driver to query the virtual device info (+mappings) on demand, and just broadcast a message to all windows. In this case it could even be done internally by the driver (so more in line with what the part-12 MR is doing), if we don't want to introduce a more global behavior. Perhaps there is some even better mechanism, which would also be more fitting to how we envision the virtual display/devic
es to evolve going forward.
Let me know what you think!
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5057
This MR adds the IMFTransform interface to the mp3dmod module so that it can be used as an MFT.
It also calls `MFTRegister` (so the MFT can be found via `MFTEnum`) and also registers a byte stream handler for the mp3 format.
--
v2: mfsrcsnk: Register the MP3 Byte Stream Handler class.
mp3dmod: Implement an IMFTransform interface.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7493
This is an adjustment of 7324.
d3d9:visual already has a test that's relatively close to what a simplified
version of the tests in 7324 looked like, so I made the few changes to expand
that test to match and then ported it to ddraw.
Implementation-wise, this removes the SD/HD difference (which only exists on
NVidia and is not necessary to improve the mentioned application).
It also removes the clamping of YUV values, which as the tests show is not
correct.
--
v2: wined3d: Interpret Y'CbCr values as being from the reduced range.
ddraw/tests: Port yuv_layout_test() from d3d9.
d3d9/tests: Expand the YUV blit tests a bit.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7416
It seems like a good thing to avoid changing the process working directory, and the *at() functions are available on all recent OSes (macOS being the laggard, didn't add them until 10.10). I'm planning to do this elsewhere in `ntdll/unix/file.c` as well.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7519
Also introduce the header `ws2bth.h` alongside the necessary constants for `AF_BTH` addresses in `ws2def.h`.
--
v2: ws2_32/tests: Add tests for Bluetooth addresses for WSAStringToAddress().
ws2_32: Implement WSAAddressToString() for Bluetooth (AF_BTH) addresses.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7504
This is the continuation of https://gitlab.winehq.org/wine/wine/-/merge_requests/7317.
There are a lot of smaller commits (some even no-op renames), because there are some inconsistencies in the codebase currently of what an NT thread priority vs a base thread priority should be and I hope that this clears that up a bit.
I tried making the commits as atomic as possible I hope this is fine... There are still a few tiny details missing like fixing up the `list_processes` request and `KeSetPriorityThread` and friends which are either stubs or not correctly working as well.
There are also probably a few tests that can be written here (after thread priority boosting has been disabled, cause that makes the behavior on windows very flaky and dynamic). In fact on windows there is some thread priority boost decay going on after the message has been processed (and probably other boosting mechanisms), which this MR does not properly capture, but are also probably not reasonable to implement.
This also reverts the commits of https://gitlab.winehq.org/wine/wine/-/merge_requests/1232, which are being effectively overwritten anyways.
The `get_thread_priority_info` request was added, because the reply in `get_thread_info` would be otherwise larger than 64 bytes, so it had to be split.
--
This merge request has too many patches to be relayed via email.
Please visit the URL below to see the contents of the merge request.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7516
I add 5 tests to test_http_connection().
The first test sends "Expires: 0", the second test sends "Expires: -1", the third test sends "Expires: 100", the fourth test sends "Expires: invalid date", the fifth test sends "Expires: Thu, 06 Mar 2025 06:08:11 GMT".
The tests on actual windows 10 has output informations, such as:
```null
http.c:6837: expires: 2025-03-06 06:14:13, current time: 2025-03-06 06:14:13, server response expires: 0
http.c:6837: expires: 2025-03-06 06:14:14, current time: 2025-03-06 06:14:14, server response expires: -1
http.c:6837: expires: 2025-03-06 06:14:14, current time: 2025-03-06 06:14:14, server response expires: 100
http.c:6837: expires: 2025-03-06 05:14:15, current time: 2025-03-06 06:14:15, server response expires: invalid date
http.c:6837: expires: 2025-03-06 06:08:11, current time: 2025-03-06 06:14:15, server response expires: Thu, 06 Mar 2025 06:08:11 GMT
```
I think Windows treats all numbers as invalid values and sets the expiration time to the current system time, while other invalid values set the expiration time to one hour before the current system time, and valid expiration times use the set expiration time.
In Wine, handling inconsistencies with Windows 10, We treat "0" as "1601-01-01 00:00:00", and all other invalid values as 10 minutes after the current system time. such as
```coffeescript
http.c:6837: expires: 1601-01-01 00:00:00, current time: 2025-03-06 06:10:56, server response expires: 0
0118:err:wininet:HTTP_ParseDateAsAsctime unexpected weekday L"-1"
0118:err:wininet:HTTP_ParseDate unexpected date format L"-1"
http.c:6837: expires: 2025-03-06 06:20:56, current time: 2025-03-06 06:10:57, server response expires: -1
0110:err:wininet:HTTP_ParseDateAsAsctime unexpected weekday L"100"
0110:err:wininet:HTTP_ParseDate unexpected date format L"100"
http.c:6837: expires: 2025-03-06 06:20:56, current time: 2025-03-06 06:10:57, server response expires: 100
0118:err:wininet:HTTP_ParseDateAsAsctime unexpected weekday L"inv"
0118:err:wininet:HTTP_ParseDate unexpected date format L"invalid date"
http.c:6837: expires: 2025-03-06 06:20:56, current time: 2025-03-06 06:10:58, server response expires: invalid date
http.c:6837: expires: 2025-03-06 06:08:10, current time: 2025-03-06 06:10:58, server response expires: Thu, 06 Mar 2025 06:08:11 GMT
```
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7323#note_96954
In my last ASan run below report showed up.
Maybe manifests also as crashes in https://test.winehq.org/data/patterns.html#setupapi:diskspace
Contains also a little patch reversing the message in two `ok` statements.
```
=================================================================
==setupapi_test.exe==3900==ERROR: AddressSanitizer: attempting free on address which was not malloc()-ed: 0xbebebebe in thread T0
#0 0x7a102bdb in free /home/runner/work/llvm-mingw/llvm-mingw/llvm-project/compiler-rt\lib/asan/asan_malloc_win.cpp:71:3
#1 0x78a6311c in SetupDestroyDiskSpaceList .../wine/dlls/setupapi/diskspace.c:246:5
#2 0x0042572a in test_SetupDuplicateDiskSpaceListA .../wine/dlls/setupapi/tests/diskspace.c:216:8
#3 0x00424ab1 in func_diskspace .../wine/dlls/setupapi/tests/diskspace.c:765:5
#4 0x0044f493 in run_test .../wine/include/wine/test.h:765:5
#5 0x0044f035 in main .../wine/include/wine/test.h:884:12
#6 0x004506de in mainCRTStartup .../wine/dlls/msvcrt/crt_main.c:58:11
#7 0x7bcc0f0f in BaseThreadInitThunk (C:\windows\system32\kernel32.dll+0x7b820f0f)
#8 0x7be31dc2 in call_thread_func_wrapper (C:\windows\system32\ntdll.dll+0x7bc41dc2)
#9 0x7be326c9 in call_thread_func .../wine/dlls/ntdll/signal_i386.c:524:9
Address 0xbebebebe is a wild pointer inside of access range of size 0x00000001.
SUMMARY: AddressSanitizer: bad-free .../wine/dlls/setupapi/diskspace.c:246:5 in SetupDestroyDiskSpaceList
```
Testbot run with this two patches: https://testbot.winehq.org/JobDetails.pl?Key=151644
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7501
--
v2: wined3d: Create a Vulkan video session backing the wined3d_decoder_vk.
wined3d: Look for a video decode queue.
d3d11: Create a wined3d_decoder object backing the d3d11 decoder object.
wined3d: Introduce a Vulkan decoder backend.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7480
Many applications request and use GL configs with alpha, but assume that
the windowing system will present their surfaces opaquely. Wayland
compositors normally respect the alpha channel, which leads to unwanted
translucency effects for such applications, so we use the
EGL_EXT_present_opaque extension to avoid this.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57800
--
Note that this has been a known issue since the initial GL support in winewayland (see description of https://gitlab.winehq.org/wine/wine/-/merge_requests/5264). At that point I didn't enable the opaque attribute because there was a bug in Mesa that could cause a crash for some 16bpp formats. I fixed the bug in https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28153, and the fix got released in 24.2.0 (Aug 2024). This Mesa version (or newer) is now either part of the latest version of most major distributions or available through official updates/backports (from what I see OpenSUSE Leap is a notable exception), so I now feel more comfortable enabling the attribute by default. Some users using older Mesa versions may be affected, but I think most people trying out the latest Wine 10.x will already be (or can move to) to newer Mesa versions anyway.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7500
These defines were only introduced to GStreamer in version 1.20; thus
compiling against earlier versions causes a compilation error.
This commit replaces the defines with their respective expansions.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7492
--
v3: include: Fix wmemchr C++ warning.
include: Fix InlineIsEqualGUID C++ warning.
include: Add some _BitScanForward(64) declarations in intrin.h.
include: Add a __shiftright128 intrinsic definition.
include: Add a _umul128 intrinsic definition.
include: Move FILE_DISPOSITION_INFO after DeleteFile(A|W).
include: Add a MB_CUR_MAX definition in ctype.h.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6752
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.
--
v36: cmd: Allow any key to continue past DIR /P pauses.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7400
This MR adds the IMFTransform interface to the mp3dmod module so that it can be used as an MFT.
It also calls `MFTRegister` (so the MFT can be found via `MFTEnum`) and also registers a byte stream handler for the mp3 format.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7493
On Wed Mar 5 01:20:21 2025 +0000, Brendan McGrath wrote:
> I was able to resolve this by copying the defines to our code (and
> declaring them if GStreamer version is < 1.20):
> [winegstreamer.patch](/uploads/caf23dfb5e167f828b2709b17eb519fb/winegstreamer.patch)
> I'm not sure that's the way we want to go; but I'll raise an MR with
> that (and I'll close it if there's a better option).
I've raised MR !7492. In the end I decided expansion was the better option.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7288#note_96829
Fix the issue where some installers refuse to launch,
due to `SHGetKnownFolderPath()` failing when called with
`FOLDERID_UserProgramFiles`.
--
v2: shell32/tests: add tests to get path of FOLDERID_USerProgramFiles
shell32: mark FOLDERID_UserProgramFiles as CSIDL_Type_User
https://gitlab.winehq.org/wine/wine/-/merge_requests/7490
On Wed Mar 5 01:20:21 2025 +0000, Brendan McGrath wrote:
> I just tried to build this in a container running debian bullseye and
> got the following error:
> ```
> ../../dlls/winegstreamer/wg_transform.c:68:50: error: expected ')'
> before string constant
> 68 | GST_ELEMENT_REGISTER_DEFINE(winegstreamerstepper,
> "winegstreamerstepper", GST_RANK_NONE, GST_TYPE_WG_STEPPER);
> | ^~~~~~~~~~~~~~~~~~~~~~~
> | )
> ```
> I _think_ that's because bullseye is running gstreamer version 1.18,
> whilst the documentation suggests `GST_ELEMENT_REGISTER_DEFINE` was
> added version 1.20.
> I think we'll need to address this as I _think_ Crossover is built
> against bullseye.
I was able to resolve this by copying the defines to our code (and declaring them if GStreamer version is < 1.20):
[winegstreamer.patch](/uploads/caf23dfb5e167f828b2709b17eb519fb/winegstreamer.patch)
I'm not sure that's the way we want to go; but I'll raise an MR with that (and I'll close it if there's a better option).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7288#note_96820
I just tried to build this in a container running debian bullseye and got the following error:
```
../../dlls/winegstreamer/wg_transform.c:68:50: error: expected ')' before string constant
68 | GST_ELEMENT_REGISTER_DEFINE(winegstreamerstepper, "winegstreamerstepper", GST_RANK_NONE, GST_TYPE_WG_STEPPER);
| ^~~~~~~~~~~~~~~~~~~~~~~
| )
```
I _think_ that's because bullseye is running gstreamer version 1.18, whilst the documentation suggests `GST_ELEMENT_REGISTER_DEFINE` was added version 1.20.
I think we'll need to address this as I _think_ Crossover is built against bullseye.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7288#note_96816
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
--
v5: 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
--
v6: bluetoothapis/tests: Add tests for BluetoothFindNextDevice.
bluetoothapis: Implement BluetoothFindNextDevice.
bluetoothapis/tests: Add tests for BluetoothFindFirstDevice, BluetoothFindDeviceClose.
bluetoothapis: Implement BluetoothFindFirstDevice and BluetoothFindDeviceClose.
winebth.sys: Implement IOCTL_WINEBTH_RADIO_STOP_DISCOVERY.
winebth.sys: Implement IOCTL_WINEBTH_RADIO_START_DISCOVERY.
winebth.sys: Remove the first 2 zero bytes after byte-swapping Bluetooth addresses.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7472