If the script cache was already freed before ScriptTextOut() runs and
hence the sfnt member is not available, use the definition from
init_script_cache() to conditionally apply the ETO_GLYPH_INDEX flag.
--
v3: gdi32/uniscribe: Ensure the cache is initialised.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5893
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.
--
v28: 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 pages (SEC_LARGE_PAGES, MEM_LARGE_PAGES).
https://gitlab.winehq.org/wine/wine/-/merge_requests/5769
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.
--
v27: 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 pages (SEC_LARGE_PAGES, MEM_LARGE_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
IIUC atexit isn't exported by ucrtbase, but still exists (maybe as a builtin) and is resolved to a module-local symbol which can be used to register functions executed on module process detach. It is called implicitly by C++ compilers to register static destructors.
--
v2: include: Define __cpuid(ex) as intrinsics when _MSC_VER is defined.
include: Don't import atexit when building with ucrtbase.
include: Guard rpcndr.h DECLSPEC_UUID definition.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5915
--
v3: server: Remove now unnecessary active_hooks from replies.
win32u: Remove now unnecessary thread info active_hooks cache.
win32u: Read the active hooks count from the shared memory.
server: Update the active hooks bitmaps when hooks are added / removed.
server: Move hooks struct initialization within add_hook.
server: Keep a reference on the desktop the hook are registered for.
server: Create a thread message queue shared mapping.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5912
--
v2: server: Remove now unnecessary active_hooks from replies.
win32u: Remove now unnecessary thread info active_hooks cache.
win32u: Read the active hooks count from the shared memory.
server: Update the active hooks bitmaps when hooks are added / removed.
server: Move hooks struct initialization within add_hook.
server: Keep a reference on the desktop the hook are registered for.
win32u: Use the shared memory to get the thread message queue handle.
server: Move thread thread message queue handle to the shared memory.
server: Create a thread message queue shared mapping.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5912
Stub Implementations of UIViewSettings and InputPaneStatics. This will reduce the FIXME clutter of missing UIViewSettings class implementation in .NET applications esp: Paint .Net
--
v4: windows.ui: Add stub IInputPaneStatics implementation.
windows.ui: Add stubs for UIViewSettings class.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5314
This is a series of commits tackling dead key state handling and scan code to vkey mapping improvements (especially for French and German keyboards).
* https://gitlab.winehq.org/mzent/wine/-/commit/6c5c90b746cc341049eec216e3bb9…: Simplifies the logic a bit there and also correctly null-terminates dead keys in ToUnicodeEx
* https://gitlab.winehq.org/mzent/wine/-/commit/a05e2fc5068a22cae94bc800b4972…: Windows does not do it and some applications misbehave with this, fully fixed later in https://gitlab.winehq.org/mzent/wine/-/commit/7cf1f6a00f17b0626126448f77a1c…
* https://gitlab.winehq.org/mzent/wine/-/commit/4bd96932139a22f2c3b1311e44c43…: MSDN states single keys are always uppercased there.
* https://gitlab.winehq.org/mzent/wine/-/commit/bac8e97d7e6a7494672d76f5fc586…: There is a bug in `CFStringCompare` with the flags used there currently, resulting in the comparison of the identical buffers "ß" and "ß" to be false. In any case `UCCompareText` behaves correctly and is much faster there.
* https://gitlab.winehq.org/mzent/wine/-/commit/bac5f485a09fbddd39efb8f2c0d87…: I think this was an accidental mistake there, going through all modifiers first per symbol almost always results in the wrong match being made. The logic is adjusted there now to be similar to the other iterations involving `char_matches_string`.
* https://gitlab.winehq.org/mzent/wine/-/commit/ffde55df4ae3f6d53198839c58356…https://gitlab.winehq.org/mzent/wine/-/commit/a453d0d4c89c59c3e1ba6c24d2d0f…: Adds additional symbol vkey mappings (now completely maps a German Macintosh and PC keyboard correctly). There are still some minor defects with the French layout (around the ú region), however changing the symbol mapping there will cause issues with other layouts I think, since the wrong match happens very early there in the priority in these cases. With this change at least the number row is now behaving correctly. Additionally the French Macintosh keyboard layout is further complicated by the "=" key being next to right shift, which is in conflict with pretty much any other keyboard layout. To fix this properly would require a partial rewrite of the heuristic being used or a new approach, but most likely more of a long term project.
* https://gitlab.winehq.org/mzent/wine/-/commit/7cf1f6a00f17b0626126448f77a1c…: Gives dead keys friendly names in `GetKeyNameFriendlyText`, just like Windows does. I tried to be as exhaustive as possible, but if there are any missing the mapping can be easily extended.
All in all the incorrect scan code to vkey mapping is usually not that tragic, since an application would need to be aware of the layout and have its own mapping of scan codes of each (FFXIV does this though). The French layout corrections are now "good enough" to behave correctly for all the hotbar slots being assigned there with these changes now though.
--
v7: winemac.drv: Give dead keys a friendly name in GetKeyNameText.
winemac.drv: Add additional German symbol vkeys.
winemac.drv: Resolve symbol vkeys first without modifiers.
winemac.drv: Use UCCompareText in char_matches_string.
winemac.drv: Uppercase single keys in GetKeyNameText.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5319
This is a series of commits tackling dead key state handling and scan code to vkey mapping improvements (especially for French and German keyboards).
* https://gitlab.winehq.org/mzent/wine/-/commit/6c5c90b746cc341049eec216e3bb9…: Simplifies the logic a bit there and also correctly null-terminates dead keys in ToUnicodeEx
* https://gitlab.winehq.org/mzent/wine/-/commit/a05e2fc5068a22cae94bc800b4972…: Windows does not do it and some applications misbehave with this, fully fixed later in https://gitlab.winehq.org/mzent/wine/-/commit/7cf1f6a00f17b0626126448f77a1c…
* https://gitlab.winehq.org/mzent/wine/-/commit/4bd96932139a22f2c3b1311e44c43…: MSDN states single keys are always uppercased there.
* https://gitlab.winehq.org/mzent/wine/-/commit/bac8e97d7e6a7494672d76f5fc586…: There is a bug in `CFStringCompare` with the flags used there currently, resulting in the comparison of the identical buffers "ß" and "ß" to be false. In any case `UCCompareText` behaves correctly and is much faster there.
* https://gitlab.winehq.org/mzent/wine/-/commit/bac5f485a09fbddd39efb8f2c0d87…: I think this was an accidental mistake there, going through all modifiers first per symbol almost always results in the wrong match being made. The logic is adjusted there now to be similar to the other iterations involving `char_matches_string`.
* https://gitlab.winehq.org/mzent/wine/-/commit/ffde55df4ae3f6d53198839c58356…https://gitlab.winehq.org/mzent/wine/-/commit/a453d0d4c89c59c3e1ba6c24d2d0f…: Adds additional symbol vkey mappings (now completely maps a German Macintosh and PC keyboard correctly). There are still some minor defects with the French layout (around the ú region), however changing the symbol mapping there will cause issues with other layouts I think, since the wrong match happens very early there in the priority in these cases. With this change at least the number row is now behaving correctly. Additionally the French Macintosh keyboard layout is further complicated by the "=" key being next to right shift, which is in conflict with pretty much any other keyboard layout. To fix this properly would require a partial rewrite of the heuristic being used or a new approach, but most likely more of a long term project.
* https://gitlab.winehq.org/mzent/wine/-/commit/7cf1f6a00f17b0626126448f77a1c…: Gives dead keys friendly names in `GetKeyNameFriendlyText`, just like Windows does. I tried to be as exhaustive as possible, but if there are any missing the mapping can be easily extended.
All in all the incorrect scan code to vkey mapping is usually not that tragic, since an application would need to be aware of the layout and have its own mapping of scan codes of each (FFXIV does this though). The French layout corrections are now "good enough" to behave correctly for all the hotbar slots being assigned there with these changes now though.
--
v6: winemac.drv: Give dead keys a friendly name in GetKeyNameText.
winemac.drv: Add additional German symbol vkeys.
winemac.drv: Resolve symbol vkeys first without modifiers.
winemac.drv: Use UCCompareText in char_matches_string.
winemac.drv: Uppercase single keys in GetKeyNameText.
winemac.drv: Do not append " dead" to dead keycodes in GetKeyNameText.
winemac.drv: Handle length of dead keycodes in ToUnicodeEx correctly.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5319
--
v2: widl: Respect u and l modifiers in expressions.
widl: Use struct integer for the aNUM and aHEXNUM tokens.
widl: Store the hexadecimal flag inside of the expr_t union.
widl: Do not allow "lu" as an integer suffix.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5906
--
v3: mmdevapi/tests: Add test for capturing render loopback.
winepulse.drv: Implement pulse_get_loopback_capture_device().
winepulse.drv: Factor out wait_pa_operation_complete().
mmdevapi: Stub AUDCLNT_STREAMFLAGS_LOOPBACK support.
mmdevapi: Adjust timing after main loop start in client_Initialize().
mmdevapi: Store device_name as a pointer in struct audio_client.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5870
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.
--
v25: 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 pages (SEC_LARGE_PAGES, MEM_LARGE_PAGES).
https://gitlab.winehq.org/wine/wine/-/merge_requests/5769
If the script cache was already freed before ScriptTextOut() runs and
hence the sfnt member is not available, use the definition from
init_script_cache() to conditionally apply the ETO_GLYPH_INDEX flag.
--
v2: uniscribe: Update ETO_GLYPH_INDEX flag even if script cache is freed.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5893
Instead of accessing the surface with macdrv_get_surface_display_image.
--
v9: winemac: Remove unnecessary surface_clip_to_visible_rect.
winemac: Remove now unnecessary cocoa window surface pointer.
winemac: Push window surface image updates to the main thread.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5798
GStreamer uses _SC_NPROCESSORS_CONF to determine 'max-threads'. On the
Steam Deck, this is configured to be 16 (which is double its number
of logical cores).
_SC_NPROCESSORS_CONF also disregards a process's CPU affinity, thus it
can create more threads than is useful, which ultimately wastes memory
resources.
Using affinity to set 'max-threads' addresses both these problems.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5923
This commit replaces the SampleGrabberSink with a dedicated Video Sink,
referred to as the Simple Video Renderer (SVR).
This brings it more inline with Windows and provides the benefit of
having direct access to the IMFSample, removing the need to copy the
sample data.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5924
The `viewWillDraw` warning was introduced recently in ceefcca7ad4cf8dee0dd1344b22b90d6e2344973 ("Update OpenGL context immediately after the window content view is visible.").
For the other one, `CGWindowListCreateImageFromArray()` is insane and takes a CFArray of window numbers (`CGWindowID`/32-bit signed integers) expanded to pointer size (*not* boxed in CFNumber). At some point clang started warning about this:
```
../dlls/winemac.drv/cocoa_window.m:2344:32: warning: cast to 'const void *' from smaller integer type 'CGWindowID' (aka 'unsigned int') [-Wint-to-void-pointer-cast]
2344 | const void* windowID = (const void*)(CGWindowID)window.windowNumber;
```
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5922
Mostly race condition fixes.
"winegstreamer: Do waits for samples on stream-specific work queues." works around a Gstreamer bug that I'll try to write a minimal reproducer for and submit to their bug tracker. For now, doing sample waits actually concurrently works around the problem.
"winegstreamer: Fixate caps in autoplug_continue_cb." so far I've only seen relevant when the source is a uridecodebin (in Proton), but I though it couldn't hurt to upstream it too.
--
v2: winegstreamer: Handle Gstreamer pipeline flushes gracefully in the media source.
winegstreamer: Ignore an assert in wg_parser.
winegstreamer: Don't only accept segment events when streams are enabled.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5917
--
v2: ntdll: Buffer pagemap reads in fill_working_set_info().
ntdll: Fill range of output in fill_working_set_info().
ntdll: Limit vprot scan range to the needed interval in get_working_set_ex().
ntdll: Iterate views instead of requested addresses in get_working_set_ex().
https://gitlab.winehq.org/wine/wine/-/merge_requests/5907
With [`VK_EXT_device_address_binding_report`](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_device_address_binding_report.html) we can get [debug_util](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/ht… callbacks used to track memory bindings. Since it's the host's implementation that starts the callback we have to be sure that we have a way of converting it to the client side's variant before it's added to the handle map - i.e. we don't know the host handle at that time yet.
This is [used by vkd3d-proton](https://github.com/HansKristian-Work/vkd3d-proton/pull/1962). Requires Mesa with https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28649.
before (note the missing BIND for VkDevice which actually means `VkDeviceMemory`):
```
vkd3d-proton % VKD3D_TEST_FILTER=create_placed_resource_size VKD3D_CONFIG=fault VKD3D_DEBUG=trace ~/src/wine/build/wine ./tests/d3d12.exe 2>&1 | grep vkd3d_address_binding_callback
trace:vkd3d-proton:vkd3d_address_binding_callback: BIND || VkBuffer || VA ffff800100200000 || size 0000000001000000.
trace:vkd3d-proton:vkd3d_address_binding_callback: BIND || VkImage || VA ffff800100200000 || size 000000000019a000.
trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkImage || VA ffff800100200000 || size 000000000019a000.
trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkBuffer || VA ffff800100200000 || size 0000000001000000.
:trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkDevice || VA ffff800100200000 || size 0000000001000000.
232285.553:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: BIND || VkBuffer || VA ffff800100200000 || size 0000000001000000.
232285.553:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkBuffer || VA ffff800100200000 || size 0000000001000000.
232285.553:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkDevice || VA ffff800100200000 || size 0000000001000000.
```
after:
```
% VKD3D_TEST_FILTER=create_placed_resource_size VKD3D_CONFIG=fault VKD3D_DEBUG=trace ~/src/wine/build/wine ./tests/d3d12.exe 2>&1 | grep vkd3d_address_binding_callback
232338.036:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: BIND || VkDevice || VA ffff800100200000 || size 0000000001000000.
232338.036:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: BIND || VkBuffer || VA ffff800100200000 || size 0000000001000000.
232338.037:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: BIND || VkImage || VA ffff800100200000 || size 000000000019a000.
232338.037:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkImage || VA ffff800100200000 || size 000000000019a000.
232338.037:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkBuffer || VA ffff800100200000 || size 0000000001000000.
232338.037:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkDevice || VA ffff800100200000 || size 0000000001000000.
232338.037:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: BIND || VkDevice || VA ffff800100200000 || size 0000000001000000.
232338.037:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: BIND || VkBuffer || VA ffff800100200000 || size 0000000001000000.
232338.037:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkBuffer || VA ffff800100200000 || size 0000000001000000.
232338.037:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkDevice || VA ffff800100200000 || size 0000000001000000.
```
[The spec guarantees](https://registry.khronos.org/vulkan/specs/1.3-extensions/html/v… the following:
> An application can receive multiple callbacks if multiple VkDebugUtilsMessengerEXT objects are created. A callback will always be executed in the same thread as the originating Vulkan call.
As of TLS I went with a suggestion from IRC:
```
<ivyl_> There's an issue with how we handle callbacks related to VK_EXT_debug_utils and VK_EXT_debug_report. In wine_vkAllocateMemory() we call device->funcs.p_vkAllocateMemory() which may execute callback.
<ivyl_> At this point we still don't have handle mapping added because we don't know what host_memory handle will be.
<ivyl_> AFAIU there's a spec guarantee that callback will be executed in the same thread as the call causing it, so I was thinking about maybe keeping `memory` in a tls (if enable_wrapper_list) and using that?
<ivyl_> but that's I don't see any precedent of using thread local storage on the unix side
<ivyl_> tls value would be short-lived in such case - only for the duration of the call to `device->funcs.p_vkAllocateMemory()`
<jacekc_> we usually use teb on unix side, see ntuser_thread_info
```
--
v4: winevulkan: Make device memory wrapper available in callbacks.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5658
IIUC atexit isn't exported by ucrtbase, but still exists (maybe as a builtin) and is resolved to a module-local symbol which can be used to register functions executed on module process detach. It is called implicitly by C++ compilers to register static destructors.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5915
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
--
v5: 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 is part IX of cmd.exe' parse engine rewrite.
It does some code cleanup and factorization for reading next line of input.
It tidies up parse time variable expansion and
starts beefing up the new parser.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5913
Additional tests reveal that RTL_QUERY_REGISTRY_DIRECT does work with
non-string default values, it just requires a pointer to the value and
it doesn't infer the size automatically. That means that the same code
can be used to handle both default and non-default values.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5911
Additional tests reveal that RTL_QUERY_REGISTRY_DIRECT does work with
non-string default values, it just requires a pointer to the value and
it doesn't infer the size automatically. That means that the same code
can be used to handle both default and non-default values.
--
v2: ntdll: Don't special-case default values in RtlQueryRegistryValues.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5911
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.
--
v24: 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).
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
If the script cache was already freed before ScriptTextOut() runs and
hence the sfnt member is not available, use the definition from
init_script_cache() to conditionally apply the ETO_GLYPH_INDEX flag.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5893
On Mon May 22 19:01:15 2023 +0000, Davide Beatrici wrote:
> Mmm... looks like a debugging leftover. @julliard
> In any case, I'm going to set it back to `DefaultPeriod`. We can always
> fix it in a dedicated commit.
Done in 5c6e63bac21d3cbeed56ad76f45f16fa8fc76518.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2868#note_73995
To reproduce it, I moved gripper left and right to hide some buttons, then brought it back. On the first image chevron didn't disappear as expected. On the second one chevron went away as I applied fix.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5706#note_73935
Xcode 15.3 adds a new linker flag (`-no_huge`) which allows the loader to use zero-fill sections to reserve the areas currently being reserved by the preloader.
This means the preloader is no longer needed (a good thing, since it's heavily dependent on private APIs).
The preloader will still be used when Xcode <15.3 is being used, or when building for i386 (32-bit for 10.14 and earlier).
I've also tested a 64-bit wineloader built with Xcode 15.3 on macOS 10.13 and found that it works correctly.
The only user-visible change I've found is that `setprogname()` now correctly changes the process name, so a `ps` listing will now show (for example) `C:\windows\regedit.exe` (as it does on Linux) instead of `/Users/bshanks/wine/build64/loader/wine-preloader C:\windows\regedit.exe`.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5884
With [`VK_EXT_device_address_binding_report`](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_device_address_binding_report.html) we can get [debug_util](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/ht… callbacks used to track memory bindings. Since it's the host's implementation that starts the callback we have to be sure that we have a way of converting it to the client side's variant before it's added to the handle map - i.e. we don't know the host handle at that time yet.
This is [used by vkd3d-proton](https://github.com/HansKristian-Work/vkd3d-proton/pull/1962). Requires Mesa with https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28649.
before (note the missing BIND for VkDevice which actually means `VkDeviceMemory`):
```
vkd3d-proton % VKD3D_TEST_FILTER=create_placed_resource_size VKD3D_CONFIG=fault VKD3D_DEBUG=trace ~/src/wine/build/wine ./tests/d3d12.exe 2>&1 | grep vkd3d_address_binding_callback
trace:vkd3d-proton:vkd3d_address_binding_callback: BIND || VkBuffer || VA ffff800100200000 || size 0000000001000000.
trace:vkd3d-proton:vkd3d_address_binding_callback: BIND || VkImage || VA ffff800100200000 || size 000000000019a000.
trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkImage || VA ffff800100200000 || size 000000000019a000.
trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkBuffer || VA ffff800100200000 || size 0000000001000000.
:trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkDevice || VA ffff800100200000 || size 0000000001000000.
232285.553:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: BIND || VkBuffer || VA ffff800100200000 || size 0000000001000000.
232285.553:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkBuffer || VA ffff800100200000 || size 0000000001000000.
232285.553:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkDevice || VA ffff800100200000 || size 0000000001000000.
```
after:
```
% VKD3D_TEST_FILTER=create_placed_resource_size VKD3D_CONFIG=fault VKD3D_DEBUG=trace ~/src/wine/build/wine ./tests/d3d12.exe 2>&1 | grep vkd3d_address_binding_callback
232338.036:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: BIND || VkDevice || VA ffff800100200000 || size 0000000001000000.
232338.036:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: BIND || VkBuffer || VA ffff800100200000 || size 0000000001000000.
232338.037:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: BIND || VkImage || VA ffff800100200000 || size 000000000019a000.
232338.037:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkImage || VA ffff800100200000 || size 000000000019a000.
232338.037:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkBuffer || VA ffff800100200000 || size 0000000001000000.
232338.037:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkDevice || VA ffff800100200000 || size 0000000001000000.
232338.037:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: BIND || VkDevice || VA ffff800100200000 || size 0000000001000000.
232338.037:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: BIND || VkBuffer || VA ffff800100200000 || size 0000000001000000.
232338.037:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkBuffer || VA ffff800100200000 || size 0000000001000000.
232338.037:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkDevice || VA ffff800100200000 || size 0000000001000000.
```
[The spec guarantees](https://registry.khronos.org/vulkan/specs/1.3-extensions/html/v… the following:
> An application can receive multiple callbacks if multiple VkDebugUtilsMessengerEXT objects are created. A callback will always be executed in the same thread as the originating Vulkan call.
As of TLS I went with a suggestion from IRC:
```
<ivyl_> There's an issue with how we handle callbacks related to VK_EXT_debug_utils and VK_EXT_debug_report. In wine_vkAllocateMemory() we call device->funcs.p_vkAllocateMemory() which may execute callback.
<ivyl_> At this point we still don't have handle mapping added because we don't know what host_memory handle will be.
<ivyl_> AFAIU there's a spec guarantee that callback will be executed in the same thread as the call causing it, so I was thinking about maybe keeping `memory` in a tls (if enable_wrapper_list) and using that?
<ivyl_> but that's I don't see any precedent of using thread local storage on the unix side
<ivyl_> tls value would be short-lived in such case - only for the duration of the call to `device->funcs.p_vkAllocateMemory()`
<jacekc_> we usually use teb on unix side, see ntuser_thread_info
```
--
v3: winevulkan: Make device memory wrapper available in callbacks.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5658