On Wed Jul 30 08:13:21 2025 +0000, Rémi Bernon wrote:
This doesn't look very useful to merge both cases after all, what about:
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;
Yeah, there isn't much common code between them. Thanks.