Beispiel #1
0
        /// <summary>
        /// Check if this object is exactly the same as another using NtCompareObject.
        /// </summary>
        /// <param name="obj">The object to compare against.</param>
        /// <returns>True if this is the same object.</returns>
        /// <exception cref="NtException">Thrown on error.</exception>
        /// <remarks>This is only supported on Windows 10 and above. For one which works on everything use SameObject.</remarks>
        public bool CompareObject(NtObject obj)
        {
            NtStatus status = NtSystemCalls.NtCompareObjects(Handle, obj.Handle);

            if (status == NtStatus.STATUS_NOT_SAME_OBJECT)
            {
                return(false);
            }
            status.ToNtException();
            return(true);
        }