EventWaitHandle.OpenExisting Yöntem

Tanım

Zaten varsa belirtilen adlandırılmış eşitleme olayını açar.

Aşırı Yüklemeler

OpenExisting(String)

Zaten varsa belirtilen adlandırılmış eşitleme olayını açar.

OpenExisting(String, EventWaitHandleRights)

Belirtilen adlandırılmış eşitleme olayını ( zaten varsa) istenen güvenlik erişimiyle açar.

OpenExisting(String)

Zaten varsa belirtilen adlandırılmış eşitleme olayını açar.

public:
 static System::Threading::EventWaitHandle ^ OpenExisting(System::String ^ name);
[System.Security.SecurityCritical]
public static System.Threading.EventWaitHandle OpenExisting (string name);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static System.Threading.EventWaitHandle OpenExisting (string name);
public static System.Threading.EventWaitHandle OpenExisting (string name);
[<System.Security.SecurityCritical>]
static member OpenExisting : string -> System.Threading.EventWaitHandle
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member OpenExisting : string -> System.Threading.EventWaitHandle
static member OpenExisting : string -> System.Threading.EventWaitHandle
Public Shared Function OpenExisting (name As String) As EventWaitHandle

Parametreler

name
String

Açılacak ve diğer işlemlerle paylaşılacak eşitleme nesnesinin adı. Bu ad büyük/küçük harfe duyarlıdır.

Döndürülenler

EventWaitHandle

Adlandırılmış sistem olayını temsil eden bir nesne.

Öznitelikler

Özel durumlar

Sağlanan name ile bir eşitleme nesnesi açılamıyor. Mevcut olmayabilir veya farklı türde bir eşitleme nesnesi aynı ada sahip olabilir. Bazı durumlarda, bu özel durum geçersiz adlar için oluşturulabilir.

name boş bir dizedir.

-veya-

Yalnızca .NET Framework: name MAX_PATH(260 karakter) uzundur.

name, null değeridir.

name geçersizdir. Bu, bilinmeyen bir ön ek veya geçersiz karakterler gibi işletim sistemi tarafından yerleştirilebilen bazı kısıtlamalar da dahil olmak üzere çeşitli nedenlerle olabilir. Adın ve ortak ön eklerin "Genel" ve "Yerel" büyük/küçük harfe duyarlıdır.

-veya-

Başka bir hata oluştu. Özelliği HResult daha fazla bilgi sağlayabilir.

Yalnızca Windows: name bilinmeyen bir ad alanı belirtti. Daha fazla bilgi için bkz . Nesne Adları .

name Çok uzun. Uzunluk kısıtlamaları işletim sistemine veya yapılandırmaya bağlı olabilir.

Adlandırılmış olay var, ancak kullanıcının bunu kullanmak için gereken güvenlik erişimi yok.

Açıklamalar

name bir ad alanı belirtmek için veya Local\ ön ekine Global\ sahip olabilir. Ad alanı belirtildiğinde Global , eşitleme nesnesi sistemdeki tüm işlemlerle paylaşılabilir. Local Ad alanı belirtilmediğinde de varsayılan olan ad alanı belirtildiğinde, eşitleme nesnesi aynı oturumdaki işlemlerle paylaşılabilir. Windows oturum açma oturumudur ve hizmetler genellikle farklı bir etkileşimli olmayan oturumda çalışır. Unix benzeri işletim sistemlerinde her kabuğun kendi oturumu vardır. Oturum yerel eşitleme nesneleri, işlemlerin aynı oturumda çalıştırıldığı bir üst/alt ilişki ile eşitleme için uygun olabilir. Windows'de eşitleme nesnesi adları hakkında daha fazla bilgi için bkz. Nesne Adları.

İstenen türde bir eşitleme nesnesi ad alanında varsa, mevcut eşitleme nesnesi açılır. Ad alanında bir eşitleme nesnesi yoksa veya ad alanında farklı türde bir eşitleme nesnesi varsa, bir WaitHandleCannotBeOpenedException oluşturulur.

