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.

190 lines
4.7 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1999-2000 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // ProvBase.h
  7. //
  8. // Implementation File:
  9. // ProvBase.cpp
  10. //
  11. // Description:
  12. // Definition of the CProvBase class.
  13. //
  14. // Author:
  15. // Henry Wang (HenryWa) 24-AUG-1999
  16. //
  17. // Notes:
  18. //
  19. //////////////////////////////////////////////////////////////////////////////
  20. #pragma once
  21. //////////////////////////////////////////////////////////////////////////////
  22. // Include Files
  23. //////////////////////////////////////////////////////////////////////////////
  24. //////////////////////////////////////////////////////////////////////////////
  25. // Forward Declarations
  26. //////////////////////////////////////////////////////////////////////////////
  27. class CProvBase;
  28. class CProvBaseAssociation;
  29. //////////////////////////////////////////////////////////////////////////////
  30. // External Declarations
  31. //////////////////////////////////////////////////////////////////////////////
  32. /* main interface class, this class defines all operations can be performed
  33. on this provider
  34. */
  35. //class CSqlEval;
  36. //////////////////////////////////////////////////////////////////////////////
  37. //++
  38. //
  39. // class CProvBase
  40. //
  41. // Description:
  42. // interface class defines all operations can be performed
  43. //
  44. //--
  45. //////////////////////////////////////////////////////////////////////////////
  46. class CProvBase
  47. {
  48. public:
  49. virtual SCODE EnumInstance(
  50. long lFlagsIn,
  51. IWbemContext * pCtxIn,
  52. IWbemObjectSink * pHandlerIn
  53. ) = 0;
  54. virtual SCODE GetObject(
  55. CObjPath & rObjPathIn,
  56. long lFlagsIn,
  57. IWbemContext * pCtxIn,
  58. IWbemObjectSink * pHandlerIn
  59. ) = 0;
  60. virtual SCODE ExecuteMethod(
  61. CObjPath & rObjPathIn,
  62. WCHAR * pwszMethodNameIn,
  63. long lFlagIn,
  64. IWbemClassObject * pParamsIn,
  65. IWbemObjectSink * pHandlerIn
  66. ) = 0;
  67. virtual SCODE PutInstance(
  68. CWbemClassObject & rInstToPutIn,
  69. long lFlagIn,
  70. IWbemContext * pCtxIn,
  71. IWbemObjectSink * pHandlerIn
  72. )
  73. {
  74. return WBEM_E_NOT_SUPPORTED;
  75. }
  76. virtual SCODE DeleteInstance(
  77. CObjPath & rObjPathIn,
  78. long lFlagIn,
  79. IWbemContext * pCtxIn,
  80. IWbemObjectSink * pHandlerIn
  81. )
  82. {
  83. return WBEM_E_NOT_SUPPORTED;
  84. }
  85. CProvBase(
  86. LPCWSTR pwszNameIn,
  87. CWbemServices * pNamespaceIn
  88. );
  89. virtual ~CProvBase( void );
  90. protected:
  91. CWbemServices * m_pNamespace;
  92. IWbemClassObject * m_pClass;
  93. _bstr_t m_bstrClassName;
  94. }; //*** class CProvBase
  95. //////////////////////////////////////////////////////////////////////////////
  96. //++
  97. //
  98. // class CProvBaseAssociation
  99. //
  100. // Description:
  101. // interface class defines all operations can be performed
  102. //
  103. //--
  104. //////////////////////////////////////////////////////////////////////////////
  105. class CProvBaseAssociation
  106. : public CProvBase
  107. {
  108. public:
  109. virtual SCODE EnumInstance(
  110. long lFlagsIn,
  111. IWbemContext * pCtxIn,
  112. IWbemObjectSink * pHandlerIn
  113. ) = 0;
  114. virtual SCODE GetObject(
  115. CObjPath & rObjPathIn,
  116. long lFlagsIn,
  117. IWbemContext * pCtxIn,
  118. IWbemObjectSink * pHandlerIn
  119. )
  120. {
  121. return WBEM_E_NOT_SUPPORTED;
  122. }
  123. virtual SCODE ExecuteMethod(
  124. CObjPath & rObjPathIn,
  125. WCHAR * pwszMethodNameIn,
  126. long lFlagIn,
  127. IWbemClassObject * pParamsIn,
  128. IWbemObjectSink * pHandlerIn
  129. )
  130. {
  131. return WBEM_E_NOT_SUPPORTED;
  132. }
  133. virtual SCODE PutInstance(
  134. CWbemClassObject & rInstToPutIn,
  135. long lFlagIn,
  136. IWbemContext * pCtxIn,
  137. IWbemObjectSink * pHandlerIn
  138. )
  139. {
  140. return WBEM_E_NOT_SUPPORTED;
  141. }
  142. virtual SCODE DeleteInstance(
  143. CObjPath & rObjPathIn,
  144. long lFlagIn,
  145. IWbemContext * pCtxIn,
  146. IWbemObjectSink * pHandlerIn
  147. )
  148. {
  149. return WBEM_E_NOT_SUPPORTED;
  150. }
  151. CProvBaseAssociation(
  152. LPCWSTR pwszNameIn,
  153. CWbemServices * pNamespaceIn
  154. )
  155. : CProvBase( pwszNameIn, pNamespaceIn )
  156. {
  157. }
  158. virtual ~CProvBaseAssociation( void )
  159. {
  160. }
  161. protected:
  162. void GetTypeName(
  163. _bstr_t & bstrClassNameOut,
  164. _bstr_t bstrProperty
  165. );
  166. }; //*** class CProvBaseAssociation