Interprocess
|
Exception | Condition |
---|---|
ArgumentNullException | Argument name cannot be empty, null or white space. |
UnauthorizedAccessException | The named mutex exists, but the user does not have the minimum needed security access rights to use it. |
This function uses a hash of the name when creating the Mutex, not the actual name - this way restrictions on the name length do not need to be a user concern. All processes needing an inter-process Mutex need to use this same function to ensure access to the same Mutex.
The name can be a string of any length (must not be empty, null or white space) and is not case-sensitive. All hashes of the name used to create the global Mutex are first converted to lower case.
The Mutex created is "Global" meaning that it will be accessible to all active application sessions including terminal service sessions. This is accomplished internally by prefixing the Mutex name with "Global\"; it is not necessary for the user to be concerned with the length or contents of the name in this method as long as the same name is used for each application. Do not use this helper function if you need to create a specifically named or non-global Mutex, such as when you need to interact with another application using a Mutex that does not use this function.