OpenExisting yöntemi belirtilen adlandırılmış sistem olayını açmaya çalışır. Sistem olayı henüz mevcut olmadığında oluşturmak için parametresi olan name oluşturuculardan EventWaitHandle birini kullanın.

Döndürülen nesneler aynı EventWaitHandle adlandırılmış sistem olayını temsil etse bile, için name aynı değeri kullanan bu yönteme yapılan birden çok çağrı mutlaka aynı nesneyi döndürmez.

.NET Framework'da bu yöntem aşırı yüklemesi, bit tabanlı OR işlem kullanılarak birleştirilen System.Threading.EventWaitHandle.OpenExisting(System.String,System.Security.AccessControl.EventWaitHandleRights) yöntemi aşırı yükleme ve belirtme EventWaitHandleRights.Synchronize ve EventWaitHandleRights.Modify hakları çağırmaya eşdeğerdir.

bayrağının EventWaitHandleRights.Synchronize belirtilmesi, bir iş parçacığının adlandırılmış sistem olayında beklemesine ve bayrağının belirtilmesi ise bir iş parçacığının EventWaitHandleRights.Modify ve Reset yöntemlerini çağırmasına Set olanak tanır.

Ayrıca bkz.

Şunlara uygulanır

OpenExisting(String, EventWaitHandleRights)

Belirtilen adlandırılmış eşitleme olayını ( zaten varsa) istenen güvenlik erişimiyle açar.

public:
 static System::Threading::EventWaitHandle ^ OpenExisting(System::String ^ name, System::Security::AccessControl::EventWaitHandleRights rights);
public static System.Threading.EventWaitHandle OpenExisting (string name, System.Security.AccessControl.EventWaitHandleRights rights);
[System.Security.SecurityCritical]
public static System.Threading.EventWaitHandle OpenExisting (string name, System.Security.AccessControl.EventWaitHandleRights rights);
static member OpenExisting : string * System.Security.AccessControl.EventWaitHandleRights -> System.Threading.EventWaitHandle
[<System.Security.SecurityCritical>]
static member OpenExisting : string * System.Security.AccessControl.EventWaitHandleRights -> System.Threading.EventWaitHandle
Public Shared Function OpenExisting (name As String, rights As EventWaitHandleRights) As EventWaitHandle

Parametreler

name
String

Açılacak ve diğer işlemlerle paylaşılacak eşitleme nesnesinin adı. Bu ad büyük/küçük harfe duyarlıdır.

rights
EventWaitHandleRights

İstenen güvenlik erişimini temsil eden numaralandırma değerlerinin bit düzeyinde birleşimi.

Döndürülenler

EventWaitHandle

Adlandırılmış sistem olayını temsil eden bir nesne.

Öznitelikler

Özel durumlar

name boş bir dizedir.

-veya-

Yalnızca .NET Framework: name MAX_PATH(260 karakter) uzundur.

name, null değeridir.

Sağlanan name ile bir eşitleme nesnesi açılamıyor. Mevcut olmayabilir veya farklı türde bir eşitleme nesnesi aynı ada sahip olabilir. Bazı durumlarda, bu özel durum geçersiz adlar için oluşturulabilir.

name geçersizdir. Bu, bilinmeyen bir ön ek veya geçersiz karakterler gibi işletim sistemi tarafından yerleştirilebilen bazı kısıtlamalar da dahil olmak üzere çeşitli nedenlerle olabilir. Adın ve ortak ön eklerin "Genel" ve "Yerel" büyük/küçük harfe duyarlıdır.

-veya-

Başka bir hata oluştu. Özelliği HResult daha fazla bilgi sağlayabilir.

Yalnızca Windows: name bilinmeyen bir ad alanı belirtti. Daha fazla bilgi için bkz . Nesne Adları .

name Çok uzun. Uzunluk kısıtlamaları işletim sistemine veya yapılandırmaya bağlı olabilir.

