MutexAcl.TryOpenExisting(String, MutexRights, Mutex) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Tries to open a specified named mutex, if it already exists, applies the desired access rights, and returns a value that indicates whether the operation succeeded.
public:
static bool TryOpenExisting(System::String ^ name, System::Security::AccessControl::MutexRights rights, [Runtime::InteropServices::Out] System::Threading::Mutex ^ % result);
public static bool TryOpenExisting (string name, System.Security.AccessControl.MutexRights rights, out System.Threading.Mutex? result);
public static bool TryOpenExisting (string name, System.Security.AccessControl.MutexRights rights, out System.Threading.Mutex result);
static member TryOpenExisting : string * System.Security.AccessControl.MutexRights * Mutex -> bool
Public Shared Function TryOpenExisting (name As String, rights As MutexRights, ByRef result As Mutex) As Boolean
Parameters
- name
- String
The name of the mutex to be opened. If it's prefixed by "Global", it refers to a machine-wide mutex. If it's prefixed by "Local", or doesn't have a prefix, it refers to a session-wide mutex. Both prefix and name are case-sensitive.
- rights
- MutexRights
The desired access rights to apply to the returned mutex.
- result
- Mutex
When this method returns true
, contains an object that represents the named mutex if the call succeeded, or null
otherwise. This parameter is treated as uninitialized.
Returns
true
if the named mutex was opened successfully; otherwise, false
.
Exceptions
name
is null
name
is an empty string.
A Win32 error occurred.
The named mutex exists, but the user does not have the security access required to use it.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기