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.

482 lines
11 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1996 - 1999
  5. //
  6. // File: certdb.idl
  7. //
  8. // Contents: IDL source for certdb.dll
  9. //
  10. //---------------------------------------------------------------------------
  11. import "wtypes.idl";
  12. import "certbase.idl";
  13. import "certbcli.idl";
  14. interface ICertDB;
  15. interface ICertDBRow;
  16. typedef struct _CERTTRANSDBATTRIBUTE // Marshalled form
  17. {
  18. ULONG obwszName;
  19. ULONG obwszValue;
  20. } CERTTRANSDBATTRIBUTE;
  21. typedef struct _CERTDBATTRIBUTE // Native form
  22. {
  23. WCHAR *pwszName;
  24. WCHAR *pwszValue;
  25. } CERTDBATTRIBUTE;
  26. typedef struct _CERTTRANSDBEXTENSION // Marshalled form
  27. {
  28. ULONG obwszName;
  29. LONG ExtFlags;
  30. DWORD cbValue;
  31. ULONG obValue;
  32. } CERTTRANSDBEXTENSION;
  33. typedef struct _CERTDBEXTENSION // Native form
  34. {
  35. WCHAR *pwszName;
  36. LONG ExtFlags;
  37. DWORD cbValue;
  38. BYTE *pbValue;
  39. } CERTDBEXTENSION;
  40. const LONG CDBENUM_ATTRIBUTES = 0x00000000;
  41. const LONG CDBENUM_EXTENSIONS = 0x00000001;
  42. //+--------------------------------------------------------------------------
  43. // IEnumCERTDBCOLUMN class -- local COM interface
  44. //+--------------------------------------------------------------------------
  45. // IEnumCERTDBCOLUMN:Next return type
  46. typedef struct _CERTTRANSDBCOLUMN // Marshalled form
  47. {
  48. DWORD Type;
  49. DWORD Index;
  50. DWORD cbMax;
  51. ULONG obwszName;
  52. ULONG obwszDisplayName;
  53. } CERTTRANSDBCOLUMN;
  54. typedef struct _CERTDBCOLUMN // Native form
  55. {
  56. DWORD Type;
  57. DWORD Index;
  58. DWORD cbMax;
  59. WCHAR *pwszName;
  60. WCHAR *pwszDisplayName;
  61. } CERTDBCOLUMN;
  62. [
  63. object,
  64. uuid(90a27030-8bd5-11d3-b32e-00c04f79dc72),
  65. local,
  66. helpstring("IEnumCERTDBCOLUMN Interface"),
  67. pointer_default(unique)
  68. ]
  69. interface IEnumCERTDBCOLUMN: IUnknown
  70. {
  71. import "oaidl.idl";
  72. HRESULT Next(
  73. [in] ULONG celt,
  74. [out] CERTDBCOLUMN *rgelt,
  75. [out] ULONG *pceltFetched);
  76. HRESULT Skip(
  77. [in] LONG celt,
  78. [out] LONG *pielt);
  79. HRESULT Reset(void);
  80. HRESULT Clone(
  81. [out] IEnumCERTDBCOLUMN **ppenum);
  82. };
  83. //+--------------------------------------------------------------------------
  84. // ICertDBComputedColumn class -- local COM interface
  85. //+--------------------------------------------------------------------------
  86. [
  87. object,
  88. uuid(5ed15981-4055-43a5-b853-58c2cd3ec101),
  89. local,
  90. helpstring("ICertDBComputedColumn Interface"),
  91. pointer_default(unique)
  92. ]
  93. interface ICertDBComputedColumn: IUnknown
  94. {
  95. import "oaidl.idl";
  96. HRESULT GetAlternateColumnId(
  97. [in] DWORD ComputedColumnId,
  98. [out] DWORD *pAlternateColumnId,
  99. [out] DWORD *pPropType);
  100. HRESULT ComputeColumnValue(
  101. [in] DWORD ComputedColumnId,
  102. [in] DWORD AlternateColumnId,
  103. [in] DWORD PropType,
  104. [in] DWORD cbProp,
  105. [in] BYTE const *pbProp,
  106. [out] DWORD *pdwValue);
  107. };
  108. //+--------------------------------------------------------------------------
  109. // IEnumCERTDBRESULTROW class -- local COM interface
  110. //+--------------------------------------------------------------------------
  111. // IEnumCERTDBRESULTROW:Next return type
  112. typedef struct _CERTTRANSDBRESULTCOLUMN // Marshalled form
  113. {
  114. DWORD Type;
  115. DWORD Index;
  116. ULONG obValue;
  117. DWORD cbValue;
  118. } CERTTRANSDBRESULTCOLUMN;
  119. typedef struct _CERTDBRESULTCOLUMN // Native form
  120. {
  121. DWORD Type;
  122. DWORD Index;
  123. BYTE *pbValue;
  124. DWORD cbValue;
  125. } CERTDBRESULTCOLUMN;
  126. typedef struct _CERTTRANSDBRESULTROW // Marshalled form
  127. {
  128. DWORD rowid;
  129. DWORD ccol;
  130. ULONG cbrow;
  131. } CERTTRANSDBRESULTROW;
  132. typedef struct _CERTDBRESULTROW // Native form
  133. {
  134. DWORD rowid;
  135. DWORD ccol;
  136. CERTDBRESULTCOLUMN *acol;
  137. } CERTDBRESULTROW;
  138. [
  139. object,
  140. uuid(915feb70-8bd5-11d3-b32e-00c04f79dc72),
  141. local,
  142. helpstring("IEnumCERTDBRESULTROW Interface"),
  143. pointer_default(unique)
  144. ]
  145. interface IEnumCERTDBRESULTROW: IUnknown
  146. {
  147. import "oaidl.idl";
  148. HRESULT Next(
  149. [in] ICertDBComputedColumn *pIComputedColumn,
  150. [in] ULONG celt,
  151. [out] CERTDBRESULTROW *rgelt,
  152. [out] ULONG *pceltFetched);
  153. HRESULT ReleaseResultRow(
  154. [in] ULONG celt,
  155. [in, out] CERTDBRESULTROW *rgelt);
  156. HRESULT Skip(
  157. [in] LONG celt,
  158. [out] LONG *pielt);
  159. HRESULT Reset(void);
  160. HRESULT Clone(
  161. [out] IEnumCERTDBRESULTROW **ppenum);
  162. };
  163. //+--------------------------------------------------------------------------
  164. // IEnumCERTDBNAME class -- local COM interface
  165. //+--------------------------------------------------------------------------
  166. // IEnumCERTDBName:Next return type
  167. typedef struct _CERTDBNAME
  168. {
  169. WCHAR *pwszName;
  170. } CERTDBNAME;
  171. [
  172. object,
  173. uuid(91dbb1a0-8bd5-11d3-b32e-00c04f79dc72),
  174. local,
  175. helpstring("IEnumCERTDBNAME Interface"),
  176. pointer_default(unique)
  177. ]
  178. interface IEnumCERTDBNAME: IUnknown
  179. {
  180. import "oaidl.idl";
  181. HRESULT Next(
  182. [in] ULONG celt,
  183. [out] CERTDBNAME *rgelt,
  184. [out] ULONG *pceltFetched);
  185. HRESULT Skip(
  186. [in] LONG celt,
  187. [out] LONG *pielt);
  188. HRESULT Reset(void);
  189. HRESULT Clone(
  190. [out] IEnumCERTDBNAME **ppenum);
  191. };
  192. //+--------------------------------------------------------------------------
  193. // ICertDBRow class -- local COM interface
  194. //+--------------------------------------------------------------------------
  195. const LONG CDBROW_COMMIT_ROLLBACK = 0x00000000;
  196. const LONG CDBROW_COMMIT_COMMIT = 0x00000001;
  197. const LONG CDBROW_COMMIT_SOFTCOMMIT= 0x00000002;
  198. [
  199. object,
  200. uuid(924b3e50-8bd5-11d3-b32e-00c04f79dc72),
  201. local,
  202. helpstring("ICertDBRow Interface"),
  203. pointer_default(unique)
  204. ]
  205. interface ICertDBRow: IUnknown
  206. {
  207. import "oaidl.idl";
  208. HRESULT BeginTransaction();
  209. HRESULT CommitTransaction(
  210. [in] DWORD dwCommitFlags);
  211. HRESULT GetRowId(
  212. [out] DWORD *pRowId);
  213. HRESULT Delete();
  214. HRESULT SetProperty(
  215. [in] WCHAR const *pwszPropName,
  216. [in] DWORD dwFlags,
  217. [in] DWORD cbProp,
  218. [in] BYTE const *pbProp); // OPTIONAL
  219. HRESULT GetProperty(
  220. [in] WCHAR const *pwszPropName,
  221. [in] DWORD dwFlags,
  222. [in] ICertDBComputedColumn *pIComputedColumn,
  223. [in, out] DWORD *pcbProp,
  224. [out] BYTE *pbProp); // OPTIONAL
  225. HRESULT SetExtension(
  226. [in] WCHAR const *pwszExtensionName,
  227. [in] DWORD dwExtFlags,
  228. [in] DWORD cbValue,
  229. [in] BYTE const *pbValue); // OPTIONAL
  230. HRESULT GetExtension(
  231. [in] WCHAR const *pwszExtensionName,
  232. [out] DWORD *pdwExtFlags,
  233. [in, out] DWORD *pcbValue,
  234. [out] BYTE *pbValue); // OPTIONAL
  235. HRESULT CopyRequestNames();
  236. HRESULT EnumCertDBName(
  237. [in] DWORD dwFlags,
  238. [out] IEnumCERTDBNAME **ppenum);
  239. };
  240. //+--------------------------------------------------------------------------
  241. // ICertDBBackup class -- local COM interface
  242. //+--------------------------------------------------------------------------
  243. [
  244. object,
  245. uuid(92a56660-8bd5-11d3-b32e-00c04f79dc72),
  246. local,
  247. helpstring("ICertDBBackup Interface"),
  248. pointer_default(unique)
  249. ]
  250. interface ICertDBBackup: IUnknown
  251. {
  252. import "oaidl.idl";
  253. HRESULT GetDBFileList(
  254. [in, out] DWORD *pcwcList,
  255. [out] WCHAR *pwszzList); // OPTIONAL
  256. HRESULT GetLogFileList(
  257. [in, out] DWORD *pcwcList,
  258. [out] WCHAR *pwszzList); // OPTIONAL
  259. HRESULT OpenFile(
  260. [in] WCHAR const *pwszFile,
  261. [out] ULARGE_INTEGER *pliSize); // OPTIONAL
  262. HRESULT ReadFile(
  263. [in, out] DWORD *pcb,
  264. [out] BYTE *pb);
  265. HRESULT CloseFile();
  266. HRESULT TruncateLog();
  267. }
  268. //+--------------------------------------------------------------------------
  269. // ICertDBRestore class -- local COM interface
  270. //+--------------------------------------------------------------------------
  271. [
  272. object,
  273. uuid(93042400-8bd5-11d3-b32e-00c04f79dc72),
  274. local,
  275. helpstring("ICertDBRestore Interface"),
  276. pointer_default(unique)
  277. ]
  278. interface ICertDBRestore: IUnknown
  279. {
  280. import "oaidl.idl";
  281. HRESULT RecoverAfterRestore(
  282. [in] DWORD cSession,
  283. [in] DWORD DBFlags,
  284. [in] WCHAR const *pwszEventSource,
  285. [in] WCHAR const *pwszLogDir,
  286. [in] WCHAR const *pwszSystemDir,
  287. [in] WCHAR const *pwszTempDir,
  288. [in] WCHAR const *pwszCheckPointFile,
  289. [in] WCHAR const *pwszLogPath,
  290. [in] CSEDB_RSTMAPW rgrstmap[],
  291. [in] LONG crstmap,
  292. [in] WCHAR const *pwszBackupLogPath,
  293. [in] DWORD genLow,
  294. [in] DWORD genHigh);
  295. }
  296. //+--------------------------------------------------------------------------
  297. // ICertDB class -- local COM interface
  298. //+--------------------------------------------------------------------------
  299. // ICertDB::OpenView dwFlags:
  300. const LONG CDBOPENVIEW_WORKERTHREAD = 1;
  301. // ICertDB::ShutDown dwFlags:
  302. const LONG CDBSHUTDOWN_PENDING = 1;
  303. [
  304. object,
  305. uuid(93582f50-8bd5-11d3-b32e-00c04f79dc72),
  306. local,
  307. helpstring("ICertDB Interface"),
  308. pointer_default(unique)
  309. ]
  310. interface ICertDB: IUnknown
  311. {
  312. import "oaidl.idl";
  313. HRESULT Open(
  314. [in] DWORD dwFlags, // DBFLAGS_*
  315. [in] DWORD cSession,
  316. [in] WCHAR const *pwszEventSource,
  317. [in] WCHAR const *pwszDBFile,
  318. [in] WCHAR const *pwszLogDir,
  319. [in] WCHAR const *pwszSystemDir,
  320. [in] WCHAR const *pwszTempDir);
  321. HRESULT ShutDown(
  322. [in] DWORD dwFlags);
  323. HRESULT OpenRow(
  324. [in] DWORD dwFlags,
  325. [in] DWORD RowId,
  326. [in] WCHAR const *pwszSerialNumberOrCertHash, // OPTIONAL
  327. [out] ICertDBRow **pprow);
  328. HRESULT OpenView(
  329. [in] DWORD ccvr,
  330. [in] CERTVIEWRESTRICTION const *acvr,
  331. [in] DWORD ccolOut,
  332. [in] DWORD const *acolOut,
  333. [in] DWORD const dwFlags,
  334. [out] IEnumCERTDBRESULTROW **ppenum);
  335. HRESULT EnumCertDBColumn(
  336. [in] DWORD dwTable,
  337. [out] IEnumCERTDBCOLUMN **ppenum);
  338. HRESULT OpenBackup(
  339. [in] LONG grbitJet,
  340. [out] ICertDBBackup **ppBackup);
  341. HRESULT GetDefaultColumnSet(
  342. [in] DWORD iColumnSetDefault,
  343. [in] DWORD cColumnIds,
  344. [out] DWORD *pcColumnIds,
  345. [out, ref] DWORD *pColumnIds);
  346. };
  347. //+--------------------------------------------------------------------------
  348. // certdb Type library
  349. //+--------------------------------------------------------------------------
  350. [
  351. uuid(93adc1d0-8bd5-11d3-b32e-00c04f79dc72),
  352. version(2.0),
  353. helpstring("CertDB 2.0 Type Library")
  354. ]
  355. library CERTDBLib
  356. {
  357. importlib("stdole2.tlb");
  358. [
  359. uuid(94142360-8bd5-11d3-b32e-00c04f79dc72),
  360. helpstring("CertDBRestore Class")
  361. ]
  362. coclass CCertDBRestore
  363. {
  364. [default] interface ICertDBRestore;
  365. };
  366. [
  367. uuid(946e4b70-8bd5-11d3-b32e-00c04f79dc72),
  368. helpstring("CertDB Class")
  369. ]
  370. coclass CCertDB
  371. {
  372. [default] interface ICertDB;
  373. };
  374. };