File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -840,6 +840,28 @@ public static void DisplayString(string text)
840840 DisplayString ( text , true ) ;
841841 }
842842
843+ /// <summary>
844+ /// Load a driver.
845+ /// </summary>
846+ /// <param name="driver_service_name">The name of the driver service.</param>
847+ /// <param name="throw_on_error">True to throw on error.</param>
848+ /// <returns>The NT status code.</returns>
849+ public static NtStatus LoadDriver ( string driver_service_name , bool throw_on_error = true )
850+ {
851+ return NtSystemCalls . NtLoadDriver ( new UnicodeString ( driver_service_name ) ) . ToNtException ( throw_on_error ) ;
852+ }
853+
854+ /// <summary>
855+ /// Unload a driver.
856+ /// </summary>
857+ /// <param name="driver_service_name">The name of the driver service.</param>
858+ /// <param name="throw_on_error">True to throw on error.</param>
859+ /// <returns>The NT status code.</returns>
860+ public static NtStatus UnloadDriver ( string driver_service_name , bool throw_on_error = true )
861+ {
862+ return NtSystemCalls . NtUnloadDriver ( new UnicodeString ( driver_service_name ) ) . ToNtException ( throw_on_error ) ;
863+ }
864+
843865 #endregion
844866
845867 #region Static Properties
Original file line number Diff line number Diff line change @@ -85,6 +85,16 @@ public static extern NtStatus NtSetSystemEnvironmentValueEx([In] UnicodeString V
8585
8686 [ DllImport ( "ntdll.dll" ) ]
8787 public static extern NtStatus NtDisplayString ( [ In ] UnicodeString Text ) ;
88+
89+ [ DllImport ( "ntdll.dll" ) ]
90+ public static extern NtStatus NtLoadDriver (
91+ [ In ] UnicodeString DriverServiceName
92+ ) ;
93+
94+ [ DllImport ( "ntdll.dll" ) ]
95+ public static extern NtStatus NtUnloadDriver (
96+ [ In ] UnicodeString DriverServiceName
97+ ) ;
8898 }
8999
90100 public static partial class NtRtl
You can’t perform that action at this time.
0 commit comments