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.

349 lines
9.0 KiB

  1. cpp_quote("/*******************************************************************************/" )
  2. cpp_quote("/* */" )
  3. cpp_quote("/* Copyright � Microsoft Corporation. All rights reserved. */" )
  4. cpp_quote("/* */" )
  5. /* REPOSIT.IDL */
  6. /* */
  7. cpp_quote("/*******************************************************************************/" )
  8. import "..\wmiutils.idl";
  9. [uuid(2af77340-dd7b-11d2-9217-00aa001f98b5)]
  10. library WmiRepository_v0
  11. {
  12. importlib("stdole32.tlb");
  13. interface IWmiDbSession;
  14. typedef BYTE *PNTSECURITY_DESCRIPTOR;
  15. typedef enum
  16. {
  17. WMIDB_HANDLE_TYPE_INVALID = 0,
  18. // Lock level
  19. WMIDB_HANDLE_TYPE_COOKIE = 0x1,
  20. WMIDB_HANDLE_TYPE_VERSIONED = 0x2,
  21. WMIDB_HANDLE_TYPE_PROTECTED = 0x3,
  22. WMIDB_HANDLE_TYPE_EXCLUSIVE = 0x4,
  23. // Cache levels
  24. WMIDB_HANDLE_TYPE_NO_CACHE = 0x100,
  25. WMIDB_HANDLE_TYPE_WEAK_CACHE = 0x200,
  26. WMIDB_HANDLE_TYPE_STRONG_CACHE = 0x300,
  27. // Special behavior
  28. WMIDB_HANDLE_TYPE_PERSISTENT = 0x1000,
  29. WMIDB_HANDLE_TYPE_AUTODELETE = 0x2000,
  30. // Open Context
  31. WMIDB_HANDLE_TYPE_SCOPE = 0x10000,
  32. WMIDB_HANDLE_TYPE_CONTAINER = 0x20000,
  33. WMIDB_HANDLE_TYPE_SUBSCOPED = 0x80000000
  34. } WMIDB_HANDLE_TYPE;
  35. typedef enum
  36. {
  37. // Batch operation flags
  38. WMIDB_FLAG_BEST_EFFORT = 0x1,
  39. WMIDB_FLAG_ATOMIC = 0x2,
  40. WMIDB_FLAG_LOOKAHEAD = 0x10
  41. } WMIDB_BATCH_FLAGS;
  42. typedef enum
  43. {
  44. // Statistics flags
  45. WMIDB_FLAG_TOTAL_HANDLES = 0x1,
  46. WMIDB_FLAG_CACHE_SATURATION = 0x2,
  47. WMIDB_FLAG_CACHE_HIT_RATE = 0x3
  48. } WMIDB_STATISTICS_FLAGS;
  49. typedef enum
  50. {
  51. // Logon flags
  52. WMIDB_FLAG_ADMIN_VERIFIED = 0x10,
  53. WMIDB_FLAG_NO_INIT = 0x20
  54. } WMIDB_LOGON_FLAGS;
  55. typedef enum
  56. {
  57. // Security flags
  58. WMIDB_FLAG_SECURITY_LOCAL_ONLY = 0x1,
  59. WMIDB_FLAG_SECURITY_PROPOGATED = 0x2
  60. } WMIDB_SECURITY_FLAGS;
  61. typedef enum
  62. {
  63. // Query flags
  64. WMIDB_FLAG_QUERY_SHALLOW = 0x0,
  65. WMIDB_FLAG_QUERY_DEEP = 0x1
  66. } WMIDB_QUERY_FLAGS;
  67. typedef enum
  68. {
  69. WMIDB_ENABLE_EVENTS = 0x0,
  70. WMIDB_DISABLE_EVENTS = 0x1000
  71. } WMIDB_EVENT_PUT_DELETE_FLAGS;
  72. typedef enum
  73. {
  74. // shutdown flags
  75. WMIDB_SHUTDOWN_NET_STOP = 0x0,
  76. WMIDB_SHUTDOWN_MACHINE_DOWN = 0x1
  77. } WMIDB_SHUTDOWN_FLAGS;
  78. //***************************************************************************
  79. //
  80. //***************************************************************************
  81. [object, local, uuid(0bc53e37-dd83-11d2-9217-00aa001f98b5)]
  82. interface IWmiDbHandle : IUnknown
  83. {
  84. HRESULT GetHandleType([out] DWORD *pdwType);
  85. };
  86. //***************************************************************************
  87. //
  88. // Logon template definitions
  89. //
  90. //***************************************************************************
  91. typedef struct
  92. {
  93. DWORD dwId;
  94. DWORD dwFlags;
  95. BSTR strParmDisplayName;
  96. VARIANT Value;
  97. } WMIDB_LOGON_PARAMETER;
  98. typedef struct
  99. {
  100. DWORD dwArraySize;
  101. [size_is(dwArraySize)] WMIDB_LOGON_PARAMETER *pParm;
  102. } WMIDB_LOGON_TEMPLATE;
  103. //***************************************************************************
  104. //
  105. //***************************************************************************
  106. [object, local, uuid(2af77343-dd7b-11d2-9217-00aa001f98b5)]
  107. interface IWmiDbController : IUnknown
  108. {
  109. HRESULT Logon(
  110. [in] WMIDB_LOGON_TEMPLATE *pLogonParms,
  111. [in] DWORD dwFlags,
  112. [in] DWORD dwRequestedHandleType,
  113. [out] IWmiDbSession **ppSession,
  114. [out] IWmiDbHandle **ppRootNamespace
  115. );
  116. HRESULT GetLogonTemplate(
  117. [in] LCID lLocale,
  118. [in] DWORD dwFlags,
  119. [out] WMIDB_LOGON_TEMPLATE **ppLogonTemplate
  120. );
  121. HRESULT FreeLogonTemplate(
  122. [in, out] WMIDB_LOGON_TEMPLATE **ppTemplate
  123. );
  124. HRESULT Shutdown(
  125. [in] DWORD dwFlags
  126. );
  127. HRESULT SetCallTimeout(
  128. [in] DWORD dwMaxTimeout
  129. );
  130. HRESULT SetCacheValue(
  131. [in] DWORD dwMaxBytes
  132. );
  133. HRESULT FlushCache(
  134. [in] DWORD dwFlags
  135. );
  136. HRESULT GetStatistics(
  137. [in] DWORD dwParameter,
  138. [out] DWORD *pdwValue
  139. );
  140. HRESULT Backup(
  141. [in] LPCWSTR szBackupFile,
  142. [in] long lFlags
  143. );
  144. HRESULT Restore(
  145. [in] LPCWSTR szBackupFile,
  146. [in] long lFlags
  147. );
  148. HRESULT LockRepository();
  149. HRESULT UnlockRepository();
  150. HRESULT GetRepositoryVersions(
  151. [out] DWORD *pdwOldVersion,
  152. [out] DWORD *pdwCurrentVersion
  153. );
  154. };
  155. //***************************************************************************
  156. //
  157. //***************************************************************************
  158. [object, local, uuid(2380c7e0-e14b-11d2-9220-00aa001f98b5)]
  159. interface IWmiDbIterator : IUnknown
  160. {
  161. HRESULT Cancel (
  162. [in] DWORD dwFlags,
  163. [in] void* pFiber);
  164. HRESULT NextBatch(
  165. [in] DWORD dwNumRequested,
  166. [in] DWORD dwTimeOutSeconds,
  167. [in] DWORD dwFlags,
  168. [in] DWORD dwRequestedHandleType,
  169. [in] REFIID riid,
  170. [in] void* pFiber,
  171. [out] DWORD *pdwNumReturned,
  172. [out, size_is(dwNumRequested), length_is(*pdwNumReturned), iid_is(riid)]
  173. LPVOID *ppObjects
  174. );
  175. };
  176. //***************************************************************************
  177. //
  178. //***************************************************************************
  179. [object, local, uuid(2af77345-dd7b-11d2-9217-00aa001f98b5)]
  180. interface IWmiDbSession : IUnknown
  181. {
  182. HRESULT GetObject(
  183. [in] IWmiDbHandle *pScope,
  184. [in] IWbemPath *pPath,
  185. [in] DWORD dwFlags,
  186. [in] DWORD dwRequestedHandleType,
  187. [out] IWmiDbHandle **ppResult
  188. );
  189. HRESULT GetObjectDirect(
  190. [in] IWmiDbHandle *pScope,
  191. [in] IWbemPath *pPath,
  192. [in] DWORD dwFlags,
  193. [in] REFIID riid,
  194. [out, iid_is(riid)] LPVOID *pObj
  195. );
  196. HRESULT PutObject(
  197. [in] IWmiDbHandle *pScope,
  198. [in] REFIID riid,
  199. [in, iid_is(riid)] LPVOID pObj,
  200. [in] DWORD dwFlags,
  201. [in] DWORD dwRequestedHandleType,
  202. [out] IWmiDbHandle **ppResult
  203. );
  204. HRESULT DeleteObject(
  205. [in] IWmiDbHandle *pScope,
  206. [in] DWORD dwFlags,
  207. [in] REFIID riid,
  208. [in, iid_is(riid)] LPVOID pObj
  209. );
  210. HRESULT ExecQuery(
  211. [in] IWmiDbHandle *pScope,
  212. [in] IWbemQuery *pQuery,
  213. [in] DWORD dwFlags,
  214. [in] DWORD dwRequestedHandleType,
  215. [out] DWORD *dwMessageFlags,
  216. [out] IWmiDbIterator **ppQueryResult
  217. );
  218. HRESULT RenameObject(
  219. [in] IWbemPath *pOldPath,
  220. [in] IWbemPath *pNewPath,
  221. [in] DWORD dwFlags,
  222. [in] DWORD dwRequestedHandleType,
  223. [out] IWmiDbHandle **ppResult
  224. );
  225. HRESULT Enumerate(
  226. [in] IWmiDbHandle *pScope,
  227. [in] DWORD dwFlags,
  228. [in] DWORD dwRequestedHandleType,
  229. [out] IWmiDbIterator **ppQueryResult
  230. );
  231. HRESULT AddObject(
  232. [in] IWmiDbHandle *pScope,
  233. [in] IWbemPath *pPath,
  234. [in] DWORD dwFlags,
  235. [in] DWORD dwRequestedHandleType,
  236. [out] IWmiDbHandle **ppResult
  237. );
  238. HRESULT RemoveObject (
  239. [in] IWmiDbHandle *pScope,
  240. [in] IWbemPath *pPath,
  241. [in] DWORD dwFlags
  242. );
  243. HRESULT SetDecoration(
  244. [in] LPWSTR lpMachineName,
  245. [in] LPWSTR lpNamespacePath
  246. );
  247. HRESULT SupportsQueries(
  248. [in] DWORD *dwQuerySupportLevel
  249. );
  250. };
  251. [object, local, uuid(4b3cca15-0e03-44cb-9b7a-822f9faf6ec0)]
  252. interface IWmiDbSessionEx : IWmiDbSession
  253. {
  254. HRESULT GetObjectByPath(
  255. [in] IWmiDbHandle *pScope,
  256. [in, string] LPCWSTR wszPath,
  257. [in] DWORD dwFlags,
  258. [in] REFIID riid,
  259. [out, iid_is(riid)] LPVOID *pObj
  260. );
  261. HRESULT DeleteObjectByPath(
  262. [in] IWmiDbHandle *pScope,
  263. [in, string] LPCWSTR wszPath,
  264. [in] DWORD dwFlags
  265. );
  266. HRESULT BeginWriteTransaction([in] DWORD dwFlags);
  267. HRESULT BeginReadTransaction([in] DWORD dwFlags);
  268. HRESULT CommitTransaction([in] DWORD dwFlags);
  269. HRESULT AbortTransaction([in] DWORD dwFlags);
  270. };
  271. }; // End of lib