This is the current proton thread priority implementation by @rbernon rebased for upstream with a few `#ifdef`s added since AFAIK Linux is the only operating system where threads have a unique PID which can be used to set niceness on.
~~I also ran `./tools/make_requests` on https://gitlab.winehq.org/mzent/wine/-/commit/6705d3481be0409f7e971c1d2c7a3… as well and `autoconf` on https://gitlab.winehq.org/mzent/wine/-/commit/d7bafe40c411753662b2ad97148a6… (which does blow up the line count a bit).~~
A few tiny changes ~~(with the ready variable for example)~~ are in anticipation for Part 2, which also adds Mach thread priorities and recalculates thread priorities on process priority change.
Since this is a rather large MR, I hope the split here is appropriate ~~(with the second part being slightly smaller)~~, but I think logically it makes the most sense here.
--
v15: server: Check wineserver privileges on init with -20 niceness.
server: Use setpriority to update thread niceness when safe.
ntdll: Set RLIMIT_NICE to its hard limit.
server: Introduce new set_thread_priority helper.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4551
This MR extends the `wgl_pixel_format` struct with extra fields required to implement `wglGetPixelFormatAttribivARB` in opengl32.dll. I have added only fields that are relevant to the current needs of the drivers. The default implementation will be used automatically if the driver populates the extra fields, which this MR does for the winex11 driver.
The new winex11 implementation tries to remain faithful to the previous behavior in terms of error handling and fallbacks. To achieve this the `wgl_pixel_format` extra fields can be marked as invalid in order for the default implementation to return errors accordingly. Note, however, that error handling around `glXGetFBConfigAttrib` is not very consistent (e.g., the parts of `describe_pixel_format` dealing with PIXELFORMATDESCRIPTOR generally disregard errors).
The MR also adds a default implementation for `wglGetPixelFormatAttribfvARB` which piggy-backs on the integer variant of this function, and removes the need for the corresponding code in the drivers. Note that we could potentially remove this function completely from `struct opengl_funcs` (i.e., place it in `manual_win_functions` in `make_opengl`), but it seems the pattern is to maintain a complete list of extension functions (and wined3d also populates the field internally, although it doesn't seem to do anything with it).
Finally, the `winex11.drv/opengl.c` file contains a mix of coding styles. I chose to be consistent with the style of the closest context (e.g., the function) I was making changes/additions in.
--
v3: winex11: Use default wglGetPixelFormatAttribivARB implementation.
winex11: Pass wgl_pixel_format to describe_pixel_format.
winex11: Update describe_pixel_format coding style.
opengl32: Add default implementation for wglGetPixelFormatAttribfvARB.
opengl32: Add default implementation for wglGetPixelFormatAttribivARB.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5844
This is in preparation for the mach thread id rework, which requires 64 bit there (and incidentally also stops truncating the FreeBSD one).
There wasn't any direct usage of `__int64` in the sever protocol before, so I added a new typedef and a new `dump_int64()` function (not sure if needed per se though).
--
v7: ntdll: Remove unneeded FreeBSD codepath in get_unix_tid().
server, ntdll: Use 64 bit for unix thread id.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5047
The last commit fixes glitches in Horizon Zero Dawn with vsync on, for reasons stated in the comment there.
The wined3d implementation already blocks the client's call to `Present()` when `vkAcquireNextImageKHR()` blocks, so is roughly equivalent to this when frame latency and buffer count are equal. It has a frame latency implementation which unblocks after calling `vkQueuePresentKHR()`, rather than waiting for its execution to complete. I think the d3d12 implementation is supposed to do the latter, though using `KHR_present_wait` may be unnecessary overkill. Waiting on queue execution comes with a performance cost either way, so without a compelling reason for a strict implementation, something similar to wined3d makes sense.
Another potential issue is after the call to `ID3D12CommandQueue_Signal()` in `d3d12_swapchain_present()`, the client is free to enqueue more commands when `Present()` returns, so by the time the signal is executed and the swapchain worker blits the image and calls `vkQueuePresentKHR()`, these commands are not necessarily enqueued immediately after the `Signal()`. This may not always be harmless.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5830
More details here: https://devblogs.microsoft.com/oldnewthing/20181206-00/?p=100415
However it does not mention that `PAGE_NOACCESS` and `PAGE_READONLY` still result in an error on Windows, which is properly implemented in this MR.
Only `WriteProcessMemory` offers this "service", `NtWriteVirtualMemory` will fail on non-writeable and executable regions (and already does so, except for the the mach server backend, which needs https://gitlab.winehq.org/wine/wine/-/merge_requests/4826 to also behave correctly here).
--
v4: kernelbase: Flush instruction cache in WriteProcessMemory.
kernelbase: Allow WriteProcessMemory to succeed on PAGE_EXECUTE and PAGE_EXECUTE_READ.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5222
For all mach vm operations this removes the task suspend and resume, which are not needed.
This uses `mach_vm_read_overwrite` to read into a caller-specified buffer, saving the `mach_vm_deallocate` call (bringing all read operations down to 1 syscall from 4).
The only alignment restriction on `mach_vm_write` according to the original CMU documentation is that data is
> [pointer to page aligned in array of bytes] An array of data to be written.
(In practice it also works with arbitrary addresses on macOS, but it probably doesn't hurt to follow the original specifications here).
The only other reference that these read/writes should be page-aligned is from the GNU Hurd documentation
> The current implementation requires that address, data and data_count all be page-aligned. Otherwise, KERN_INVALID_ARGUMENT is returned.
which I assume was the reason why this was originally done (plus it sounds to me like they will fix that in the future and 4fe19777 already broke GNU Hurd support anyways, if that was supposed to be working).
Also this includes the missing mach part of 5b1f3b14, which was only applied to the ptrace backend, and together with the `write_process_memory` rework, this gets rid of all fixmes in mach.c
--
v4: server: Simplify mach write_process_memory.
server: Use mach_vm_read_overwrite in get_selector_entry.
server: Use mach_vm_read_overwrite in read_process_memory.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4826
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56769
--
v4: quartz/tests: Test that avi_decompressor_source_qc_Notify does not deadlock if called from a foreign thread during IMemInput_Receive.
quartz: Allow concurrent calls to AVI decoder qc_Notify and Receive.
msvfw32/tests: Test that Cinepak rejects unsupported output types.
iccvid: Reject unsupported output types.
quartz/tests: Add Cinepak test to avi splitter.
winegstreamer: Make AVI splitter use end of previous frame if the current frame doesn't have a timestamp.
winegstreamer: Implement AM_MEDIA_TYPE to wg_format converter for Cinepak video.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5846
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56698
--
v8: quartz/tests: Test that avi_decompressor_source_qc_Notify does not deadlock if called from a foreign thread during IMemInput_Receive.
quartz: Allow concurrent calls to AVI decoder qc_Notify and Receive.
msvfw32/tests: Test that Cinepak rejects unsupported output types.
iccvid: Reject unsupported output types.
quartz/tests: Add Cinepak test to avi splitter.
winegstreamer: Make AVI splitter use end of previous frame if the current frame doesn't have a timestamp.
winegstreamer: Implement AM_MEDIA_TYPE to wg_format converter for Cinepak video.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5744
Rémi Bernon (@rbernon) commented about dlls/winegstreamer/wg_transform.c:
> - {
> - gst_caps_unref(parsed_caps);
> - parsed_caps = gst_caps_ref(src_caps);
> - }
> -
> - if (!(element = find_element(GST_ELEMENT_FACTORY_TYPE_DECODER, parsed_caps, sink_caps))
> - || !append_element(transform->container, element, &first, &last))
> - goto out;
> - break;
> -
> - case WG_MAJOR_TYPE_AUDIO:
> - case WG_MAJOR_TYPE_VIDEO:
> - break;
> - case WG_MAJOR_TYPE_UNKNOWN:
> - GST_FIXME("Format %u not implemented!", input_format.major_type);
> + if (!transform_create_transcoder(transform, src_caps, &input_format, &first, &last))
Can we add an encoder element without changing all this code? It doesn't look like you need all the complicated converter sequence, maybe only a videoconvert (do you even need one?).
I don't want to be a blocker but to be honest I'm a bit annoyed with the idea of having to rewrite the patches I am trying to upstream with transform media types.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5879#note_73696
LLVM 17 or 18 no longer allow non-private labels to appear between
.cfi_startproc/endproc when targeting Mach-O.
Similar fixes as in commit 295d521b11644fb76c36854336b13c2155bb7d79.
Since this is needed for 2 out of 4 architectures, would it be better to do it for all 4 and then modify the shared `__wine_syscall_dispatcher_return()` prototype?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5871
On Tue Jun 18 16:34:50 2024 +0000, Emil Velikov wrote:
> Does the wine (pre)loader unload things on `exit()` or perhaps the
> dependency on ntdll.so and(?) win32u.so, makes that impossible?
> Either way, as you said there are bigger concerns than this one dlhandle.
Well for instance the user driver is never unloaded, and it links and uses symbols from win32u directly, so neither of them will be unloaded.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5835#note_73682
Adds the registry key
HKEY_CURRENT_USER\\Software\\Wine\\Wayland Driver\\rawinput
witch allows mouse raw input. This makes it easier
to calculate the same sensitivity in different games,
use sensitivity calculators, and easily change values
when changing mouse DPI and do not depend on the compositor or OS.
For example, you want to set the sensitivity to half as much,
but sensitivity curves in libinput are more difficult
to calculate than mouse sensitivity in the games.
Implementation of ideas written in the comments: https://gitlab.winehq.org/wine/wine/-/merge_requests/4698
--
v4: winewayland.drv: Add mouse rawinput support
server: Add send_hardware_message flags for rawinput translation.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5869
This MR extends the `wgl_pixel_format` struct with extra fields required to implement `wglGetPixelFormatAttribivARB` in opengl32.dll. I have added only fields that are relevant to the current needs of the drivers. The default implementation will be used automatically if the driver populates the extra fields, which this MR does for the winex11 driver.
The new winex11 implementation tries to remain faithful to the previous behavior in terms of error handling and fallbacks. To achieve this the `wgl_pixel_format` extra fields can be marked as invalid in order for the default implementation to return errors accordingly. Note, however, that error handling around `glXGetFBConfigAttrib` is not very consistent (e.g., the parts of `describe_pixel_format` dealing with PIXELFORMATDESCRIPTOR generally disregard errors).
The MR also adds a default implementation for `wglGetPixelFormatAttribfvARB` which piggy-backs on the integer variant of this function, and removes the need for the corresponding code in the drivers. Note that we could potentially remove this function completely from `struct opengl_funcs` (i.e., place it in `manual_win_functions` in `make_opengl`), but it seems the pattern is to maintain a complete list of extension functions (and wined3d also populates the field internally, although it doesn't seem to do anything with it).
Finally, the `winex11.drv/opengl.c` file contains a mix of coding styles. I chose to be consistent with the style of the closest context (e.g., the function) I was making changes/additions in.
--
v2: winex11: Use default wglGetPixelFormatAttribivARB implementation.
winex11: Pass wgl_pixel_format to describe_pixel_format.
winex11: Update describe_pixel_format coding style.
opengl32: Add default implementation for wglGetPixelFormatAttribfvARB.
opengl32: Add default implementation for wglGetPixelFormatAttribivARB.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5844
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.
--
v23: ntdll: Use PAGEMAP_SCAN to implement get_working_set_ex, if available.
kernel32: Add tests for large page mapping support.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5769
On Fri Jun 7 14:39:29 2024 +0000, Gabriel Ivăncescu wrote:
> I see, if you look at it that way it makes sense to use IID, yeah (I was
> thinking of the functions as complete separate entities rather than
> interface implementations).
> I still think it's slightly better to just pass/store func_info_t as a
> container though—it's not just the args but everywhere else we need to
> store it (like in ProxyFunction as I mentioned), now it's one less field
> to worry about. And besides, if we ever do need to change it at some
> point later, it will be much easier without affecting call sites.
Current func info is more than (id,iid) carrier, it would only make things more confusing to reuse it as an opaque with constrains like that. We could introduce a new struct, if needed.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5444#note_73651
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.
--
v22: ntdll: Use PAGEMAP_SCAN to implement get_working_set_ex, if available.
kernel32: Add tests for large page mapping support.
ntdll: Support creating and mapping files backed by large pages (SEC_LARGE_PAGES).
https://gitlab.winehq.org/wine/wine/-/merge_requests/5769
Since `EVENT_SYSTEM_MINIMIZESTART` and `EVENT_SYSTEM_MINIMIZEEND` are implemented now (thanks to Esme), this is implementing visibility change events using them. We have to keep track of the browsers to iterate all the documents from the hook.
Note that I tried to refcount the per-thread hook and add it only when necessary (on a visiblity change listener), since it can slow down the entire prefix.
--
v3: mshtml: Implement visibilitychange event.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5861
Since `EVENT_SYSTEM_MINIMIZESTART` and `EVENT_SYSTEM_MINIMIZEEND` are implemented now (thanks to Esme), this is implementing visibility change events using them. We have to keep track of the browsers to iterate all the documents from the hook.
Note that I tried to refcount the per-thread hook and add it only when necessary (on a visiblity change listener), since it can slow down the entire prefix.
--
v2: mshtml: Implement visibilitychange event.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5861
First part of Proton shared memory series. The full branch can be seen at https://gitlab.winehq.org/rbernon/wine/-/commits/mr/shared-memories.
--
v42: win32u: Use the desktop shared data for GetCursorPos.
server: Move the last cursor time to the desktop session object.
server: Move the cursor position to the desktop session object.
win32u: Open the desktop shared object in NtUserSetThreadDesktop.
server: Return the desktop object locator in (get|set)_thread_desktop.
server: Allocate shared session object for desktops.
include: Add ReadNoFence64 inline helpers.
server: Create a global session shared mapping.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3103
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.
--
v21: ntdll: Use PAGEMAP_SCAN to implement get_working_set_ex, if available.
kernel32: Add tests for large page mapping support.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5769
Adds the registry key
HKEY_CURRENT_USER\\Software\\Wine\\Wayland Driver\\rawinput
witch allows mouse raw input. This makes it easier
to calculate the same sensitivity in different games,
use sensitivity calculators, and easily change values
when changing mouse DPI and do not depend on the compositor or OS.
For example, you want to set the sensitivity to half as much,
but sensitivity curves in libinput are more difficult
to calculate than mouse sensitivity in the games.
Implementation of ideas written in the comments: https://gitlab.winehq.org/wine/wine/-/merge_requests/4698
--
v3: winewayland.drv: Add mouse rawinput support
server: Add send_hardware_message flags for rawinput translation.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5869
Adds the registry key
HKEY_CURRENT_USER\\Software\\Wine\\Wayland Driver\\rawinput
witch allows mouse raw input. This makes it easier
to calculate the same sensitivity in different games,
use sensitivity calculators, and easily change values
when changing mouse DPI and do not depend on the compositor or OS.
For example, you want to set the sensitivity to half as much,
but sensitivity curves in libinput are more difficult
to calculate than mouse sensitivity in the games.
Implementation of ideas written in the comments: https://gitlab.winehq.org/wine/wine/-/merge_requests/4698
--
v2: winewayland.drv: Add mouse rawinput support
https://gitlab.winehq.org/wine/wine/-/merge_requests/5869
Adds the registry key
HKEY_CURRENT_USER\\Software\\Wine\\Wayland Driver\\rawinput
witch allows mouse raw input. This makes it easier
to calculate the same sensitivity in different games,
use sensitivity calculators, and easily change values
when changing mouse DPI and do not depend on the compositor or OS.
For example, you want to set the sensitivity to half as much,
but sensitivity curves in libinput are more difficult
to calculate than mouse sensitivity in the games.
Implementation of ideas written in the comments: https://gitlab.winehq.org/wine/wine/-/merge_requests/4698
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5869
Adds the registry key
`HKEY_CURRENT_USER\\Software\\Wine\\Wayland Driver\\unaccelerated_pointer`
witch allows raw input. This makes it easier
to calculate the same sensitivity in different games,
use sensitivity calculators, and easily change values
when changing DPI and do not depend on the compositor or OS.
For example, you want to set the sensitivity to half as much,
and sensitivity curves in libinput are more difficult
to calculate than in the games themselves.
Based on Proton and Wine-Staging patches by @rbernon.
--
v9: winewayland.drv: Add unaccelerated pointer support
server: Add send_hardware_message flags for rawinput translation.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4698
This is the first step in moving the various D3DXCreateTextureFromFileInMemory functions over to using shared code.
--
v5: d3dx9: Add support for specifying which mip level to get pixel data from to d3dx_image_get_pixels().
d3dx9: Cleanup texture value argument handling in D3DXCreateTextureFromFileInMemoryEx().
d3dx9: Add support for specifying a starting mip level when initializing a d3dx_image structure.
d3dx9: Use struct volume inside of struct d3dx_image for storing dimensions.
d3dx9: Use d3dx_image structure inside of D3DXCreateTextureFromFileInMemoryEx().
d3dx9: Refactor texture creation and cleanup in D3DXCreateTextureFromFileInMemoryEx().
https://gitlab.winehq.org/wine/wine/-/merge_requests/5801
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.
--
v18: ntdll: Use PAGEMAP_SCAN to implement get_working_set_ex, if available.
ntdll: Support mapping pages for views created with SEC_LARGE_PAGES.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5769
This is the part VI of the cmd engine rewrite.
It starts splitting FOR loop parsing from its execution.
This is done for numbers (/L) and filesets (/F) FOR loops.
It also extends support for delay expansion of various parts of these loops.
Next MR will tackle the tree oriented FOR loop handling.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5868
The Jet4 driver doesn't handle the DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO
property which is passed in SetProperties. On return that property is marked
as DBPROPSTATUS_NOTSUPPORTED and returns DB_S_ERRORSOCCURRED.
In this case, we dont care that isn't not supported and should allow
the DataSource to succeed.
--
v2: oledb32: When creating a Data Source, handle non fatal errors.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5864
The two tests sometimes fail on macOS and produce >8MB test reports, which fail to upload to the test results page.
--
v2: dwrite/tests: Ignore macOS specific "flip" sbix format.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5866
The Jet4 driver doesn't handle the DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO
property which is passed in SetProperties. On return that property is marked
as DBPROPSTATUS_NOTSUPPORTED and returns DB_S_ERRORSOCCURRED.
In this case, we dont care that isn't not supported and should allow
the DataSource to succeed.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5864
Signed-off-by: Fan WenJie <fanwj(a)mail.ustc.edu.cn>
when get_char_dimensions failed, width not set, width may be undefined value and cause undefined behaviour
--
v2: win32u: memset 0 to metric in get_text_metr_size
https://gitlab.winehq.org/wine/wine/-/merge_requests/5854
These patches fix painting in an application that draws outside of a CS_PARENTDC child
client area in its WM_PAINT handler.
Comments and suggestions are welcome.
--
v4: win32u: Use parent rectangle for visible region calculations of a CS_PARENTDC child.
win32u: Don't clip update region to the window client rectangle.
win32u: GetUpdateRect() should clip update rectangle to the window client area.
win32u: GetUpdateRgn() should clip update region to the window client area.
win32u: Clip PAINTSTRUCT.rcPaint to the window client area.
server: For a CS_PARENTDC child use parent for visible region calculations.
server: If the being validated region covers whole window then validate everything.
user32/tests: Add a message test for listbox redrawing after LB_SETCOUNT.
user32/tests: Test BeginPaint() clipbox of cropped window with CS_PARENTDC.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5665
--
v6: win32u: Avoid changing thread DPI context in process_hardware_message.
win32u: Factor hardware message point DPI mapping together.
win32u: Use map_window_points with explicit DPI over screen_to_client.
win32u: Split hardware message window lookup to a separate helper.
win32u: Use per-monitor DPI window_from_point in process_mouse_message.
win32u: Parameterize window_from_point dpi.
server: Pass window's per-monitor DPI in set_window_pos.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5819
We need to look at the Setup key for the driver, as it can be different
compare to the actually driver.
For example, mysql uses the same Setup file to configure both the Ascii/Unicode
vession but has a different file for the actual ODBC functions.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5858
On Mon Jun 17 07:53:48 2024 +0000, darkblaze69 wrote:
> With this MR since 71ff81b apps don't launch with wayland driver,
> showing these errors after some timeouts.
> So we can't use wayland now.
> ```
> 0138:err:sync:RtlpWaitForCriticalSection section 7BF9B2E0
> "../wine/dlls/ntdll/loader.c: loader_section" wait timed out in thread
> 0138, blocked by 0134, retrying (60 sec)
> 0144:err:sync:RtlpWaitForCriticalSection section 7BF9B2E0
> "../wine/dlls/ntdll/loader.c: loader_section" wait timed out in thread
> 0144, blocked by 0134, retrying (60 sec)
> 014c:err:sync:RtlpWaitForCriticalSection section 7BF9B2E0
> "../wine/dlls/ntdll/loader.c: loader_section" wait timed out in thread
> 014c, blocked by 0134, retrying (60 sec)
> ```
Sorry about that, https://gitlab.winehq.org/wine/wine/-/merge_requests/5857 should fix the problem.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5833#note_73393
Overriding the SDL_VIDEODRIVER variable (for Wayland support as an example)
on the Linux side can lead to some games under Wine failing to load (so treat
that variable as special).
--
v4: ntdll: Add SDL_AUDIO*/SDL_VIDEO* to the special variables list.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5231
With this MR since 71ff81b apps don't launch with wayland driver, showing these errors after some timeouts.
So we can't use wayland now.
```
0138:err:sync:RtlpWaitForCriticalSection section 7BF9B2E0 "../wine/dlls/ntdll/loader.c: loader_section" wait timed out in thread 0138, blocked by 0134, retrying (60 sec)
0144:err:sync:RtlpWaitForCriticalSection section 7BF9B2E0 "../wine/dlls/ntdll/loader.c: loader_section" wait timed out in thread 0144, blocked by 0134, retrying (60 sec)
014c:err:sync:RtlpWaitForCriticalSection section 7BF9B2E0 "../wine/dlls/ntdll/loader.c: loader_section" wait timed out in thread 014c, blocked by 0134, retrying (60 sec)
```
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5833#note_73375
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.
--
v17: ntdll: mlock mapped pages for views created with SEC_LARGE_PAGES.
kernel32: Add tests for large page mapping support.
ntdll: Validate parameters to NtCreateSection if large pages are requested.
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
It turns out that message sequences with "wine_only" messages, although they don't cause a test failure on Windows, do cause `ok_sequence_` to log a failure, so that it dumps the sequence. We need `ok_sequence_` to treat these as skippable messages on Windows so that it ignores the failure to match them.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5853
Trace output with PulseAudio:
```
0144:trace:mmdevapi:adjust_timing Requested duration 1000000 and period 0
0144:trace:mmdevapi:adjust_timing Device periods: 26666 default and 26666 minimum
0144:trace:mmdevapi:adjust_timing Adjusted duration 1000000 and period 100000
```
--
v4: winepulse: Don't set a floor for the period(s).
mmdevapi: Set the default period to a minimum of 10 ms.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5810
Trace output with PulseAudio:
```
0144:trace:mmdevapi:adjust_timing Requested duration 1000000 and period 0
0144:trace:mmdevapi:adjust_timing Device periods: 26666 default and 26666 minimum
0144:trace:mmdevapi:adjust_timing Adjusted duration 1000000 and period 100000
```
--
v3: winepulse: Don't cap period(s).
mmdevapi: Cap default period to 10 ms.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5810
Instead of accessing the surface with macdrv_get_surface_display_image.
--
v5: winemac: Remove now unnecessary cocoa window surface pointer.
winemac: Push window surface image updates to the main thread.
winemac: Create window surface CGImageRef on surface flush.
winemac: Create a provider for the surface and a HBITMAP wrapping it.
winemac: Remove unused macdrv_get_surface_display_image copy_data parameter.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5798
Trace output with PulseAudio:
```
0144:trace:mmdevapi:adjust_timing Requested duration 1000000 and period 0
0144:trace:mmdevapi:adjust_timing Device periods: 26666 default and 26666 minimum
0144:trace:mmdevapi:adjust_timing Adjusted duration 1000000 and period 100000
```
--
v2: winepulse: Don't cap period(s).
mmdevapi: Cap default period to 10 ms.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5810
Instead of accessing the surface with macdrv_get_surface_display_image.
--
v4: winemac: Remove now unnecessary cocoa window surface pointer.
winemac: Push window surface image updates to the main thread.
winemac: Create window surface CGImageRef on surface flush.
winemac: Create a provider for the surface and a HBITMAP wrapping it.
winemac: Remove unused macdrv_get_surface_display_image copy_data parameter.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5798
The aim of this serie is to split FOR loop instruction parsing from
it's execution.
In more details:
- introduces CMD_FOR_CONTROL structure to hold parsed FOR instruction
- improves the support of FOR loop variables (%0-%9 are now available)
- fixes a couple of issues in FOR instruction parsing (missing \t detection
in a couple of places, quotes management),
- fixes a couple of issues in FOR execution (mainly missing delayed
substitution of some constructs)
- code refactoring with helpers
--
v2: programs/cmd: Introduce helpers to handle directory walk.
programs/cmd: Enable '%0' through '%9' as valid FOR loop variables.
programs/cmd: Introduce helpers to save and restore FOR loop contexts.
programs/cmd: Introduce helpers to handle FOR variables.
programs/cmd: Add more tests about FOR loops.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5794
Adds the registry key
`HKEY_CURRENT_USER\\Software\\Wine\\Wayland Driver\\unaccelerated_pointer`
witch allows raw input. This makes it easier
to calculate the same sensitivity in different games,
use sensitivity calculators, and easily change values
when changing DPI and do not depend on the compositor or OS.
For example, you want to set the sensitivity to half as much,
and sensitivity curves in libinput are more difficult
to calculate than in the games themselves.
Based on Proton and Wine-Staging patches by @rbernon.
--
v8: winewayland.drv: Add unaccelerated pointer support
server: Add send_hardware_message flags for rawinput translation.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4698
This MR extends the `wgl_pixel_format` struct with extra fields required to implement `wglGetPixelFormatAttribivARB` in opengl32.dll. I have added only fields that are relevant to the current needs of the drivers. The default implementation will be used automatically if the driver populates the extra fields, which this MR does for the winex11 driver.
The new winex11 implementation tries to remain faithful to the previous behavior in terms of error handling and fallbacks. To achieve this the `wgl_pixel_format` extra fields can be marked as invalid in order for the default implementation to return errors accordingly. Note, however, that error handling around `glXGetFBConfigAttrib` is not very consistent (e.g., the parts of `describe_pixel_format` dealing with PIXELFORMATDESCRIPTOR generally disregard errors).
The MR also adds a default implementation for `wglGetPixelFormatAttribfvARB` which piggy-backs on the integer variant of this function, and removes the need for the corresponding code in the drivers. Note that we could potentially remove this function completely from `struct opengl_funcs` (i.e., place it in `manual_win_functions` in `make_opengl`), but it seems the pattern is to maintain a complete list of extension functions (and wined3d also populates the field internally, although it doesn't seem to do anything with it).
Finally, the `winex11.drv/opengl.c` file contains a mix of coding styles. I chose to be consistent with the style of the closest context (e.g., the function) I was making changes/additions in.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5844
The aim of this serie is to split FOR loop instruction parsing from
it's execution.
In more details:
- introduces CMD_FOR_CONTROL structure to hold parsed FOR instruction
- improves the support of FOR loop variables (%0-%9 are now available)
- fixes a couple of issues in FOR instruction parsing (missing \t detection
in a couple of places, quotes management),
- fixes a couple of issues in FOR execution (mainly missing delayed
substitution of some constructs)
- code refactoring with helpers
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5794
This MR lets conhost support IME input window mode.
Note: this MR doesn't include support for properly displaying
the glyphs when they fall out of charset of current code page.
It also lets some diacritics to work.
Note: for these, the generated INPUT_RECORD sequence still widely
differs from native:
- it matches the key down INPUT_RECORD + unicode char (which is what
most app will use)
- it differs on the rest (no key-up, no dead char...) but that shouldn't
matter too much
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5850
Trace output with PulseAudio:
```
0144:trace:mmdevapi:adjust_timing Requested duration 1000000 and period 0
0144:trace:mmdevapi:adjust_timing Device periods: 26666 default and 26666 minimum
0144:trace:mmdevapi:adjust_timing Adjusted duration 1000000 and period 100000
```
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5810