File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -121,6 +121,16 @@ public static bool IsSuccess(this NtStatus status)
121121 return ( int ) status >= 0 ;
122122 }
123123
124+ /// <summary>
125+ /// Checks if the NtStatus value is an error.
126+ /// </summary>
127+ /// <param name="status">The NtStatus value</param>
128+ /// <returns>True if an error.</returns>
129+ public static bool IsError ( this NtStatus status )
130+ {
131+ return status . GetSeverity ( ) == NtStatusSeverity . STATUS_SEVERITY_ERROR ;
132+ }
133+
124134 /// <summary>
125135 /// Get the severity of the NTSTATUS.
126136 /// </summary>
@@ -542,13 +552,13 @@ internal static NtStatus MapDosErrorToStatus()
542552 /// </summary>
543553 /// <param name="status">The status code.</param>
544554 /// <returns>The mapped DOS error.</returns>
545- public static int MapNtStatusToDosError ( NtStatus status )
555+ public static Win32Error MapNtStatusToDosError ( NtStatus status )
546556 {
547557 if ( status . GetFacility ( ) == NtStatusFacility . FACILITY_NTWIN32 )
548558 {
549- return status . GetStatusCode ( ) ;
559+ return ( Win32Error ) status . GetStatusCode ( ) ;
550560 }
551- return NtRtl . RtlNtStatusToDosErrorNoTeb ( status ) ;
561+ return ( Win32Error ) NtRtl . RtlNtStatusToDosErrorNoTeb ( status ) ;
552562 }
553563
554564 /// <summary>
You can’t perform that action at this time.
0 commit comments