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.

140 lines
2.3 KiB

  1. /*++
  2. Copyright (C) 1996-2001 Microsoft Corporation
  3. Module Name:
  4. Globals.h
  5. Abstract:
  6. History:
  7. --*/
  8. #ifndef _EXCEPTIONS_H
  9. #define _EXCEPTIONS_H
  10. #include <eh.h>
  11. #include <Allocator.h>
  12. /******************************************************************************
  13. *
  14. * Name:
  15. *
  16. *
  17. * Description:
  18. *
  19. *
  20. *****************************************************************************/
  21. class Wmi_Structured_Exception
  22. {
  23. private:
  24. UINT m_ExceptionCode ;
  25. EXCEPTION_POINTERS *m_ExceptionInformation ;
  26. public:
  27. Wmi_Structured_Exception () {}
  28. Wmi_Structured_Exception (
  29. UINT a_ExceptionCode ,
  30. EXCEPTION_POINTERS *a_ExceptionInformation
  31. ) : m_ExceptionCode ( a_ExceptionCode ) ,
  32. m_ExceptionInformation ( a_ExceptionInformation )
  33. {}
  34. ~Wmi_Structured_Exception () {}
  35. UINT GetExceptionCode ()
  36. {
  37. return m_ExceptionCode ;
  38. }
  39. EXCEPTION_POINTERS *GetExtendedInformation ()
  40. {
  41. return m_ExceptionInformation ;
  42. }
  43. };
  44. /******************************************************************************
  45. *
  46. * Name:
  47. *
  48. *
  49. * Description:
  50. *
  51. *
  52. *****************************************************************************/
  53. class Wmi_SetStructuredExceptionHandler
  54. {
  55. private:
  56. _se_translator_function m_PrevFunc;
  57. public:
  58. static void __cdecl s_Trans_Func (
  59. UINT a_ExceptionNumber ,
  60. EXCEPTION_POINTERS *a_ExceptionInformation
  61. )
  62. {
  63. throw Wmi_Structured_Exception ( a_ExceptionNumber , a_ExceptionInformation ) ;
  64. }
  65. Wmi_SetStructuredExceptionHandler () : m_PrevFunc ( NULL )
  66. {
  67. m_PrevFunc = _set_se_translator ( s_Trans_Func ) ;
  68. }
  69. ~Wmi_SetStructuredExceptionHandler ()
  70. {
  71. _set_se_translator ( m_PrevFunc ) ;
  72. }
  73. };
  74. /******************************************************************************
  75. *
  76. * Name:
  77. *
  78. *
  79. * Description:
  80. *
  81. *
  82. *****************************************************************************/
  83. class Wmi_Heap_Exception
  84. {
  85. public:
  86. enum HEAP_ERROR
  87. {
  88. E_ALLOCATION_ERROR = 0 ,
  89. E_FREE_ERROR
  90. };
  91. private:
  92. HEAP_ERROR m_Error ;
  93. public:
  94. Wmi_Heap_Exception ( HEAP_ERROR a_Error ) : m_Error ( a_Error ) {}
  95. ~Wmi_Heap_Exception () {}
  96. HEAP_ERROR GetError ()
  97. {
  98. return m_Error;
  99. }
  100. };
  101. #endif // _EXCEPTIONS_H