Follow-up of !2786, which appears to have been abandoned.
--
v23: 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
If ClipCursor is called while the seat doesn't have a pointer and the
call qualifies for locking the pointer, it would have tried to lock a
null wl_pointer.
For example, I'm launching a fullscreen application (which causes ClipCursor calls on startup) in a headless compositor before I launch my virtual keyboard/pointer client. While the pointer is deinitialized and there cannot be a focused hwnd, the cursor wl_surface will not be set, making it qualify for pointer locking.
--
v2: winewayland: Require wl_pointer for pointer constraints.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7857
`MulDiv` doesn't match the correct Windows behavior for the function, which actually differs in some edge cases for 32-bit and 64-bit.
Test case:
```c
MulDiv(1, 0x80000000, 0x80000000);
// WINE - both 32-bit and 64-bit: 0
// Windows (32-bit/kernel32.dll): 2
// Windows (64-bit/kernelbase.dll): -1
```
On Windows 32-bit, this would return 2. On 64-bit, it'd return -1.
However, on WINE, this call would return 0 for both 32-bit and 64-bit. This discrepancy was previously abused by threat actors to detect if the application runs under WINE.
---
On Windows, `MulDiv` has a different implementation for 32-bit (from `kernel32.dll`) and 64-bit (leveraged to `kernelbase.dll` from `kernel32.dll`).
After adjusting the 64-bit code to be an exact replica of the original code from `kernelbase.dll`, it'd still return the incorrect value due to Microsoft's code having undefined behavior with negation. It could be avoided with `-O0` but I opted into rewriting it with the undefined behavior to be, well.. defined.
To clarify, the original code from Microsoft has a bug (logically, at least). But WINE is supposed to have matching behavior so we can run Windows programs as intended.
The 32-bit version of `MulDiv` in Windows has a more complicated bug; I've documented it in the code.
---
This is my first contribution to WINE - I cannot find any `CONTRIBUTING.md` or similar file with guidelines so I did my best to follow the convention of other merge requests.
I've added unit testing for `MulDiv` to ensure there won't be a regression in the future.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7916
This MR adds an initial implementation of the winsock `WSALookupsService*` methods for performing Bluetooth device discovery (`LUP_CONTAINERS`).
--
v17: ws2_32: Implement WSALookupServiceNext for Bluetooth device discovery.
ws2_32: Implement WSALookupServiceBegin for Bluetooth device discovery.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7542
This MR adds an initial implementation of the winsock `WSALookupsService*` methods for performing Bluetooth device discovery (`LUP_CONTAINERS`).
--
v16: 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
Add `IOCTL_WINEBTH_RADIO_START_AUTH`, which gets used to implement `BluetoothAuthenticateDeviceEx`.
--
v5: bluetoothapis/tests: Add tests for BluetoothAuthenticateDeviceEx.
bluetoothapis: Use a wizard GUI to respond to pairing requests if an authentication callback is not registered.
bluetoothapis: Implement BluetoothAuthenticateDeviceEx.
winebth.sys: Implement IOCTL_WINEBTH_RADIO_START_AUTH.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7885
Add `IOCTL_WINEBTH_RADIO_START_AUTH`, which gets used to implement `BluetoothAuthenticateDeviceEx`.
--
v4: bluetoothapis/tests: Add tests for BluetoothAuthenticateDeviceEx.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7885
VxDCall service id 0x0010 provides int24 dispatch functionality and
VxDCall service id 0x002a provides int41 dispatch functionality.
All of these services together with existing service id 0x0029 (for
int31/dpmi functionality) have same API, first VxDCall() argument is
value for EAX register and second argument is value for ECX register.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7906
On Sat Apr 26 17:30:57 2025 +0000, Joe Souza wrote:
> I wasn't aware of WCMD_parameter. That is a good suggestion if it works
> for what's needed here.
FindFirstFileEx is an optimization for remote/network file systems, such that a round trip across the network is not performed for unwanted directory entries. Since Wine seems to support only file systems that are mounted by the host operating system and does not appear to have any direct knowledge of remote-mounted file systems, I can skip using the Ex function here.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7843#note_101956
On Sat Apr 26 17:30:01 2025 +0000, Joe Souza wrote:
> In the latest changes I have already split out much code from
> WCMD_ReadConsole into subfunctions. You're saying it's still too long?
> I suppose that I could split out the code for the individual case
> statements into separate handler functions, but the code to handle Tab
> is the bulk of that function.
I wasn't aware of WCMD_parameter. That is a good suggestion if it works for what's needed here.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7843#note_101955
On Sat Apr 26 15:12:31 2025 +0000, eric pouech wrote:
> thanks
> a couple of high level comments:
> * I don't think having a separate source file just for \~400 LoC is
> worth it
> * WCMD_ReadConsole is way too big as a function and need to be split in
> smaller pieces.
> * you should also be using the command line parsing functions instead of
> rewriting them (eg WCMD_parameter to loop against the various parameters)
> from quick testing:
> * when looping around files sometimes filename is inserted in quotes,
> while it shouldn't. Native seems to insert quotes only when filename
> contains specific characters (spaces...), but to also remove them if
> next file doesn't contain any...
> * using "cd c:\\Program Files"\<tab\>\<backspace\>\\\<tab\> doesn't
> behave as native... native circles in the directory content, current MR
> only adds a double quote
> * got a crash when playing with MR (perhaps one of the buffer overflow
> stated above, perhaps not)
> * when the width of the console is smaller than the full line input (eg
> spread at least on two lines), circling gives some strange result
> (cursor and display when from bottom of screen buffer back to top, will
> previous content not shifted)
> likely the current appoach of just having a handle to findfirst/findnext
> will not fit all the (long term) goals. at some point, we want to
> support shift-tab which circles backwards in the matching files. and I
> fail to see what using FindFirstFileEx brings as value, as you filter
> against directory when needed (I'm not asking for supporting shift-tab
> right now, but rather to put in place a structure were it wil fit simply
> when we implement it)
> support for cd/rmdir/ and friends should be added in a second patch
> I didn't go further in the review given the amount a remarks and
> problems stated above. I'll restart when they are solved
> (will look in // to the ESC issue raised)
In the latest changes I have already split out much code from WCMD_ReadConsole into subfunctions. You're saying it's still too long? I suppose that I could split out the code for the individual case statements into separate handler functions, but the code to handle Tab is the bulk of that function.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7843#note_101954