/// <summary> /// Turns NTSTATUS errors into the appropriate exception (that maps with existing .NET behavior as much as possible). /// There are additional IOException derived errors for ease of client error handling. /// </summary> public static Exception GetException(this NTStatus status, string path = null) { switch (status) { case NTStatus.STATUS_NOT_IMPLEMENTED: return(new NotImplementedException(path ?? WInteropStrings.NoValue)); } return(status.ToWindowsError().GetException(path)); }