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.

443 lines
11 KiB

  1. //***************************************************************************
  2. //
  3. // (c) 1999 by Microsoft Corp. All Rights Reserved.
  4. //
  5. // REPOSIT.IDL
  6. //
  7. // raymcc 18-Mar-99 Created as prototype for Quasar.
  8. // raymcc 23-Mar-99 Misc. corrections; added IWmiDbIterator
  9. // cvadai 31-Mar-99 Added Cancel and timeout to IWmiDbIterator
  10. // cvadai 02-Apr-99 Modified IWmiDbBatchSession parameters.
  11. // cvadai 06-Apr-99 Changed Logon out parameter to IWmiDbSession.
  12. // raymcc 06-May-99 New handle type for duplication
  13. // cvadai 13-May-99 New flags for logon, security.
  14. // cvadai 29-Jul-99 Removed SetNamespacePath, added Logon param.
  15. //
  16. //***************************************************************************
  17. import "..\wmiutils.idl";
  18. [uuid(2af77340-dd7b-11d2-9217-00aa001f98b5)]
  19. library WmiRepository_v0
  20. {
  21. importlib("stdole32.tlb");
  22. interface IWmiDbSession;
  23. typedef BYTE *PNTSECURITY_DESCRIPTOR;
  24. typedef enum
  25. {
  26. WMIDB_HANDLE_TYPE_INVALID = 0,
  27. // Lock level
  28. WMIDB_HANDLE_TYPE_COOKIE = 0x1,
  29. WMIDB_HANDLE_TYPE_VERSIONED = 0x2,
  30. WMIDB_HANDLE_TYPE_PROTECTED = 0x3,
  31. WMIDB_HANDLE_TYPE_EXCLUSIVE = 0x4,
  32. // Cache levels
  33. WMIDB_HANDLE_TYPE_NO_CACHE = 0x100,
  34. WMIDB_HANDLE_TYPE_WEAK_CACHE = 0x200,
  35. WMIDB_HANDLE_TYPE_STRONG_CACHE = 0x300,
  36. // Special behavior
  37. WMIDB_HANDLE_TYPE_PERSISTENT = 0x1000,
  38. WMIDB_HANDLE_TYPE_AUTODELETE = 0x2000,
  39. // Open Context
  40. WMIDB_HANDLE_TYPE_SCOPE = 0x10000,
  41. WMIDB_HANDLE_TYPE_CONTAINER = 0x20000,
  42. WMIDB_HANDLE_TYPE_SUBSCOPED = 0x80000000
  43. } WMIDB_HANDLE_TYPE;
  44. typedef enum
  45. {
  46. // Batch operation flags
  47. WMIDB_FLAG_BEST_EFFORT = 0x1,
  48. WMIDB_FLAG_ATOMIC = 0x2,
  49. WMIDB_FLAG_LOOKAHEAD = 0x10
  50. } WMIDB_BATCH_FLAGS;
  51. typedef enum
  52. {
  53. // Statistics flags
  54. WMIDB_FLAG_TOTAL_HANDLES = 0x1,
  55. WMIDB_FLAG_CACHE_SATURATION = 0x2,
  56. WMIDB_FLAG_CACHE_HIT_RATE = 0x3
  57. } WMIDB_STATISTICS_FLAGS;
  58. typedef enum
  59. {
  60. // Logon flags
  61. WMIDB_FLAG_ADMIN_VERIFIED = 0x10,
  62. WMIDB_FLAG_NO_INIT = 0x20
  63. } WMIDB_LOGON_FLAGS;
  64. typedef enum
  65. {
  66. // Security flags
  67. WMIDB_FLAG_SECURITY_LOCAL_ONLY = 0x1,
  68. WMIDB_FLAG_SECURITY_PROPOGATED = 0x2
  69. } WMIDB_SECURITY_FLAGS;
  70. typedef enum
  71. {
  72. // Query flags
  73. WMIDB_FLAG_QUERY_SHALLOW = 0x0,
  74. WMIDB_FLAG_QUERY_DEEP = 0x1
  75. } WMIDB_QUERY_FLAGS;
  76. typedef enum
  77. {
  78. WMIDB_ENABLE_EVENTS = 0x0,
  79. WMIDB_DISABLE_EVENTS = 0x1000
  80. } WMIDB_EVENT_PUT_DELETE_FLAGS;
  81. typedef enum
  82. {
  83. // shutdown flags
  84. WMIDB_SHUTDOWN_NET_STOP = 0x0,
  85. WMIDB_SHUTDOWN_MACHINE_DOWN = 0x1
  86. } WMIDB_SHUTDOWN_FLAGS;
  87. //***************************************************************************
  88. //
  89. //***************************************************************************
  90. [uuid(89B9BAF8-6A06-11d3-A5FE-00105A0A3102)]
  91. coclass WmiRepository_SQL
  92. {
  93. interface IWmiDbController;
  94. };
  95. [uuid(89B9BAFC-6A06-11d3-A5FE-00105A0A3102)]
  96. coclass WmiRepository_Jet
  97. {
  98. interface IWmiDbController;
  99. };
  100. [object, uuid(0bc53e37-dd83-11d2-9217-00aa001f98b5)]
  101. interface IWmiDbHandle : IUnknown
  102. {
  103. HRESULT GetHandleType([out] DWORD *pdwType);
  104. };
  105. //***************************************************************************
  106. //
  107. // Logon template definitions
  108. //
  109. //***************************************************************************
  110. typedef struct
  111. {
  112. DWORD dwId;
  113. DWORD dwFlags;
  114. BSTR strParmDisplayName;
  115. VARIANT Value;
  116. } WMIDB_LOGON_PARAMETER;
  117. typedef struct
  118. {
  119. DWORD dwArraySize;
  120. [size_is(dwArraySize)] WMIDB_LOGON_PARAMETER *pParm;
  121. } WMIDB_LOGON_TEMPLATE;
  122. //***************************************************************************
  123. //
  124. //***************************************************************************
  125. [object, uuid(2af77343-dd7b-11d2-9217-00aa001f98b5)]
  126. interface IWmiDbController : IUnknown
  127. {
  128. HRESULT Logon(
  129. [in] WMIDB_LOGON_TEMPLATE *pLogonParms,
  130. [in] DWORD dwFlags,
  131. [in] DWORD dwRequestedHandleType,
  132. [out] IWmiDbSession **ppSession,
  133. [out] IWmiDbHandle **ppRootNamespace
  134. );
  135. HRESULT GetLogonTemplate(
  136. [in] LCID lLocale,
  137. [in] DWORD dwFlags,
  138. [out] WMIDB_LOGON_TEMPLATE **ppLogonTemplate
  139. );
  140. HRESULT FreeLogonTemplate(
  141. [in, out] WMIDB_LOGON_TEMPLATE **ppTemplate
  142. );
  143. HRESULT Shutdown(
  144. [in] DWORD dwFlags
  145. );
  146. HRESULT SetCallTimeout(
  147. [in] DWORD dwMaxTimeout
  148. );
  149. HRESULT SetCacheValue(
  150. [in] DWORD dwMaxBytes
  151. );
  152. HRESULT FlushCache(
  153. [in] DWORD dwFlags
  154. );
  155. HRESULT GetStatistics(
  156. [in] DWORD dwParameter,
  157. [out] DWORD *pdwValue
  158. );
  159. HRESULT Backup(
  160. [in] LPCWSTR szBackupFile,
  161. [in] long lFlags
  162. );
  163. HRESULT Restore(
  164. [in] LPCWSTR szBackupFile,
  165. [in] long lFlags
  166. );
  167. HRESULT LockRepository();
  168. HRESULT UnlockRepository();
  169. HRESULT GetRepositoryVersions(
  170. [out] DWORD *pdwOldVersion,
  171. [out] DWORD *pdwCurrentVersion
  172. );
  173. };
  174. //***************************************************************************
  175. //
  176. //***************************************************************************
  177. [object, uuid(2380c7e0-e14b-11d2-9220-00aa001f98b5)]
  178. interface IWmiDbIterator : IUnknown
  179. {
  180. HRESULT Cancel (
  181. [in] DWORD dwFlags,
  182. [in] void* pFiber);
  183. HRESULT NextBatch(
  184. [in] DWORD dwNumRequested,
  185. [in] DWORD dwTimeOutSeconds,
  186. [in] DWORD dwFlags,
  187. [in] DWORD dwRequestedHandleType,
  188. [in] REFIID riid,
  189. [in] void* pFiber,
  190. [out] DWORD *pdwNumReturned,
  191. [out, size_is(dwNumRequested), length_is(*pdwNumReturned), iid_is(riid)]
  192. LPVOID *ppObjects
  193. );
  194. };
  195. //***************************************************************************
  196. //
  197. //***************************************************************************
  198. [object, uuid(2af77345-dd7b-11d2-9217-00aa001f98b5)]
  199. interface IWmiDbSession : IUnknown
  200. {
  201. HRESULT GetObject(
  202. [in] IWmiDbHandle *pScope,
  203. [in] IWbemPath *pPath,
  204. [in] DWORD dwFlags,
  205. [in] DWORD dwRequestedHandleType,
  206. [out] IWmiDbHandle **ppResult
  207. );
  208. HRESULT GetObjectDirect(
  209. [in] IWmiDbHandle *pScope,
  210. [in] IWbemPath *pPath,
  211. [in] DWORD dwFlags,
  212. [in] REFIID riid,
  213. [out, iid_is(riid)] LPVOID *pObj
  214. );
  215. HRESULT PutObject(
  216. [in] IWmiDbHandle *pScope,
  217. [in] REFIID riid,
  218. [in, iid_is(riid)] LPVOID pObj,
  219. [in] DWORD dwFlags,
  220. [in] DWORD dwRequestedHandleType,
  221. [out] IWmiDbHandle **ppResult
  222. );
  223. HRESULT DeleteObject(
  224. [in] IWmiDbHandle *pScope,
  225. [in] DWORD dwFlags,
  226. [in] REFIID riid,
  227. [in, iid_is(riid)] LPVOID pObj
  228. );
  229. HRESULT ExecQuery(
  230. [in] IWmiDbHandle *pScope,
  231. [in] IWbemQuery *pQuery,
  232. [in] DWORD dwFlags,
  233. [in] DWORD dwRequestedHandleType,
  234. [out] DWORD *dwMessageFlags,
  235. [out] IWmiDbIterator **ppQueryResult
  236. );
  237. HRESULT RenameObject(
  238. [in] IWbemPath *pOldPath,
  239. [in] IWbemPath *pNewPath,
  240. [in] DWORD dwFlags,
  241. [in] DWORD dwRequestedHandleType,
  242. [out] IWmiDbHandle **ppResult
  243. );
  244. HRESULT Enumerate(
  245. [in] IWmiDbHandle *pScope,
  246. [in] DWORD dwFlags,
  247. [in] DWORD dwRequestedHandleType,
  248. [out] IWmiDbIterator **ppQueryResult
  249. );
  250. HRESULT AddObject(
  251. [in] IWmiDbHandle *pScope,
  252. [in] IWbemPath *pPath,
  253. [in] DWORD dwFlags,
  254. [in] DWORD dwRequestedHandleType,
  255. [out] IWmiDbHandle **ppResult
  256. );
  257. HRESULT RemoveObject (
  258. [in] IWmiDbHandle *pScope,
  259. [in] IWbemPath *pPath,
  260. [in] DWORD dwFlags
  261. );
  262. HRESULT SetDecoration(
  263. [in] LPWSTR lpMachineName,
  264. [in] LPWSTR lpNamespacePath
  265. );
  266. HRESULT SupportsQueries(
  267. [in] DWORD *dwQuerySupportLevel
  268. );
  269. };
  270. [object, uuid(4b3cca15-0e03-44cb-9b7a-822f9faf6ec0)]
  271. interface IWmiDbSessionEx : IWmiDbSession
  272. {
  273. HRESULT GetObjectByPath(
  274. [in] IWmiDbHandle *pScope,
  275. [in, string] LPCWSTR wszPath,
  276. [in] DWORD dwFlags,
  277. [in] REFIID riid,
  278. [out, iid_is(riid)] LPVOID *pObj
  279. );
  280. HRESULT DeleteObjectByPath(
  281. [in] IWmiDbHandle *pScope,
  282. [in, string] LPCWSTR wszPath,
  283. [in] DWORD dwFlags
  284. );
  285. HRESULT BeginWriteTransaction([in] DWORD dwFlags);
  286. HRESULT BeginReadTransaction([in] DWORD dwFlags);
  287. HRESULT CommitTransaction([in] DWORD dwFlags);
  288. HRESULT AbortTransaction([in] DWORD dwFlags);
  289. };
  290. // Dummy interface to work around MIDL not stripping all the interface
  291. // attributes for IWmiDbSession (MIDL 6.00.0328)
  292. [object, uuid(15e6e24f-7432-4da9-9bd4-c33db0df06c0)]
  293. interface I15e6e24f74324da99bd4c33db0df06c0 : IUnknown
  294. {
  295. HRESULT foo();
  296. };
  297. //***************************************************************************
  298. //
  299. //***************************************************************************
  300. typedef struct
  301. {
  302. HRESULT hRes;
  303. DWORD dwFlags;
  304. IWbemPath *pPath;
  305. IUnknown *pHandle;
  306. IWmiDbHandle *pReturnHandle;
  307. } WMI_BATCH_OBJECT_ACCESS;
  308. typedef struct
  309. {
  310. DWORD dwArraySize;
  311. [size_is(dwArraySize)] WMI_BATCH_OBJECT_ACCESS *pElements;
  312. } WMIOBJECT_BATCH;
  313. //***************************************************************************
  314. //
  315. //***************************************************************************
  316. [object, uuid(0bc53e39-dd83-11d2-9217-00aa001f98b5)]
  317. interface IWmiDbBatchSession : IUnknown
  318. {
  319. HRESULT GetObjects(
  320. [in] IWmiDbHandle *pScope,
  321. [in] DWORD dwFlags,
  322. [in] DWORD dwRequestedHandleType,
  323. [in, out] WMIOBJECT_BATCH *pBatch
  324. );
  325. HRESULT PutObjects(
  326. [in] IWmiDbHandle *pScope,
  327. [in] DWORD dwFlags,
  328. [in] DWORD dwRequestedHandleType,
  329. [in, out] WMIOBJECT_BATCH *pBatch
  330. );
  331. HRESULT DeleteObjects(
  332. [in] IWmiDbHandle *pScope,
  333. [in] DWORD dwFlags,
  334. [in] WMIOBJECT_BATCH *pBatch
  335. );
  336. };
  337. [object, uuid(843180D9-8489-42d7-BB07-3A5D91818E2E)]
  338. interface IWmiDbBackupRestore : IUnknown
  339. {
  340. HRESULT Backup (
  341. [in] LPCWSTR lpBackupPath,
  342. [in] DWORD dwFlags
  343. );
  344. HRESULT Restore (
  345. [in] LPCWSTR lpRestorePath,
  346. [in] LPCWSTR lpDestination,
  347. [in] DWORD dwFlags
  348. );
  349. };
  350. }; // End of lib