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.

379 lines
7.6 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Copyright (c) 1997-1999 Microsoft Corporation
  4. //
  5. // File:
  6. //
  7. // Contents:
  8. //
  9. // History:
  10. //
  11. //---------------------------------------------------------------------------
  12. #ifndef __TLSAPIP_H__
  13. #define __TLSAPIP_H__
  14. #include <wincrypt.h>
  15. #include "tlsapi.h"
  16. #include "tlsrpc.h"
  17. #define TLSCERT_TYPE_EXCHANGE 1
  18. #define TLSCERT_TYPE_SIGNATURE 2
  19. #define ENTERPRISE_SERVER_MULTI L"EnterpriseServerMulti"
  20. #define TLS_RTM_VERSION_BIT 0x20000000
  21. #define IS_LSSERVER_RTM(x) ((x & TLS_RTM_VERSION_BIT) > 0)
  22. #define TLS_VERSION_ENTERPRISE_BIT 0x80000000
  23. #define CURRENT_TLSERVER_VERSION(version) HIBYTE(LOWORD(version))
  24. #define GET_LSSERVER_MAJOR_VERSION(version) HIBYTE(LOWORD(version))
  25. #define GET_LSSERVER_MINOR_VERSION(version) LOBYTE(LOWORD(version))
  26. #define IS_ENFORCE_LSSERVER(version) \
  27. ((version & 0x40000000) > 0)
  28. //#define PERMANENT_LICENSE_LEASE_EXPIRE_LEEWAY (30) /* 30 seconds */
  29. #define PERMANENT_LICENSE_LEASE_EXPIRE_LEEWAY (60*60*24*7) /* 7 days */
  30. //
  31. // TLSInstallCertificate() certificate type.
  32. //
  33. #define CERTIFICATE_CA_TYPE 1
  34. #define CERTITICATE_MF_TYPE 2
  35. #define CERTIFICATE_CH_TYPE 3
  36. #define CERTIFICATE_SPK_TYPE 4
  37. #define CERTIFICATE_LEVEL_ROOT 0
  38. typedef struct _LSHydraCertRequest {
  39. DWORD dwHydraVersion;
  40. PBYTE pbEncryptedHwid;
  41. DWORD cbEncryptedHwid;
  42. LPTSTR szSubjectRdn;
  43. PCERT_PUBLIC_KEY_INFO SubjectPublicKeyInfo;
  44. DWORD dwNumCertExtension;
  45. PCERT_EXTENSION pCertExtensions;
  46. } LSHydraCertRequest, *LPLSHydraCertRequest, *PLSHydraCertRequest;
  47. #ifdef __cplusplus
  48. extern "C" {
  49. #endif
  50. DWORD WINAPI
  51. RequestToTlsRequest(
  52. const LICENSEREQUEST* lpRequest,
  53. TLSLICENSEREQUEST* lpRpcRequest
  54. );
  55. DWORD WINAPI
  56. TlsRequestToRequest(
  57. TLSLICENSEREQUEST* lpRpcRequest ,
  58. LICENSEREQUEST* lpRequest
  59. );
  60. DWORD WINAPI
  61. TLSReplicateKeyPack(
  62. TLS_HANDLE hHandle,
  63. DWORD cbLsIdentification,
  64. PBYTE pbLsIdentification,
  65. LPLSKeyPack lpKeyPack,
  66. PDWORD pdwErrCode
  67. );
  68. DWORD WINAPI
  69. TLSAuditLicenseKeyPack(
  70. TLS_HANDLE hHandle,
  71. DWORD dwKeyPackId,
  72. FILETIME ftStartTime,
  73. FILETIME ftEndTime,
  74. BOOL bResetCounter,
  75. LPTLSKeyPackAudit lplsAudit,
  76. PDWORD dwErrCode
  77. );
  78. DWORD WINAPI
  79. TLSRetrieveTermServCert(
  80. TLS_HANDLE hHandle,
  81. DWORD cbResponseData,
  82. PBYTE pbResponseData,
  83. PDWORD cbCert,
  84. PBYTE* pbCert,
  85. PDWORD pdwErrCode
  86. );
  87. DWORD WINAPI
  88. TLSRequestTermServCert(
  89. TLS_HANDLE hHandle,
  90. LPLSHydraCertRequest pRequest,
  91. PDWORD cbChallengeData,
  92. PBYTE* pbChallengeData,
  93. PDWORD pdwErrCode
  94. );
  95. DWORD WINAPI
  96. TLSInstallCertificate(
  97. TLS_HANDLE hHandle,
  98. DWORD dwCertType,
  99. DWORD dwCertLevel,
  100. DWORD cbSingnatureCert,
  101. PBYTE pbSingnatureCert,
  102. DWORD cbExchangeCert,
  103. PBYTE pbExchangeCert,
  104. PDWORD pdwErrCode
  105. );
  106. DWORD WINAPI
  107. TLSGetServerCertificate(
  108. TLS_HANDLE hHandle,
  109. BOOL bSignCert,
  110. PBYTE *ppCertBlob,
  111. PDWORD pdwCertBlobLen,
  112. PDWORD pdwErrCode
  113. );
  114. DWORD WINAPI
  115. TLSRegisterLicenseKeyPack(
  116. TLS_HANDLE hHandle,
  117. LPBYTE pbCHCertBlob,
  118. DWORD cbCHCertBlobSize,
  119. LPBYTE pbRootCertBlob,
  120. DWORD cbRootCertBlob,
  121. LPBYTE lpKeyPackBlob,
  122. DWORD dwKeyPackBlobLen,
  123. PDWORD pdwErrCode
  124. );
  125. DWORD WINAPI
  126. TLSGetLSPKCS10CertRequest(
  127. TLS_HANDLE hHandle,
  128. DWORD dwCertType,
  129. PDWORD pcbdata,
  130. PBYTE* ppbData,
  131. PDWORD pdwErrCode
  132. );
  133. DWORD WINAPI
  134. TLSKeyPackAdd(
  135. TLS_HANDLE hHandle,
  136. LPLSKeyPack lpKeypack,
  137. PDWORD pdwErrCode
  138. );
  139. DWORD WINAPI
  140. TLSKeyPackSetStatus(
  141. TLS_HANDLE hHandle,
  142. DWORD dwSetParm,
  143. LPLSKeyPack lpKeyPack,
  144. PDWORD pdwErrCode
  145. );
  146. DWORD WINAPI
  147. TLSLicenseSetStatus(
  148. TLS_HANDLE hHandle,
  149. DWORD dwSetParam,
  150. LPLSLicense lpLicense,
  151. PDWORD pdwErrCode
  152. );
  153. DWORD WINAPI
  154. TLSReturnKeyPack(
  155. TLS_HANDLE hHandle,
  156. DWORD dwKeyPackId,
  157. DWORD dwReturnReason,
  158. PDWORD pdwErrCode
  159. );
  160. DWORD WINAPI
  161. TLSReturnLicense(
  162. TLS_HANDLE hHandle,
  163. DWORD dwKeyPackId,
  164. DWORD dwLicenseId,
  165. DWORD dwReturnReason,
  166. PDWORD pdwErrCode
  167. );
  168. DWORD WINAPI
  169. TLSAnnounceServer(
  170. TLS_HANDLE hHandle,
  171. DWORD dwType,
  172. FILETIME* ftTime,
  173. LPTSTR pszSetupId,
  174. LPTSTR pszDomainName,
  175. LPTSTR pszMachineName,
  176. PDWORD pdwErrCode
  177. );
  178. DWORD WINAPI
  179. TLSLookupServer(
  180. TLS_HANDLE hHandle,
  181. LPTSTR pszLookupSetupId,
  182. LPTSTR pszLsSetupId,
  183. PDWORD pcbSetupId,
  184. LPTSTR pszDomainName,
  185. PDWORD pcbDomainName,
  186. LPTSTR pszLsName,
  187. PDWORD pcbMachineName,
  188. PDWORD pdwErrCode
  189. );
  190. DWORD WINAPI
  191. TLSAnnounceLicensePack(
  192. TLS_HANDLE hHandle,
  193. PTLSReplRecord pReplRecord,
  194. OUT PDWORD pdwErrCode
  195. );
  196. DWORD WINAPI
  197. TLSReturnLicensedProduct(
  198. PCONTEXT_HANDLE phContext,
  199. PTLSLicenseToBeReturn pClientLicense,
  200. PDWORD pdwErrCode
  201. );
  202. DWORD WINAPI
  203. TLSTriggerReGenKey(
  204. IN TLS_HANDLE hHandle,
  205. IN BOOL bReserved,
  206. OUT PDWORD pdwErrCode
  207. );
  208. DWORD WINAPI
  209. TLSSetTlsPrivateData(
  210. IN TLS_HANDLE hHandle,
  211. IN DWORD dwPrivateDataType,
  212. IN PTLSPrivateDataUnion pPrivateData,
  213. OUT PDWORD pdwErrCode
  214. );
  215. DWORD WINAPI
  216. TLSGetTlsPrivateData(
  217. IN TLS_HANDLE hHandle,
  218. IN DWORD dwGetDataType,
  219. IN PTLSPrivateDataUnion pGetParm,
  220. OUT PDWORD pdwRetDataType,
  221. OUT PTLSPrivateDataUnion* ppRetData,
  222. OUT PDWORD pdwErrCode
  223. );
  224. DWORD WINAPI
  225. TLSResponseServerChallenge(
  226. IN TLS_HANDLE hHandle,
  227. IN PTLSCHALLENGERESPONSEDATA pClientResponse,
  228. OUT PDWORD pdwErrCode
  229. );
  230. DWORD WINAPI
  231. TLSChallengeServer(
  232. IN TLS_HANDLE hHandle,
  233. IN DWORD dwClientType,
  234. IN PTLSCHALLENGEDATA pClientChallenge,
  235. OUT PTLSCHALLENGERESPONSEDATA* ppServerResponse,
  236. OUT PTLSCHALLENGEDATA* ppServerChallenge,
  237. OUT PDWORD pdwErrCode
  238. );
  239. DWORD WINAPI
  240. TLSTelephoneRegisterLKP(
  241. TLS_HANDLE hHandle,
  242. DWORD cbData,
  243. PBYTE pbData,
  244. PDWORD pdwErrCode
  245. );
  246. DWORD WINAPI
  247. TLSGetServerUniqueId(
  248. TLS_HANDLE hHandle,
  249. PDWORD pcbData,
  250. PBYTE* ppbByte,
  251. PDWORD pdwErrCode
  252. );
  253. DWORD WINAPI
  254. TLSGetServerPID(
  255. TLS_HANDLE hHandle,
  256. PDWORD pcbData,
  257. PBYTE* ppbByte,
  258. PDWORD pdwErrCode
  259. );
  260. DWORD WINAPI
  261. TLSGetServerSPK(
  262. TLS_HANDLE hHandle,
  263. PDWORD pcbData,
  264. PBYTE* ppbByte,
  265. PDWORD pdwErrCode
  266. );
  267. DWORD WINAPI
  268. TLSDepositeServerSPK(
  269. TLS_HANDLE hHandle,
  270. DWORD cbSPK,
  271. PBYTE pbSPK,
  272. PCERT_EXTENSIONS pCertExtensions,
  273. PDWORD pdwErrCode
  274. );
  275. DWORD WINAPI
  276. TLSAllocateInternetLicense(
  277. IN TLS_HANDLE hHandle,
  278. IN const CHALLENGE_CONTEXT ChallengeContext,
  279. IN const LICENSEREQUEST* pRequest,
  280. IN LPTSTR pszMachineName,
  281. IN LPTSTR pszUserName,
  282. IN const DWORD cbChallengeResponse,
  283. IN const PBYTE pbChallengeResponse,
  284. OUT PDWORD pcbLicense,
  285. OUT PBYTE* ppbLicense,
  286. IN OUT PDWORD pdwErrCode
  287. );
  288. DWORD WINAPI
  289. TLSReturnInternetLicense(
  290. IN TLS_HANDLE hHandle,
  291. IN const DWORD cbLicense,
  292. IN const PBYTE pbLicense,
  293. OUT PDWORD pdwErrCode
  294. );
  295. DWORD WINAPI
  296. TLSAllocateInternetLicenseEx(
  297. IN TLS_HANDLE hHandle,
  298. IN const CHALLENGE_CONTEXT ChallengeContext,
  299. IN const LICENSEREQUEST* pRequest,
  300. IN LPTSTR pszMachineName,
  301. IN LPTSTR pszUserName,
  302. IN const DWORD cbChallengeResponse,
  303. IN const PBYTE pbChallengeResponse,
  304. OUT PTLSInternetLicense pInternetLicense,
  305. OUT PDWORD pdwErrCode
  306. );
  307. DWORD WINAPI
  308. TLSReturnInternetLicenseEx(
  309. IN TLS_HANDLE hHandle,
  310. IN const LICENSEREQUEST* pRequest,
  311. IN const ULARGE_INTEGER* pulSerialNumber,
  312. IN const DWORD dwQuantity,
  313. OUT PDWORD pdwErrCode
  314. );
  315. BOOL
  316. TLSIsBetaNTServer();
  317. BOOL
  318. TLSIsLicenseEnforceEnable();
  319. BOOL
  320. TLSRefreshLicenseServerCache(
  321. DWORD dwTimeOut
  322. );
  323. #ifdef __cplusplus
  324. }
  325. #endif
  326. #endif