Adlandırılmış olay var, ancak kullanıcının istenen güvenlik erişimi yok.

Örnekler

Aşağıdaki kod örneği, erişim denetimi güvenliğine sahip adlandırılmış bir sistem olayının işlemler arası davranışını gösterir. Örnek, adlandırılmış bir olayın varlığını test etmek için yöntem aşırı yüklemesini kullanır OpenExisting(String) .

Olay yoksa, geçerli kullanıcıya olayı kullanma hakkını reddeden, ancak olay üzerinde okuma ve değiştirme izinleri veren ilk sahiplik ve erişim denetimi güvenliği ile oluşturulur.

Derlenmiş örneği iki komut penceresiyle çalıştırırsanız, ikinci kopya çağrısında OpenExisting(String)bir erişim ihlali özel durumu oluşturur. Özel durum yakalanmış ve örnek, izinlerini okumak ve değiştirmek için gereken haklarla olayı beklemek için yöntemi aşırı yüklemesini kullanır OpenExisting(String, EventWaitHandleRights) .

İzinler değiştirildikten sonra, olay üzerinde beklemek ve sinyal vermek için gereken haklarla açılır. Derlenmiş örneği üçüncü bir komut penceresinden çalıştırırsanız, örnek yeni izinler kullanılarak çalıştırılır.

using namespace System;
using namespace System::Threading;
using namespace System::Security::AccessControl;
using namespace System::Security::Permissions;

