From c699471994665cc10946b6e3ebabfdbd7a907383 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sun, 25 May 2025 17:15:23 +0200 Subject: [PATCH] [AUDIOSRV] Register and unregister device notifications --- base/services/audiosrv/pnp.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/base/services/audiosrv/pnp.c b/base/services/audiosrv/pnp.c index 26a2fae9449..6a2946ebe41 100644 --- a/base/services/audiosrv/pnp.c +++ b/base/services/audiosrv/pnp.c @@ -138,9 +138,7 @@ RegisterForDeviceNotifications(VOID) device_notification_handle = RegisterDeviceNotificationW((HANDLE) service_status_handle, ¬ification_filter, - DEVICE_NOTIFY_SERVICE_HANDLE -/* | - DEVICE_NOTIFY_ALL_INTERFACE_CLASSES*/); + DEVICE_NOTIFY_SERVICE_HANDLE); if (!device_notification_handle) { DPRINT("failed with error %d\n", GetLastError()); @@ -158,12 +156,10 @@ RegisterForDeviceNotifications(VOID) VOID UnregisterDeviceNotifications(VOID) { - /* TODO -- NOT IMPLEMENTED! */ - if (device_notification_handle) { - /* TODO */ - device_notification_handle = NULL; + if (UnregisterDeviceNotification(device_notification_handle)) + device_notification_handle = NULL; } }