From c44fce50005274d2455f5c49028d6fe04ae7effa Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Tue, 13 Oct 2026 18:10:44 +0900 Subject: [PATCH] Windows: honor notification suppression when dismounting Guard both direct SHChangeNotify flushes with DeviceChangeBroadcastDisabled. These calls bypass BroadcastDeviceChange and its suppression check. --- src/Common/Dlgcode.c | 2 +- src/Mount/Mount.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c index 0581d7ed..654d54c2 100644 --- a/src/Common/Dlgcode.c +++ b/src/Common/Dlgcode.c @@ -9827,7 +9827,7 @@ retry: removal before the process exits, leaving a ghost drive letter. Re-send the notification with SHCNF_FLUSH to force synchronous processing by Explorer before we return. */ - if (Silent) + if (Silent && !DeviceChangeBroadcastDisabled) { wchar_t root[] = { (wchar_t) (nDosDriveNo + L'A'), L':', L'\\', 0 }; SHChangeNotify (SHCNE_DRIVEREMOVED, SHCNF_PATH | SHCNF_FLUSH, root, NULL); diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c index 31b7157a..565ef859 100644 --- a/src/Mount/Mount.c +++ b/src/Mount/Mount.c @@ -6350,7 +6350,7 @@ retry: /* GH #337, GH #1426: Flush shell notifications synchronously in silent/CLI mode to prevent ghost drive letters when the process exits immediately after dismount. */ - if (Silent) + if (Silent && !DeviceChangeBroadcastDisabled) { DWORD removedDrives = prevMountList.ulMountedDrives & ~mountList.ulMountedDrives; for (i = 0; i < 26; i++)