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.

258 lines
7.3 KiB

  1. /*++
  2. Copyright (c) 1998-2000 Microsoft Corporation
  3. Module Name:
  4. iisprov.h
  5. Abstract:
  6. Global include file. This file is included by pretty much everything, so
  7. to minimize dependencies, only put stuff in here that will be used by majority
  8. of files.
  9. Author:
  10. ???
  11. Revision History:
  12. Mohit Srivastava 18-Dec-00
  13. --*/
  14. #ifndef _iisprov_H_
  15. #define _iisprov_H_
  16. extern "C" {
  17. #include <nt.h>
  18. #include <ntrtl.h>
  19. #include <nturtl.h>
  20. }
  21. #include <objbase.h>
  22. #include <initguid.h>
  23. #include <windows.h>
  24. #include <wbemprov.h>
  25. #include <genlex.h>
  26. #include <opathlex.h>
  27. #include <objpath.h>
  28. #include <comdef.h>
  29. #include <stdio.h>
  30. #include <atlbase.h>
  31. #include "iisfiles.h"
  32. #include <eventlog.hxx>
  33. #include "ProviderBase.h"
  34. #include "schema.h"
  35. #include "schemadynamic.h"
  36. #include "hashtable.h"
  37. #include "metabase.h"
  38. #include "utils.h"
  39. #include "globalconstants.h"
  40. //
  41. // These variables keep track of when the module can be unloaded
  42. //
  43. extern long g_cLock;
  44. //
  45. // Provider interfaces are provided by objects of this class
  46. //
  47. class CIISInstProvider : public CProviderBase
  48. {
  49. public:
  50. static bool ms_bInitialized; // If Initialize succeeded
  51. //
  52. // Implemented
  53. //
  54. CIISInstProvider(
  55. BSTR ObjectPath = NULL,
  56. BSTR User = NULL,
  57. BSTR Password = NULL,
  58. IWbemContext* pCtx = NULL)
  59. {}
  60. HRESULT STDMETHODCALLTYPE DoInitialize(
  61. LPWSTR i_wszUser,
  62. LONG i_lFlags,
  63. LPWSTR i_wszNamespace,
  64. LPWSTR i_wszLocale,
  65. IWbemServices* i_pNamespace,
  66. IWbemContext* i_pCtx,
  67. IWbemProviderInitSink* i_pInitSink);
  68. HRESULT STDMETHODCALLTYPE DoCreateInstanceEnumAsync(
  69. const BSTR i_ClassName,
  70. long i_lFlags,
  71. IWbemContext __RPC_FAR* i_pCtx,
  72. IWbemObjectSink __RPC_FAR* i_pHandler);
  73. HRESULT STDMETHODCALLTYPE DoDeleteInstanceAsync(
  74. const BSTR i_ObjectPath,
  75. long i_lFlags,
  76. IWbemContext __RPC_FAR* i_pCtx,
  77. IWbemObjectSink __RPC_FAR* i_pHandler);
  78. HRESULT STDMETHODCALLTYPE DoExecMethodAsync(
  79. const BSTR i_strObjectPath,
  80. const BSTR i_strMethodName,
  81. long i_lFlags,
  82. IWbemContext* i_pCtx,
  83. IWbemClassObject* i_pInParams,
  84. IWbemObjectSink* i_pHandler);
  85. HRESULT STDMETHODCALLTYPE DoGetObjectAsync(
  86. const BSTR i_ObjectPath,
  87. long i_lFlags,
  88. IWbemContext __RPC_FAR* i_pCtx,
  89. IWbemObjectSink __RPC_FAR* i_pHandler);
  90. HRESULT STDMETHODCALLTYPE DoPutInstanceAsync(
  91. IWbemClassObject __RPC_FAR* i_pObj,
  92. long i_lFlags,
  93. IWbemContext __RPC_FAR* i_pCtx,
  94. IWbemObjectSink __RPC_FAR* i_pHandler);
  95. HRESULT STDMETHODCALLTYPE DoExecQueryAsync(
  96. const BSTR i_bstrQueryLanguage,
  97. const BSTR i_bstrQuery,
  98. long i_lFlags,
  99. IWbemContext __RPC_FAR* i_pCtx,
  100. IWbemObjectSink __RPC_FAR* i_pResponseHandler);
  101. private:
  102. IWbemClassObject* ConstructExtendedStatus(
  103. const CIIsProvException* i_pException) const;
  104. IWbemClassObject* ConstructExtendedStatus(
  105. HRESULT i_hr) const;
  106. void ValidatePutParsedObject(
  107. ParsedObjectPath* i_pParsedObject,
  108. IWbemClassObject* i_pObj,
  109. bool* io_pbInstanceNameSame,
  110. bool* io_pbInstanceExists,
  111. WMI_CLASS** o_ppWmiClass = NULL);
  112. //
  113. // Worker methods called by public methods
  114. //
  115. void WorkerGetObjectAsync(
  116. IWbemClassObject** o_ppObj,
  117. BSTR i_bstrObjPath,
  118. bool i_bCreateKeyIfNotExist);
  119. void WorkerGetObjectAsync(
  120. IWbemClassObject** o_ppObj,
  121. ParsedObjectPath* i_pParsedObjPath,
  122. bool i_bCreateKeyIfNotExist);
  123. void WorkerExecMethodAsync(
  124. BSTR i_strObjectPath,
  125. BSTR i_strMethodName,
  126. IWbemContext* i_pCtx,
  127. IWbemClassObject* i_pInParams,
  128. IWbemObjectSink* i_pHandler);
  129. void WorkerDeleteObjectAsync(
  130. ParsedObjectPath* i_pParsedObject);
  131. void WorkerPutObjectAsync(
  132. IWbemClassObject* i_pObj,
  133. IWbemClassObject* i_pObjOld, // can be NULL
  134. ParsedObjectPath* i_pParsedObject,
  135. long i_lFlags,
  136. bool i_bInstanceExists,
  137. BSTR* o_pbstrObjPath);
  138. void WorkerEnumObjectAsync(
  139. BSTR i_bstrClassName,
  140. IWbemObjectSink FAR* i_pHandler);
  141. //
  142. // These methods should only be called by WorkerExecMethodAsync
  143. //
  144. void WorkerExecFtpServiceMethod(
  145. LPCWSTR i_wszMbPath,
  146. WMI_CLASS* i_pClass,
  147. WMI_METHOD* i_pMethod,
  148. IWbemContext* i_pCtx,
  149. IWbemClassObject* i_pInParams,
  150. IWbemObjectSink* i_pHandler);
  151. void WorkerExecWebServiceMethod(
  152. LPCWSTR i_wszMbPath,
  153. WMI_CLASS* i_pClass,
  154. WMI_METHOD* i_pMethod,
  155. IWbemContext* i_pCtx,
  156. IWbemClassObject* i_pInParams,
  157. IWbemObjectSink* i_pHandler);
  158. static void WorkerExecWebAppMethod(
  159. LPCWSTR i_wszMbPath,
  160. LPCWSTR i_wszClassName,
  161. WMI_METHOD* i_pMethod,
  162. IWbemContext* i_pCtx,
  163. IWbemClassObject* i_pInParams,
  164. IWbemObjectSink* i_pHandler,
  165. CWbemServices* i_pNameSpace);
  166. static void WorkerExecComputerMethod(
  167. LPCWSTR i_wszMbPath,
  168. LPCWSTR i_wszClassName,
  169. WMI_METHOD* i_pMethod,
  170. IWbemContext* i_pCtx,
  171. IWbemClassObject* i_pInParams,
  172. IWbemObjectSink* i_pHandler,
  173. CWbemServices* i_pNameSpace);
  174. static void WorkerExecCertMapperMethod(
  175. LPCWSTR i_wszMbPath,
  176. LPCWSTR i_wszClassName,
  177. WMI_METHOD* i_pMethod,
  178. IWbemContext* i_pCtx,
  179. IWbemClassObject* i_pInParams,
  180. IWbemObjectSink* i_pHandler,
  181. CWbemServices* i_pNameSpace);
  182. static void WorkerExecAppPoolMethod(
  183. LPCWSTR i_wszMbPath,
  184. LPCWSTR i_wszClassName,
  185. WMI_METHOD* i_pMethod,
  186. IWbemContext* i_pCtx,
  187. IWbemClassObject* i_pInParams,
  188. IWbemObjectSink* i_pHandler,
  189. CWbemServices* i_pNameSpace);
  190. };
  191. // This class is the class factory for CInstPro objects.
  192. class CProvFactory : public IClassFactory
  193. {
  194. protected:
  195. ULONG m_cRef;
  196. public:
  197. CProvFactory(void);
  198. ~CProvFactory(void);
  199. //IUnknown members
  200. STDMETHODIMP QueryInterface(REFIID, PPVOID);
  201. STDMETHODIMP_(ULONG) AddRef(void);
  202. STDMETHODIMP_(ULONG) Release(void);
  203. //IClassFactory members
  204. STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, PPVOID);
  205. STDMETHODIMP LockServer(BOOL);
  206. };
  207. #endif