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.

81 lines
3.9 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1997.
  5. //
  6. // File: misc.hxx
  7. //
  8. // Contents: Definitions of utility stuff for use
  9. //
  10. // Functions:
  11. //
  12. // Macros:
  13. //
  14. // History:
  15. //
  16. //----------------------------------------------------------------------------
  17. #ifndef _MISC_HXX_
  18. #define _MISC_HXX_
  19. /* #if DBG == 1 */
  20. /* */
  21. /* STDAPI CheckAndReturnResult( */
  22. /* HRESULT hr, */
  23. /* LPSTR lpstrFile, */
  24. /* UINT line, */
  25. /* int cSuccess, */
  26. /* ...); */
  27. /* */
  28. /* STDAPI_(void) CheckResult(HRESULT hr, LPSTR lpstrFile, UINT line); */
  29. /* STDAPI PrintHRESULT(DWORD dwFlags, HRESULT hr); */
  30. /* */
  31. /* #define SRETURN(hr) \ */
  32. /* return CheckAndReturnResult((hr), __FILE__, __LINE__, -1) */
  33. /* #define RRETURN(hr) \ */
  34. /* return CheckAndReturnResult((hr), __FILE__, __LINE__, 0) */
  35. /* #define RRETURN1(hr, s1) \ */
  36. /* return CheckAndReturnResult((hr), __FILE__, __LINE__, 1, (s1)) */
  37. /* #define RRETURN2(hr, s1, s2) \ */
  38. /* return CheckAndReturnResult((hr), __FILE__, __LINE__, 2, (s1), (s2)) */
  39. /* #define RRETURN3(hr, s1, s2, s3) \ */
  40. /* return CheckAndReturnResult((hr), __FILE__, __LINE__, 3, (s1), (s2), (s3)) */
  41. /* */
  42. /* #define RRETURN_EXP_IF_ERR(hr) \ */
  43. /* {if (FAILED(hr)) { \ */
  44. /* RaiseException(hr); \ */
  45. /* } \ */
  46. /* RRETURN(hr);} */
  47. /* */
  48. /* #define WARN_ERROR(hr) CheckResult((hr), __FILE__, __LINE__) */
  49. /* */
  50. /* #define TRETURN(hr) return PrintHRESULT(DEB_TRACE, (hr)) */
  51. /* #define TRACEHRESULT(hr) PrintHRESULT(DEB_TRACE, (hr)) */
  52. /* */
  53. /* #else // DBG == 0 */
  54. #define SRETURN(hr) return (hr)
  55. #define RRETURN(hr) return (hr)
  56. #define RRETURN1(hr, s1) return (hr)
  57. #define RRETURN2(hr, s1, s2) return (hr)
  58. #define RRETURN3(hr, s1, s2, s3) return (hr)
  59. #define RRETURN_EXP_IF_ERR(hr) \
  60. {if (FAILED(hr)) { \
  61. RaiseException(hr); \
  62. } \
  63. RRETURN(hr);}
  64. #define WARN_ERROR(hr)
  65. #define TRETURN(hr) return (hr)
  66. #define TRACEHRESULT(hr)
  67. /* #endif // DBG */
  68. #endif //_MISC_HXX_