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.

123 lines
1.8 KiB

  1. /*++
  2. Copyright (C) 2001 Microsoft Corporation
  3. Module Name:
  4. Wmiguard.cpp
  5. --*/
  6. #include "precomp.h"
  7. #include "wmiguard.h"
  8. /******************************************************************************
  9. *
  10. * Name:
  11. *
  12. *
  13. * Description:
  14. *
  15. *
  16. *****************************************************************************/
  17. WmiGuard :: WmiGuard ( )
  18. {
  19. }
  20. /******************************************************************************
  21. *
  22. * Name:
  23. *
  24. *
  25. * Description:
  26. *
  27. *
  28. *****************************************************************************/
  29. WmiGuard :: ~WmiGuard ()
  30. {
  31. }
  32. /******************************************************************************
  33. *
  34. * Name:
  35. *
  36. *
  37. * Description:
  38. *
  39. *
  40. *****************************************************************************/
  41. HRESULT WmiGuard :: TryEnter()
  42. {
  43. HRESULT hr = E_UNEXPECTED;
  44. if ( m_pCS != NULL )
  45. {
  46. try
  47. {
  48. if ( m_pCS->TryEnter () )
  49. {
  50. hr = S_OK;
  51. }
  52. else
  53. {
  54. hr = S_FALSE ;
  55. }
  56. }
  57. STANDARD_CATCH
  58. }
  59. return hr;
  60. }
  61. /******************************************************************************
  62. *
  63. * Name:
  64. *
  65. *
  66. * Description:
  67. *
  68. *
  69. *****************************************************************************/
  70. HRESULT WmiGuard :: Enter()
  71. {
  72. HRESULT hr = E_UNEXPECTED;
  73. if ( m_pCS != NULL )
  74. {
  75. try
  76. {
  77. m_pCS->Enter ();
  78. hr = S_OK;
  79. }
  80. STANDARD_CATCH
  81. }
  82. return hr;
  83. }
  84. /******************************************************************************
  85. *
  86. * Name:
  87. *
  88. *
  89. * Description:
  90. *
  91. *
  92. *****************************************************************************/
  93. HRESULT WmiGuard :: Leave()
  94. {
  95. HRESULT hr = E_UNEXPECTED;
  96. if ( m_pCS != NULL )
  97. {
  98. try
  99. {
  100. m_pCS->Leave ();
  101. hr = S_OK;
  102. }
  103. STANDARD_CATCH
  104. }
  105. return hr;
  106. }