Source code of Windows XP (NT5)
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.

64 lines
754 B

  1. /*++
  2. Copyright (C) 1998-2001 Microsoft Corporation
  3. Module Name:
  4. Abstract:
  5. History:
  6. --*/
  7. #include "precomp.h"
  8. #include <comutil.h>
  9. #include <smrtptr.h>
  10. CReleaseMe::CReleaseMe ( IUnknown *pIn)
  11. {
  12. m_pIn = pIn;
  13. }
  14. CReleaseMe::~CReleaseMe ()
  15. {
  16. if (m_pIn)
  17. m_pIn->Release();
  18. }
  19. CFreeMe::CFreeMe ( BSTR pIn)
  20. {
  21. m_pIn = pIn;
  22. }
  23. CFreeMe::~CFreeMe ()
  24. {
  25. if (m_pIn)
  26. SysFreeString(m_pIn);
  27. }
  28. CClearMe::CClearMe ( VARIANT *pIn)
  29. {
  30. m_pIn = pIn;
  31. VariantInit(m_pIn);
  32. }
  33. CClearMe::~CClearMe ()
  34. {
  35. if (m_pIn)
  36. VariantClear(m_pIn);
  37. }
  38. CRepdrvrCritSec::CRepdrvrCritSec (CRITICAL_SECTION *pCS)
  39. {
  40. p_cs = pCS;
  41. EnterCriticalSection(pCS);
  42. }
  43. CRepdrvrCritSec::~CRepdrvrCritSec()
  44. {
  45. LeaveCriticalSection(p_cs);
  46. }