On Tue Sep 3 15:15:10 2024 +0000, Rémi Bernon wrote:
I still don't like the "simplification" much, sorry. What about something like https://gitlab.winehq.org/rbernon/wine/-/commits/wip/devnotify-simplify? It filters the notification early, makes full copies of them to be called later, which makes the `device_notify_create_event` helper an appropriate place for client-specific fixups (like setting dbch_handle and dbch_hdevnotify). The device paths are also optionally passed as an explicit parameter to the plugplay interface, which is probably better than shoving it into the events. Then, I think you should also reorder the changes to put the tests first if possible, with some todo_wine, then the implementation of IoReportTargetDeviceChange which calls into plugplay but doesn't do anything else, and last the support for DBT_DEVTYP_HANDLE (assuming it's not making things outrageously complicated to handle in the tests). The refactoring can come first or after, doesn't matter much.
Hm, that is simpler, but would it make sense to generalize the `path` parameter in `plugplay_{send|get}_event` to a `BYTE *oob_data, SIZE_T *oob_data_size` instead? That way, the new parameters could be used to send additional data similar to `path` if the need ever arises in the future, plus it also makes the parameters more understandable.