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.

463 lines
10 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. TLSGetServerScopeFixed(
  149. TLS_HANDLE hHandle,
  150. LPTSTR *pszScopeName,
  151. PDWORD pdwErrCode
  152. );
  153. DWORD WINAPI
  154. TLSGetInfo(
  155. TLS_HANDLE hHandle,
  156. DWORD cbHSCert,
  157. PBYTE pHSCert,
  158. PDWORD pcbLSCert,
  159. PBYTE* ppbLSCert,
  160. DWORD* pcbLSSecretKey,
  161. PBYTE* ppbLSSecretKey,
  162. PDWORD pdwErrCode
  163. );
  164. DWORD WINAPI
  165. TLSIssuePlatformChallenge(
  166. TLS_HANDLE hHandle,
  167. DWORD dwClientInfo,
  168. PCHALLENGE_CONTEXT pChallengeContext,
  169. PDWORD pcbChallengeData,
  170. PBYTE* pChallengeData,
  171. PDWORD pdwErrCode
  172. );
  173. DWORD WINAPI
  174. TLSIssueNewLicense(
  175. TLS_HANDLE hHandle,
  176. CHALLENGE_CONTEXT ChallengeContext,
  177. LICENSEREQUEST* pRequest,
  178. LPTSTR pszMachineName,
  179. LPTSTR pszUserName,
  180. DWORD cbChallengeResponse,
  181. PBYTE pbChallengeResponse,
  182. BOOL bAcceptTemporaryLicense,
  183. PDWORD pcbLicense,
  184. PBYTE* ppbLicense,
  185. PDWORD pdwErrCode
  186. );
  187. DWORD WINAPI
  188. TLSIssueNewLicenseEx(
  189. TLS_HANDLE hHandle,
  190. PDWORD pSupportFlags,
  191. CHALLENGE_CONTEXT ChallengeContext,
  192. LICENSEREQUEST *pRequest,
  193. LPTSTR pMachineName,
  194. LPTSTR pUserName,
  195. DWORD cbChallengeResponse,
  196. PBYTE pbChallengeResponse,
  197. BOOL bAcceptTemporaryLicense,
  198. DWORD dwQuantity,
  199. PDWORD pcbLicense,
  200. PBYTE* ppbLicense,
  201. PDWORD pdwErrCode
  202. );
  203. DWORD WINAPI
  204. TLSIssueNewLicenseExEx(
  205. TLS_HANDLE hHandle,
  206. PDWORD pSupportFlags,
  207. CHALLENGE_CONTEXT ChallengeContext,
  208. LICENSEREQUEST *pRequest,
  209. LPTSTR pMachineName,
  210. LPTSTR pUserName,
  211. DWORD cbChallengeResponse,
  212. PBYTE pbChallengeResponse,
  213. BOOL bAcceptTemporaryLicense,
  214. BOOL bAcceptFewerLicenses,
  215. DWORD *pdwQuantity,
  216. PDWORD pcbLicense,
  217. PBYTE* ppbLicense,
  218. PDWORD pdwErrCode
  219. );
  220. DWORD WINAPI
  221. TLSUpgradeLicense(
  222. TLS_HANDLE hHandle,
  223. LICENSEREQUEST* pRequest,
  224. CHALLENGE_CONTEXT ChallengeContext,
  225. DWORD cbChallengeResponse,
  226. PBYTE pbChallengeResponse,
  227. DWORD cbOldLicense,
  228. PBYTE pbOldLicense,
  229. PDWORD pcbNewLicense,
  230. PBYTE* ppbNewLicense,
  231. PDWORD pdwErrCode
  232. );
  233. DWORD WINAPI
  234. TLSUpgradeLicenseEx(
  235. TLS_HANDLE hHandle,
  236. PDWORD pSupportFlags,
  237. LICENSEREQUEST *pRequest,
  238. CHALLENGE_CONTEXT ChallengeContext,
  239. DWORD cbChallengeResponse,
  240. PBYTE pbChallengeResponse,
  241. DWORD cbOldLicense,
  242. PBYTE pbOldLicense,
  243. DWORD dwQuantity,
  244. PDWORD pcbNewLicense,
  245. PBYTE* ppbNewLicense,
  246. PDWORD pdwErrCode
  247. );
  248. DWORD WINAPI
  249. TLSAllocateConcurrentLicense(
  250. TLS_HANDLE hHandle,
  251. LPTSTR pszHydraServer,
  252. LICENSEREQUEST* pRequest,
  253. LONG* dwQuantity,
  254. PDWORD pdwErrCode
  255. );
  256. DWORD WINAPI
  257. TLSGetLastError(
  258. TLS_HANDLE hHandle,
  259. DWORD cbBufferSize,
  260. LPTSTR pszBuffer,
  261. PDWORD pdwErrCode
  262. );
  263. DWORD WINAPI
  264. TLSGetLastErrorFixed(
  265. TLS_HANDLE hHandle,
  266. LPTSTR *pszBuffer,
  267. PDWORD pdwErrCode
  268. );
  269. DWORD WINAPI
  270. TLSKeyPackEnumBegin(
  271. TLS_HANDLE hHandle,
  272. DWORD dwSearchParm,
  273. BOOL bMatchAll,
  274. LPLSKeyPackSearchParm lpSearchParm,
  275. PDWORD pdwErrCode
  276. );
  277. DWORD WINAPI
  278. TLSKeyPackEnumNext(
  279. TLS_HANDLE hHandle,
  280. LPLSKeyPack lpKeyPack,
  281. PDWORD pdwErrCode
  282. );
  283. DWORD WINAPI
  284. TLSKeyPackEnumEnd(
  285. TLS_HANDLE hHandle,
  286. PDWORD pdwErrCode
  287. );
  288. DWORD WINAPI
  289. TLSLicenseEnumBegin(
  290. TLS_HANDLE hHandle,
  291. DWORD dwSearchParm,
  292. BOOL bMatchAll,
  293. LPLSLicenseSearchParm lpSearchParm,
  294. PDWORD pdwErrCode
  295. );
  296. DWORD WINAPI
  297. TLSLicenseEnumNext(
  298. TLS_HANDLE hHandle,
  299. LPLSLicense lpLicense,
  300. PDWORD pdwErrCode
  301. );
  302. DWORD WINAPI
  303. TLSLicenseEnumNextEx(
  304. TLS_HANDLE hHandle,
  305. LPLSLicenseEx lpLicense,
  306. PDWORD pdwErrCode
  307. );
  308. DWORD WINAPI
  309. TLSLicenseEnumEnd(
  310. TLS_HANDLE hHandle,
  311. PDWORD pdwErrCode
  312. );
  313. DWORD WINAPI
  314. TLSGetAvailableLicenses(
  315. TLS_HANDLE hHandle,
  316. DWORD dwSearchParm,
  317. LPLSKeyPack lplsKeyPack,
  318. LPDWORD lpdwAvail,
  319. PDWORD pdwErrCode
  320. );
  321. DWORD WINAPI
  322. TLSGetRevokeKeyPackList(
  323. TLS_HANDLE hHandle,
  324. PDWORD pcbNumberOfRange,
  325. LPLSRange* ppRevokeRange,
  326. PDWORD pdwErrCode
  327. );
  328. DWORD WINAPI
  329. TLSGetRevokeLicenseList(
  330. TLS_HANDLE hHandle,
  331. PDWORD pcbNumberOfRange,
  332. LPLSRange* ppRevokeRange,
  333. PDWORD pdwErrCode
  334. );
  335. LICENSE_STATUS
  336. TLSGetTSCertificate(
  337. CERT_TYPE CertType,
  338. LPBYTE *ppbCertificate,
  339. LPDWORD pcbCertificate);
  340. LICENSE_STATUS
  341. TLSFreeTSCertificate(
  342. LPBYTE pbCertificate);
  343. DWORD WINAPI
  344. TLSInit();
  345. DWORD WINAPI
  346. TLSStartDiscovery();
  347. DWORD WINAPI
  348. TLSStopDiscovery();
  349. void WINAPI
  350. TLSShutdown();
  351. DWORD WINAPI
  352. TLSInDomain(
  353. BOOL *pfInDomain,
  354. LPWSTR *szDomain);
  355. DWORD WINAPI
  356. TLSMarkLicense(
  357. TLS_HANDLE hHandle,
  358. UCHAR ucFlags,
  359. DWORD cbLicense,
  360. PBYTE pLicense,
  361. PDWORD pdwErrCode
  362. );
  363. DWORD WINAPI
  364. TLSCheckLicenseMark(
  365. TLS_HANDLE hHandle,
  366. DWORD cbLicense,
  367. PBYTE pLicense,
  368. PUCHAR pucFlags,
  369. PDWORD pdwErrCode
  370. );
  371. DWORD WINAPI
  372. TLSGetSupportFlags(
  373. TLS_HANDLE hHandle,
  374. DWORD *pdwSupportFlags
  375. );
  376. DWORD WINAPI
  377. TLSGetServerNameEx(
  378. TLS_HANDLE hHandle,
  379. LPTSTR pszMachineName,
  380. PDWORD pcbSize,
  381. PDWORD pdwErrCode
  382. );
  383. DWORD WINAPI
  384. TLSGetServerNameFixed(
  385. TLS_HANDLE hHandle,
  386. LPTSTR *pszMachineName,
  387. PDWORD pdwErrCode
  388. );
  389. #ifdef __cplusplus
  390. }
  391. #endif
  392. #endif