Include the hash of the SID in the Window Class and Mutant #19109
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.
Right now, we do not use a sufficiently unique name to disambiguate Terminal instances running on the same desktop.
Mutexes (mutants) are named objects that live in the user's session, under
Sessions\1\BaseNamedObjects
(for the local desktop session). When multiple users are logged into the same session--such as with "Run as different user"--they share a local BaseNamedObjects namespace. Ugh.We cannot use
CreatePrivateNamespace
as it requires a boundary descriptor, and the only boundary descriptors supported by the current API are based on package identity. I also fear thatCreatePrivateNamespace
is subject to a race condition withOpenPrivateNamespace
; Create will not Open an existing one, so we would need to back off and retry either opening or creating. Yuck.After this commit, we will hash the user's SID into the name of both the window class and the mutant, right after the path hash (if running unpackaged).
Closes #18704