Windows: flush shell notifications when dismounting with /q - #1852
Open
amail80 wants to merge 1 commit into
Open
Windows: flush shell notifications when dismounting with /q#1852amail80 wants to merge 1 commit into
amail80 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #1658. That fix gates the synchronous SHChangeNotify on
Silent,but the immediate process exit is caused by
Quit, and the two are set bydifferent command line switches:
/qdoes not imply/s, soVeraCrypt /dismount X: /qnever reaches theSHCNF_FLUSHbranch and the ghost drive letter reported in #337 and #1426 canstill appear. This is what the process actually terminates on
(src/Mount/Mount.c):
Observable without hitting the race: the same
Silentcheck also selects howthe unmount runs, so
VeraCrypt /d X: /qdisplays the wait dialog, which onlyhappens when
Silentis FALSE - confirming the flush branch is skipped on thispath. Whether a ghost letter then appears depends on Explorer processing the
asynchronous notification before the process exits, so it is timing dependent;
the missing flush is not.
Quitis defined in Mount.c only, while half of the fix lives in Dlgcode.c,which is also linked into Format and ExpandVolume - and ExpandVolume defines its
own
Quit, so the symbol cannot simply be moved. This adds a small shared flaginstead:
BOOL ProcessExitsAfterCommandQuit = TRUE;in ExtractCommandLine()if (Silent || ProcessExitsAfterCommand)Silentis kept in the condition, so existing behaviour is unchanged; the patchis purely additive.
Also reported on SourceForge as ticket #629.