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.

433 lines
10 KiB

  1. /*++
  2. Copyright (C) 1996-2001 Microsoft Corporation
  3. Module Name:
  4. ProvFact.h
  5. Abstract:
  6. History:
  7. --*/
  8. #ifndef _Server_StaThread_H
  9. #define _Server_StaThread_H
  10. #include <Thread.h>
  11. #include "ProvRegInfo.h"
  12. /******************************************************************************
  13. *
  14. * Name:
  15. *
  16. *
  17. * Description:
  18. *
  19. *
  20. *****************************************************************************/
  21. #define ProxyIndex_Sta_IWbemServices 0
  22. #define ProxyIndex_Sta_IWbemEventProvider 1
  23. #define ProxyIndex_Sta_IWbemEventProviderQuerySink 2
  24. #define ProxyIndex_Sta_IWbemEventProviderSecurity 3
  25. #define ProxyIndex_Sta_IWbemEventConsumerProvider 4
  26. #define ProxyIndex_Sta_IWbemEventConsumerProviderEx 5
  27. #define ProxyIndex_Sta_IWbemUnboundObjectSink 6
  28. #define ProxyIndex_Sta_Size 7
  29. /******************************************************************************
  30. *
  31. * Name:
  32. *
  33. *
  34. * Description:
  35. *
  36. *
  37. *****************************************************************************/
  38. class CServerObject_StaThread : public IWbemServices ,
  39. public IWbemEventProvider ,
  40. public IWbemEventProviderQuerySink ,
  41. public IWbemEventProviderSecurity ,
  42. public IWbemEventConsumerProviderEx ,
  43. public IWbemUnboundObjectSink ,
  44. public IWbemProviderInit ,
  45. public IWbemShutdown ,
  46. public WmiThread < ULONG > ,
  47. public CWbemGlobal_IWmiObjectSinkController
  48. {
  49. private:
  50. WmiAllocator &m_Allocator ;
  51. LONG m_Flags ;
  52. IWbemContext *m_Context ;
  53. GUID *m_TransactionIdentifier ;
  54. LPWSTR m_User ;
  55. LPWSTR m_Locale ;
  56. LPWSTR m_Scope ;
  57. LPWSTR m_Namespace ;
  58. LPWSTR m_ProviderName ;
  59. IWbemPath *m_NamespacePath ;
  60. IWbemServices *m_Repository ;
  61. IUnknown *m_Provider_IUnknown ;
  62. IWbemServices *m_Provider_IWbemServices ;
  63. IWbemEventConsumerProvider *m_Provider_IWbemEventConsumerProvider ;
  64. IWbemEventConsumerProviderEx *m_Provider_IWbemEventConsumerProviderEx ;
  65. IWbemUnboundObjectSink *m_Provider_IWbemUnboundObjectSink ;
  66. IWbemEventProvider *m_Provider_IWbemEventProvider ;
  67. IWbemEventProviderQuerySink *m_Provider_IWbemEventProviderQuerySink ;
  68. IWbemEventProviderSecurity *m_Provider_IWbemEventProviderSecurity ;
  69. CServerObject_ProviderRegistrationV1 *m_Registration ;
  70. ProxyContainer m_ProxyContainer ;
  71. protected:
  72. public: /* Internal */
  73. CServerObject_StaThread (
  74. WmiAllocator & a_Allocator,
  75. CServerObject_ProviderRegistrationV1& registration
  76. ) ;
  77. ~CServerObject_StaThread () ;
  78. WmiStatusCode Initialize_Callback () ;
  79. WmiStatusCode UnInitialize_Callback () ;
  80. void CallBackRelease () ;
  81. LPCWSTR Direct_GetProviderName () { return m_ProviderName ; }
  82. LPCWSTR Direct_GetLocale () { return m_Locale ; }
  83. LPCWSTR Direct_GetUser () { return m_User ; }
  84. GUID *Direct_GetTransactionIdentifier () { return m_TransactionIdentifier ; }
  85. IWbemContext *Direct_GetContext () { return m_Context ; }
  86. LPCWSTR Direct_GetNamespace () { return m_Namespace ; }
  87. IWbemPath *Direct_GetNamespacePath () { return m_NamespacePath ; }
  88. LPCWSTR Direct_GetScope () { return m_Scope ; }
  89. IWbemServices *Direct_GetRepository () { return m_Repository ; }
  90. IWbemServices *Direct_GetProviderService () { return m_Provider_IWbemServices ; }
  91. HRESULT SetProviderName ( wchar_t *a_ProviderName ) ;
  92. HRESULT SetContext ( IWbemContext *a_Context ) ;
  93. HRESULT SetScope ( LPCWSTR a_Scope ) ;
  94. HRESULT SetNamespace ( LPCWSTR a_Namespace ) ;
  95. HRESULT SetNamespacePath ( IWbemPath *a_NamespacePath ) ;
  96. HRESULT SetRepository ( IWbemServices *a_Repository ) ;
  97. HRESULT SetProviderService ( IUnknown *a_ProviderService ) ;
  98. HRESULT InitializeProvider (
  99. GUID *a_TransactionIdentifier ,
  100. LPCWSTR a_User ,
  101. LPCWSTR a_Locale ,
  102. LPCWSTR a_Namespace ,
  103. IWbemPath *a_NamespacePath ,
  104. IWbemServices *a_Repository ,
  105. LONG a_Flags ,
  106. IWbemContext *a_Context ,
  107. LPCWSTR a_Scope ,
  108. CServerObject_ProviderRegistrationV1 &a_Registration
  109. ) ;
  110. HRESULT GetApartmentInstanceProvider (
  111. GUID *a_TransactionIdentifier ,
  112. LPCWSTR a_User ,
  113. LPCWSTR a_Locale ,
  114. LPCWSTR a_Namespace ,
  115. IWbemPath *a_NamespacePath ,
  116. IWbemServices *a_Repository ,
  117. LONG a_Flags ,
  118. IWbemContext *a_Context ,
  119. LPCWSTR a_Scope ,
  120. CServerObject_ProviderRegistrationV1 &a_Registration
  121. ) ;
  122. public: /* External */
  123. //Non-delegating object IUnknown
  124. STDMETHODIMP QueryInterface ( REFIID , LPVOID FAR * ) ;
  125. STDMETHODIMP_( ULONG ) AddRef () ;
  126. STDMETHODIMP_( ULONG ) Release () ;
  127. /* IWbemServices methods */
  128. HRESULT STDMETHODCALLTYPE OpenNamespace (
  129. const BSTR a_Namespace ,
  130. long a_Flags ,
  131. IWbemContext *a_Context ,
  132. IWbemServices **a_Service ,
  133. IWbemCallResult **a_CallResult
  134. ) ;
  135. HRESULT STDMETHODCALLTYPE CancelAsyncCall (
  136. IWbemObjectSink *a_Sink
  137. ) ;
  138. HRESULT STDMETHODCALLTYPE QueryObjectSink (
  139. long a_Flags ,
  140. IWbemObjectSink **a_Sink
  141. ) ;
  142. HRESULT STDMETHODCALLTYPE GetObject (
  143. const BSTR a_ObjectPath ,
  144. long a_Flags ,
  145. IWbemContext *a_Context ,
  146. IWbemClassObject **ppObject ,
  147. IWbemCallResult **a_CallResult
  148. ) ;
  149. HRESULT STDMETHODCALLTYPE GetObjectAsync (
  150. const BSTR a_ObjectPath ,
  151. long a_Flags ,
  152. IWbemContext *a_Context ,
  153. IWbemObjectSink *a_Sink
  154. ) ;
  155. HRESULT STDMETHODCALLTYPE PutClass (
  156. IWbemClassObject *a_Object ,
  157. long a_Flags ,
  158. IWbemContext *a_Context ,
  159. IWbemCallResult **a_CallResult
  160. ) ;
  161. HRESULT STDMETHODCALLTYPE PutClassAsync (
  162. IWbemClassObject *a_Object ,
  163. long a_Flags ,
  164. IWbemContext *a_Context ,
  165. IWbemObjectSink *a_Sink
  166. ) ;
  167. HRESULT STDMETHODCALLTYPE DeleteClass (
  168. const BSTR a_Class ,
  169. long a_Flags ,
  170. IWbemContext *a_Context ,
  171. IWbemCallResult **a_CallResult
  172. ) ;
  173. HRESULT STDMETHODCALLTYPE DeleteClassAsync (
  174. const BSTR a_Class ,
  175. long a_Flags ,
  176. IWbemContext *a_Context ,
  177. IWbemObjectSink *a_Sink
  178. ) ;
  179. HRESULT STDMETHODCALLTYPE CreateClassEnum (
  180. const BSTR a_Superclass ,
  181. long a_Flags ,
  182. IWbemContext *a_Context ,
  183. IEnumWbemClassObject **a_Enum
  184. ) ;
  185. HRESULT STDMETHODCALLTYPE CreateClassEnumAsync (
  186. const BSTR a_Superclass ,
  187. long a_Flags ,
  188. IWbemContext *a_Context ,
  189. IWbemObjectSink *a_Sink
  190. ) ;
  191. HRESULT STDMETHODCALLTYPE PutInstance (
  192. IWbemClassObject *a_Instance ,
  193. long a_Flags ,
  194. IWbemContext *a_Context ,
  195. IWbemCallResult **a_CallResult
  196. ) ;
  197. HRESULT STDMETHODCALLTYPE PutInstanceAsync (
  198. IWbemClassObject *a_Instance ,
  199. long a_Flags ,
  200. IWbemContext *a_Context ,
  201. IWbemObjectSink *a_Sink
  202. ) ;
  203. HRESULT STDMETHODCALLTYPE DeleteInstance (
  204. const BSTR a_ObjectPath ,
  205. long a_Flags ,
  206. IWbemContext *a_Context ,
  207. IWbemCallResult **a_CallResult
  208. ) ;
  209. HRESULT STDMETHODCALLTYPE DeleteInstanceAsync (
  210. const BSTR a_ObjectPath,
  211. long a_Flags,
  212. IWbemContext *a_Context ,
  213. IWbemObjectSink *a_Sink
  214. ) ;
  215. HRESULT STDMETHODCALLTYPE CreateInstanceEnum (
  216. const BSTR a_Class ,
  217. long a_Flags ,
  218. IWbemContext *a_Context ,
  219. IEnumWbemClassObject **a_Enum
  220. ) ;
  221. HRESULT STDMETHODCALLTYPE CreateInstanceEnumAsync (
  222. const BSTR a_Class ,
  223. long a_Flags ,
  224. IWbemContext *a_Context ,
  225. IWbemObjectSink *a_Sink
  226. ) ;
  227. HRESULT STDMETHODCALLTYPE ExecQuery (
  228. const BSTR a_QueryLanguage,
  229. const BSTR a_Query,
  230. long a_Flags ,
  231. IWbemContext *a_Context ,
  232. IEnumWbemClassObject **a_Enum
  233. ) ;
  234. HRESULT STDMETHODCALLTYPE ExecQueryAsync (
  235. const BSTR a_QueryLanguage ,
  236. const BSTR a_Query ,
  237. long a_Flags ,
  238. IWbemContext *a_Context ,
  239. IWbemObjectSink *a_Sink
  240. ) ;
  241. HRESULT STDMETHODCALLTYPE ExecNotificationQuery (
  242. const BSTR a_QueryLanguage ,
  243. const BSTR a_Query ,
  244. long a_Flags ,
  245. IWbemContext *a_Context ,
  246. IEnumWbemClassObject **a_Enum
  247. ) ;
  248. HRESULT STDMETHODCALLTYPE ExecNotificationQueryAsync (
  249. const BSTR a_QueryLanguage ,
  250. const BSTR a_Query ,
  251. long a_Flags ,
  252. IWbemContext *a_Context ,
  253. IWbemObjectSink *a_Sink
  254. ) ;
  255. HRESULT STDMETHODCALLTYPE ExecMethod (
  256. const BSTR a_ObjectPath ,
  257. const BSTR a_MethodName ,
  258. long a_Flags ,
  259. IWbemContext *a_Context ,
  260. IWbemClassObject *a_InParams ,
  261. IWbemClassObject **a_OutParams ,
  262. IWbemCallResult **a_CallResult
  263. ) ;
  264. HRESULT STDMETHODCALLTYPE ExecMethodAsync (
  265. const BSTR a_ObjectPath ,
  266. const BSTR a_MethodName ,
  267. long a_Flags ,
  268. IWbemContext *a_Context ,
  269. IWbemClassObject *a_InParams ,
  270. IWbemObjectSink *a_Sink
  271. ) ;
  272. /* IWbemEventConsumerProvider */
  273. HRESULT STDMETHODCALLTYPE FindConsumer (
  274. IWbemClassObject *a_LogicalConsumer ,
  275. IWbemUnboundObjectSink **a_Consumer
  276. );
  277. /* IWbemEventConsumerProviderEx */
  278. HRESULT STDMETHODCALLTYPE ValidateSubscription (
  279. IWbemClassObject *a_LogicalConsumer
  280. ) ;
  281. /* IWbemUnboundObjectSink */
  282. HRESULT STDMETHODCALLTYPE IndicateToConsumer (
  283. IWbemClassObject *a_LogicalConsumer ,
  284. long a_ObjectCount ,
  285. IWbemClassObject **a_Objects
  286. ) ;
  287. /* IWbemEventProvider */
  288. HRESULT STDMETHODCALLTYPE ProvideEvents (
  289. IWbemObjectSink *a_Sink ,
  290. long a_Flags
  291. ) ;
  292. /* IWbemEventProviderQuerySink */
  293. HRESULT STDMETHODCALLTYPE NewQuery (
  294. unsigned long a_Id ,
  295. WBEM_WSTR a_QueryLanguage ,
  296. WBEM_WSTR a_Query
  297. );
  298. HRESULT STDMETHODCALLTYPE CancelQuery (
  299. unsigned long a_Id
  300. ) ;
  301. /* IWbemEventProviderSecurity */
  302. HRESULT STDMETHODCALLTYPE AccessCheck (
  303. WBEM_CWSTR a_QueryLanguage ,
  304. WBEM_CWSTR a_Query ,
  305. long a_SidLength ,
  306. const BYTE *a_Sid
  307. ) ;
  308. /* IWbemProviderInit methods */
  309. HRESULT STDMETHODCALLTYPE Initialize (
  310. LPWSTR a_User ,
  311. LONG a_Flags ,
  312. LPWSTR a_Namespace ,
  313. LPWSTR a_Locale ,
  314. IWbemServices *a_Core ,
  315. IWbemContext *a_Context ,
  316. IWbemProviderInitSink *a_Sink
  317. ) ;
  318. HRESULT STDMETHODCALLTYPE Shutdown (
  319. LONG a_Flags ,
  320. ULONG a_MaxMilliSeconds ,
  321. IWbemContext *a_Context
  322. ) ;
  323. };
  324. #endif // _Server_StaThread_H