UtilApplicationCreateMutex(Boolean, String, Boolean, Boolean, MutexSecurity) Method
Initializes a new instance of the
Mutex class with a
Boolean
value that indicates whether the calling thread should have initial ownership
of the
Mutex, a
String that is the name of the mutex,
a
Boolean variable that, when the method returns,
indicates whether the calling thread was granted initial ownership of the
Mutex,
and the access control security to be applied to the
Mutex.
Namespace: DevCase.Core.ApplicationAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
No code example is currently available or this language may not be supported.
- globalScope Boolean
-
Indicates the visibility scope for the Mutex object to be created.
If , The mutex is visible in all terminal server sessions,
otherwise, The mutex is visible only in the terminal server session where it was created.
- name String
-
The name of the system mutex.
If the value is , the Mutex is unnamed.
- initiallyOwned Boolean
- to give the calling thread initial ownership of the named system mutex if
the named system mutex is created as a result of this call; otherwise, .
- refCreatedNew Boolean
-
When this method returns, contains a Boolean that is
if a local mutex was created (that is, if name is null or an empty string)
or if the specified named system mutex was created;
if the specified named system mutex already existed.
- mutexSecurity MutexSecurity
-
A MutexSecurity object that represents the access control security to be applied to the named system mutex.
Mutex
The resulting
Mutex object.
This is a code example.
No code example is currently available or this language may not be supported.
Dim mutexName As String = Guid.NewGuid().ToString()
Dim initiallyOwned As Boolean = True
Dim createdNew As Boolean
Dim allowEveryoneRule As New MutexAccessRule(New SecurityIdentifier(WellKnownSidType.WorldSid, Nothing), MutexRights.FullControl, AccessControlType.Allow)
Dim mutexSecurity As New MutexSecurity()
mutexSecurity.AddAccessRule(allowEveryoneRule)
Dim mutex As Mutex = CreateMutex(True, mutexName, initiallyOwned, createdNew, mutexSecurity)
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.