public ref class Example
{
public:
   [SecurityPermissionAttribute(SecurityAction::Demand,Flags=SecurityPermissionFlag::UnmanagedCode)]
   static void Main()
   {
      String^ ewhName = L"EventWaitHandleExample5";

      EventWaitHandle^ ewh = nullptr;
      bool doesNotExist = false;
      bool unauthorized = false;
      
      // The value of this variable is set by the event
      // constructor. It is true if the named system event was
      // created, and false if the named event already existed.
      //
      bool wasCreated;
      
      // Attempt to open the named event.
      try
      {
         // Open the event with (EventWaitHandleRights.Synchronize
         // | EventWaitHandleRights.Modify), to wait on and
         // signal the named event.
         //
         ewh = EventWaitHandle::OpenExisting( ewhName );
      }
      catch ( WaitHandleCannotBeOpenedException^ ) 
      {
         Console::WriteLine( L"Named event does not exist." );
         doesNotExist = true;
      }
      catch ( UnauthorizedAccessException^ ex ) 
      {
         Console::WriteLine( L"Unauthorized access: {0}", ex->Message );
         unauthorized = true;
      }

      // There are three cases: (1) The event does not exist.
      // (2) The event exists, but the current user doesn't
      // have access. (3) The event exists and the user has
      // access.
      //
      if ( doesNotExist )
      {
         // The event does not exist, so create it.

         // Create an access control list (ACL) that denies the
         // current user the right to wait on or signal the
         // event, but allows the right to read and change
         // security information for the event.
         //
         String^ user = String::Concat( Environment::UserDomainName, L"\\",
            Environment::UserName );
         EventWaitHandleSecurity^ ewhSec = gcnew EventWaitHandleSecurity;
         //following constructor fails
         EventWaitHandleAccessRule^ rule = gcnew EventWaitHandleAccessRule(
            user,
            static_cast<EventWaitHandleRights>(
               EventWaitHandleRights::Synchronize | 
               EventWaitHandleRights::Modify),
            AccessControlType::Deny );
         ewhSec->AddAccessRule( rule );

         rule = gcnew EventWaitHandleAccessRule( user,
            static_cast<EventWaitHandleRights>(
               EventWaitHandleRights::ReadPermissions | 
               EventWaitHandleRights::ChangePermissions),
            AccessControlType::Allow );
         ewhSec->AddAccessRule( rule );
         
         // Create an EventWaitHandle object that represents
         // the system event named by the constant 'ewhName',
         // initially signaled, with automatic reset, and with
         // the specified security access. The Boolean value that
         // indicates creation of the underlying system object
         // is placed in wasCreated.
         //
         ewh = gcnew EventWaitHandle( true,
            EventResetMode::AutoReset,
            ewhName,
            wasCreated,
            ewhSec );
         
         // If the named system event was created, it can be
         // used by the current instance of this program, even
         // though the current user is denied access. The current
         // program owns the event. Otherwise, exit the program.
         //
         if ( wasCreated )
         {
            Console::WriteLine( L"Created the named event." );
         }
         else
         {
            Console::WriteLine( L"Unable to create the event." );
            return;
         }
      }
      else if ( unauthorized )
      {
         // Open the event to read and change the access control
         // security. The access control security defined above
         // allows the current user to do this.
         //
         try
         {
            ewh = EventWaitHandle::OpenExisting( ewhName, 
               static_cast<EventWaitHandleRights>(
                  EventWaitHandleRights::ReadPermissions |
                  EventWaitHandleRights::ChangePermissions) );
            
            // Get the current ACL. This requires
            // EventWaitHandleRights.ReadPermissions.
            EventWaitHandleSecurity^ ewhSec = ewh->GetAccessControl();
            String^ user = String::Concat( Environment::UserDomainName, L"\\",
               Environment::UserName );
            
            // First, the rule that denied the current user
            // the right to enter and release the event must
            // be removed.
            EventWaitHandleAccessRule^ rule = gcnew EventWaitHandleAccessRule(
               user,
               static_cast<EventWaitHandleRights>(
                  EventWaitHandleRights::Synchronize |
                  EventWaitHandleRights::Modify),
               AccessControlType::Deny );
            ewhSec->RemoveAccessRule( rule );
            
            // Now grant the user the correct rights.
            //
            rule = gcnew EventWaitHandleAccessRule( user,
               static_cast<EventWaitHandleRights>(
                  EventWaitHandleRights::Synchronize |
                  EventWaitHandleRights::Modify),
               AccessControlType::Allow );
            ewhSec->AddAccessRule( rule );
            
            // Update the ACL. This requires
            // EventWaitHandleRights.ChangePermissions.
            ewh->SetAccessControl( ewhSec );
            Console::WriteLine( L"Updated event security." );
            
            // Open the event with (EventWaitHandleRights.Synchronize
            // | EventWaitHandleRights.Modify), the rights required
            // to wait on and signal the event.
            //
            ewh = EventWaitHandle::OpenExisting( ewhName );
         }
         catch ( UnauthorizedAccessException^ ex ) 
         {
            Console::WriteLine( L"Unable to change permissions: {0}",
               ex->Message );
            return;
         }

      }
      
      // Wait on the event, and hold it until the program
      // exits.
      //
      try
      {
         Console::WriteLine( L"Wait on the event." );
         ewh->WaitOne();
         Console::WriteLine( L"Event was signaled." );
         Console::WriteLine( L"Press the Enter key to signal the event and exit." );
         Console::ReadLine();
      }
      catch ( UnauthorizedAccessException^ ex ) 
      {
         Console::WriteLine( L"Unauthorized access: {0}", ex->Message );
      }
      finally
      {
         ewh->Set();
      }
   }
};

int main()
{
   Example::Main();
}
using System;
using System.Threading;
using System.Security.AccessControl;

