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.

259 lines
7.7 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. #include "safecs.h"
  41. //
  42. // These variables keep track of when the module can be unloaded
  43. //
  44. extern long g_cLock;
  45. //
  46. // Provider interfaces are provided by objects of this class
  47. //
  48. class CIISInstProvider : public CProviderBase
  49. {
  50. public:
  51. static bool ms_bInitialized; // If Initialize succeeded
  52. static CSafeAutoCriticalSection *m_SafeCritSec;
  53. //
  54. // Implemented
  55. //
  56. CIISInstProvider(
  57. BSTR ObjectPath = NULL,
  58. BSTR User = NULL,
  59. BSTR Password = NULL,
  60. IWbemContext* pCtx = NULL)
  61. {}
  62. HRESULT STDMETHODCALLTYPE DoInitialize(
  63. LPWSTR i_wszUser,
  64. LONG i_lFlags,
  65. LPWSTR i_wszNamespace,
  66. LPWSTR i_wszLocale,
  67. IWbemServices* i_pNamespace,
  68. IWbemContext* i_pCtx,
  69. IWbemProviderInitSink* i_pInitSink);
  70. HRESULT STDMETHODCALLTYPE DoCreateInstanceEnumAsync(
  71. const BSTR i_ClassName,
  72. long i_lFlags,
  73. IWbemContext __RPC_FAR* i_pCtx,
  74. IWbemObjectSink __RPC_FAR* i_pHandler);
  75. HRESULT STDMETHODCALLTYPE DoDeleteInstanceAsync(
  76. const BSTR i_ObjectPath,
  77. long i_lFlags,
  78. IWbemContext __RPC_FAR* i_pCtx,
  79. IWbemObjectSink __RPC_FAR* i_pHandler);
  80. HRESULT STDMETHODCALLTYPE DoExecMethodAsync(
  81. const BSTR i_strObjectPath,
  82. const BSTR i_strMethodName,
  83. long i_lFlags,
  84. IWbemContext* i_pCtx,
  85. IWbemClassObject* i_pInParams,
  86. IWbemObjectSink* i_pHandler);
  87. HRESULT STDMETHODCALLTYPE DoGetObjectAsync(
  88. const BSTR i_ObjectPath,
  89. long i_lFlags,
  90. IWbemContext __RPC_FAR* i_pCtx,
  91. IWbemObjectSink __RPC_FAR* i_pHandler);
  92. HRESULT STDMETHODCALLTYPE DoPutInstanceAsync(
  93. IWbemClassObject __RPC_FAR* i_pObj,
  94. long i_lFlags,
  95. IWbemContext __RPC_FAR* i_pCtx,
  96. IWbemObjectSink __RPC_FAR* i_pHandler);
  97. HRESULT STDMETHODCALLTYPE DoExecQueryAsync(
  98. const BSTR i_bstrQueryLanguage,
  99. const BSTR i_bstrQuery,
  100. long i_lFlags,
  101. IWbemContext __RPC_FAR* i_pCtx,
  102. IWbemObjectSink __RPC_FAR* i_pResponseHandler);
  103. private:
  104. IWbemClassObject* ConstructExtendedStatus(
  105. const CIIsProvException* i_pException) const;
  106. IWbemClassObject* ConstructExtendedStatus(
  107. HRESULT i_hr) const;
  108. void ValidatePutParsedObject(
  109. ParsedObjectPath* i_pParsedObject,
  110. IWbemClassObject* i_pObj,
  111. bool* io_pbInstanceNameSame,
  112. bool* io_pbInstanceExists,
  113. WMI_CLASS** o_ppWmiClass = NULL);
  114. //
  115. // Worker methods called by public methods
  116. //
  117. void WorkerGetObjectAsync(
  118. IWbemClassObject** o_ppObj,
  119. BSTR i_bstrObjPath,
  120. bool i_bCreateKeyIfNotExist);
  121. void WorkerGetObjectAsync(
  122. IWbemClassObject** o_ppObj,
  123. ParsedObjectPath* i_pParsedObjPath,
  124. bool i_bCreateKeyIfNotExist);
  125. void WorkerExecMethodAsync(
  126. BSTR i_strObjectPath,
  127. BSTR i_strMethodName,
  128. IWbemContext* i_pCtx,
  129. IWbemClassObject* i_pInParams,
  130. IWbemObjectSink* i_pHandler);
  131. void WorkerDeleteObjectAsync(
  132. ParsedObjectPath* i_pParsedObject);
  133. void WorkerPutObjectAsync(
  134. IWbemClassObject* i_pObj,
  135. IWbemClassObject* i_pObjOld, // can be NULL
  136. ParsedObjectPath* i_pParsedObject,
  137. long i_lFlags,
  138. bool i_bInstanceExists,
  139. BSTR* o_pbstrObjPath);
  140. void WorkerEnumObjectAsync(
  141. BSTR i_bstrClassName,
  142. IWbemObjectSink FAR* i_pHandler);
  143. //
  144. // These methods should only be called by WorkerExecMethodAsync
  145. //
  146. void WorkerExecFtpServiceMethod(
  147. LPCWSTR i_wszMbPath,
  148. WMI_CLASS* i_pClass,
  149. WMI_METHOD* i_pMethod,
  150. IWbemContext* i_pCtx,
  151. IWbemClassObject* i_pInParams,
  152. IWbemObjectSink* i_pHandler);
  153. void WorkerExecWebServiceMethod(
  154. LPCWSTR i_wszMbPath,
  155. WMI_CLASS* i_pClass,
  156. WMI_METHOD* i_pMethod,
  157. IWbemContext* i_pCtx,
  158. IWbemClassObject* i_pInParams,
  159. IWbemObjectSink* i_pHandler);
  160. static void WorkerExecWebAppMethod(
  161. LPCWSTR i_wszMbPath,
  162. LPCWSTR i_wszClassName,
  163. WMI_METHOD* i_pMethod,
  164. IWbemContext* i_pCtx,
  165. IWbemClassObject* i_pInParams,
  166. IWbemObjectSink* i_pHandler,
  167. CWbemServices* i_pNameSpace);
  168. static void WorkerExecComputerMethod(
  169. LPCWSTR i_wszMbPath,
  170. LPCWSTR i_wszClassName,
  171. WMI_METHOD* i_pMethod,
  172. IWbemContext* i_pCtx,
  173. IWbemClassObject* i_pInParams,
  174. IWbemObjectSink* i_pHandler,
  175. CWbemServices* i_pNameSpace);
  176. static void WorkerExecCertMapperMethod(
  177. LPCWSTR i_wszMbPath,
  178. LPCWSTR i_wszClassName,
  179. WMI_METHOD* i_pMethod,
  180. IWbemContext* i_pCtx,
  181. IWbemClassObject* i_pInParams,
  182. IWbemObjectSink* i_pHandler,
  183. CWbemServices* i_pNameSpace);
  184. static void WorkerExecAppPoolMethod(
  185. LPCWSTR i_wszMbPath,
  186. LPCWSTR i_wszClassName,
  187. WMI_METHOD* i_pMethod,
  188. IWbemContext* i_pCtx,
  189. IWbemClassObject* i_pInParams,
  190. IWbemObjectSink* i_pHandler,
  191. CWbemServices* i_pNameSpace);
  192. };
  193. // This class is the class factory for CInstPro objects.
  194. class CProvFactory : public IClassFactory
  195. {
  196. protected:
  197. ULONG m_cRef;
  198. public:
  199. CProvFactory(void);
  200. ~CProvFactory(void);
  201. //IUnknown members
  202. STDMETHODIMP QueryInterface(REFIID, PPVOID);
  203. STDMETHODIMP_(ULONG) AddRef(void);
  204. STDMETHODIMP_(ULONG) Release(void);
  205. //IClassFactory members
  206. STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, PPVOID);
  207. STDMETHODIMP LockServer(BOOL);
  208. };
  209. #endif