--
v3: ws2_32: Support bind for Bluetooth RFCOMM addresses.
ws2_32: Add bind tests for Bluetooth RFCOMM sockets.
server: Add support for creating Bluetooth RFCOMM sockets.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7634
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.
--
v5: bluetoothapis/tests: Add tests for BluetoothRegisterForAuthenticationEx and BluetoothUnregisterAuthentication.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7630
Some console objects currently do several unique things:
* Delegate waits onto the queue of another object. This is not really a problem
for in-process waits, since we can just return the sync object for the
delegate. However, it's also unnecessary, adds to the complexity of the server
logic, and is one out of one places where this is done.
* Make the wait state dependent on the process. This is difficult to emulate
with ntsync and would require creating separate server objects for each
process, hacking into duplicate_handle.
* Fail a wait entirely in certain circumstances. This is pretty much impossible
to emulate with in-process waits.
Although ntsync has been in development for some time, I have regrettably failed
to notice these problems until now.
Fortunately, none of these behaviours happen on modern Windows. Although I/O on
unbound handles delegates to the console of the current process, the signaled
state does not. As the tests here show, the signaled state of a handle depends
on the active console of the process in which the handle was created. If that
console no longer exists, the signaled state is no longer updated [with one
rather inexplicable exception].
Crucially, in current Windows waits never fail, and the state of an object is
the same across all process which hold handles to it. Therefore this patch
brings our behaviour to closer match current Windows.
In theory these are fds and should use default_fd_signaled(). However, the
points at which the handles are signaled are completely different, and I/O does
not trigger console handles to become signaled when it normally would. Therefore
for the time being I've kept the code using custom signaled ops.
There is one other oddity related to consoles, which is the existence of
console_add_queue(), which seeks to lazily create an input thread when a console
is first waited on. This is one out of two places, after this patch, when the
wait process is hijacked (the other being message queues). Fortunately this is
easy to handle for in-process synchronization objects, by queueing the ioctl
from the callback used to retrieve the in-process synchronization object itself.
--
v6: server: Track unbound output signaled state based on its original console.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7608
This MR adds a basic implementation for the BluetoothAdapter interface in Windows.Devices.Bluetooth, including winebth.sys support for getting properties associated with the radio's Low Energy capabilities.
--
v3: windows.devices.bluetooth/tests: Add tests for IBluetoothAdapter.
windows.devices.bluetooth: Implement BluetoothAdapter::IsAdvertisementOffloadSupported.
windows.devices.bluetooth: Implement BluetoothAdapter::IsCentralRoleSupported.
windows.devices.bluetooth: Implement BluetoothAdapter::IsPeripheralRoleSupported.
windows.devices.bluetooth: Implement BluetoothAdapter::IsLowEnergySupported.
winebth.sys: Implement IOCTL_WINEBTH_RADIO_GET_LE_INFO.
winebth.sys: Fetch BLE-related properties for BlueZ adapter objects as well.
windows.devices.bluetooth: Implement IBluetoothAdapter::get_DeviceId().
windows.devices.bluetooth: Implement IBluetoothAdapterStatics::GetDefaultAsync().
https://gitlab.winehq.org/wine/wine/-/merge_requests/7659
This MR adds a basic implementation for the BluetoothAdapter interface in Windows.Devices.Bluetooth, including winebth.sys support for getting properties associated with the radio's Low Energy capabilities.
--
v2: windows.devices.bluetooth: Implement BluetoothAdapter::IsAdvertisementOffloadSupported.
windows.devices.bluetooth: Implement BluetoothAdapter::IsCentralRoleSupported.
windows.devices.bluetooth: Implement BluetoothAdapter::IsPeripheralRoleSupported.
windows.devices.bluetooth: Implement BluetoothAdapter::IsLowEnergySupported.
winebth.sys: Implement IOCTL_WINEBTH_RADIO_GET_LE_INFO.
winebth.sys: Fetch BLE-related properties for BlueZ adapter objects as well.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7659
This MR adds a basic implementation for the BluetoothAdapter interface in Windows.Devices.Bluetooth, including winebth.sys support for getting properties associated with the radio's Low Energy capabilities.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7659
`WS_POPUP` for instance is `0x80000000`, which overflows a `LONG`. Coverity complained about this. The return type of `get_window_long()` already was `DWORD`.
--
v3: win32u: Store window styles in a UINT (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`.
--
v2: win32u: Store window styles in a DWORD (Coverity).
https://gitlab.winehq.org/wine/wine/-/merge_requests/7657