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
9.3 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1996-1998
  5. //
  6. // File: tlsapi.h
  7. //
  8. // Contents:
  9. //
  10. // History: 12-09-97 HueiWang Created
  11. //
  12. //---------------------------------------------------------------------------
  13. #ifndef __TLSAPI_H__
  14. #define __TLSAPI_H__
  15. #include "tlsdef.h"
  16. #ifndef WINAPI
  17. #define WINAPI __stdcall
  18. #endif
  19. typedef BYTE* PBYTE;
  20. typedef DWORD* PDWORD;
  21. typedef PBYTE LPBYTE;
  22. typedef PDWORD LPDWORD;
  23. typedef UCHAR* PUCHAR;
  24. //----------------------------------------------------------------------------------
  25. // IssuedLicense related structure
  26. //
  27. typedef struct __LSLicense {
  28. DWORD dwVersion;
  29. DWORD dwLicenseId; // internal tracking number
  30. DWORD dwKeyPackId; // join with License Pack
  31. TCHAR szHWID[GUID_MAX_SIZE];
  32. TCHAR szMachineName[MAXCOMPUTERNAMELENGTH];
  33. TCHAR szUserName[MAXUSERNAMELENGTH];
  34. DWORD dwCertSerialLicense;
  35. DWORD dwLicenseSerialNumber;
  36. DWORD ftIssueDate;
  37. DWORD ftExpireDate;
  38. UCHAR ucLicenseStatus;
  39. } LSLicense, *LPLSLicense;
  40. typedef LSLicense LSLicenseSearchParm;
  41. typedef LSLicenseSearchParm* LPLSLicenseSearchParm;
  42. typedef struct __LSLicenseEx {
  43. DWORD dwVersion;
  44. DWORD dwLicenseId; // internal tracking number
  45. DWORD dwKeyPackId; // join with License Pack
  46. TCHAR szHWID[GUID_MAX_SIZE];
  47. TCHAR szMachineName[MAXCOMPUTERNAMELENGTH];
  48. TCHAR szUserName[MAXUSERNAMELENGTH];
  49. DWORD dwCertSerialLicense;
  50. DWORD dwLicenseSerialNumber;
  51. DWORD ftIssueDate;
  52. DWORD ftExpireDate;
  53. UCHAR ucLicenseStatus;
  54. DWORD dwQuantity;
  55. } LSLicenseEx, *LPLSLicenseEx;
  56. //----------------------------------------------------------------------------------
  57. // Table License Key Pack related structure
  58. //
  59. typedef struct __LSKeyPack {
  60. DWORD dwVersion;
  61. UCHAR ucKeyPackType;
  62. TCHAR szCompanyName[LSERVER_MAX_STRING_SIZE+1];
  63. TCHAR szKeyPackId[LSERVER_MAX_STRING_SIZE+1];
  64. TCHAR szProductName[LSERVER_MAX_STRING_SIZE+1];
  65. TCHAR szProductId[LSERVER_MAX_STRING_SIZE+1];
  66. TCHAR szProductDesc[LSERVER_MAX_STRING_SIZE+1];
  67. WORD wMajorVersion;
  68. WORD wMinorVersion;
  69. DWORD dwPlatformType;
  70. UCHAR ucLicenseType;
  71. DWORD dwLanguageId;
  72. UCHAR ucChannelOfPurchase;
  73. TCHAR szBeginSerialNumber[LSERVER_MAX_STRING_SIZE+1];
  74. DWORD dwTotalLicenseInKeyPack;
  75. DWORD dwProductFlags;
  76. DWORD dwKeyPackId;
  77. UCHAR ucKeyPackStatus;
  78. DWORD dwActivateDate;
  79. DWORD dwExpirationDate;
  80. DWORD dwNumberOfLicenses;
  81. } LSKeyPack, *LPLSKeyPack;
  82. typedef LSKeyPack LSKeyPackSearchParm;
  83. typedef LSKeyPackSearchParm* LPLSKeyPackSearchParm;
  84. //---------------------------------------------------------------------------
  85. typedef struct {
  86. DWORD dwLow;
  87. DWORD dwHigh;
  88. } LSRange, *LPLSRange, *PLSRange;
  89. typedef HANDLE TLS_HANDLE;
  90. typedef DWORD CHALLENGE_CONTEXT;
  91. typedef CHALLENGE_CONTEXT* PCHALLENGE_CONTEXT;
  92. typedef BOOL (* TLSENUMERATECALLBACK)(TLS_HANDLE hBinding, LPCTSTR pszServer, HANDLE dwUserData);
  93. #ifdef __cplusplus
  94. extern "C" {
  95. #endif
  96. HRESULT FindEnterpriseServer(TLS_HANDLE *phBinding);
  97. HRESULT GetAllEnterpriseServers(WCHAR ***ppszServers, DWORD *pdwCount);
  98. // void *MIDL_user_allocate(DWORD size);
  99. // void MIDL_user_free(void *pointer);
  100. // void * __stdcall MIDL_user_allocate(DWORD);
  101. // void __stdcall MIDL_user_free( void * );
  102. DWORD WINAPI
  103. EnumerateTlsServer(
  104. TLSENUMERATECALLBACK fCallBack,
  105. HANDLE dwUserData,
  106. DWORD dwTimeOut,
  107. BOOL fRegOnly
  108. );
  109. TLS_HANDLE WINAPI
  110. TLSConnectToAnyLsServer(
  111. DWORD dwTimeout
  112. );
  113. TLS_HANDLE WINAPI
  114. TLSConnectToLsServer(
  115. LPTSTR szLsServer
  116. );
  117. void WINAPI
  118. TLSDisconnectFromServer(
  119. TLS_HANDLE hHandle
  120. );
  121. DWORD WINAPI
  122. TLSGetVersion (
  123. TLS_HANDLE hHandle,
  124. PDWORD pdwVersion
  125. );
  126. DWORD WINAPI
  127. TLSSendServerCertificate(
  128. TLS_HANDLE hHandle,
  129. DWORD cbCert,
  130. PBYTE pbCert,
  131. PDWORD pdwErrCode
  132. );
  133. DWORD WINAPI
  134. TLSGetServerName(
  135. TLS_HANDLE hHandle,
  136. LPTSTR pszMachineName,
  137. PDWORD pcbSize,
  138. PDWORD pdwErrCode
  139. );
  140. DWORD WINAPI
  141. TLSGetServerScope(
  142. TLS_HANDLE hHandle,
  143. LPTSTR pszScopeName,
  144. PDWORD pcbSize,
  145. PDWORD pdwErrCode
  146. );
  147. DWORD WINAPI
  148. TLSGetInfo(
  149. TLS_HANDLE hHandle,
  150. DWORD cbHSCert,
  151. PBYTE pHSCert,
  152. PDWORD pcbLSCert,
  153. PBYTE* ppbLSCert,
  154. DWORD* pcbLSSecretKey,
  155. PBYTE* ppbLSSecretKey,
  156. PDWORD pdwErrCode
  157. );
  158. DWORD WINAPI
  159. TLSIssuePlatformChallenge(
  160. TLS_HANDLE hHandle,
  161. DWORD dwClientInfo,
  162. PCHALLENGE_CONTEXT pChallengeContext,
  163. PDWORD pcbChallengeData,
  164. PBYTE* pChallengeData,
  165. PDWORD pdwErrCode
  166. );
  167. DWORD WINAPI
  168. TLSIssueNewLicense(
  169. TLS_HANDLE hHandle,
  170. CHALLENGE_CONTEXT ChallengeContext,
  171. LICENSEREQUEST* pRequest,
  172. LPTSTR pszMachineName,
  173. LPTSTR pszUserName,
  174. DWORD cbChallengeResponse,
  175. PBYTE pbChallengeResponse,
  176. BOOL bAcceptTemporaryLicense,
  177. PDWORD pcbLicense,
  178. PBYTE* ppbLicense,
  179. PDWORD pdwErrCode
  180. );
  181. DWORD WINAPI
  182. TLSIssueNewLicenseEx(
  183. TLS_HANDLE hHandle,
  184. PDWORD pSupportFlags,
  185. CHALLENGE_CONTEXT ChallengeContext,
  186. LICENSEREQUEST *pRequest,
  187. LPTSTR pMachineName,
  188. LPTSTR pUserName,
  189. DWORD cbChallengeResponse,
  190. PBYTE pbChallengeResponse,
  191. BOOL bAcceptTemporaryLicense,
  192. DWORD dwQuantity,
  193. PDWORD pcbLicense,
  194. PBYTE* ppbLicense,
  195. PDWORD pdwErrCode
  196. );
  197. DWORD WINAPI
  198. TLSIssueNewLicenseExEx(
  199. TLS_HANDLE hHandle,
  200. PDWORD pSupportFlags,
  201. CHALLENGE_CONTEXT ChallengeContext,
  202. LICENSEREQUEST *pRequest,
  203. LPTSTR pMachineName,
  204. LPTSTR pUserName,
  205. DWORD cbChallengeResponse,
  206. PBYTE pbChallengeResponse,
  207. BOOL bAcceptTemporaryLicense,
  208. BOOL bAcceptFewerLicenses,
  209. DWORD *pdwQuantity,
  210. PDWORD pcbLicense,
  211. PBYTE* ppbLicense,
  212. PDWORD pdwErrCode
  213. );
  214. DWORD WINAPI
  215. TLSUpgradeLicense(
  216. TLS_HANDLE hHandle,
  217. LICENSEREQUEST* pRequest,
  218. CHALLENGE_CONTEXT ChallengeContext,
  219. DWORD cbChallengeResponse,
  220. PBYTE pbChallengeResponse,
  221. DWORD cbOldLicense,
  222. PBYTE pbOldLicense,
  223. PDWORD pcbNewLicense,
  224. PBYTE* ppbNewLicense,
  225. PDWORD pdwErrCode
  226. );
  227. DWORD WINAPI
  228. TLSUpgradeLicenseEx(
  229. TLS_HANDLE hHandle,
  230. PDWORD pSupportFlags,
  231. LICENSEREQUEST *pRequest,
  232. CHALLENGE_CONTEXT ChallengeContext,
  233. DWORD cbChallengeResponse,
  234. PBYTE pbChallengeResponse,
  235. DWORD cbOldLicense,
  236. PBYTE pbOldLicense,
  237. DWORD dwQuantity,
  238. PDWORD pcbNewLicense,
  239. PBYTE* ppbNewLicense,
  240. PDWORD pdwErrCode
  241. );
  242. DWORD WINAPI
  243. TLSAllocateConcurrentLicense(
  244. TLS_HANDLE hHandle,
  245. LPTSTR pszHydraServer,
  246. LICENSEREQUEST* pRequest,
  247. LONG* dwQuantity,
  248. PDWORD pdwErrCode
  249. );
  250. DWORD WINAPI
  251. TLSGetLastError(
  252. TLS_HANDLE hHandle,
  253. DWORD cbBufferSize,
  254. LPTSTR pszBuffer,
  255. PDWORD pdwErrCode
  256. );
  257. DWORD WINAPI
  258. TLSKeyPackEnumBegin(
  259. TLS_HANDLE hHandle,
  260. DWORD dwSearchParm,
  261. BOOL bMatchAll,
  262. LPLSKeyPackSearchParm lpSearchParm,
  263. PDWORD pdwErrCode
  264. );
  265. DWORD WINAPI
  266. TLSKeyPackEnumNext(
  267. TLS_HANDLE hHandle,
  268. LPLSKeyPack lpKeyPack,
  269. PDWORD pdwErrCode
  270. );
  271. DWORD WINAPI
  272. TLSKeyPackEnumEnd(
  273. TLS_HANDLE hHandle,
  274. PDWORD pdwErrCode
  275. );
  276. DWORD WINAPI
  277. TLSLicenseEnumBegin(
  278. TLS_HANDLE hHandle,
  279. DWORD dwSearchParm,
  280. BOOL bMatchAll,
  281. LPLSLicenseSearchParm lpSearchParm,
  282. PDWORD pdwErrCode
  283. );
  284. DWORD WINAPI
  285. TLSLicenseEnumNext(
  286. TLS_HANDLE hHandle,
  287. LPLSLicense lpLicense,
  288. PDWORD pdwErrCode
  289. );
  290. DWORD WINAPI
  291. TLSLicenseEnumNextEx(
  292. TLS_HANDLE hHandle,
  293. LPLSLicenseEx lpLicense,
  294. PDWORD pdwErrCode
  295. );
  296. DWORD WINAPI
  297. TLSLicenseEnumEnd(
  298. TLS_HANDLE hHandle,
  299. PDWORD pdwErrCode
  300. );
  301. DWORD WINAPI
  302. TLSGetAvailableLicenses(
  303. TLS_HANDLE hHandle,
  304. DWORD dwSearchParm,
  305. LPLSKeyPack lplsKeyPack,
  306. LPDWORD lpdwAvail,
  307. PDWORD pdwErrCode
  308. );
  309. DWORD WINAPI
  310. TLSGetRevokeKeyPackList(
  311. TLS_HANDLE hHandle,
  312. PDWORD pcbNumberOfRange,
  313. LPLSRange* ppRevokeRange,
  314. PDWORD pdwErrCode
  315. );
  316. DWORD WINAPI
  317. TLSGetRevokeLicenseList(
  318. TLS_HANDLE hHandle,
  319. PDWORD pcbNumberOfRange,
  320. LPLSRange* ppRevokeRange,
  321. PDWORD pdwErrCode
  322. );
  323. LICENSE_STATUS
  324. TLSGetTSCertificate(
  325. CERT_TYPE CertType,
  326. LPBYTE *ppbCertificate,
  327. LPDWORD pcbCertificate);
  328. LICENSE_STATUS
  329. TLSFreeTSCertificate(
  330. LPBYTE pbCertificate);
  331. DWORD WINAPI
  332. TLSInit();
  333. DWORD WINAPI
  334. TLSStartDiscovery();
  335. DWORD WINAPI
  336. TLSStopDiscovery();
  337. void WINAPI
  338. TLSShutdown();
  339. DWORD WINAPI
  340. TLSInDomain(
  341. BOOL *pfInDomain,
  342. LPWSTR *szDomain);
  343. DWORD WINAPI
  344. TLSMarkLicense(
  345. TLS_HANDLE hHandle,
  346. UCHAR ucFlags,
  347. DWORD cbLicense,
  348. PBYTE pLicense,
  349. PDWORD pdwErrCode
  350. );
  351. DWORD WINAPI
  352. TLSCheckLicenseMark(
  353. TLS_HANDLE hHandle,
  354. DWORD cbLicense,
  355. PBYTE pLicense,
  356. PUCHAR pucFlags,
  357. PDWORD pdwErrCode
  358. );
  359. DWORD WINAPI
  360. TLSGetSupportFlags(
  361. TLS_HANDLE hHandle,
  362. DWORD *pdwSupportFlags
  363. );
  364. DWORD WINAPI
  365. TLSGetServerNameEx(
  366. TLS_HANDLE hHandle,
  367. LPTSTR pszMachineName,
  368. PDWORD pcbSize,
  369. PDWORD pdwErrCode
  370. );
  371. #ifdef __cplusplus
  372. }
  373. #endif
  374. #endif