mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-10-22 06:12:35 +00:00
Windows: honor notification suppression when dismounting
Guard both direct SHChangeNotify flushes with DeviceChangeBroadcastDisabled. These calls bypass BroadcastDeviceChange and its suppression check.
This commit is contained in:
@@ -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);
|
||||
|
||||
+1
-1
@@ -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++)
|
||||
|
||||
Reference in New Issue
Block a user