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.

101 lines
1.7 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. All rights reserved.
  4. Module Name:
  5. hresult.hxx
  6. Abstract:
  7. auto log
  8. Author:
  9. Larry Zhu (LZhu) December 8, 2001
  10. Revision History:
  11. --*/
  12. #ifndef _HRESULT_HXX_
  13. #define _HRESULT_HXX_
  14. #include "dbgstate.hxx"
  15. #ifdef DBG
  16. /********************************************************************
  17. THResult
  18. ********************************************************************/
  19. class THResult : public TStatusDerived<HRESULT> {
  20. public:
  21. THResult(
  22. IN HRESULT Status = kUnInitializedValue
  23. );
  24. ~THResult(
  25. VOID
  26. );
  27. virtual BOOL
  28. IsErrorSevereEnough(
  29. VOID
  30. ) const;
  31. virtual PCTSTR
  32. GetErrorServerityDescription(
  33. VOID
  34. ) const;
  35. private:
  36. //
  37. // no copy
  38. //
  39. THResult(const THResult& rhs);
  40. //
  41. // Don't let clients use operator= without going through the
  42. // base class (i.e., using DBGCHK ).
  43. //
  44. // If you get an error trying to access private member function '=,'
  45. // you are trying to set the status without using the DBGCHK macro.
  46. //
  47. // This is needed to update the line and file, which must be done
  48. // at the macro level (not inline C++ function) since __LINE__ and
  49. // __FILE__ are handled by the preprocessor.
  50. //
  51. HRESULT
  52. operator=(
  53. IN HRESULT Status
  54. );
  55. };
  56. #else
  57. #define THResult HRESULT // HRESULT in free build
  58. #endif // DBG
  59. EXTERN_C
  60. HRESULT
  61. GetLastErrorAsHResult(
  62. VOID
  63. );
  64. EXTERN_C
  65. HRESULT
  66. HResultFromWin32(
  67. IN DWORD dwError
  68. );
  69. #endif // _HRESULT_HXX_