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.

296 lines
7.1 KiB

  1. //***************************************************************************
  2. //
  3. // Copyright (c) 1998-1999 Microsoft Corporation
  4. //
  5. // qualifier.h
  6. //
  7. // alanbos 27-Mar-00 Created.
  8. //
  9. // CSWbemQualifier and CSWbemQualifierSet definitions.
  10. //
  11. //***************************************************************************
  12. #ifndef _QUALIFIER_H_
  13. #define _QUALIFIER_H_
  14. //***************************************************************************
  15. //
  16. // CLASS NAME:
  17. //
  18. // CSWbemQualifier
  19. //
  20. // DESCRIPTION:
  21. //
  22. // Implements the ISWbemQualifier interface.
  23. //
  24. //***************************************************************************
  25. class CSWbemQualifier : public ISWbemQualifier,
  26. public ISupportErrorInfo,
  27. public IProvideClassInfo
  28. {
  29. private:
  30. class CQualifierDispatchHelp : public CDispatchHelp
  31. {
  32. public:
  33. HRESULT HandleError (
  34. DISPID dispidMember,
  35. unsigned short wFlags,
  36. DISPPARAMS FAR* pdispparams,
  37. VARIANT FAR* pvarResult,
  38. UINT FAR* puArgErr,
  39. HRESULT hRes
  40. );
  41. bool HandleNulls (
  42. DISPID dispidMember,
  43. unsigned short wFlags
  44. )
  45. {
  46. return false;
  47. }
  48. };
  49. IWbemQualifierSet *m_pIWbemQualifierSet;
  50. CQualifierDispatchHelp m_Dispatch;
  51. BSTR m_name;
  52. CWbemSite *m_pSite;
  53. protected:
  54. long m_cRef; //Object reference count
  55. public:
  56. CSWbemQualifier (IWbemQualifierSet *pQualSet, BSTR name,
  57. CWbemSite *pSite = NULL);
  58. ~CSWbemQualifier (void);
  59. //Non-delegating object IUnknown
  60. STDMETHODIMP QueryInterface(REFIID, LPVOID*);
  61. STDMETHODIMP_(ULONG) AddRef(void);
  62. STDMETHODIMP_(ULONG) Release(void);
  63. // IDispatch
  64. STDMETHODIMP GetTypeInfoCount(UINT* pctinfo)
  65. {return m_Dispatch.GetTypeInfoCount(pctinfo);}
  66. STDMETHODIMP GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo** pptinfo)
  67. {return m_Dispatch.GetTypeInfo(itinfo, lcid, pptinfo);}
  68. STDMETHODIMP GetIDsOfNames(REFIID riid, OLECHAR** rgszNames,
  69. UINT cNames, LCID lcid, DISPID* rgdispid)
  70. {return m_Dispatch.GetIDsOfNames(riid, rgszNames, cNames,
  71. lcid,
  72. rgdispid);}
  73. STDMETHODIMP Invoke(DISPID dispidMember, REFIID riid, LCID lcid,
  74. WORD wFlags, DISPPARAMS* pdispparams, VARIANT* pvarResult,
  75. EXCEPINFO* pexcepinfo, UINT* puArgErr)
  76. {return m_Dispatch.Invoke(dispidMember, riid, lcid, wFlags,
  77. pdispparams, pvarResult, pexcepinfo, puArgErr);}
  78. // ISWbemQualifier methods
  79. HRESULT STDMETHODCALLTYPE get_Value
  80. (
  81. /*[out]*/ VARIANT *value
  82. );
  83. HRESULT STDMETHODCALLTYPE put_Value
  84. (
  85. /*[in]*/ VARIANT *value
  86. );
  87. HRESULT STDMETHODCALLTYPE get_Name
  88. (
  89. /*[out]*/ BSTR *name
  90. );
  91. HRESULT STDMETHODCALLTYPE get_IsLocal
  92. (
  93. /*[out]*/ VARIANT_BOOL *local
  94. );
  95. HRESULT STDMETHODCALLTYPE get_PropagatesToSubclass
  96. (
  97. /*[out]*/ VARIANT_BOOL *value
  98. );
  99. HRESULT STDMETHODCALLTYPE put_PropagatesToSubclass
  100. (
  101. /*[in]*/ VARIANT_BOOL value
  102. );
  103. HRESULT STDMETHODCALLTYPE get_PropagatesToInstance
  104. (
  105. /*[out]*/ VARIANT_BOOL *value
  106. );
  107. HRESULT STDMETHODCALLTYPE put_PropagatesToInstance
  108. (
  109. /*[in]*/ VARIANT_BOOL value
  110. );
  111. HRESULT STDMETHODCALLTYPE get_IsOverridable
  112. (
  113. /*[out]*/ VARIANT_BOOL *value
  114. );
  115. HRESULT STDMETHODCALLTYPE put_IsOverridable
  116. (
  117. /*[in]*/ VARIANT_BOOL value
  118. );
  119. HRESULT STDMETHODCALLTYPE get_IsAmended
  120. (
  121. /*[out]*/ VARIANT_BOOL *value
  122. );
  123. // ISupportErrorInfo methods
  124. HRESULT STDMETHODCALLTYPE InterfaceSupportsErrorInfo
  125. (
  126. /* [in] */ REFIID riid
  127. );
  128. // IProvideClassInfo methods
  129. HRESULT STDMETHODCALLTYPE GetClassInfo
  130. (
  131. /* [in,out] */ ITypeInfo **ppTI
  132. )
  133. {
  134. return m_Dispatch.GetClassInfo (ppTI);
  135. };
  136. };
  137. //***************************************************************************
  138. //
  139. // CLASS NAME:
  140. //
  141. // CSWbemQualifierSet
  142. //
  143. // DESCRIPTION:
  144. //
  145. // Implements the ISWbemQualifierSet interface.
  146. //
  147. //***************************************************************************
  148. class CSWbemQualifierSet : public ISWbemQualifierSet,
  149. public ISupportErrorInfo,
  150. public IProvideClassInfo
  151. {
  152. private:
  153. class CQualifierSetDispatchHelp : public CDispatchHelp
  154. {
  155. public:
  156. HRESULT HandleError (
  157. DISPID dispidMember,
  158. unsigned short wFlags,
  159. DISPPARAMS FAR* pdispparams,
  160. VARIANT FAR* pvarResult,
  161. UINT FAR* puArgErr,
  162. HRESULT hRes
  163. );
  164. };
  165. IWbemQualifierSet *m_pIWbemQualifierSet;
  166. CQualifierSetDispatchHelp m_Dispatch;
  167. CWbemSite *m_pSite;
  168. protected:
  169. long m_cRef; //Object reference count
  170. public:
  171. CSWbemQualifierSet (IWbemQualifierSet *pQualSet,
  172. ISWbemInternalObject *pObject = NULL);
  173. ~CSWbemQualifierSet (void);
  174. //Non-delegating object IUnknown
  175. STDMETHODIMP QueryInterface(REFIID, LPVOID*);
  176. STDMETHODIMP_(ULONG) AddRef(void);
  177. STDMETHODIMP_(ULONG) Release(void);
  178. // IDispatch
  179. STDMETHODIMP GetTypeInfoCount(UINT* pctinfo)
  180. {return m_Dispatch.GetTypeInfoCount(pctinfo);}
  181. STDMETHODIMP GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo** pptinfo)
  182. {return m_Dispatch.GetTypeInfo(itinfo, lcid, pptinfo);}
  183. STDMETHODIMP GetIDsOfNames(REFIID riid, OLECHAR** rgszNames,
  184. UINT cNames, LCID lcid, DISPID* rgdispid)
  185. {return m_Dispatch.GetIDsOfNames(riid, rgszNames, cNames,
  186. lcid,
  187. rgdispid);}
  188. STDMETHODIMP Invoke(DISPID dispidMember, REFIID riid, LCID lcid,
  189. WORD wFlags, DISPPARAMS* pdispparams, VARIANT* pvarResult,
  190. EXCEPINFO* pexcepinfo, UINT* puArgErr)
  191. {return m_Dispatch.Invoke(dispidMember, riid, lcid, wFlags,
  192. pdispparams, pvarResult, pexcepinfo, puArgErr);}
  193. // Collection methods
  194. HRESULT STDMETHODCALLTYPE get__NewEnum
  195. (
  196. /*[out]*/ IUnknown **ppUnk
  197. );
  198. HRESULT STDMETHODCALLTYPE get_Count
  199. (
  200. /*[out]*/ long *plCount
  201. );
  202. HRESULT STDMETHODCALLTYPE Add
  203. (
  204. /*[in]*/ BSTR name,
  205. /*[in]*/ VARIANT *pVal,
  206. /*[in]*/ VARIANT_BOOL propagatesToSubclasses,
  207. /*[in]*/ VARIANT_BOOL propagatesToInstances,
  208. /*[in]*/ VARIANT_BOOL overridable,
  209. /*[in]*/ long lFlags,
  210. /*[out]*/ ISWbemQualifier **ppQualifier
  211. );
  212. HRESULT STDMETHODCALLTYPE Item
  213. (
  214. /*[in]*/ BSTR Name,
  215. /*[in]*/ long lFlags,
  216. /*[out]*/ ISWbemQualifier **ppQualifier
  217. );
  218. HRESULT STDMETHODCALLTYPE Remove
  219. (
  220. /*[in]*/ BSTR Name,
  221. /*[in]*/ long lFlags
  222. );
  223. // ISWbemQualifierSet methods
  224. HRESULT STDMETHODCALLTYPE BeginEnumeration
  225. (
  226. );
  227. HRESULT STDMETHODCALLTYPE Next
  228. (
  229. /*[in]*/ long lFlags,
  230. /*[out]*/ ISWbemQualifier **ppQualifier
  231. );
  232. // ISupportErrorInfo methods
  233. HRESULT STDMETHODCALLTYPE InterfaceSupportsErrorInfo
  234. (
  235. /* [in] */ REFIID riid
  236. );
  237. // IProvideClassInfo methods
  238. HRESULT STDMETHODCALLTYPE GetClassInfo
  239. (
  240. /* [in,out] */ ITypeInfo **ppTI
  241. )
  242. {
  243. return m_Dispatch.GetClassInfo (ppTI);
  244. };
  245. };
  246. #endif