internal class Example
{
    internal static void Main()
    {
        const string ewhName = "EventWaitHandleExample5";

        EventWaitHandle ewh = null;
        bool doesNotExist = false;
        bool unauthorized = false;

        // The value of this variable is set by the event
        // constructor. It is true if the named system event was
        // created, and false if the named event already existed.
        //
        bool wasCreated;

        // Attempt to open the named event.
        try
        {
            // Open the event with (EventWaitHandleRights.Synchronize
            // | EventWaitHandleRights.Modify), to wait on and 
            // signal the named event.
            //
            ewh = EventWaitHandle.OpenExisting(ewhName);
        }
        catch (WaitHandleCannotBeOpenedException)
        {
            Console.WriteLine("Named event does not exist.");
            doesNotExist = true;
        }
        catch (UnauthorizedAccessException ex)
        {
            Console.WriteLine("Unauthorized access: {0}", ex.Message);
            unauthorized = true;
        }

        // There are three cases: (1) The event does not exist.
        // (2) The event exists, but the current user doesn't 
        // have access. (3) The event exists and the user has
        // access.
        //
        if (doesNotExist)
        {
            // The event does not exist, so create it.

            // Create an access control list (ACL) that denies the
            // current user the right to wait on or signal the 
            // event, but allows the right to read and change
            // security information for the event.
            //
            string user = Environment.UserDomainName + "\\"
                + Environment.UserName;
            EventWaitHandleSecurity ewhSec = 
                new EventWaitHandleSecurity();

            EventWaitHandleAccessRule rule = 
                new EventWaitHandleAccessRule(user, 
                    EventWaitHandleRights.Synchronize | 
                    EventWaitHandleRights.Modify, 
                    AccessControlType.Deny);
            ewhSec.AddAccessRule(rule);

            rule = new EventWaitHandleAccessRule(user, 
                EventWaitHandleRights.ReadPermissions | 
                EventWaitHandleRights.ChangePermissions, 
                AccessControlType.Allow);
            ewhSec.AddAccessRule(rule);

            // Create an EventWaitHandle object that represents
            // the system event named by the constant 'ewhName', 
            // initially signaled, with automatic reset, and with
            // the specified security access. The Boolean value that 
            // indicates creation of the underlying system object
            // is placed in wasCreated.
            //
            ewh = new EventWaitHandle(true, 
                EventResetMode.AutoReset, 
                ewhName, 
                out wasCreated, 
                ewhSec);

            // If the named system event was created, it can be
            // used by the current instance of this program, even 
            // though the current user is denied access. The current
            // program owns the event. Otherwise, exit the program.
            // 
            if (wasCreated)
            {
                Console.WriteLine("Created the named event.");
            }
            else
            {
                Console.WriteLine("Unable to create the event.");
                return;
            }
        }
        else if (unauthorized)
        {
            // Open the event to read and change the access control
            // security. The access control security defined above
            // allows the current user to do this.
            //
            try
            {
                ewh = EventWaitHandle.OpenExisting(ewhName, 
                    EventWaitHandleRights.ReadPermissions | 
                    EventWaitHandleRights.ChangePermissions);

                // Get the current ACL. This requires 
                // EventWaitHandleRights.ReadPermissions.
                EventWaitHandleSecurity ewhSec = ewh.GetAccessControl();
                
                string user = Environment.UserDomainName + "\\"
                    + Environment.UserName;

                // First, the rule that denied the current user 
                // the right to enter and release the event must
                // be removed.
                EventWaitHandleAccessRule rule = 
                    new EventWaitHandleAccessRule(user, 
                        EventWaitHandleRights.Synchronize | 
                        EventWaitHandleRights.Modify, 
                        AccessControlType.Deny);
                ewhSec.RemoveAccessRule(rule);

                // Now grant the user the correct rights.
                // 
                rule = new EventWaitHandleAccessRule(user, 
                    EventWaitHandleRights.Synchronize | 
                    EventWaitHandleRights.Modify, 
                    AccessControlType.Allow);
                ewhSec.AddAccessRule(rule);

                // Update the ACL. This requires
                // EventWaitHandleRights.ChangePermissions.
                ewh.SetAccessControl(ewhSec);

                Console.WriteLine("Updated event security.");

                // Open the event with (EventWaitHandleRights.Synchronize 
                // | EventWaitHandleRights.Modify), the rights required
                // to wait on and signal the event.
                //
                ewh = EventWaitHandle.OpenExisting(ewhName);
            }
            catch (UnauthorizedAccessException ex)
            {
                Console.WriteLine("Unable to change permissions: {0}",
                    ex.Message);
                return;
            }
        }

        // Wait on the event, and hold it until the program
        // exits.
        //
        try
        {
            Console.WriteLine("Wait on the event.");
            ewh.WaitOne();
            Console.WriteLine("Event was signaled.");
            Console.WriteLine("Press the Enter key to signal the event and exit.");
            Console.ReadLine();
        }
        catch (UnauthorizedAccessException ex)
        {
            Console.WriteLine("Unauthorized access: {0}", ex.Message);
        }
        finally
        {
            ewh.Set();
        }
    }
}
Imports System.Threading
Imports System.Security.AccessControl

