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.

161 lines
3.5 KiB

  1. /*++
  2. Copyright (C) 1996-2001 Microsoft Corporation
  3. Module Name:
  4. WBEMQUAL.CPP
  5. Abstract:
  6. History:
  7. --*/
  8. #include "precomp.h"
  9. #include <stdio.h>
  10. //#include <wbemutil.h>
  11. #include "wbemqual.h"
  12. //***************************************************************************
  13. //
  14. // CTestQualifier::CTestQualifier
  15. //
  16. // Constructor for CTestQualifier.
  17. //
  18. //***************************************************************************
  19. CTestQualifier::CTestQualifier()
  20. {
  21. m_pName = 0;
  22. m_pValue = 0;
  23. m_lType = 0;
  24. }
  25. //***************************************************************************
  26. //
  27. // CTestQualifier::~CTestQualifier
  28. //
  29. // Destructor for CTestQualifier.
  30. //
  31. //***************************************************************************
  32. CTestQualifier::~CTestQualifier()
  33. {
  34. delete m_pName;
  35. delete m_pValue;
  36. }
  37. //***************************************************************************
  38. //
  39. // CTestQualifier::CTestQualifier
  40. //
  41. // Copy constructor for CTestQualifier.
  42. //
  43. //***************************************************************************
  44. CTestQualifier::CTestQualifier(CTestQualifier &Src)
  45. {
  46. m_pName = 0;
  47. m_pValue = 0;
  48. m_lType = 0;
  49. *this = Src;
  50. }
  51. //***************************************************************************
  52. //
  53. // CTestQualifier::operator =
  54. //
  55. // Copy constructor for CTestQualifier.
  56. //
  57. //***************************************************************************
  58. CTestQualifier& CTestQualifier::operator =(CTestQualifier &Src)
  59. {
  60. delete m_pName;
  61. delete m_pValue;
  62. m_pName = new wchar_t[wcslen(Src.m_pName) + 1];
  63. wcscpy(m_pName, Src.m_pName);
  64. m_pValue = new CVar(*Src.m_pValue);
  65. m_lType = Src.m_lType;
  66. return *this;
  67. }
  68. //***************************************************************************
  69. //
  70. // CTestProperty::CTestProperty
  71. //
  72. // Constructor.
  73. //
  74. //***************************************************************************
  75. CTestProperty::CTestProperty(IWbemQualifierSet* pQualifiers)
  76. {
  77. m_pName = 0;
  78. m_pValue = 0;
  79. m_lType = 0;
  80. m_pClass = 0;
  81. m_pQualifiers = pQualifiers;
  82. if (m_pQualifiers)
  83. m_pQualifiers->AddRef();
  84. }
  85. //***************************************************************************
  86. //
  87. // CTestProperty::~CTestProperty
  88. //
  89. // Destructor.
  90. //
  91. //***************************************************************************
  92. CTestProperty::~CTestProperty()
  93. {
  94. delete m_pName;
  95. delete m_pValue;
  96. delete m_pClass;
  97. if (m_pQualifiers)
  98. m_pQualifiers->Release();
  99. }
  100. //***************************************************************************
  101. //
  102. // CTestMethod::CTestMethod
  103. //
  104. // Constructor.
  105. //
  106. //***************************************************************************
  107. CTestMethod::CTestMethod(IWbemQualifierSet* pQualifiers, IWbemClassObject * pInArgs,
  108. IWbemClassObject * pOutArgs, BOOL bEnableInputArgs, BOOL bEnableOutputArgs)
  109. :CTestProperty(pQualifiers)
  110. {
  111. m_pInArgs = pInArgs;
  112. if (m_pInArgs)
  113. m_pInArgs->AddRef();
  114. m_pOutArgs = pOutArgs;
  115. if (m_pOutArgs)
  116. m_pOutArgs->AddRef();
  117. m_bEnableInputArgs = bEnableInputArgs;
  118. m_bEnableOutputArgs = bEnableOutputArgs;
  119. }
  120. //***************************************************************************
  121. //
  122. // CTestMethod::~CTestMethod
  123. //
  124. // Destructor.
  125. //
  126. //***************************************************************************
  127. CTestMethod::~CTestMethod()
  128. {
  129. if (m_pInArgs)
  130. m_pInArgs->Release();
  131. if (m_pOutArgs)
  132. m_pOutArgs->Release();
  133. }