Source code of Windows XP (NT5)
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.

55 lines
1.1 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: N C E H . H
  7. //
  8. // Contents: Exception handling stuff.
  9. //
  10. // Notes:
  11. //
  12. // Author: shaunco 27 Mar 1997
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #ifndef _NCEH_H_
  17. #define _NCEH_H_
  18. // NC_TRY and NC_CATCH_ALL are #defined to allow easy replacement. This
  19. // is handy when evaulating SEH (__try, __except) vs. C++ EH (try, catch).
  20. //
  21. #define NC_TRY __try
  22. #define NC_CATCH_ALL __except(EXCEPTION_EXECUTE_HANDLER)
  23. #define NC_FINALLY __finally
  24. // For DEBUG builds, don't catch anything. This allows the debugger to locate
  25. // the exact source of the exception.
  26. /*
  27. #ifdef DBG
  28. */
  29. #define COM_PROTECT_TRY
  30. #define COM_PROTECT_CATCH ;
  31. /*
  32. #else // DBG
  33. #define COM_PROTECT_TRY __try
  34. #define COM_PROTECT_CATCH \
  35. __except (EXCEPTION_EXECUTE_HANDLER ) \
  36. { \
  37. hr = E_UNEXPECTED; \
  38. }
  39. #endif // DBG
  40. */
  41. #endif // _NCEH_H_