This introduces a faster implementation of signal and wait operations on NT
events, semaphores, and mutexes, which improves performance to native levels for
a wide variety of games and other applications.
The goal here is similar to the long-standing out-of-tree "esync" and "fsync"
patch sets, but without the flaws that make those patch sets not upstreamable.
The Linux "ntsync" driver is not currently released. It has been accepted into
the trunk Linux tree for 6.14, so barring any extraordinary circumstances, the
API is frozen and it will be released in its current form in about 2 months.
Since it has passed all relevant reviewers on the kernel side, and the API is
all but released, it seems there is no reason any more not to submit the Wine
side to match.
Some important notes:
* This patch set does *not* include any way to disable ntsync support, since
that kind of configuration often seems to be dispreferred where not necessary.
In essence, ntsync should just work everywhere.
Probably the easiest way to effectively disable ntsync, for the purposes of
testing, is to chmod the /dev/ntsync device to prevent its being opened.
Regardless, a Wine switch to disable ntsync can be added simply enough. Note
that it should probably not take the form of a registry key, however, since it
needs to be easily accessible from the server itself.
* It is, generally speaking, not possible for only some objects, or some
processes, to have backing ntsync objects, while others use the old server
path. The esync/fsync patch sets explicitly protected against this by making
sure every process had a consistent view of whether esync was enabled. This is
not provided here, since no switch is provided to toggle ntsync, and it should
not be possible to get into such an inconsistent state without gross
misconfiguration.
* Similarly, no diagnostic messages are provided to note that ntsync is in use,
or not in use. These messages are part of esync/fsync, as well as part of
ntsync "testing" trees unofficially distributed. However, if ntsync is working
correctly, no message should be necessary.
The basic structure is:
* Each type of server object which can be waited on by the client (including
events, semaphores, mutexes, but also other types such as processes, files)
must store an "inproc_sync" object.
This "inproc_sync" object is a full server object (note that this differs from
esync/fsync). A vector and server request is introduced to retrieve an NT
handle to this object from an arbitrary NT handle.
Since the actual ntsync objects are simply distinct file descriptions, we then
call get_handle_fd from the client to retrieve an fd to the object, and then
perform ioctls on it.
* Objects signaled by the server (processes, files, etc) perform ntsync ioctls
on that object. The backing object in all such cases is simply an event.
* Signal and wait operations on the client side attempt to defer to an
"inproc_\*" function, falling back to the server implementation if it returns
STATUS_NOT_IMPLEMENTED. This mirrors how in-process synchronization objects
(critical sections, SRW locks, etc) used to be implemented—attempting to use
an architecture-specific "fast_\*" function and falling back if it returned
STATUS_NOT_IMPLEMENTED.
* The inproc_sync handles, once retrieved, are cached per-process. This caching
takes a similar form to the fd cache. It does not reuse the same
infrastructure, however.
The primary reason for this is that the fd cache is designed to fit within a
64-bit value and uses 64-bit atomic operations to ensure consistency. However,
we need to store more than 64 bits of information. [We also need to modify
them after caching, in order to correctly implement handle closing—see below.]
The secondary reason is that retrieving the ntsync fd from the inproc_sync
handle itself uses the fd cache.
* In order to keep the Linux driver simple, it does not implement access flags
(EVENT_MODIFY_STATE etc.) Instead, the flags are cached locally and validated
there. This too mirrors the fd cache. Note that this means that a malicious
process can now modify objects it should not be able modify—which is less true
than it is with wineserver—but this is no different from the way other objects
(notably fds) are handled, and would require manual syscalls.
* In order to achieve correct behaviour related to closing objects while they
are used, this patch set essentially relies on refcounting. This is broadly
true of the server as well, but because we need to avoid server calls when
performing object operations, significantly more care must be taken.
In particular, because waits need to be interruptable by signals and then be
restarted, we need the backing ntsync object to remain valid until all users
are done with it. On a process level, this is achieved by letting multiple
processes own handles to the underlying inproc_sync server object.
On a thread level, multiple simultaneous calls need to refcount the process's
local handle. This refcount is stored in the sync object cache. When it
reaches zero, the cache is cleared.
Punting this behaviour to the Linux driver would have introduced a great deal
more complexity, which is best kept in userspace and out of the kernel.
* The cache is, as such, treated as a cache. The penultimate commit, which
introduces client support but does not yet cache the objects, effectively
illustrates this by never actually caching anything, and retrieving a new NT
handle and fd every time.
* Certain waits, on internal handles (such as async, startup_info, completion),
are delegated to the server even when ntsync is used. Those server objects do
not create an underlying ntsync object.
--
v4: ntdll: Cache in-process synchronization objects.
ntdll: Use server_wait_for_object() when waiting on only the queue object.
ntdll: Use in-process synchronization objects.
ntdll: Introduce a helper to wait on an internal server handle.
server: Allow creating an event object for client-side user APC signaling.
server: Introduce select_inproc_queue and unselect_inproc_queue requests.
server: Add a request to retrieve the in-process synchronization object from a handle.
server: Create in-process synchronization objects for fd-based objects.
server: Create in-process synchronization objects for timers.
server: Create in-process synchronization objects for threads.
server: Create in-process synchronization objects for message queues.
server: Create in-process synchronization objects for jobs.
server: Create in-process synchronization objects for processes.
server: Create in-process synchronization objects for keyed events.
server: Create in-process synchronization objects for device managers.
server: Create in-process synchronization objects for debug objects.
server: Create in-process synchronization objects for console servers.
server: Create in-process synchronization objects for consoles.
server: Create in-process synchronization objects for completion ports.
server: Create in-process synchronization objects for mutexes.
server: Create in-process synchronization objects for semaphores.
server: Create in-process synchronization objects for events.
server: Add an object operation to retrieve an in-process synchronization object.
ntdll: Retrieve and cache an ntsync device in wait calls.
ntdll: Add stub functions for in-process synchronization.
ntdll: Add some traces to synchronization methods.
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/7226
ReadNoFence64 is broken on i386 MSVC <11.0 and Clang MSVC mode, and has never been used inside Wine for PE side.
--
v2: include: Remove ReadNoFence64 and related definitions if defined(_MSC_VER).
include: Compile out ReadNoFence64 if defined(_MSC_VER) && !defined(__WINESRC__).
https://gitlab.winehq.org/wine/wine/-/merge_requests/7303
The absolute dirid (-1) is an empty string and should not have a backslash appended to separate it from the filename; DestinationDirs with `-1` and a file spec like `c:\foo.bin` must remain as `c:\foo.bin` after `build_filepathsW`, it must not become `\c:\foo.bin`. This also fixes a undefined access to `buffer[-1]` when src2 is an empty string!
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7688
Windows Vista added the concept of virtual accounts for services.
There exists a deterministic mapping between the name of a service and its
security identifier.
The format of virtual account's SID is the following.
Revision: 1
Identifier Authority: NT_AUTHORITY (5)
Domain Identifier: NT_SERVICE (80)
Relative Identifier: SHA1(ServiceName)
For example the SID of a service named "TestService" is:
S-1-5-80-3892056402-659729507-4115993473-1921682939-1565901394
RtlCreateServiceSid generates the SID of a service from its name.
This function is the first step towards adding virtual account support to System.Security.Principal.NTAccount from .NET which is required for OculusSetup.exe.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7682
Setting a __wine_x11_focus_time window property to indicate the time of
the last NormalState, -1 if the window is mapping itself, or 0 if the
window is not in a NormalState.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7684
Follow-up of !2786, which appears to have been abandoned.
--
v8: ws2_32/tests: Add test for AF_UNIX sockets.
server: Fix getsockname() and accept() on AF_UNIX sockets.
server: Introduce error when attempting to create a SOCK_DGRAM AF_UNIX socket.
server: Allow for deletion of socket files.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7650
Follow-up of !2786, which appears to have been abandoned.
--
v7: ws2_32/tests: Add test for AF_UNIX sockets.
server: Fix getsockname() and accept() on AF_UNIX sockets.
server: Introduce error when attempting to create a SOCK_DGRAM AF_UNIX socket.
server: Allow for deletion of socket files.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7650
This serie (#5 in PDB rewrite) actually starts the implementation of the i
"new" PDB reader.
Basically, during the phase of migration from the "old" to the "new" PDB
reader, both readers will be used at the same time (for every loaded module
with PDB information).
So:
- be ready to expect an increase in memory usage (as both will handle their
own information),
- in the process of migration, when possible, parts of the "old" reader
will be disabled not to consume too much memory nor time,
Default will be to use the "new" reader. If you really want to use the
"old" reader, set the WINE\_DBGHELP\_OLD\_PDB env variable.
The integration of the "new" PDB reader is done through a set of methods
attached to each debug format (1).
This serie:
- sets the foundations of the "new" PDB reader (in a new pdb.c file),
- use it to support the access to PFO unwinding information in PDB files
(and this allows to unmap the PDB file, used by the all reader, when
all information have been read by "old" reader),
- introduces the methods vtable for each debug format.
Note 1:
- "new" PDB reader will not support as many PDB variations as the "old"
reader,
- actually, PDB files come into two forms. The second form became the
CL.EXE default in MSVC version 8, something like 30 years ago,
(first format was very limited in the potential size of the PDB file),
- also, the CodeView records in the PDB files exist in 3 versions:
+ V1: 2^16 types per image, identifiers as pascal string, 255 char max,
+ V2: 2^32 types per image, identifiers as pascal string, 255 char max,
+ V3: 2^32 types per image, identifiers as C-strings ("unlimited"),
- for now, only support for the V3 CodeView records is included
- I don't plan to add all the other variations as they are very obsolete,
- for the record, this is aligned with clang design decisions for their
PDB implementation,
Note 2:
- "old" reader maps the whole PDB file in memory, then allocate memory
chunks for each internal stream and reconstructs the stream by copying
from the filemap into the stream buffer),
- "new" reader access the PDB file through ReadFile,
[1] dwarf4/5 is a candidate to be moved to this new interface for the
same reasons as PDB (not to load every debug information at module
loading in dbghelp),
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7680
This MR adds an initial implementation of the winsock `WSALookupsService*` methods for performing Bluetooth device discovery (`LUP_CONTAINERS`).
Pending !7472, the code will also eventually support performing device inquiry scans.
--
v15: ws2_32: Implement WSALookupServiceNext for Bluetooth device discovery.
ws2_32: Implement WSALookupServiceBegin for Bluetooth device discovery.
ws2_32/tests: Add tests for the Bluetooth namespace (NS_BTH) in WSALookupServiceBegin/Next.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7542
This MR uses the cursor-shapes-v1 protocol to tell the compositor which system
cursor shape to use. If a shape match is not found (or cursor-shapes-v1
is not available) we fall back to setting the cursor buffer from the
Windows cursor data as before.
The second commit implements support for a "UseSystemCursors" driver option, similar
to what winex11 has. Since this is the first winewayland driver option we also introduce
all the related registry reading code.
--
Side note: The registry code is a copy from winex11, and is the third copy in the
codebase (x11, mac, wayland). Perhaps it's worth introducing a common
ntuser function to perform the option reading for the drivers, something like
`NtUserGetDriverOption("X11 Driver", buffer, buffer_size, TRUE /* whether to read app specific option if present */)`.
With such a function there is the concern about each call reopening the registry, but we can see if that's actually a problem and how a different API (or some sort of caching) may help.
--
v2: winewayland: Support "UseSystemCursors" driver option.
winewayland: Use system cursor shapes when possible.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7678
Introduce infrastructure necessary to support receiving, sending and replying (to) Bluetooth authentication/pairing requests:
- During startup, the Bluetooth driver now creates a "pairing agent" and registers it with BlueZ. The pairing agent is a DBus object implementing the `org.bluez.Agent1` interface (documented [here](https://github.com/bluez/bluez/blob/master/doc/org.bluez.Agent.rst)), which receives authentication requests from BlueZ. The pairing agent then forwards the request data to the PE driver, in form of a `WINEBLUETOOTH_EVENT_AUTH_EVENT` event. The agent is unregistered during driver shutdown.
- Right now, the agent only supports Numeric Comparison pairing requests.
- Create a new auxiliary device, `\??\WINEBTHAUTH` during driver startup. This device handles authentication functionality that is independent of radio PDOs on the system, which allows the userspace APIs to not track individual Bluetooth radio objects to implement authentication. `WINEBTHAUTH` right now serves two purposes:
- Serve as the device object for which `GUID_WINEBTH_AUTHENTICATION_REQUEST` PnP events are broadcasted. This event is sent whenever the Bluetooth event loop in (`bluetooth_event_loop_thread_proc`) receives `WINEBLUETOOTH_EVENT_AUTH_EVENT`. The event's buffer contains a `struct winebth_authentication_request` value, which contains data relevant to the incoming auth request.
- Handle the `IOCTL_WINEBTH_AUTH_REGISTER` IOCTL. This simply calls the [`RequestDefaultAgent` BlueZ method](https://github.com/bluez/bluez/blob/master/doc/org.bluez.AgentManag… right now, which asks BlueZ to send all incoming Bluetooth authentication requests to Wine's pairing agent (described above). This is not always strictly necessary, but is useful if there already is a default pairing agent set.
- `WINEBTHAUTH` will also ultimately be in charge of responding to authentication requests, which I'll be adding in the next-ish MR(s).
- Implement `BluetoothRegisterForAuthenticationEx` and `BluetoothUnregisterAuthentication`. Registration is done by invoking `IOCTL_WINEBTH_AUTH_REGISTER`, and then listening for `GUID_WINEBTH_AUTHENTICATION_REQUEST` events on a `HANDLE` to `\??\WINEBTHAUTH` using the newly added `CM_Register_Notifications`.
To keep the MR from getting any larger, I have not included support for `BluetoothSendAuthenticationResponseEx`. That will likely be introduced in the future.
--
v9: bluetoothapis/tests: Add tests for BluetoothRegisterForAuthenticationEx and BluetoothUnregisterAuthentication.
bluetoothapis: Implement BluetoothRegisterForAuthenticationEx and BluetoothUnregisterForAuthentication.
winebth.sys: Implement IOCTL_WINEBTH_AUTH_REGISTER.
winebth.sys: Broadcast a WINEBTH_AUTHENTICATION_REQUEST PnP event on receiving a RequestConfirmation request from BlueZ.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7630
Introduce infrastructure necessary to support receiving, sending and replying (to) Bluetooth authentication/pairing requests:
- During startup, the Bluetooth driver now creates a "pairing agent" and registers it with BlueZ. The pairing agent is a DBus object implementing the `org.bluez.Agent1` interface (documented [here](https://github.com/bluez/bluez/blob/master/doc/org.bluez.Agent.rst)), which receives authentication requests from BlueZ. The pairing agent then forwards the request data to the PE driver, in form of a `WINEBLUETOOTH_EVENT_AUTH_EVENT` event. The agent is unregistered during driver shutdown.
- Right now, the agent only supports Numeric Comparison pairing requests.
- Create a new auxiliary device, `\??\WINEBTHAUTH` during driver startup. This device handles authentication functionality that is independent of radio PDOs on the system, which allows the userspace APIs to not track individual Bluetooth radio objects to implement authentication. `WINEBTHAUTH` right now serves two purposes:
- Serve as the device object for which `GUID_WINEBTH_AUTHENTICATION_REQUEST` PnP events are broadcasted. This event is sent whenever the Bluetooth event loop in (`bluetooth_event_loop_thread_proc`) receives `WINEBLUETOOTH_EVENT_AUTH_EVENT`. The event's buffer contains a `struct winebth_authentication_request` value, which contains data relevant to the incoming auth request.
- Handle the `IOCTL_WINEBTH_AUTH_REGISTER` IOCTL. This simply calls the [`RequestDefaultAgent` BlueZ method](https://github.com/bluez/bluez/blob/master/doc/org.bluez.AgentManag… right now, which asks BlueZ to send all incoming Bluetooth authentication requests to Wine's pairing agent (described above). This is not always strictly necessary, but is useful if there already is a default pairing agent set.
- `WINEBTHAUTH` will also ultimately be in charge of responding to authentication requests, which I'll be adding in the next-ish MR(s).
- Implement `BluetoothRegisterForAuthenticationEx` and `BluetoothUnregisterAuthentication`. Registration is done by invoking `IOCTL_WINEBTH_AUTH_REGISTER`, and then listening for `GUID_WINEBTH_AUTHENTICATION_REQUEST` events on a `HANDLE` to `\??\WINEBTHAUTH` using the newly added `CM_Register_Notifications`.
To keep the MR from getting any larger, I have not included support for `BluetoothSendAuthenticationResponseEx`. That will likely be introduced in the future.
--
v8: bluetoothapis/tests: Add tests for BluetoothRegisterForAuthenticationEx and BluetoothUnregisterAuthentication.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7630
Introduce infrastructure necessary to support receiving, sending and replying (to) Bluetooth authentication/pairing requests:
- During startup, the Bluetooth driver now creates a "pairing agent" and registers it with BlueZ. The pairing agent is a DBus object implementing the `org.bluez.Agent1` interface (documented [here](https://github.com/bluez/bluez/blob/master/doc/org.bluez.Agent.rst)), which receives authentication requests from BlueZ. The pairing agent then forwards the request data to the PE driver, in form of a `WINEBLUETOOTH_EVENT_AUTH_EVENT` event. The agent is unregistered during driver shutdown.
- Right now, the agent only supports Numeric Comparison pairing requests.
- Create a new auxiliary device, `\??\WINEBTHAUTH` during driver startup. This device handles authentication functionality that is independent of radio PDOs on the system, which allows the userspace APIs to not track individual Bluetooth radio objects to implement authentication. `WINEBTHAUTH` right now serves two purposes:
- Serve as the device object for which `GUID_WINEBTH_AUTHENTICATION_REQUEST` PnP events are broadcasted. This event is sent whenever the Bluetooth event loop in (`bluetooth_event_loop_thread_proc`) receives `WINEBLUETOOTH_EVENT_AUTH_EVENT`. The event's buffer contains a `struct winebth_authentication_request` value, which contains data relevant to the incoming auth request.
- Handle the `IOCTL_WINEBTH_AUTH_REGISTER` IOCTL. This simply calls the [`RequestDefaultAgent` BlueZ method](https://github.com/bluez/bluez/blob/master/doc/org.bluez.AgentManag… right now, which asks BlueZ to send all incoming Bluetooth authentication requests to Wine's pairing agent (described above). This is not always strictly necessary, but is useful if there already is a default pairing agent set.
- `WINEBTHAUTH` will also ultimately be in charge of responding to authentication requests, which I'll be adding in the next-ish MR(s).
- Implement `BluetoothRegisterForAuthenticationEx` and `BluetoothUnregisterAuthentication`. Registration is done by invoking `IOCTL_WINEBTH_AUTH_REGISTER`, and then listening for `GUID_WINEBTH_AUTHENTICATION_REQUEST` events on a `HANDLE` to `\??\WINEBTHAUTH` using the newly added `CM_Register_Notifications`.
To keep the MR from getting any larger, I have not included support for `BluetoothSendAuthenticationResponseEx`. That will likely be introduced in the future.
--
v7: bluetoothapis/tests: Add tests for BluetoothRegisterForAuthenticationEx and BluetoothUnregisterAuthentication.
bluetoothapis: Implement BluetoothRegisterForAuthenticationEx and BluetoothUnregisterForAuthentication.
winebth.sys: Implement IOCTL_WINEBTH_AUTH_REGISTER.
winebth.sys: Broadcast a BLUETOOTH_AUTHENTICATION_REQUEST PnP event on receiving a RequestConfirmation request from BlueZ.
winebth.sys: Register a pairing agent with BlueZ during startup.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7630
This MR uses the cursor-shapes-v1 protocol to tell the compositor which system
cursor shape to use. If a shape match is not found (or cursor-shapes-v1
is not available) we fall back to setting the cursor buffer from the
Windows cursor data as before.
The second commit implements support for a "UseSystemCursors" driver option, similar
to what winex11 has. Since this is the first winewayland driver option we also introduce
all the related registry reading code.
--
Side note: The registry code is a copy from winex11, and is the third copy in the
codebase (x11, mac, wayland). Perhaps it's worth introducing a common
ntuser function to perform the option reading for the drivers, something like
`NtUserGetDriverOption("X11 Driver", buffer, buffer_size, TRUE /* whether to read app specific option if present */)`.
With such a function there is the concern about each call reopening the registry, but we can see if that's actually a problem and how a different API (or some sort of caching) may help.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7678
In CopyFileEx, and DeleteFile functions, by default, the file name
and path are limited to MAX_PATH characters. To extend this limit
to 32,767 wide characters, need prepend "\\\\?\\" to the path.
--
v5: kernelbase: Limit the maximum path length for DeleteFile.
kernelbase: Fix DeleteFileA doesn't support long path.
kernelbase: Limit the maximum path length for filesystem.
ntdll: Load the value of longPathAware from manifest.
kernel32/tests: Add tests for maximum path length limitation.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7540
--
v2: comctl32/tests: Test MSAA events for SysLink.
comctl32/tests: Test SetWindowText and LM_GETITEM for SysLink.
comctl32/tests: Test accLocation values on SysLink control.
comctl32: Implement EVENT_OBJECT_NAMECHANGE for SysLink controls.
comctl32: Implement accDoDefaultAction for SysLink controls.
comctl32/tests: Add test for SysLink accDoDefaultAction.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7618
Introduce infrastructure necessary to support receiving, sending and replying (to) Bluetooth authentication/pairing requests:
- During startup, the Bluetooth driver now creates a "pairing agent" and registers it with BlueZ. The pairing agent is a DBus object implementing the `org.bluez.Agent1` interface (documented [here](https://github.com/bluez/bluez/blob/master/doc/org.bluez.Agent.rst)), which receives authentication requests from BlueZ. The pairing agent then forwards the request data to the PE driver, in form of a `WINEBLUETOOTH_EVENT_AUTH_EVENT` event. The agent is unregistered during driver shutdown.
- Right now, the agent only supports Numeric Comparison pairing requests.
- Create a new auxiliary device, `\??\WINEBTHAUTH` during driver startup. This device handles authentication functionality that is independent of radio PDOs on the system, which allows the userspace APIs to not track individual Bluetooth radio objects to implement authentication. `WINEBTHAUTH` right now serves two purposes:
- Serve as the device object for which `GUID_WINEBTH_AUTHENTICATION_REQUEST` PnP events are broadcasted. This event is sent whenever the Bluetooth event loop in (`bluetooth_event_loop_thread_proc`) receives `WINEBLUETOOTH_EVENT_AUTH_EVENT`. The event's buffer contains a `struct winebth_authentication_request` value, which contains data relevant to the incoming auth request.
- Handle the `IOCTL_WINEBTH_AUTH_REGISTER` IOCTL. This simply calls the [`RequestDefaultAgent` BlueZ method](https://github.com/bluez/bluez/blob/master/doc/org.bluez.AgentManag… right now, which asks BlueZ to send all incoming Bluetooth authentication requests to Wine's pairing agent (described above). This is not always strictly necessary, but is useful if there already is a default pairing agent set.
- `WINEBTHAUTH` will also ultimately be in charge of responding to authentication requests, which I'll be adding in the next-ish MR(s).
- Implement `BluetoothRegisterForAuthenticationEx` and `BluetoothUnregisterAuthentication`. Registration is done by invoking `IOCTL_WINEBTH_AUTH_REGISTER`, and then listening for `GUID_WINEBTH_AUTHENTICATION_REQUEST` events on a `HANDLE` to `\??\WINEBTHAUTH` using the newly added `CM_Register_Notifications`.
To keep the MR from getting any larger, I have not included support for `BluetoothSendAuthenticationResponseEx`. That will likely be introduced in the future.
--
v6: bluetoothapis/tests: Add tests for BluetoothRegisterForAuthenticationEx and BluetoothUnregisterAuthentication.
bluetoothapis: Implement BluetoothRegisterForAuthenticationEx and BluetoothUnregisterForAuthentication.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7630
WMSyncReader starts a background read thread that reads from the IStream
passed to IWMSyncReader::OpenStream. This means it could use the IStream in the
background even when no IWMSyncReader methods are being called.
For well-behaved applications, this is probably OK. However, AQUARIUM
(Steam 2515070) frees the IStream it passes to WMSyncReader _before_
it calls IWMSyncReader::Close, which stops the read thread. This causes
the read thread to access freed memory. This is improper, but not
unreasonable, as IWMSyncReader is supposed to be a synchronous
interface, so one might assume when they weren't calling into
IWMSyncReader methods, the IStream won't be used.
This commit adds a `wg_parser_dont_read` function, which can be used to
stop wg_parser from issuing read requests. This is used by IWMSyncReader
to make sure read requests are only issued when IWMSyncReader methods
are being called.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7676
In preparation for more changes to properly track X11 active window and request active window changes, ultimately improving window focus consistency on X11.
--
v2: winex11: Track _NET_ACTIVE_WINDOW property changes.
winex11: Introduce a new handle_state_change helper.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7627
This MR adds tests that examine the values of the samples output by the byte stream handlers.
It is marked as draft as it is dependent on the fixes included within MR !7569.
I've also renamed the tests as they previously exclusively tested the sample output timestamps. The tests now also look at the number of buffers included in a sample and total size of the buffers within a sample.
--
v2: mfplat/tests: Add tests for MP3 Byte Stream Output.
mfplat/tests: Add tests for Byte Stream Output.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7672
This MR adds tests that examine the values of the samples output by the byte stream handlers.
It is marked as draft as it is dependent on the fixes included within MR !7569.
I've also renamed the tests as they previously exclusively tested the sample output timestamps. The tests now also look at the number of buffers included in a sample and total size of the buffers within a sample.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7672
Follow-up of !2786, which appears to have been abandoned.
--
v4: Fixup deletion of socket files
ws2_32/tests: Add test for AF_UNIX sockets.
server: Fix getsockname() and accept() on AF_UNIX sockets.
server: Introduce error when attempting to create a SOCK_DGRAM AF_UNIX socket.
server: Allow for deletion of socket files.
ws2_32: Add support for AF_UNIX sockets.
ws2_32: Add afunix.h header.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7650
Follow-up of !2786, which appears to have been abandoned.
--
v3: ws2_32/tests: Add test for AF_UNIX sockets.
server: Fix getsockname() and accept() on AF_UNIX sockets.
server: Introduce error when attempting to create a SOCK_DGRAM AF_UNIX socket.
server: Allow for deletion of socket files.
ws2_32: Add support for AF_UNIX sockets.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7650
Implemented the following functions with a bit of a hack:
PowerGetActiveScheme
PowerSetActiveScheme
PowerEnumerate
PowerReadFriendlyName
--
v2: powrprof.dll: fix CI compile issues
https://gitlab.winehq.org/wine/wine/-/merge_requests/7667
..and improve performance and precision of parse_numeric_literal() for doubles, and replace artificial (INT_MAX/100) border conditions with the true +/- 308
10^308 is the largest representable power of 10 in double
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7591
`WS_POPUP` for instance is `0x80000000`, which overflows a `LONG`. Coverity complained about this. The return type of `get_window_long()` already was `DWORD`.
--
v5: win32u: Store window styles in a DWORD (Coverity).
https://gitlab.winehq.org/wine/wine/-/merge_requests/7657
`WS_POPUP` for instance is `0x80000000`, which overflows a `LONG`. Coverity complained about this. The return type of `get_window_long()` already was `DWORD`.
--
v4: win32u: Store window styles in a UINT (Coverity).
https://gitlab.winehq.org/wine/wine/-/merge_requests/7657
Add Expat as a dependency, and use it to parse the XML returned from FreeBSD's kern.sched.topology_spec sysctl.
--
v6: ntdll: implement create_logical_proc_info on FreeBSD.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7339
The last of the saving patches for d3dx9. :)
--
v4: d3dx9: Add support for saving IDirect3DVolumeTexture9 textures to DDS files in D3DXSaveTextureToFileInMemory().
d3dx9: Add support for saving IDirect3DCubeTexture9 textures to DDS files in D3DXSaveTextureToFileInMemory().
d3dx9: Add support for saving IDirect3DTexture9 textures to DDS files in D3DXSaveTextureToFileInMemory().
d3dx9/tests: Add more tests for saving textures to DDS files.
d3dx9/tests: Add a test for reading back a texture saved as D3DXIFF_JPG.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7636
--
v12: server: Handle hardlinks and casefolding when renaming the same file.
server: Handle renames to destinations containing trailing slashes.
kernel32/tests: Test renaming a file into a hardlink of itself.
kernel32/tests: Use FindClose instead of CloseHandle when closing
https://gitlab.winehq.org/wine/wine/-/merge_requests/6855
Windows 10 [received support](https://devblogs.microsoft.com/commandline/af_unix-comes-to-window… for AF_UNIX sockets in Insider Build 17063. This merge request adds basic support for AF_UNIX sockets to ws2_32 and wineserver.
Of particular note is the difficulty in handling `sun_path`. Most of the functions that allow for translating Windows paths to Unix paths are not accessible from ws2_32. I considered the following options:
* Pass the Windows path to wineserver and do the conversion there.
* This is, as far as I can tell, not possible without major rearchitecting. wineserver does not have functions to translate Windows paths to Unix paths, for obvious reasons.
* Obtain the current working directory of the requesting process and temporarily change directories to there.
* This only handles relative paths and fails for absolute paths, UNC paths, etc.
* Conditionally change directories based on whether the path is relative or not.
* This is error-prone and wineserver does not have the requisite functions to do this cleanly.
I ultimately decided to pass the translated Unix path to wineserver, which changes directories to `dirname(path)`. It then provides `bind` and `connect` with `basename(path)`. This is not threadsafe, but wineserver is not (currently) multithreaded.
Abstract sockets are not fully supported by this patch, matching the behavior of Windows.
--
v67: ws2_32/tests: Add test for AF_UNIX sockets.
server: Fix getsockname() and accept() on AF_UNIX sockets.
server: Introduce error when attempting to create a SOCK_DGRAM AF_UNIX socket.
server: Allow for deletion of socket files.
ws2_32: Add support for AF_UNIX sockets.
ws2_32: Add afunix.h header.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2786
Follow-up of !2786, which appears to have been abandoned.
--
v2: ws2_32/tests: Add test for AF_UNIX sockets.
server: Fix getsockname() and accept() on AF_UNIX sockets.
server: Introduce error when attempting to create a SOCK_DGRAM AF_UNIX socket.
server: Allow for deletion of socket files.
ws2_32: Add support for AF_UNIX sockets.
ws2_32: Add afunix.h header.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7650
Related Wine issue: https://bugs.winehq.org/show_bug.cgi?id=52714
I'm starting work on updating/extending Linux force feedback API and one of my goals is to expose the number and an array that contains the device's ffb-enabled axes. As I'm mainly working with USB PID driver, I already have a POC of obtaining this data.
What prompted this is that currently Wine always creates virtual joysticks with two PID ffb axes. This causes issues with [Richard Burns Rally](https://github.com/ValveSoftware/Proton/issues/6702#issuecomment-267…, as this game incorrectly initializes a `CONSTANT_FORCE` effect with all the FFB axes that contain `DIDOI_FFACTUATOR` flag and then trying to update `cAxes` and `rgdwAxes` values which leads to `DIERR_INVALIDPARAM`.
Now, this flag is set by wine while enumerating virtual device's axes and while `(axis index < FFB axes)`, flag is applied. This means, that every device which has FFB functionality and at least two axes, will report FFB on `X`, `Y`.
While updated API would mean a lot of steering wheels would correctly report only 1 axis, a lot of USB PID wheels still include `X` and `Y` in their `AXES_ENABLE` and `DIRECTION` usages. This, again, would lead to broken FFB (in affected games).
On Windows, there's a possibility of overwriting some joystick capabilities with registry entries, which ends up removing `DIDOI_FFACTUATOR` flag from a selected axis. This doesn't work in Wine.
This MR allows Wine to add an arbitrary number (up to `PID_AXES_MAX`) of axes to the PID descriptor, based on the value of Haptic Axes from SDL or from Linux FF api in the future (I'm working on it). Additionally, to work around RBR and other games with similar, wrong FFB handling, I introduced a [hint](https://github.com/libsdl-org/SDL/issues/12341) to SDL that allows a dynamic overwrite of the number of haptic axes. For the Linux API, I'll figure out a nice way to override when the number of axes will be exposed.
With these changes, I was able to successfully get force feedback on my Moza Racing R9 with all axes usable. With additional traces in the dinput code, I confirmed that with one axis defined in the PID descriptor, the game created a constant force effect with just one axis and `cAxes = 1`.
--
v39: dinput/tests: Add tests for 6-axis ff joystick
https://gitlab.winehq.org/wine/wine/-/merge_requests/7422