When the listview expands or collapses an item it notifies the parent using the TVN_ITEMEXPANDING message. The parent can return true on this message and it prevents the treeview from expanding or collapsing the item. WINE does not let you deny TVN_ITEMEXPANDING by returning true.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53727
--
v14: comctl32/treeview: Allow treeview parent to deny treeview expansion.
comctl32/tests: Add test to check if treeview expansion can be denied.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6218
PnP device notifications/events are currently sent and received from the `plugplay` service as the raw-bytes for the `DBT_DEVTYP_DEVICEINTERFACE` struct that needs to be sent from the PnP code in `ntoskrnl.exe`. While simple, it does not support sending `DBT_DEVTYP_HANDLE` events, as they also include a `HANDLE` to the device the event comes from, which cannot simply be sent as raw bytes. This MR reworks how notifications are sent and received from the `plugplay` service, by:
1. Introducing new structs `DEVICE_BROADCAST_HANDLE` and `DEVICE_BROADCAST_DEVICEINTERFACE` in `plugplay.idl`. The structs are similar to their counterparts in `dbt.h` without the `devicetype` and `size` fields added for the header.
2. Re-write `plugplay_{send,get}_event` to use the newly added union `DEVICE_BROADCAST`, which uses the `devicetype` value as the discriminant. A deep copy of this union is then appended to the event queue of every registered listener.
3. Re-write `I_ScRegisterDeviceNotification` and `device_notify_proc` in `sechost/service.c` to use the newly added types instead. Additionally, add support for registering for `DBT_DEVTYPE_HANDLE` notifications, for which the `OBJECT_NAME_INFORMATION` value for the device `HANDLE` is used to filter notifications in order to correctly dispatch them to their registered callbacks.
4. Re-write the callbacks in `user32/input.c` to accept the `DEVICE_BROADCAST` union instead, and construct the appropriate `DEV_BROADCAST_*` struct from it, which gets sent to `SendMessageTimeoutW` as usual.
Support for `DBT_DEVTYP_HANDLE` is needed for the Bluetooth driver stack I have been working on recently, which uses `DBT_DEVTYP_HANDLE` events to notify userspace about newly found Bluetooth devices during discovery and incoming authentication requests, as documented by MS [here](https://learn.microsoft.com/en-us/windows/win32/bluetooth/bluetooth-a….
--
v6: plugplay: Rewrite RPC interface to send and receive events using the newly introduced DEVICE_BROADCAST types.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6315
PnP device notifications/events are currently sent and received from the `plugplay` service as the raw-bytes for the `DBT_DEVTYP_DEVICEINTERFACE` struct that needs to be sent from the PnP code in `ntoskrnl.exe`. While simple, it does not support sending `DBT_DEVTYP_HANDLE` events, as they also include a `HANDLE` to the device the event comes from, which cannot simply be sent as raw bytes. This MR reworks how notifications are sent and received from the `plugplay` service, by:
1. Introducing new structs `DEVICE_BROADCAST_HANDLE` and `DEVICE_BROADCAST_DEVICEINTERFACE` in `plugplay.idl`. The structs are similar to their counterparts in `dbt.h` without the `devicetype` and `size` fields added for the header.
2. Re-write `plugplay_{send,get}_event` to use the newly added union `DEVICE_BROADCAST`, which uses the `devicetype` value as the discriminant. A deep copy of this union is then appended to the event queue of every registered listener.
3. Re-write `I_ScRegisterDeviceNotification` and `device_notify_proc` in `sechost/service.c` to use the newly added types instead. Additionally, add support for registering for `DBT_DEVTYPE_HANDLE` notifications, for which the `OBJECT_NAME_INFORMATION` value for the device `HANDLE` is used to filter notifications in order to correctly dispatch them to their registered callbacks.
4. Re-write the callbacks in `user32/input.c` to accept the `DEVICE_BROADCAST` union instead, and construct the appropriate `DEV_BROADCAST_*` struct from it, which gets sent to `SendMessageTimeoutW` as usual.
Support for `DBT_DEVTYP_HANDLE` is needed for the Bluetooth driver stack I have been working on recently, which uses `DBT_DEVTYP_HANDLE` events to notify userspace about newly found Bluetooth devices during discovery and incoming authentication requests, as documented by MS [here](https://learn.microsoft.com/en-us/windows/win32/bluetooth/bluetooth-a….
--
v5: plugplay: Rewrite RPC interface to send and receive events using the newly introduced DEVICE_BROADCAST types.
include/wine: Add header dbt.h.
include/wine/plugplay: Separate device broadcast event types into their own structs.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6315
I'm not sure about the need for this solution, so it's a **DRAFT**. For me it is an academic interest to check whether atomic locks will give advantages over pthread_mutex in games. Need to think about tests that can actually be measured.
Before build need define `USE_AFL`.
```bash
export CFLAGS="${CFLAGS} -DUSE_AFL"
```
Old: https://gitlab.winehq.org/wine/wine/-/merge_requests/6031
v2 Changes:
- Implemented different types of mutexes, and converted the code to use gcc extensions instead of C11.
- Added tests and implemented as a separate library for testing. For tests, need to disable cpufreq scheduler and any power management, otherwise the tests will be unstable. https://github.com/h0tc0d3/afl
- Depending on the processor, a regular mutex can be slightly faster or slightly slower. The recursive mutex used in ntdll is more than 2 times faster, and slightly faster with a simple lock-unlock.
TODO:
- Condvar and RWlocks. With condvar there is a problem of preemption of lower priority threads by a higher priority thread. PI mutex allows to avoid this and takes into account the order, but works much slower. It is not yet entirely clear which condvar is better to use in wine. https://sourceware.org/bugzilla/show_bug.cgi?id=11588https://static.lwn.net/images/conf/rtlws11/papers/proc/p10.pd
- Try to speed up windows synchronization primitives. At this point, I don't quite understand how this works and why the ntsync implementation uses server and vanilla wine doesn't. I would appreciate any help if it would be possible to improve the performance of synchronization primitives by implementing atomic structures.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6307
Based on the wine-staging patch winex11-CandidateWindowPos from Felix Yan with works from
Muneyuki Noguchi and Sebastian Lackner.
--
v3: win32u: Set host IME composition window position in NtUserShowCaret().
win32u: Set host IME composition window position in set_caret_pos().
win32u: Support setting host IME composition window position for ImmSetCompositionWindow().
https://gitlab.winehq.org/wine/wine/-/merge_requests/6286
Based on the wine-staging patch winex11-CandidateWindowPos from Felix Yan with works from
Muneyuki Noguchi and Sebastian Lackner.
--
v2: win32u: Set host IME composition window position in NtUserShowCaret().
win32u: Set host IME composition window position in set_caret_pos().
win32u: Support setting host IME composition window position for ImmSetCompositionWindow().
https://gitlab.winehq.org/wine/wine/-/merge_requests/6286