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.

352 lines
8.1 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2002-2004 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // VdsClasses.h
  7. //
  8. // Implementation File:
  9. // VdsClasses.cpp
  10. //
  11. // Description:
  12. // Definition of the VDS WMI Provider classes.
  13. //
  14. // Author: Jim Benton (jbenton) 15-Jan-2002
  15. //
  16. // Notes:
  17. //
  18. //////////////////////////////////////////////////////////////////////////////
  19. #pragma once
  20. //////////////////////////////////////////////////////////////////////////////
  21. // Include Files
  22. //////////////////////////////////////////////////////////////////////////////
  23. #include "ProvBase.h"
  24. extern CRITICAL_SECTION g_csThreadData;
  25. //////////////////////////////////////////////////////////////////////////////
  26. //++
  27. //
  28. // class CVolume
  29. //
  30. // Description:
  31. // Provider Implementation for Volume
  32. //
  33. //--
  34. //////////////////////////////////////////////////////////////////////////////
  35. class CVolume : public CProvBase
  36. {
  37. //
  38. // constructor
  39. //
  40. public:
  41. CVolume(
  42. LPCWSTR pwszNameIn,
  43. CWbemServices * pNamespaceIn
  44. );
  45. ~CVolume()
  46. { }
  47. //
  48. // methods
  49. //
  50. public:
  51. virtual HRESULT EnumInstance(
  52. long lFlagsIn,
  53. IWbemContext* pCtxIn,
  54. IWbemObjectSink* pHandlerIn
  55. );
  56. virtual HRESULT GetObject(
  57. CObjPath& rObjPathIn,
  58. long lFlagsIn,
  59. IWbemContext* pCtxIn,
  60. IWbemObjectSink* pHandlerIn
  61. );
  62. virtual HRESULT ExecuteMethod(
  63. BSTR bstrObjPathIn,
  64. WCHAR* pwszMethodNameIn,
  65. long lFlagIn,
  66. IWbemClassObject* pParamsIn,
  67. IWbemObjectSink* pHandlerIn
  68. );
  69. virtual HRESULT PutInstance(
  70. CWbemClassObject& rInstToPutIn,
  71. long lFlagIn,
  72. IWbemContext* pCtxIn,
  73. IWbemObjectSink* pHandlerIn
  74. );
  75. virtual HRESULT DeleteInstance(
  76. CObjPath& rObjPathIn,
  77. long lFlagIn,
  78. IWbemContext* pCtxIn,
  79. IWbemObjectSink* pHandlerIn
  80. ) { return WBEM_E_NOT_SUPPORTED; };
  81. static CProvBase * S_CreateThis(
  82. LPCWSTR pwszNameIn,
  83. CWbemServices* pNamespaceIn
  84. );
  85. HRESULT Initialize();
  86. private:
  87. void LoadInstance(
  88. IN WCHAR* pwszVolume,
  89. IN OUT IWbemClassObject* pObject);
  90. BOOL IsValid(
  91. IN WCHAR* pwszVolume);
  92. BOOL IsDirty(
  93. IN WCHAR* pwszVolume);
  94. BOOL IsMountable(
  95. IN WCHAR* pwszVolume);
  96. BOOL HasMountPoints(
  97. IN WCHAR* pwszVolume);
  98. HRESULT
  99. ExecAddMountPoint(
  100. IN BSTR bstrObjPath,
  101. IN WCHAR* pwszMethodName,
  102. IN long lFlag,
  103. IN IWbemClassObject* pParams,
  104. IN IWbemObjectSink* pHandler);
  105. HRESULT
  106. ExecMount(
  107. IN BSTR bstrObjPath,
  108. IN WCHAR* pwszMethodName,
  109. IN long lFlag,
  110. IN IWbemClassObject* pParams,
  111. IN IWbemObjectSink* pHandler);
  112. HRESULT
  113. ExecDismount(
  114. IN BSTR bstrObjPath,
  115. IN WCHAR* pwszMethodName,
  116. IN long lFlag,
  117. IN IWbemClassObject* pParams,
  118. IN IWbemObjectSink* pHandler);
  119. HRESULT
  120. ExecDefrag(
  121. IN BSTR bstrObjPath,
  122. IN WCHAR* pwszMethodName,
  123. IN long lFlag,
  124. IN IWbemClassObject* pParams,
  125. IN IWbemObjectSink* pHandler);
  126. HRESULT
  127. ExecDefragAnalysis(
  128. IN BSTR bstrObjPath,
  129. IN WCHAR* pwszMethodName,
  130. IN long lFlag,
  131. IN IWbemClassObject* pParams,
  132. IN IWbemObjectSink* pHandler);
  133. HRESULT
  134. ExecChkdsk(
  135. IN BSTR bstrObjPath,
  136. IN WCHAR* pwszMethodName,
  137. IN long lFlag,
  138. IN IWbemClassObject* pParams,
  139. IN IWbemObjectSink* pHandler);
  140. HRESULT
  141. ExecScheduleAutoChk(
  142. IN BSTR bstrObjPath,
  143. IN WCHAR* pwszMethodName,
  144. IN long lFlag,
  145. IN IWbemClassObject* pParams,
  146. IN IWbemObjectSink* pHandler);
  147. HRESULT
  148. ExecExcludeAutoChk(
  149. IN BSTR bstrObjPath,
  150. IN WCHAR* pwszMethodName,
  151. IN long lFlag,
  152. IN IWbemClassObject* pParams,
  153. IN IWbemObjectSink* pHandler);
  154. HRESULT
  155. ExecFormat(
  156. IN BSTR bstrObjPath,
  157. IN WCHAR* pwszMethodName,
  158. IN long lFlag,
  159. IN IWbemClassObject* pParams,
  160. IN IWbemObjectSink* pHandler);
  161. DWORD AddMountPoint(
  162. IN WCHAR* pwszVolume,
  163. IN WCHAR* pwszDirectory);
  164. DWORD Mount(
  165. IN WCHAR* pwszVolume);
  166. DWORD Dismount(
  167. IN WCHAR* pwszVolume,
  168. IN BOOL fForce,
  169. IN BOOL fPermanent);
  170. DWORD
  171. Defrag(
  172. IN WCHAR* pwszVolume,
  173. OUT BOOL fForce,
  174. IN IWbemObjectSink* pHandler,
  175. IN OUT IWbemClassObject* pObject);
  176. DWORD
  177. DefragAnalysis(
  178. IN WCHAR* pwszVolume,
  179. OUT BOOL* pfDefragRecommended,
  180. IN OUT IWbemClassObject* pObject);
  181. DWORD
  182. Chkdsk(
  183. IN WCHAR* pwszVolume,
  184. IN BOOL fFixErrors,
  185. IN BOOL fVigorousIndexCheck,
  186. IN BOOL fSkipFolderCycle,
  187. IN BOOL fForceDismount,
  188. IN BOOL fRecoverBadSectors,
  189. IN BOOL fOkToRunAtBootup
  190. );
  191. DWORD
  192. AutoChk(
  193. IN const WCHAR* pwszAutoChkCommand,
  194. IN WCHAR* pwmszVolumes
  195. );
  196. DWORD
  197. Format(
  198. IN WCHAR* pwszVolume,
  199. IN BOOL fQuickFormat,
  200. IN BOOL fEnableCompression,
  201. IN WCHAR* pwszFileSystem,
  202. IN DWORD cbAllocationSize,
  203. IN WCHAR* pwszLabel,
  204. IN IWbemObjectSink* pHandler
  205. );
  206. void
  207. SetDriveLetter(
  208. IN WCHAR* pwszVolume,
  209. IN WCHAR* pwszDrive
  210. );
  211. void
  212. SetLabel(
  213. IN WCHAR* pwszVolume,
  214. IN WCHAR* pwszLabel
  215. );
  216. void
  217. SetContentIndexing(
  218. IN WCHAR* pwszVolume,
  219. IN BOOL fIndexingEnabled
  220. );
  221. void
  222. SetQuotasEnabled(
  223. IN WCHAR* pwszVolume,
  224. IN BOOL fQuotasEnabled
  225. );
  226. }; // class CVolume
  227. //////////////////////////////////////////////////////////////////////////////
  228. //++
  229. //
  230. // class CMountPoint
  231. //
  232. // Description:
  233. // Provider Implementation for Volume
  234. //
  235. //--
  236. //////////////////////////////////////////////////////////////////////////////
  237. class CMountPoint : public CProvBase
  238. {
  239. //
  240. // constructor
  241. //
  242. public:
  243. CMountPoint(
  244. LPCWSTR pwszNameIn,
  245. CWbemServices * pNamespaceIn
  246. );
  247. ~CMountPoint(){ }
  248. //
  249. // methods
  250. //
  251. public:
  252. virtual HRESULT EnumInstance(
  253. long lFlagsIn,
  254. IWbemContext* pCtxIn,
  255. IWbemObjectSink* pHandlerIn
  256. );
  257. virtual HRESULT GetObject(
  258. CObjPath& rObjPathIn,
  259. long lFlagsIn,
  260. IWbemContext* pCtxIn,
  261. IWbemObjectSink* pHandlerIn
  262. );
  263. virtual HRESULT ExecuteMethod(
  264. BSTR bstrObjPathIn,
  265. WCHAR* pwszMethodNameIn,
  266. long lFlagIn,
  267. IWbemClassObject* pParamsIn,
  268. IWbemObjectSink* pHandlerIn
  269. ) { return WBEM_E_NOT_SUPPORTED; };
  270. virtual HRESULT PutInstance(
  271. CWbemClassObject& rInstToPutIn,
  272. long lFlagIn,
  273. IWbemContext* pCtxIn,
  274. IWbemObjectSink* pHandlerIn
  275. );
  276. virtual HRESULT DeleteInstance(
  277. CObjPath& rObjPathIn,
  278. long lFlagIn,
  279. IWbemContext* pCtxIn,
  280. IWbemObjectSink* pHandlerIn
  281. );
  282. static CProvBase * S_CreateThis(
  283. LPCWSTR pwszNameIn,
  284. CWbemServices* pNamespaceIn
  285. );
  286. HRESULT Initialize();
  287. private:
  288. void LoadInstance(
  289. IN WCHAR* pwszVolume,
  290. IN WCHAR* pwszDirectory,
  291. IN OUT IWbemClassObject* pObject);
  292. }; // class CMountPoint