Friend Class Example

    <MTAThread> _
    Friend Shared Sub Main()
        Const ewhName As String = "EventWaitHandleExample5"

        Dim ewh As EventWaitHandle = Nothing
        Dim doesNotExist as Boolean = False
        Dim unauthorized As Boolean = False

        ' The value of this variable is set by the event
        ' constructor. It is True if the named system event was
        ' created, and False if the named event already existed.
        '
        Dim wasCreated As Boolean

        ' Attempt to open the named event.
        Try
            ' Open the event with (EventWaitHandleRights.Synchronize
            ' Or EventWaitHandleRights.Modify), to wait on and 
            ' signal the named event.
            '
            ewh = EventWaitHandle.OpenExisting(ewhName)
        Catch ex As WaitHandleCannotBeOpenedException
            Console.WriteLine("Named event does not exist.")
            doesNotExist = True
        Catch ex As UnauthorizedAccessException
            Console.WriteLine("Unauthorized access: {0}", ex.Message)
            unauthorized = True
        End Try

        ' There are three cases: (1) The event does not exist.
        ' (2) The event exists, but the current user doesn't 
        ' have access. (3) The event exists and the user has
        ' access.
        '
        If doesNotExist Then
            ' The event does not exist, so create it.

            ' Create an access control list (ACL) that denies the
            ' current user the right to wait on or signal the 
            ' event, but allows the right to read and change
            ' security information for the event.
            '
            Dim user As String = Environment.UserDomainName _ 
                & "\" & Environment.UserName
            Dim ewhSec As New EventWaitHandleSecurity()

            Dim rule As New EventWaitHandleAccessRule(user, _
                EventWaitHandleRights.Synchronize Or _
                EventWaitHandleRights.Modify, _
                AccessControlType.Deny)
            ewhSec.AddAccessRule(rule)

            rule = New EventWaitHandleAccessRule(user, _
                EventWaitHandleRights.ReadPermissions Or _
                EventWaitHandleRights.ChangePermissions, _
                AccessControlType.Allow)
            ewhSec.AddAccessRule(rule)

            ' Create an EventWaitHandle object that represents
            ' the system event named by the constant 'ewhName', 
            ' initially signaled, with automatic reset, and with
            ' the specified security access. The Boolean value that 
            ' indicates creation of the underlying system object
            ' is placed in wasCreated.
            '
            ewh = New EventWaitHandle(True, _
                EventResetMode.AutoReset, ewhName, _
                wasCreated, ewhSec)

            ' If the named system event was created, it can be
            ' used by the current instance of this program, even 
            ' though the current user is denied access. The current
            ' program owns the event. Otherwise, exit the program.
            ' 
            If wasCreated Then
                Console.WriteLine("Created the named event.")
            Else
                Console.WriteLine("Unable to create the event.")
                Return
            End If

        ElseIf unauthorized Then

            ' Open the event to read and change the access control
            ' security. The access control security defined above
            ' allows the current user to do this.
            '
            Try
                ewh = EventWaitHandle.OpenExisting(ewhName, _
                    EventWaitHandleRights.ReadPermissions Or _
                    EventWaitHandleRights.ChangePermissions)

                ' Get the current ACL. This requires 
                ' EventWaitHandleRights.ReadPermissions.
                Dim ewhSec As EventWaitHandleSecurity = _
                    ewh.GetAccessControl()
                
                Dim user As String = Environment.UserDomainName _ 
                    & "\" & Environment.UserName

                ' First, the rule that denied the current user 
                ' the right to enter and release the event must
                ' be removed.
                Dim rule As New EventWaitHandleAccessRule(user, _
                    EventWaitHandleRights.Synchronize Or _
                    EventWaitHandleRights.Modify, _
                    AccessControlType.Deny)
                ewhSec.RemoveAccessRule(rule)

                ' Now grant the user the correct rights.
                ' 
                rule = New EventWaitHandleAccessRule(user, _
                    EventWaitHandleRights.Synchronize Or _
                    EventWaitHandleRights.Modify, _
                    AccessControlType.Allow)
                ewhSec.AddAccessRule(rule)

                ' Update the ACL. This requires
                ' EventWaitHandleRights.ChangePermissions.
                ewh.SetAccessControl(ewhSec)

                Console.WriteLine("Updated event security.")

                ' Open the event with (EventWaitHandleRights.Synchronize 
                ' Or EventWaitHandleRights.Modify), the rights required
                ' to wait on and signal the event.
                '
                ewh = EventWaitHandle.OpenExisting(ewhName)

            Catch ex As UnauthorizedAccessException
                Console.WriteLine("Unable to change permissions: {0}", _
                    ex.Message)
                Return
            End Try

        End If

        ' Wait on the event, and hold it until the program
        ' exits.
        '
        Try
            Console.WriteLine("Wait on the event.")
            ewh.WaitOne()
            Console.WriteLine("Event was signaled.")
            Console.WriteLine("Press the Enter key to signal the event and exit.")
            Console.ReadLine()
        Catch ex As UnauthorizedAccessException
            Console.WriteLine("Unauthorized access: {0}", _
                ex.Message)
        Finally
            ewh.Set()
        End Try
    End Sub 
