Rémi Bernon (@rbernon) commented about dlls/windows.devices.enumeration/main.c:
+ case DevQueryStateAborted: + EnterCriticalSection( &watcher->cs ); + if (action_data->Data.State == DevQueryStateAborted) + { + watcher->status = DeviceWatcherStatus_Aborted; + DevCloseObjectQuery( watcher->query ); + } + else + watcher->status = DeviceWatcherStatus_Stopped; + watcher->query = NULL; + LeaveCriticalSection( &watcher->cs ); + + if (action_data->Data.State == DevQueryStateClosed) + typed_event_handlers_notify( &watcher->stopped_handlers, (IInspectable *)iface, NULL ); + IWeakReference_Release( weak ); + break; This doesn't look very useful to merge both cases after all, what about:
```suggestion:-16+0 case DevQueryStateClosed: EnterCriticalSection( &watcher->cs ); watcher->status = DeviceWatcherStatus_Stopped; watcher->query = NULL; LeaveCriticalSection( &watcher->cs ); typed_event_handlers_notify( &watcher->stopped_handlers, (IInspectable *)iface, NULL ); IWeakReference_Release( weak ); break; case DevQueryStateAborted: EnterCriticalSection( &watcher->cs ); watcher->status = DeviceWatcherStatus_Aborted; DevCloseObjectQuery( watcher->query ); watcher->query = NULL; LeaveCriticalSection( &watcher->cs ); IWeakReference_Release( weak ); break; ``` -- https://gitlab.winehq.org/wine/wine/-/merge_requests/8555#note_111446