Ejemplo n.º 1
0
        /// <summary>
        /// Opens a thread in the system identified via its Win32 thread Id.
        /// </summary>
        /// <param name="rights">Indicates how you intend to manipulate the thread.</param>
        /// <param name="inheritHandle">true if the returned handle should be inherited by child processes.</param>
        /// <param name="threadId">The Win32 Id identifying a thread.</param>
        /// <returns>A SafeWaitHandle matching the opened thread. This method throws a WaitHandleCannotBeOpenedException if the thread cannot be opened.</returns>
        public static SafeWaitHandle OpenThread(ThreadRights rights, Boolean inheritHandle, Int32 threadId)
        {
            SafeWaitHandle thread = NativeMethods.OpenThread(rights, inheritHandle, threadId);

            Contract.Assume(thread != null);
            if (thread.IsInvalid)
            {
                throw new WaitHandleCannotBeOpenedException();
            }
            return(thread);
        }
Ejemplo n.º 2
0
 internal static extern SafeWaitHandle OpenThread(ThreadRights dwDesiredAccess,
    [MarshalAs(UnmanagedType.Bool)] Boolean bInheritHandle, Int32 threadId);
Ejemplo n.º 3
0
 /// <summary>
 /// Opens a thread in the system identified via its Win32 thread Id.
 /// </summary>
 /// <param name="rights">Indicates how you intend to manipulate the thread.</param>
 /// <param name="inheritHandle">true if the returned handle should be inherited by child processes.</param>
 /// <param name="threadId">The Win32 Id identifying a thread.</param>
 /// <returns>A SafeWaitHandle matching the opened thread. This method throws a WaitHandleCannotBeOpenedException if the thread cannot be opened.</returns>
 public static SafeWaitHandle OpenThread(ThreadRights rights, Boolean inheritHandle, Int32 threadId) {
    SafeWaitHandle thread = NativeMethods.OpenThread(rights, inheritHandle, threadId);
    Contract.Assume(thread != null);
    if (thread.IsInvalid) throw new WaitHandleCannotBeOpenedException();
    return thread;
 }
Ejemplo n.º 4
0
 public ThreadAccessRule(string identity, ThreadRights threadRights, AccessControlType type)
     : this(new NTAccount(identity), threadRights, type)
 {
 }
Ejemplo n.º 5
0
 public ThreadAccessRule(IdentityReference identity, ThreadRights threadRights, AccessControlType type)
     : base(identity, (int)threadRights, false, InheritanceFlags.None, PropagationFlags.None, type)
 {
 }
Ejemplo n.º 6
0
 public ThreadAccessRule(string identity, ThreadRights threadRights, AccessControlType type)
     : this(new NTAccount(identity), threadRights, type)
 {
 }
Ejemplo n.º 7
0
 public ThreadAccessRule(IdentityReference identity, ThreadRights threadRights, AccessControlType type)
     : base(identity, (int)threadRights, false, InheritanceFlags.None, PropagationFlags.None, type)
 {
 }
Ejemplo n.º 8
0
 internal static extern SafeWaitHandle OpenThread(ThreadRights dwDesiredAccess,
                                                  [MarshalAs(UnmanagedType.Bool)] Boolean bInheritHandle, Int32 threadId);
Ejemplo n.º 9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ThreadAuditRule"/> class.
 /// </summary>
 /// <param name="identity">The identity.</param>
 /// <param name="threadRights">The thread rights.</param>
 /// <param name="type">The type.</param>
 public ThreadAuditRule(string identity, ThreadRights threadRights, AuditFlags type)
     : this(new NTAccount(identity), threadRights, type)
 {
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ThreadAuditRule"/> class.
 /// </summary>
 /// <param name="identity">The identity.</param>
 /// <param name="threadRights">The thread rights.</param>
 /// <param name="type">The type.</param>
 public ThreadAuditRule(IdentityReference identity, ThreadRights threadRights, AuditFlags type)
     : base(identity, (int)threadRights, false, InheritanceFlags.None, PropagationFlags.None, type)
 {
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ThreadAuditRule"/> class.
 /// </summary>
 /// <param name="identity">The identity.</param>
 /// <param name="threadRights">The thread rights.</param>
 /// <param name="type">The type.</param>
 public ThreadAuditRule(string identity, ThreadRights threadRights, AuditFlags type)
     : this(new NTAccount(identity), threadRights, type)
 {
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ThreadAuditRule"/> class.
 /// </summary>
 /// <param name="identity">The identity.</param>
 /// <param name="threadRights">The thread rights.</param>
 /// <param name="type">The type.</param>
 public ThreadAuditRule(IdentityReference identity, ThreadRights threadRights, AuditFlags type)
     : base(identity, (int)threadRights, false, InheritanceFlags.None, PropagationFlags.None, type)
 {
 }