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.

343 lines
12 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1999
  6. //
  7. // File: wintrold.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #ifndef WINTROLD_H
  11. #define WINTROLD_H
  12. /************************************************************************
  13. * *
  14. * wintrust.h -- This module defines the 32-Bit WinTrust definitions *
  15. * needed to build Trust Providers and / Subject *
  16. * Interface Packages. *
  17. * *
  18. * Copyright (c) 1990-1996, Microsoft Corp. All rights reserved. *
  19. * *
  20. ************************************************************************/
  21. #ifndef _WINTRUST_
  22. #define _WINTRUST_
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. /***********************************************************************
  27. * *
  28. * This section contains definitions related to: *
  29. * *
  30. * WinTrust in general *
  31. * *
  32. ************************************************************************/
  33. //
  34. // WinTrust Revisioning
  35. //
  36. #define WIN_TRUST_MAJOR_REVISION_MASK 0xFFFF0000
  37. #define WIN_TRUST_MINOR_REVISION_MASK 0x0000FFFF
  38. #define WIN_TRUST_REVISION_1_0 0x00010000
  39. /***********************************************************************
  40. * *
  41. * This section contains definitions related to: *
  42. * *
  43. * Subject Interface Packages *
  44. * *
  45. ************************************************************************/
  46. //
  47. // Allows passing of subject and type material.
  48. //
  49. typedef struct _WIN_TRUST_SIP_SUBJECT {
  50. GUID * SubjectType;
  51. WIN_TRUST_SUBJECT Subject;
  52. } WIN_TRUST_SIP_SUBJECT, *LPWIN_TRUST_SIP_SUBJECT;
  53. //
  54. // Templates of services that must be EXPORTED by SIPs
  55. // FOR USE by Trust Providers (calling through WinTrust).
  56. //
  57. typedef BOOL
  58. ( *LPWINTRUST_SUBJECT_CHECK_CONTENT_INFO)(
  59. IN LPWIN_TRUST_SIP_SUBJECT lpSubject, // pointer to subject info
  60. IN LPWIN_CERTIFICATE lpSignedData // PKCS #7 Signed Data
  61. );
  62. typedef BOOL
  63. ( *LPWINTRUST_SUBJECT_ENUM_CERTIFICATES)(
  64. IN LPWIN_TRUST_SIP_SUBJECT lpSubject, // pointer to subject info
  65. IN DWORD dwTypeFilter, // 0 or WIN_CERT_TYPE_xxx
  66. OUT LPDWORD lpCertificateCount,
  67. IN OUT LPDWORD lpIndices, // Rcvs WIN_CERT_TYPE_
  68. IN DWORD dwIndexCount
  69. );
  70. typedef BOOL
  71. ( *LPWINTRUST_SUBJECT_GET_CERTIFICATE)(
  72. IN LPWIN_TRUST_SIP_SUBJECT lpSubject,
  73. IN DWORD dwCertificateIndex,
  74. OUT LPWIN_CERTIFICATE lpCertificate,
  75. IN OUT LPDWORD lpRequiredLength
  76. );
  77. typedef BOOL
  78. ( *LPWINTRUST_SUBJECT_GET_CERT_HEADER)(
  79. IN LPWIN_TRUST_SIP_SUBJECT lpSubject,
  80. IN DWORD dwCertificateIndex,
  81. OUT LPWIN_CERTIFICATE lpCertificateHeader
  82. );
  83. typedef BOOL
  84. (*LPWINTRUST_SUBJECT_GET_NAME)(
  85. IN LPWIN_TRUST_SIP_SUBJECT lpSubject,
  86. IN LPWIN_CERTIFICATE lpSignedData,
  87. IN OUT LPWSTR lpBuffer,
  88. IN OUT LPDWORD lpRequiredLength
  89. );
  90. typedef DWORD
  91. (*LPWINTRUST_PROVIDER_PING) (
  92. IN LPWSTR lpProviderName,
  93. IN DWORD dwClientParameter,
  94. OUT LPDWORD lpdwServerReturnValue
  95. );
  96. typedef struct _WINTRUST_SIP_DISPATCH_TABLE
  97. {
  98. LPWINTRUST_SUBJECT_CHECK_CONTENT_INFO CheckSubjectContentInfo;
  99. LPWINTRUST_SUBJECT_ENUM_CERTIFICATES EnumSubjectCertificates;
  100. LPWINTRUST_SUBJECT_GET_CERTIFICATE GetSubjectCertificate;
  101. LPWINTRUST_SUBJECT_GET_CERT_HEADER GetSubjectCertHeader;
  102. LPWINTRUST_SUBJECT_GET_NAME GetSubjectName;
  103. } WINTRUST_SIP_DISPATCH_TABLE, *LPWINTRUST_SIP_DISPATCH_TABLE;
  104. //
  105. // Structure describing an individual SIP.
  106. //
  107. // This structure is passed back to WinTrust from a Subject Interface Package
  108. // initialization call.
  109. //
  110. typedef struct _WINTRUST_SIP_INFO {
  111. DWORD dwRevision;
  112. LPWINTRUST_SIP_DISPATCH_TABLE lpServices;
  113. DWORD dwSubjectTypeCount;
  114. GUID * lpSubjectTypeArray;
  115. } WINTRUST_SIP_INFO, *LPWINTRUST_SIP_INFO;
  116. //
  117. // SIP Intialization routine.
  118. // SIP DLLs are required to have a routine named:
  119. //
  120. // WinTrustSipInitialize.
  121. //
  122. // This initialization routine must have the following
  123. // definition:
  124. //
  125. typedef BOOL
  126. (*LPWINTRUST_SUBJECT_PACKAGE_INITIALIZE)(
  127. IN DWORD dwWinTrustRevision,
  128. OUT LPWINTRUST_SIP_INFO *lpSipInfo
  129. );
  130. /***********************************************************************
  131. * *
  132. * This section contains definitions related to: *
  133. * *
  134. * Trust Providers *
  135. * *
  136. ************************************************************************/
  137. //
  138. // This should be with the other SPUB GUIDs in winbase.h
  139. //
  140. // PublishedSoftwareNoBad {C6B2E8D0-E005-11cf-A134-00C04FD7BF43}
  141. #define WIN_SPUB_ACTION_PUBLISHED_SOFTWARE_NOBADUI \
  142. { 0xc6b2e8d0, \
  143. 0xe005, \
  144. 0x11cf, \
  145. { 0xa1, 0x34, 0x0, 0xc0, 0x4f, 0xd7, 0xbf, 0x43 } \
  146. }
  147. //
  148. // Dispatch table of WinTrust services available to Trust Providers
  149. //
  150. // Client side...
  151. typedef struct _WINTRUST_CLIENT_TP_DISPATCH_TABLE
  152. {
  153. LPWINTRUST_PROVIDER_PING ServerPing;
  154. LPWINTRUST_SUBJECT_CHECK_CONTENT_INFO CheckSubjectContentInfo;
  155. LPWINTRUST_SUBJECT_ENUM_CERTIFICATES EnumSubjectCertificates;
  156. LPWINTRUST_SUBJECT_GET_CERTIFICATE GetSubjectCertificate;
  157. LPWINTRUST_SUBJECT_GET_CERT_HEADER GetSubjectCertHeader;
  158. LPWINTRUST_SUBJECT_GET_NAME GetSubjectName;
  159. } WINTRUST_CLIENT_TP_DISPATCH_TABLE, *LPWINTRUST_CLIENT_TP_DISPATCH_TABLE;
  160. // Server side...
  161. typedef struct _WINTRUST_SERVER_TP_DISPATCH_TABLE
  162. {
  163. LPWINTRUST_SUBJECT_CHECK_CONTENT_INFO CheckSubjectContentInfo;
  164. LPWINTRUST_SUBJECT_ENUM_CERTIFICATES EnumSubectCertificates;
  165. LPWINTRUST_SUBJECT_GET_CERTIFICATE GetSubjectCertificate;
  166. LPWINTRUST_SUBJECT_GET_CERT_HEADER GetSubjectCertHeader;
  167. LPWINTRUST_SUBJECT_GET_NAME GetSubjectName;
  168. } WINTRUST_SERVER_TP_DISPATCH_TABLE, *LPWINTRUST_SERVER_TP_DISPATCH_TABLE;
  169. //
  170. // The following structures are passed by WinTrust to a
  171. // Trust Provider being initialized.
  172. //
  173. // Client side...
  174. typedef struct _WINTRUST_CLIENT_TP_INFO {
  175. DWORD dwRevision;
  176. LPWINTRUST_CLIENT_TP_DISPATCH_TABLE lpServices;
  177. } WINTRUST_CLIENT_TP_INFO, *LPWINTRUST_CLIENT_TP_INFO;
  178. // Server side
  179. typedef struct _WINTRUST_SERVER_TP_INFO {
  180. DWORD dwRevision;
  181. LPWINTRUST_SERVER_TP_DISPATCH_TABLE lpServices;
  182. } WINTRUST_SERVER_TP_INFO, *LPWINTRUST_SERVER_TP_INFO;
  183. //
  184. // Templates of Trust Provider services available to WinTrust
  185. //
  186. typedef LONG
  187. (*LPWINTRUST_PROVIDER_VERIFY_TRUST) (
  188. IN HWND hwnd,
  189. IN GUID * ActionID,
  190. IN LPVOID ActionData
  191. );
  192. typedef VOID
  193. (*LPWINTRUST_PROVIDER_SUBMIT_CERTIFICATE) (
  194. IN LPWIN_CERTIFICATE lpCertificate
  195. );
  196. typedef VOID
  197. (*LPWINTRUST_PROVIDER_CLIENT_UNLOAD) (
  198. IN LPVOID lpTrustProviderInfo
  199. );
  200. typedef VOID
  201. (*LPWINTRUST_PROVIDER_SERVER_UNLOAD) (
  202. IN LPVOID lpTrustProviderInfo
  203. );
  204. //
  205. // Dispatch table of Trust provider services available for use by WinTrust
  206. //
  207. // Client side...
  208. typedef struct _WINTRUST_PROVIDER_CLIENT_SERVICES
  209. {
  210. LPWINTRUST_PROVIDER_CLIENT_UNLOAD Unload;
  211. LPWINTRUST_PROVIDER_VERIFY_TRUST VerifyTrust;
  212. LPWINTRUST_PROVIDER_SUBMIT_CERTIFICATE SubmitCertificate;
  213. } WINTRUST_PROVIDER_CLIENT_SERVICES, *LPWINTRUST_PROVIDER_CLIENT_SERVICES;
  214. typedef struct _WINTRUST_PROVIDER_SERVER_SERVICES
  215. {
  216. LPWINTRUST_PROVIDER_SERVER_UNLOAD Unload;
  217. LPWINTRUST_PROVIDER_PING Ping;
  218. } WINTRUST_PROVIDER_SERVER_SERVICES, *LPWINTRUST_PROVIDER_SERVER_SERVICES;
  219. //
  220. // This structure is passed back from the client-side Trust Provider
  221. // following initialization of that Trust Provider.
  222. //
  223. typedef struct _WINTRUST_PROVIDER_CLIENT_INFO {
  224. DWORD dwRevision;
  225. LPWINTRUST_PROVIDER_CLIENT_SERVICES lpServices;
  226. DWORD dwActionIdCount;
  227. GUID * lpActionIdArray;
  228. } WINTRUST_PROVIDER_CLIENT_INFO, *LPWINTRUST_PROVIDER_CLIENT_INFO;
  229. //
  230. // This structure is passed back from the server-side trust provider following
  231. // initialization of that trust provider.
  232. //
  233. typedef struct _WINTRUST_PROVIDER_SERVER_INFO {
  234. DWORD dwRevision;
  235. LPWINTRUST_PROVIDER_SERVER_SERVICES lpServices;
  236. } WINTRUST_PROVIDER_SERVER_INFO, *LPWINTRUST_PROVIDER_SERVER_INFO;
  237. //
  238. // Trust Provider Initialization Routines
  239. // Each Trust Provider DLL must have a client and server side initialization
  240. // routine. The routines must be named:
  241. //
  242. // WinTrustProviderClientInitialize()
  243. // and
  244. // WinTrustProviderServerInitialize()
  245. //
  246. // and must be defined to match the following templates...
  247. //
  248. typedef BOOL
  249. (*LPWINTRUST_PROVIDER_CLIENT_INITIALIZE)(
  250. IN DWORD dwWinTrustRevision,
  251. IN LPWINTRUST_CLIENT_TP_INFO lpWinTrustInfo,
  252. IN LPWSTR lpProviderName,
  253. OUT LPWINTRUST_PROVIDER_CLIENT_INFO *lpTrustProviderInfo
  254. );
  255. typedef BOOL
  256. (*LPWINTRUST_PROVIDER_SERVER_INITIALIZE) (
  257. IN DWORD dwWinTrustRevision,
  258. IN LPWINTRUST_SERVER_TP_INFO lpWinTrustInfo,
  259. IN LPWSTR lpProviderName,
  260. OUT LPWINTRUST_PROVIDER_SERVER_INFO *lpTrustProviderInfo
  261. );
  262. #ifdef __cplusplus
  263. }
  264. #endif
  265. #endif // _WINTRUST_
  266. #endif // WINTROLD_H