SemaphoreAcl.TryOpenExisting(String, SemaphoreRights, Semaphore) 메서드

정의

지정된 명명된 세마포를 열려고 시도합니다(이미 있는 경우). 원하는 액세스 권한을 적용하고 작업이 성공했는지 여부를 나타내는 값을 반환합니다.

public:
 static bool TryOpenExisting(System::String ^ name, System::Security::AccessControl::SemaphoreRights rights, [Runtime::InteropServices::Out] System::Threading::Semaphore ^ % result);
public static bool TryOpenExisting(string name, System.Security.AccessControl.SemaphoreRights rights, out System.Threading.Semaphore? result);
public static bool TryOpenExisting(string name, System.Security.AccessControl.SemaphoreRights rights, out System.Threading.Semaphore result);
static member TryOpenExisting : string * System.Security.AccessControl.SemaphoreRights * Semaphore -> bool
Public Shared Function TryOpenExisting (name As String, rights As SemaphoreRights, ByRef result As Semaphore) As Boolean

매개 변수

name
String

열 세마포의 이름입니다. "Global" 접두사인 경우 컴퓨터 전체 세마포를 나타냅니다. "Local"의 접두사이거나 접두사 없는 경우 세션 전체 세마포를 참조합니다. 접두사 및 이름 모두 대/소문자를 구분합니다.

rights
SemaphoreRights

반환된 세마포에 적용할 원하는 액세스 권한입니다.

result
Semaphore

이 메서드가 반환 true될 때 호출이 성공한 경우 명명된 세마포를 나타내는 개체를 포함하거나 null 그렇지 않은 경우 해당 개체를 포함합니다. 이 매개 변수는 초기화되지 않은 것으로 처리됩니다.

반품

true명명된 세마포가 성공적으로 열렸으면 이고, 그렇지 않으면 . false

예외

namenull인 경우

name 은 빈 문자열입니다.

Win32 오류가 발생했습니다.

명명된 세마포가 있지만 사용자에게는 이 세마포를 사용하는 데 필요한 보안 액세스 권한이 없습니다.

적용 대상