/// <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); }
internal static extern SafeWaitHandle OpenThread(ThreadRights dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] Boolean bInheritHandle, Int32 threadId);
/// <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; }
public ThreadAccessRule(string identity, ThreadRights threadRights, AccessControlType type) : this(new NTAccount(identity), threadRights, type) { }
public ThreadAccessRule(IdentityReference identity, ThreadRights threadRights, AccessControlType type) : base(identity, (int)threadRights, false, InheritanceFlags.None, PropagationFlags.None, type) { }
/// <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) { }
/// <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) { }