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.

49 lines
1.1 KiB

  1. #define NETCFG_TRY try {
  2. #define NETCFG_CATCH(hr) ; } \
  3. catch (SE_Exception e) \
  4. { \
  5. hr = HRESULT_FROM_WIN32(e.getSeNumber()); \
  6. TraceException(hr, "SE_Exception"); \
  7. } \
  8. catch (std::bad_alloc a) \
  9. { \
  10. hr = E_OUTOFMEMORY; \
  11. TraceException(hr, "std::bad_alloc"); \
  12. } \
  13. catch (std::exception s) \
  14. { \
  15. hr = E_FAIL; \
  16. TraceException(hr, "std::exception"); \
  17. } \
  18. catch (HRESULT hrCaught) \
  19. { \
  20. hr = hrCaught; \
  21. TraceException(hr, "HRESULT"); \
  22. }
  23. #define NETCFG_CATCH_NOHR ; } \
  24. catch (SE_Exception e) \
  25. { \
  26. TraceException(E_FAIL, "SE_Exception"); \
  27. } \
  28. catch (std::bad_alloc a) \
  29. { \
  30. TraceException(E_FAIL, "std::bad_alloc"); \
  31. } \
  32. catch (std::exception s) \
  33. { \
  34. TraceException(E_FAIL, "std::exception"); \
  35. } \
  36. catch (HRESULT hrCaught) \
  37. { \
  38. TraceException(E_FAIL, "HRESULT"); \
  39. }
  40. #define NETCFG_CATCH_AND_RETHROW ; } \
  41. catch (...) \
  42. { \
  43. TraceException(E_FAIL, "..."); \
  44. throw; \
  45. }