End Class

Açıklamalar

name bir ad alanı belirtmek için veya Local\ ön ekine Global\ sahip olabilir. Ad alanı belirtildiğinde Global , eşitleme nesnesi sistemdeki tüm işlemlerle paylaşılabilir. Local Ad alanı belirtilmediğinde de varsayılan olan ad alanı belirtildiğinde, eşitleme nesnesi aynı oturumdaki işlemlerle paylaşılabilir. Windows oturum açma oturumudur ve hizmetler genellikle farklı bir etkileşimli olmayan oturumda çalışır. Unix benzeri işletim sistemlerinde her kabuğun kendi oturumu vardır. Oturum yerel eşitleme nesneleri, işlemlerin aynı oturumda çalıştırıldığı bir üst/alt ilişki ile eşitleme için uygun olabilir. Windows'de eşitleme nesnesi adları hakkında daha fazla bilgi için bkz. Nesne Adları.

İstenen türde bir eşitleme nesnesi ad alanında varsa, mevcut eşitleme nesnesi açılır. Ad alanında bir eşitleme nesnesi yoksa veya ad alanında farklı türde bir eşitleme nesnesi varsa, bir WaitHandleCannotBeOpenedException oluşturulur.

parametresi, rights iş parçacıklarının EventWaitHandleRights.Synchronize olayda beklemesine izin vermek için bayrağını ve iş parçacıklarının EventWaitHandleRights.Modify ve Reset yöntemlerini çağırmasına izin vermek için bayrağını Set içermelidir.

OpenExisting yöntemi, var olan adlandırılmış bir sistem olayını açmaya çalışır. Sistem olayı henüz mevcut olmadığında oluşturmak için parametresi olan name oluşturuculardan EventWaitHandle birini kullanın.

Döndürülen nesneler aynı EventWaitHandle adlandırılmış sistem olayını temsil etse bile, için name aynı değeri kullanan bu yönteme yapılan birden çok çağrı mutlaka aynı nesneyi döndürmez.

Ayrıca bkz.

Şunlara uygulanır