Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
1.3 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. except.c
  5. Abstract:
  6. This module declares the exception handling function used by the
  7. mailslot file system.
  8. Author:
  9. Manny Weiser (mannyw) 7-Jan-1991
  10. Revision History:
  11. --*/
  12. #include "mailslot.h"
  13. #define Dbg DEBUG_TRACE_CATCH_EXCEPTIONS
  14. #ifdef ALLOC_PRAGMA
  15. #pragma alloc_text( PAGE, MsExceptionFilter )
  16. #pragma alloc_text( PAGE, MsProcessException )
  17. #endif
  18. LONG
  19. MsExceptionFilter (
  20. IN NTSTATUS ExceptionCode
  21. )
  22. {
  23. PAGED_CODE();
  24. DebugTrace(0, Dbg, "MsExceptionFilter %08lx\n", ExceptionCode);
  25. DebugDump("", Dbg, NULL );
  26. if (FsRtlIsNtstatusExpected( ExceptionCode )) {
  27. return EXCEPTION_EXECUTE_HANDLER;
  28. } else {
  29. return EXCEPTION_CONTINUE_SEARCH;
  30. }
  31. }
  32. NTSTATUS
  33. MsProcessException (
  34. IN PMSFS_DEVICE_OBJECT MsfsDeviceObject,
  35. IN PIRP Irp,
  36. IN NTSTATUS ExceptionCode
  37. )
  38. {
  39. NTSTATUS FinalExceptionCode;
  40. PAGED_CODE();
  41. FinalExceptionCode = ExceptionCode;
  42. if (FsRtlIsNtstatusExpected( ExceptionCode )) {
  43. MsCompleteRequest( Irp, ExceptionCode );
  44. } else {
  45. KeBugCheck( MAILSLOT_FILE_SYSTEM );
  46. }
  47. return FinalExceptionCode;
  48. }