I know we've had a policy to avoid window manager specific workarounds, I think we could reconsider it. The fix could be unguarded and applied with every window manager, and could very well work, but I think it is ugly enough to justify checking for KWin specifically.
The problem is that as soon as a window configure request is sent to a maximized window, KWin internal state gets bogus and it loses track of the window maximized state. I've described the KWin source details on https://bugs.kde.org/show_bug.cgi?id=496966 and opened https://invent.kde.org/plasma/kwin/-/merge_requests/6854 as a possible fix for it, but the time it will take to land could justify working around it in Wine.
The workaround is to avoid sending configure requests to maximized windows, which sounds sensible and we already avoid resizing maximized windows, but, moving a maximized window to a different monitor *requires* sending a configure request. KWin bug makes no difference to requests with only position changes, and they trigger it all the same. So, the only solution is to temporarily remove the maximized state bits before sending the configure request, putting them back afterwards. This is quite straightforward to do with the new state tracker, but it could very well trigger other problems with other window managers.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57465
--
v4: winex11: Workaround KWin bug with maximized windows.
winex11: Set _NET_WM_USER_TIME to 0 to implement SWP_NOACTIVATE.
winex11: Keep track of the SWP flags to be used when mapping windows.
winex11: Keep _NET_WM_USER_TIME on the individual windows.
winex11: Workaround Mutter bug when changing decorations.
winex11: Avoid creating windows with override-redirect flag set.
winex11: Track _MOTIF_WM_HINTS property in the state tracker.
winex11: Introduce a new handle_state_change helper.
winex11: Ignore transient state changes in other processes.
winex11: Give focus to the expected window when unampping with focus.
winex11: Use the current state when deciding how to reply to WM_TAKE_FOCUS.
winex11: Use the state tracker for the desktop window _NET_WM_STATE.
win32u: Use the winstation monitor update serial to detect updates.
server: Add a winstation monitor update serial counter.
win32u: Extend display_lock CS around winstation check.
win32u: Release the Win16 mutex when yielding in peek_message.
win32u: Skip updating the cache on driver load if we're already updating it.
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/6944
On Sat Dec 7 21:14:33 2024 +0000, Robbert van der Helm wrote:
> Embedding the entire virtual desktop window will sadly not work for this
> use case. The context here is that professional audio production
> software usually lets users use third party synthesizers and effects
> through various plugin systems. Those plugins are native shared
> libraries that implement one of the various standardized plugin ABIs.
> Most of these plugins are only available for Windows and macOS, which
> means they can't be loaded on Linux. Yabridge makes it possible to use
> these plugins on Linux by acting as both a plugin and a plugin host, and
> then passing through any and all function calls made by either the
> native host or the Windows plugin so it appears that they're talking to
> a regular old native plugin or host.
> The thing is that users usually need to interact with those plugins
> through a custom GUI provided by the plugin. In all of the common plugin
> standards the host provides a native window handle that the plugin then
> embeds itself into (reparent on X11, child window on Windows, etc.). So
> to make this work, yabridge creates a Win32 window, asks the plugin to
> embed itself into that window, and then reparents the X11 window (i.e.
> `GetProp(hwnd, "__wine_x11_whole_window")`) into the X11 window provided
> by the host. This approach works surprisingly well, except for the
> aforementioned mouse coordinate offset thing. In the past yabridge was
> able to fix this by directly sending `ConfigureNotify` events to Wine
> without actually moving the window so Wine knows where the window is
> actually located on screen, but that no longer works with the stricter
> implementation from this PR.
> So my question is more or less: can we make this behavior work with the
> updated winex11 implementation, or would it be feasible to make Wine
> aware of this behavior so it would just work without having to inform
> Wine where on screen an embedded window is?
I don't know for sure but there are probably some ways to make it work. It works already more or less well with embedded systray windows, so maybe doing something similar could be enough.
Alternatively mouse input is mapped in `map_event_coords` and we preferred event root/x_root/y_root values when available because it avoided some inconsistencies when moving windows, but window positioning has been refactored lately, and maybe this isn't necessary anymore.
Using window-relative mouse input could solve your case too (or we could also perhaps consider a winecfg option to prefer it over absolute positions).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6569#note_90107
On Mon Dec 2 22:41:17 2024 +0000, Rémi Bernon wrote:
> There has been various changes in the way we handle window positioning,
> and it's now probably more flexible to arbitrary X11 parent windows, but
> in any case we still always consider the X root window coordinates as
> the origin for the Win32 desktop.
> If you want to embed all Wine windows into another window and use its
> position as the Win32 desktop origin, it's basically what the "virtual
> desktop" mode is doing already. It's an option in winecfg, where we
> create a dedicated window for the Win32 desktop and every Wine window
> will be a child of it. You could probably then reparent the desktop
> window to the window you want?
Embedding the entire virtual desktop window will sadly not work for this use case. The context here is that professional audio production software usually lets users use third party synthesizers and effects through various plugin systems. Those plugins are native shared libraries that implement one of the various standardized plugin ABIs. Most of these plugins are only available for Windows and macOS, which means they can't be loaded on Linux. Yabridge makes it possible to use these plugins on Linux by acting as both a plugin and a plugin host, and then passing through any and all function calls made by either the native host or the Windows plugin so it appears that they're talking to a regular old native plugin or host.
The thing is that users usually need to interact with those plugins through a custom GUI provided by the plugin. In all of the common plugin standards the host provides a native window handle that the plugin then embeds itself into (reparent on X11, child window on Windows, etc.). So to make this work, yabridge creates a Win32 window, asks the plugin to embed itself into that window, and then reparents the X11 window (i.e. `GetProp(hwnd, "__wine_x11_whole_window")`) into the X11 window provided by the host. This approach works surprisingly well, except for the aforementioned mouse coordinate offset thing. In the past yabridge was able to fix this by directly sending `ConfigureNotify` events to Wine without actually moving the window so Wine knows where the window is actually located on screen, but that no longer works with the stricter implementation from this PR.
So my question is more or less: can we make this behavior work with the updated winex11 implementation, or would it be feasible to make Wine aware of this behavior so it would just work without having to inform Wine where on screen an embedded window is?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6569#note_90101
I know we've had a policy to avoid window manager specific workarounds, I think we could reconsider it. The fix could be unguarded and applied with every window manager, and could very well work, but I think it is ugly enough to justify checking for KWin specifically.
The problem is that as soon as a window configure request is sent to a maximized window, KWin internal state gets bogus and it loses track of the window maximized state. I've described the KWin source details on https://bugs.kde.org/show_bug.cgi?id=496966 and opened https://invent.kde.org/plasma/kwin/-/merge_requests/6854 as a possible fix for it, but the time it will take to land could justify working around it in Wine.
The workaround is to avoid sending configure requests to maximized windows, which sounds sensible and we already avoid resizing maximized windows, but, moving a maximized window to a different monitor *requires* sending a configure request. KWin bug makes no difference to requests with only position changes, and they trigger it all the same. So, the only solution is to temporarily remove the maximized state bits before sending the configure request, putting them back afterwards. This is quite straightforward to do with the new state tracker, but it could very well trigger other problems with other window managers.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57465
--
v3: winex11: Workaround KWin bug with maximized windows.
winex11: Keep track of the window manager name.
winex11: Keep track of the _NET_SUPPORTING_WM_CHECK window.
winex11: Listen to root window _NET_SUPPORTED property changes.
winex11: Move the _NET_SUPPORTED information to the thread data.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6944
--
v4: server: Check for zero access in alloc_handle().
shell32: Don't open reg keys with zero access mask.
wbemprox: Don't open reg keys with zero access mask.
quartz: Don't open reg keys with zero access mask.
devenum: Don't open reg keys with zero access mask.
setupapi: Don't open reg keys with zero access mask.
kernel32: Don't open reg keys with zero access mask.
httpapi: Don't open files with zero access.
server: Skip inaccessible threads in (get_next_thread).
ntoskrnl.exe/tests: Open directory object with nonzero access in test_permanent().
https://gitlab.winehq.org/wine/wine/-/merge_requests/6047
Loading the driver the first time will call update_display_cache again,
and will need to enter the lock.
--
v3: win32u: Skip updating the cache on driver load if we're already updating it.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6978
Loading the driver the first time will call update_display_cache again,
and will need to enter the lock.
--
v2: win32u: Always load the user driver before entering display_lock.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6978
Returns MAC address by:
- search local interfaces, or
- send UDP packed that does not need linux privilege, then search local cache
solve https://bugs.winehq.org/show_bug.cgi?id=9418
files updated
- /dlls/iphlpapi/iphlpapi_main.c
- /dlls/iphlpapi/tests/iphlpapi.c
--
v15: jscript: Add support for deleting host properties.
jscript: Move property allocation to update_external_prop.
include: Add SQL_C_TCHAR define.
include: Add DB_VARNUMERIC struct.
include: Add _WIN32_WINNT_ version defines.
server: Ensure in pending delete on close that path to unlink are unique.
winegstreamer: Handle null transform in WMA IMediaObject::Flush().
winegstreamer: Handle null transform in video IMFTransform::ProcessMessage() FLUSH.
winegstreamer: Handle null transform in video IMFTransform::ProcessMessage() DRAIN.
winegstreamer: Handle null transform in video IMediaObject::Flush().
ucrtbase: Enable utf8 support.
msvcrt: Prepare remaining process creation functions to handle utf-8 encoded arguments.
msvcrt: Prepare _execle to handle utf-8 encoded arguments.
msvcrt: Prepare _spawnl to handle utf-8 encoded arguments.
msvcrt: Prepare _loaddll to handle utf-8 encoded path.
msvcrt: Prepare freopen to handle utf-8 encoded path.
msvcrt: Prepare _sopen_dispatch to handle utf-8 encoded path.
msvcrt: Return error on NULL path parameter in _wsopen_dispatch.
msvcrt: Add putenv() utf-8 tests.
msvcrt: Call _wfindnext64i32 in _findnext64i32 function.
msvcrt: Call _wfindfirst64i32 in _findfirst64i32 function.
server: Print signal names in traces.
wrc: Use the correct error function for syntax errors.
winebuild: Remove support for .def files as import libraries.
winegcc: Remove support for .def files as import libraries.
configure: Correctly check the --enable-build-id option.
bcrypt: Trace returned handles.
include: Use inline assembly on Clang MSVC mode in exception helpers.
windows.networking.connectivity: Use %I64d instead of %llu.
mfmediaengine: Fallback to sample copy if scaling is required.
mfmediaengine: Implement D3D-aware video frame sink.
mfmediaengine: Implement the Simple Video Renderer.
ntdll: Use sched_getcpu instead of the getcpu syscall.
win32u: Hold the display_lock when checking the cache update time.
win32u: Remove recursive lock_display_devices calls.
win32u: Implement update_display_cache with lock_display_devices.
win32u: Add a force parameter to lock_display_devices.
ntdll: Implement NtGetCurrentProcessorNumber for macOS on x86_64.
qasf: Correctly return failure in process_output.
qasf/tests: Add more tests for dmo_wrapper_sink_Receive.
windowscodecs: Implement CreateMetadataReader().
windowscodecs/metadata: Add a helper to iterate over components.
windowscodecs/tests: Add a basic test for CreateComponentEnumerator().
windowscodecs/tests: Add some tests for CreateMetadataReader().
windowscodecs/tests: Use string literals in the metadata tests.
mshtml: Get rid of unused HTMLElement_toString_dispids.
mshtml: Expose respective props from StyleSheetPrototype.
mshtml: Don't expose toString from styles in IE9+ modes.
mshtml: Don't expose the *Expression methods from styles in IE9+ modes.
mshtml: Don't expose the clip* props from style declaration or properties in IE9+ modes.
mshtml: Don't expose 'behavior' prop from styles in IE11 mode.
mshtml: Move 'filter' prop to MSCSSPropertiesPrototype in IE9 mode.
mshtml: Prefer builtins for style aliases that have the same name.
mshtml: Expose respective props from MSCSSPropertiesPrototype.
mshtml/tests: Add more tests for the style aliased prop names.
msvcrt: Call _wfindnext64 in _findnext64 function.
msvcrt: Call _wfindfirst64 in _findfirst64 function.
msvcrt: Call _wfindnext32 in _findnext32 function.
msvcrt: Call _wfindfirst32 in _findfirst32 function.
include: Cleanup corecrt_io.h file and use it in io.h.
msvcrt: Prepare _searchenv_s() for utf-8 encoded filename.
msvcrt: Don't return success on GetFullPathName error in _wsearchenv_s.
msvcrt: Call _wtempnam in _tempnam function.
msvcrt: Call _wrename in rename function.
msvcrt: Call _wstat64 in _stat64 function.
d3dcompiler/tests: Test the 'double' HLSL data type.
d3dx9/tests: Test the 'double' HLSL data type.
d3dx9/tests: Add d3dx9_43 tests.
d3dx9_43: Generate an import library.
d3dcompiler/tests: Clean up further tests fixed by vkd3d merges.
d3dx11/tests: Clean up tests fixed by vkd3d merges.
d3d10_1/tests: Clean up tests fixed by vkd3d merges.
d3dcompiler/tests: Clean up tests fixed by vkd3d merges.
kernelbase: Improve logging of information classes in GetTokenInformation.
Revert "win32u: Create explorer with the thread effective access token.".
explorer: Apply a default admin token when running for the desktop.
widl: Avoid unused variable warning.
wbemprox: Avoid unused variable warning.
vbscript: Avoid unused variable warning.
msxml: Avoid unused variable warning.
msi: Avoid unused variable warning.
jscript: Avoid unused variable warning.
windows.networking.connectivity: Implement IConnectionProfile::GetNetworkConnectivityLevel().
windows.networking.connectivity/tests: Add some INetworkInformationStatics::GetInternetConnectionProfile() tests.
windows.networking.connectivity: Implement INetworkInformationStatics::GetInternetConnectionProfile().
windows.networking.connectivity: Add INetworkInformationStatics stub interface.
windows.networking.connectivity: Add stub dll.
dbghelp: Search debug info with buildid for RSDS debug entry w/o filenames.
dbghelp: Extend search for buildid in system directories.
ntdll: Use %fs/%gs prefixes instead of a separate .byte 0x64/.byte 0x65.
include: Use %fs/%gs prefixes instead of a separate .byte 0x64/.byte 0x65.
server: Only store a Unix name for regular files.
taskmgr: Only list dynamically settable debug channels.
quartz/dsoundrender: Make trace messages more consistent.
quartz/dsoundrender: Use a consistent style for method names.
quartz/dsoundrender: Make brace placement consistent.
quartz/dsoundrender: Add missing static qualifier to IDispatch methods.
quartz/dsoundrender: Rename "This" to "filter".
qasf: Return failure in dmo_wrapper_sink_Receive if process_output fails.
qasf/tests: Test dmo_wrapper_sink_Receive if downstream fail to receive.
qasf: Return S_FALSE for flushing in dmo_wrapper_sink_Receive.
msvcrt: Prepare _mktemp_s to handle UTF-8 strings.
msvcrt: Prepare _mktemp to handle UTF-8 strings.
msvcrt: Call _wunlink in _wremove function.
msvcrt: Call _unlink in remove function.
msvcrt: Call _wchmod in _chmod function.
msvcrt: Call _waccess in _access function.
msvcrt: Call _wunlink in _unlink function.
msvcrt: Prepare _fsopen to handle UTF-8 strings.
gdiplus: Cast enums to unsigned type when validating its value.
winevulkan: Use WINE_UNIX_LIB instead of WINE_VK_HOST.
winevulkan: Mirror function handling in vk_is_available_instance_function32().
ntdll: Make a debug channel dynamically settable only if there's no specified class.
loader: Add Default, Failed, and LastKnownGood values to HKLM\System\Select.
advapi32/tests: Add test for CurrentControlSet link.
winevulkan: Update to VK spec version 1.4.303.
msvcp140: Add a version resource.
winex11: Use bilinear filtering in xrender_blit.
win32u: Let fullscreen windows cover entire monitors, keeping aspect ratio.
winex11: Set a non-transparent window background pixel color.
configure: Don't add -Wl,--build-id linker option to CFLAGS.
configure: Use -Wl,--build-id unconditionally if requested.
winegcc: Remap build-id linker option for clang.
configure: Properly test clang for dwarf support.
gdiplus: Use the FormatID of the source image when cloning.
winex11: Do not use desired_state when computing state updates.
explorer: Prevent apps from showing Wine specific shell tray window with no icons.
ntdll/tests: Fix format warning with clang.
ntdll: Fix reported exception code for some brk immediates.
ntdll: Test more ARM64 brk instruction exception behaviour.
winex11: Don't update Win32 window position for offscreen windows.
d2d1/effect: Improve handling of blob properties.
kernelbase: Add test for EnumSystemFirmwareTables on missing provider.
kernelbase: Properly return 0 from EnumSystemFirmwareTable on error.
kernel32: Use a proper import for HeapFree.
win32u: Move surface and swapchain wrappers from winevulkan.
winevulkan: Keep the host function pointers in devices and instances.
winevulkan: Use the vulkan object as the wrapper tree node.
winevulkan: Get rid of unnecessary *to_handle helpers.
winevulkan: Avoid changing client command buffer pointer.
winevulkan: Fix incorrect client queue pointers.
winevulkan: Introduce a new vulkan_object_init helper.
winevulkan: Use the result to decide if creation failed.
server: Make CurrentControlSet a symlink in new prefixes.
include: Enable format attributes for debug traces in Clang MSVC mode.
mmdevapi/tests: Use %u format for unsigned int arguments.
imagehlp: Cast AddressOfData to size_t in debug traces.
ole32/tests: Add more FMTID_UserDefinedProperties property storage tests.
ole32: Read property storage section from correct location.
ole32/tests: Add FMTID_UserDefinedProperties property storage tests.
ole32: Fix unsupported vector elements detection in PropertyStorage_ReadProperty.
msvcrt: Call _wfullpath in _fullpath function.
msvcrt: Call _wgetdcwd in _getdcwd function.
msvcrt: Call _wgetcwd in _getcwd function.
msvcrt: Call _wchdir in _chdir function.
msvcrt: Call _wrmdir in _rmdir function.
msvcrt: Call _wmkdir in _mkdir function.
bluetoothapis: Implement BluetoothFindFirstRadio, BluetoothFindNextRadio, BluetoothFindRadioClose.
bluetoothapis/tests: Add tests for BluetoothFindRadioClose.
bluetoothapis/tests: Add tests for BluetoothFindNextRadio.
bluetoothapis/tests: Add tests for BluetoothFindFirstRadio.
bluetoothapis/tests: Fix potential test failure from memcmp'ing uninitialized bytes.
msxml3: Accept the domdoc MaxElementDepth property.
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/6884
Tested by running chrome without no-sandbox successfully.
--
v3: ntdll: Force redirect all ARM64EC indirect calls until the JIT is ready.
ntdll: Add arm64ec_get_module_metadata helper.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6877
--
v3: server: Check for zero access in alloc_handle().
server: Skip inaccessible threads in (get_next_thread).
ntoskrnl.exe/tests: Open directory object with nonzero access in test_permanent().
https://gitlab.winehq.org/wine/wine/-/merge_requests/6047
On Fri Dec 6 16:34:37 2024 +0000, Gabriel Ivăncescu wrote:
> Well Typed Arrays will need something similar (they override all input
> indices, and override defineProperty), when I made the first dispex
> revamp with them, it wasn't clear how it would interact with the host
> object implementation. Well, it's clear now that we need a way to
> override them, I guess.
> And btw Typed Arrays really need that DISPID optimization as well (or my
> original hack, which didn't cover enums only) to skip DISPID for every element.
`lookup_prop()` allows overriding all indices. It could probably use "don't enum" mentioned recently.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6970#note_89979
On Fri Dec 6 10:42:56 2024 +0000, Jacek Caban wrote:
> Thanks. This intentionally doesn't touch `PROP_EXTERN`, as deleting
> those requires interaction with the host object. For all jscript knows,
> the host may choose to ignore the delete. Fixing accessor and function
> properties should cover everything prototypes currently need, so those
> should be in good shape for the code freeze.
> It could be useful to allow external properties to opt into this delete
> mechanism for cases where host-owned properties should always behave
> like regular ones. Examples include `constructor`, `prototype`, and
> possibly constants like `Node.TEXT_NODE`.
> For cases like document and window, we might introduce a flag in
> `property_info` to modify name lookup. Jscript could continue searching
> the prototype chain and use returned info only if the search fails.
> Storage properties seem more complicated. None of the solutions that
> come to mind feel ideal, but this is a very niche corner case. I doubt
> any reasonable code depends on it, so it seems safe to ignore for now.
> It also doesn't seem like something Proton needs to worry about.
Well Typed Arrays will need something similar (they override all input indices, and override defineProperty), when I made the first dispex revamp with them, it wasn't clear how it would interact with the host object implementation. Well, it's clear now that we need a way to override them, I guess.
And btw Typed Arrays really need that DISPID optimization as well (or my original hack, which didn't cover enums only) to skip DISPID for every element.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6970#note_89973
This MR adds support for getting a Bluetooth adapter's properties from its corresponding `org.bluez.Adapter1` object, and making them available to userspace via device properties and the `IOCTL_BTH_GET_LOCAL_INFO` ioctl, updating these properties whenever a `PropertiesChanged` signal is received for the adapter.
It also adds code for creating and removing radio PDOs on receiving `InterafacesAdded` and `InterfacesRemoved` signals from BlueZ, respectively.
--
v5: winebth.sys: Implement IOCTL_BTH_GET_LOCAL_INFO.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6936
This MR adds support for getting a Bluetooth adapter's properties from its corresponding `org.bluez.Adapter1` object, and making them available to userspace via device properties and the `IOCTL_BTH_GET_LOCAL_INFO` ioctl, updating these properties whenever a `PropertiesChanged` signal is received for the adapter.
It also adds code for creating and removing radio PDOs on receiving `InterafacesAdded` and `InterfacesRemoved` signals from BlueZ, respectively.
--
v4: winebth.sys: Implement IOCTL_BTH_GET_LOCAL_INFO.
winebth.sys: Update radio PDO properties on receiving PropertiesChanged for an org.bluez.Adapter1 object.
winebth.sys: Remove the corresponding radio PDO on receiving InterfacesRemoved for a org.bluez.Adapter1 object.
winebth.sys: Create new radio PDOs on receiving InterfacesAdded for objects that implement org.bluez.Adapter1.
winebth.sys: Set radio PDO properties from the device's corresponding org.bluez.Adapter1 object properties.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6936
This PR updates the behaviour of `NtQueryDirectoryFile`, bringing it in line with current Windows behaviour. The need for this update was discovered when attempting to build the Unreal Engine with MSVC under Wine. In certain cases conditional include statements do not behave as expected, due to MSVC depending on undocumented behaviour of `NtQueryDirectoryFile`.
We ran tests on multiple versions of Windows, and discovered that the behaviour has changed since the original Wine implementation, but the documentation has not. The source code for our test tool, and a set of results can be found [here](https://github.com/TensorWorks/NtQueryDirectoryFile-Test). As of Windows 8, calling `NtQueryDirectoryFile` with a re-used handle, a new mask, and setting the `RestartScan` flag to True, causes the cached results to be erased and a new scan to be performed with the updated mask. Currently, Wine performs as did earlier versions of Windows, where the changed mask is ignored, and the cache is reused. This can cause `NtQueryDirectoryFile` under Wine to falsely report that files exist, when they do not.
This PR corrects this behaviour, invalidating the cache when required. Implementing this exposed further undocumented behaviour of `NtQueryDirectoryFile`, where a search for a non-existent file will return either `STATUS_NO_MORE_FILES` or `STATUS_NO_SUCH_FILE`, depending on whether or not the handle had been previously used regardless of the value of `RestartScan`. This was reflected in a `winetest` which allowed for the response to be either `STATUS_SUCCESS` or `STATUS_NO_MORE_FILES`. This test has been updated to only allow current Windows behaviour, and `NtQueryDirectoryFile` will return either `STATUS_NO_MORE_FILES` or `STATUS_NO_SUCH_FILE` as appropriate.
This patch also adds unit tests for the new behaviour of `NtQueryDirectoryFile`. These tests pass when running `winetest` under Windows, and under Wine with these changes in place, but they will fail under older versions of Wine.
--
v5: ntdll: Add tests to confirm filemasks are tied to handles and not directories
https://gitlab.winehq.org/wine/wine/-/merge_requests/6904
This MR adds support for getting a Bluetooth adapter's properties from its corresponding `org.bluez.Adapter1` object, and making them available to userspace via device properties and the `IOCTL_BTH_GET_LOCAL_INFO` ioctl, updating these properties whenever a `PropertiesChanged` signal is received for the adapter.
It also adds code for creating and removing radio PDOs on receiving `InterafacesAdded` and `InterfacesRemoved` signals from BlueZ, respectively.
--
v3: winebth.sys: Implement IOCTL_BTH_GET_LOCAL_INFO.
winebth.sys: Update radio PDO properties on receiving PropertiesChanged for an org.bluez.Adapter1 object.
winebth.sys: Remove the corresponding radio PDO on receiving InterfacesRemoved for a org.bluez.Adapter1 object.
winebth.sys: Create new radio PDOs on receiving InterfacesAdded for objects that implement org.bluez.Adapter1.
winebth.sys: Set radio PDO properties from the device's corresponding org.bluez.Adapter1 object properties.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6936
Sorry for the delay, I'm not sure what to think about it. If it's dropped in modern Windows, it's not clear if we want it. I guess it wouldn't hurt...
We usually add SVGs so that maintainer mode can generate binary blobs. It seems that Tango theme repo contains SVGs, could we use them?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4174#note_89955
On Fri Dec 6 10:42:56 2024 +0000, Gabriel Ivăncescu wrote:
> This looks fine for now, pretty neat way to fix it.
> But I still don't think we can escape a revamp at some point. The 2
> "largest" volatile objects I tested before were the storage, and
> doc/window, and they function differently. On doc and window, the
> volatile props (stuff like accessing DOM elements via props) are looked
> up after the prototypes, while on storage, they are looked up first,
> before even the prop on the object.
> For example:
> - localStorage.getItem("test") returns null (no volatile item).
> - Object.defineProperty(localStorage, "test", ...) creates normal prop
> on it.
> - localStorage.setItem("test", "blah") now it is `blah` (only way to
> retrieve the defined prop underneat is getOwnPropertyDescriptor)
> - localStorage.removeItem("test") now reveals the original defined prop
> Worse is that it also hijacks deletion, so delete acts like removeItem,
> but if you call delete now, it won't delete the defineProperty prop
> (since there's no setItem so nothing to remove).
> For doc and window it's the opposite and if anything in the prototype
> chain has the name of an element id, it will be returned instead.
Thanks. This intentionally doesn't touch `PROP_EXTERN`, as deleting those requires interaction with the host object. For all jscript knows, the host may choose to ignore the delete. Fixing accessor and function properties should cover everything prototypes currently need, so those should be in good shape for the code freeze.
It could be useful to allow external properties to opt into this delete mechanism for cases where host-owned properties should always behave like regular ones. Examples include `constructor`, `prototype`, and possibly constants like `Node.TEXT_NODE`.
For cases like document and window, we might introduce a flag in `property_info` to modify name lookup. Jscript could continue searching the prototype chain and use returned info only if the search fails.
Storage properties seem more complicated. None of the solutions that come to mind feel ideal, but this is a very niche corner case. I doubt any reasonable code depends on it, so it seems safe to ignore for now. It also doesn't seem like something Proton needs to worry about.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6970#note_89951
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
--
v12: server: Work around macOS W^X limitations in write_process_memory.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4826
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
--
v11: server: Work around macOS W^X limitations in write_process_memory.
server: Do not page-align address in write_process_memory.
server: Do not suspend mach task in write_process_memory.
server: Use mach_vm_read_overwrite in get_selector_entry.
server: Do not suspend mach task in get_selector_entry.
server: Use mach_vm_read_overwrite in read_process_memory.
server: Do not suspend mach task in read_process_memory.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4826
This is a more correct version of 6849, plus some other changes not included in
6849, and should supersede the remaining patches in that merge request.
It is also a large and risky change and may not be suitable this close to code
freeze.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6973
--
v8: winegstreamer: Send media source shutdown notification via IMFMediaShutdownNotify.
mf: Introduce IMFMediaShutdownNotify for notification of media source shutdown.
mf: Handle media source Start() failure due to source shutdown.
mf: Handle media source event subscription failure due to source shutdown.
mf: Handle media source BeginGetEvent() failure due to shutdown.
mf: Handle media source EndGetEvent() failure due to shutdown.
mf/tests: Add tests for shutting down a media source used in a session.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6800
This simplifies future tests that check for object name of devices.
--
v2: server: Fix object name resolution of \Device\Null.
server: Make explicit the ownership of the unix_name buffer.
https://gitlab.winehq.org/wine/wine/-/merge_requests/475
`sched_getcpu()` has been supported since glibc 2.6 (2007), and is faster since it can use a vsyscall. Plus, FreeBSD implements it as well.
--
v2: ntdll: Use sched_getcpu instead of the getcpu syscall.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6963
--
v7: winegstreamer: Send media source shutdown notification via IMFMediaShutdownNotify.
mf: Introduce IMFMediaShutdownNotify for notification of media source shutdown.
mf: Handle media source Start() failure due to source shutdown.
mf: Handle media source event subscription failure due to source shutdown.
mf: Handle media source BeginGetEvent() failure due to shutdown.
mf: Handle media source EndGetEvent() failure due to shutdown.
mf/tests: Add tests for shutting down a media source used in a session.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6800
x86_64 Windows and macOS both use `%gs` to access thread-specific data (Windows TEB, macOS TSD). To date, Wine has worked around this conflict by filling the most important TEB fields (`0x30`/`Self`, `0x58`/`ThreadLocalStorage`) in the macOS TSD structure (Apple reserved the fields for our use). This was sufficient for most Windows apps.
CrossOver's Wine had an additional hack to handle `0x60`/`ProcessEnvironmentBlock`, and binary patches for certain CEF binaries which directly accessed `0x8`/`StackBase`. Additionally, Apple's libd3dshared could activate a special mode in Rosetta 2 where code executing in certain regions would use the Windows TEB when accessing `%gs`.
Now that the PE separation is complete, GSBASE can be swapped when entering/exiting PE code. This is done in the syscall dispatcher, unix-call dispatcher, and for user-mode callbacks. GSBASE also needs to be set to the macOS TSD when entering signal handlers (in `init_handler()`), and then restored to the Windows TEB when exiting (in `leave_handler()`). There is a special-case needed in `usr1_handler`: when inside a syscall (on the kernel stack), GSBASE may need to be reset to either the TEB or the TSD. The only way to tell is to determine what GSBASE was set to on entry to the signal handler.
---
macOS does not have a public API for setting GSBASE, but the private `_thread_set_tsd_base()` works and was added in macOS 10.12.
`_thread_set_tsd_base()` is a small thunk that sets `%esi`, `%eax`, and does the `syscall`: https://github.com/apple-oss-distributions/xnu/blob/8d741a5de7ff4191bf97d57….
The syscall instruction itself clobbers `%rcx` and `%r11`.
I've tried to save as few registers as possible when calling `_thread_set_tsd_base()`, but there may be room for improvement there.
---
I've tested this successfully on macOS 15 (Apple Silicon and Intel) with several apps and games, including the `cefclient.exe` CEF sample.
I still need to test this patch on macOS 10.13, and I'd also like to do some performance testing.
---
I also tested an alternate implementation strategy for this which took advantage of the expanded "full" thread state which is passed to signal handlers when a process has set a user LDT. The full thread state includes GSBASE, so GSBASE is set back to whatever is in the sigcontext on return (like every other field in the context). This would avoid needing to explicitly reset GSBASE in `leave_handler()`, and avoid the special-case in `usr1_handler()`.
This strategy was simpler, but I'm not using it for 2 reasons:
- the "full" thread state is only available starting with macOS 10.15, and we still support 10.13.
- more crucially, Rosetta 2 doesn't seem to correctly implement the GS.base field of the full thread state. It's set to 0 on entry, and isn't read on exit.
--
v2: ntdll: Remove x86_64 Mac-specific TEB access workarounds that are no longer needed.
ntdll: On macOS x86_64, swap GSBASE between the TEB and macOS TSD when entering/leaving PE code.
ntdll: Ensure init_handler runs in signal handlers before any compiler-generated memset calls.
ntdll: Remove ugly fallback method for getting a thread's GSBASE on macOS.
ntdll: Leave kernel stack before accessing %gs in x86_64 syscall dispatcher.
ntdll: Do %gs accesses before switching to kernel stack in x86_64 syscall dispatcher.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6866
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.
--
v8: mfmediaengine: Fallback to sample copy if scaling is required.
mfmediaengine: Implement D3D-aware video frame sink.
mfmediaengine: Implement SVR.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5924