LhSetInclusiveACL() public static method

public static LhSetInclusiveACL ( Int32 InThreadIdList, Int32 InThreadCount, IntPtr InHandle ) : void
InThreadIdList System.Int32
InThreadCount System.Int32
InHandle System.IntPtr
return void
Example #1
0
        /// <summary>
        /// Sets an inclusive ACL. This means all threads that are enumerated through <paramref name="InACL"/>
        /// are intercepted while all others are NOT. Of course this will overwrite the existing ACL.
        /// </summary>
        /// <remarks>
        /// Please note that this is not necessarily the final
        /// negotiation result. Refer to <see cref="LocalHook.IsThreadIntercepted"/> for more information.
        /// In general inclusive ACLs will restrict exclusive ACLs while local ACLs will overwrite the
        /// global ACL.
        /// </remarks>
        /// <param name="InACL">Threads to be explicitly included in negotiation.</param>
        /// <exception cref="ArgumentException">
        /// The limit of 128 access entries is exceeded!
        /// </exception>
        public void SetInclusiveACL(Int32[] InACL)
        {
            if (InACL == null)
            {
                m_ACL = new Int32[0];
            }
            else
            {
                m_ACL = (Int32[])InACL.Clone();
            }

            m_IsExclusive = false;

            if (m_Handle == IntPtr.Zero)
            {
                NativeAPI.LhSetGlobalInclusiveACL(m_ACL, m_ACL.Length);
            }
            else
            {
                NativeAPI.LhSetInclusiveACL(m_ACL, m_ACL.Length, m_Handle);
            }
        }