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.

89 lines
1.2 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. All rights reserved.
  4. Module Name:
  5. hresult.cxx
  6. Abstract:
  7. auto log
  8. Author:
  9. Larry Zhu (LZhu) December 6, 2001
  10. Revision History:
  11. --*/
  12. #include "precomp.hxx"
  13. #pragma hdrstop
  14. #include "hresult.hxx"
  15. #ifdef DBG
  16. /********************************************************************
  17. THResult members
  18. ********************************************************************/
  19. THResult::
  20. THResult(
  21. IN HRESULT hResult
  22. ) : TStatusDerived<HRESULT>(hResult)
  23. {
  24. }
  25. THResult::
  26. ~THResult(
  27. VOID
  28. )
  29. {
  30. }
  31. BOOL
  32. THResult::
  33. IsErrorSevereEnough(
  34. VOID
  35. ) const
  36. {
  37. HRESULT hResult = GetTStatusBase();
  38. return FAILED(hResult);
  39. }
  40. PCTSTR
  41. THResult::
  42. GetErrorServerityDescription(
  43. VOID
  44. ) const
  45. {
  46. HRESULT hResult = GetTStatusBase();
  47. return SUCCEEDED(hResult) ? TEXT("SUCCEEDED") : TEXT("FAILED");
  48. }
  49. #endif // DBG
  50. EXTERN_C
  51. HRESULT
  52. HResultFromWin32(
  53. IN DWORD dwError
  54. )
  55. {
  56. return HRESULT_FROM_WIN32(dwError);
  57. }
  58. EXTERN_C
  59. HRESULT
  60. GetLastErrorAsHResult(
  61. VOID
  62. )
  63. {
  64. return HResultFromWin32(GetLastError());
  65. }