File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -488,6 +488,17 @@ public static NtProcess OpenCurrent()
488488 return Current . Duplicate ( ) ;
489489 }
490490
491+ /// <summary>
492+ /// Test whether a process can access another protected process.
493+ /// </summary>
494+ /// <param name="current">The current process.</param>
495+ /// <param name="target">The target process.</param>
496+ /// <returns>True if the process can be accessed.</returns>
497+ public static bool TestProtectedAccess ( NtProcess current , NtProcess target )
498+ {
499+ return NtRtl . RtlTestProtectedAccess ( current . Protection . Level , target . Protection . Level ) ;
500+ }
501+
491502 #endregion
492503
493504 #region Public Methods
@@ -1869,6 +1880,16 @@ public NtResult<int> GetSessionId(bool throw_on_error)
18691880 default , throw_on_error ) . Map ( s => s . SessionId ) ;
18701881 }
18711882
1883+ /// <summary>
1884+ /// Test whether the current process can access another protected process.
1885+ /// </summary>
1886+ /// <param name="target">The target process.</param>
1887+ /// <returns>True if the process can be accessed.</returns>
1888+ public bool TestProtectedAccess ( NtProcess target )
1889+ {
1890+ return TestProtectedAccess ( this , target ) ;
1891+ }
1892+
18721893 /// <summary>
18731894 /// Method to query information for this object type.
18741895 /// </summary>
Original file line number Diff line number Diff line change @@ -758,6 +758,10 @@ public static extern NtStatus RtlCreateProcessParametersEx(
758758
759759 [ DllImport ( "ntdll.dll" ) ]
760760 public static extern void RtlDestroyProcessParameters ( IntPtr pProcessParameters ) ;
761+
762+ [ DllImport ( "ntdll.dll" ) ]
763+ [ return : MarshalAs ( UnmanagedType . U1 ) ]
764+ public static extern bool RtlTestProtectedAccess ( byte request_level , byte target_level ) ;
761765 }
762766
763767 [ Flags ]
You can’t perform that action at this time.
0 commit comments