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.

889 lines
21 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1996-1998
  5. //
  6. // File: tlsapip.cpp
  7. //
  8. // Contents: Private API
  9. //
  10. // History: 09-09-97 HueiWang Created
  11. //
  12. //---------------------------------------------------------------------------
  13. #include <nt.h>
  14. #include <ntrtl.h>
  15. #include <nturtl.h>
  16. #include <windows.h>
  17. #include <stdio.h>
  18. #include <stdlib.h>
  19. #include <tchar.h>
  20. #include <rpc.h>
  21. #include "lscommon.h"
  22. #include <wincrypt.h>
  23. #include "tlsrpc.h"
  24. #include "tlsapi.h"
  25. #include "tlsapip.h"
  26. #include <secdbg.h>
  27. //----------------------------------------------------------------------------
  28. BOOL
  29. TLSIsLicenseEnforceEnable()
  30. /*++
  31. --*/
  32. {
  33. #if ENFORCE_LICENSING
  34. return TRUE;
  35. #else
  36. return FALSE;
  37. #endif
  38. }
  39. //----------------------------------------------------------------------------
  40. BOOL
  41. TLSIsBetaNTServer()
  42. /*++
  43. Abstract:
  44. Detemine if base NT is a beta or RTM version.
  45. Parameter:
  46. None.
  47. Return:
  48. TRUE/FALSE
  49. --*/
  50. {
  51. BOOL bBetaNt = FALSE;
  52. DWORD dwStatus;
  53. DWORD cbData;
  54. DWORD cbType;
  55. HKEY hKey = NULL;
  56. __try {
  57. LARGE_INTEGER Time = USER_SHARED_DATA->SystemExpirationDate;
  58. if(Time.QuadPart)
  59. {
  60. bBetaNt = TRUE;
  61. // check our special registry key - force
  62. // issuing a RTM license.
  63. dwStatus = RegOpenKeyEx(
  64. HKEY_LOCAL_MACHINE,
  65. L"SOFTWARE\\Microsoft\\TermServLicensing",
  66. 0,
  67. KEY_ALL_ACCESS,
  68. &hKey
  69. );
  70. if(dwStatus == ERROR_SUCCESS)
  71. {
  72. dwStatus = RegQueryValueEx(
  73. hKey,
  74. _TEXT("RunAsRTM"),
  75. NULL,
  76. &cbType,
  77. NULL,
  78. &cbData
  79. );
  80. // for testing, force it to run as RTM version.
  81. // key must exist and must be DWORD type
  82. if(dwStatus == ERROR_SUCCESS && cbType == REG_DWORD)
  83. {
  84. bBetaNt = FALSE;
  85. }
  86. }
  87. }
  88. }
  89. __except(EXCEPTION_EXECUTE_HANDLER) {
  90. ASSERT(FALSE);
  91. }
  92. if(hKey != NULL)
  93. {
  94. RegCloseKey(hKey);
  95. }
  96. return bBetaNt;
  97. }
  98. //----------------------------------------------------------------------------
  99. DWORD WINAPI
  100. TLSAllocateInternetLicenseEx(
  101. IN TLS_HANDLE hHandle,
  102. IN const CHALLENGE_CONTEXT ChallengeContext,
  103. IN const LICENSEREQUEST* pRequest,
  104. IN LPTSTR pszMachineName,
  105. IN LPTSTR pszUserName,
  106. IN const DWORD cbChallengeResponse,
  107. IN const PBYTE pbChallengeResponse,
  108. OUT PTLSInternetLicense pInternetLicense,
  109. OUT PDWORD pdwErrCode
  110. )
  111. /*++
  112. --*/
  113. {
  114. TLSLICENSEREQUEST rpcRequest;
  115. RequestToTlsRequest( pRequest, &rpcRequest );
  116. return TLSRpcAllocateInternetLicenseEx(
  117. hHandle,
  118. ChallengeContext,
  119. &rpcRequest,
  120. pszMachineName,
  121. pszUserName,
  122. cbChallengeResponse,
  123. pbChallengeResponse,
  124. pInternetLicense,
  125. pdwErrCode
  126. );
  127. }
  128. //----------------------------------------------------------------------------
  129. DWORD WINAPI
  130. TLSReturnInternetLicenseEx(
  131. IN TLS_HANDLE hHandle,
  132. IN const LICENSEREQUEST* pRequest,
  133. IN const ULARGE_INTEGER* pulSerialNumber,
  134. IN const DWORD dwQuantity,
  135. OUT PDWORD pdwErrCode
  136. )
  137. /*++
  138. --*/
  139. {
  140. TLSLICENSEREQUEST rpcRequest;
  141. RequestToTlsRequest( pRequest, &rpcRequest );
  142. return TLSRpcReturnInternetLicenseEx(
  143. hHandle,
  144. &rpcRequest,
  145. pulSerialNumber,
  146. dwQuantity,
  147. pdwErrCode
  148. );
  149. }
  150. //----------------------------------------------------------------------------
  151. DWORD WINAPI
  152. TLSRegisterLicenseKeyPack(
  153. TLS_HANDLE hHandle,
  154. LPBYTE pbCHCertBlob,
  155. DWORD cbCHCertBlobSize,
  156. LPBYTE pbRootCertBlob,
  157. DWORD cbRootCertBlob,
  158. LPBYTE lpKeyPackBlob,
  159. DWORD dwKeyPackBlobLen,
  160. PDWORD pdwErrCode
  161. )
  162. /*++
  163. ++*/
  164. {
  165. return TLSRpcRegisterLicenseKeyPack(
  166. hHandle,
  167. pbCHCertBlob,
  168. cbCHCertBlobSize,
  169. pbRootCertBlob,
  170. cbRootCertBlob,
  171. lpKeyPackBlob,
  172. dwKeyPackBlobLen,
  173. pdwErrCode
  174. );
  175. }
  176. //----------------------------------------------------------------------------
  177. DWORD WINAPI
  178. TLSTelephoneRegisterLKP(
  179. IN TLS_HANDLE hHandle,
  180. IN DWORD cbData,
  181. IN PBYTE pbData,
  182. OUT PDWORD pdwErrCode
  183. )
  184. /*++
  185. --*/
  186. {
  187. return TLSRpcTelephoneRegisterLKP(
  188. hHandle,
  189. cbData,
  190. pbData,
  191. pdwErrCode
  192. );
  193. }
  194. //----------------------------------------------------------------------------
  195. DWORD WINAPI
  196. RequestToTlsRequest(
  197. const LICENSEREQUEST* lpRequest,
  198. TLSLICENSEREQUEST* lpRpcRequest
  199. )
  200. /*++
  201. ++*/
  202. {
  203. if(lpRequest == NULL || lpRpcRequest == NULL || lpRequest->pProductInfo == NULL)
  204. return ERROR_INVALID_PARAMETER;
  205. //
  206. // NOTE : No memory allocation, DO NOT FREE ...
  207. //
  208. lpRpcRequest->cbEncryptedHwid = lpRequest->cbEncryptedHwid;
  209. lpRpcRequest->pbEncryptedHwid = lpRequest->pbEncryptedHwid;
  210. lpRpcRequest->dwLanguageID = lpRequest->dwLanguageID;
  211. lpRpcRequest->dwPlatformID = lpRequest->dwPlatformID;
  212. lpRpcRequest->ProductInfo.dwVersion = lpRequest->pProductInfo->dwVersion;
  213. lpRpcRequest->ProductInfo.cbCompanyName = lpRequest->pProductInfo->cbCompanyName;
  214. lpRpcRequest->ProductInfo.pbCompanyName = lpRequest->pProductInfo->pbCompanyName;
  215. lpRpcRequest->ProductInfo.cbProductID = lpRequest->pProductInfo->cbProductID;
  216. lpRpcRequest->ProductInfo.pbProductID = lpRequest->pProductInfo->pbProductID;
  217. return ERROR_SUCCESS;
  218. }
  219. //----------------------------------------------------------------------------
  220. DWORD WINAPI
  221. TLSReturnLicense(
  222. TLS_HANDLE hHandle,
  223. DWORD dwKeyPackId,
  224. DWORD dwLicenseId,
  225. DWORD dwRetrunReason,
  226. PDWORD pdwErrCode
  227. )
  228. /*++
  229. ++*/
  230. {
  231. return TLSRpcReturnLicense(
  232. hHandle,
  233. dwKeyPackId,
  234. dwLicenseId,
  235. dwRetrunReason,
  236. pdwErrCode
  237. );
  238. }
  239. //----------------------------------------------------------------------------
  240. DWORD WINAPI
  241. TLSGetLSPKCS10CertRequest(
  242. TLS_HANDLE hHandle,
  243. DWORD dwCertType,
  244. PDWORD pcbData,
  245. PBYTE* ppbData,
  246. PDWORD pdwErrCode
  247. )
  248. /*++
  249. ++*/
  250. {
  251. return TLSRpcGetLSPKCS10CertRequest(
  252. hHandle,
  253. dwCertType,
  254. pcbData,
  255. ppbData,
  256. pdwErrCode
  257. );
  258. }
  259. //----------------------------------------------------------------------------
  260. DWORD WINAPI
  261. TLSRequestTermServCert(
  262. TLS_HANDLE hHandle,
  263. LPLSHydraCertRequest pRequest,
  264. PDWORD cbChallengeData,
  265. PBYTE* pbChallengeData,
  266. PDWORD pdwErrCode
  267. )
  268. /*++
  269. ++*/
  270. {
  271. TLSHYDRACERTREQUEST CertRequest;
  272. CertRequest.dwHydraVersion = pRequest->dwHydraVersion;
  273. CertRequest.pbEncryptedHwid = pRequest->pbEncryptedHwid;
  274. CertRequest.cbEncryptedHwid = pRequest->cbEncryptedHwid;
  275. CertRequest.szSubjectRdn = pRequest->szSubjectRdn;
  276. CertRequest.pSubjectPublicKeyInfo = (TLSCERT_PUBLIC_KEY_INFO *)pRequest->SubjectPublicKeyInfo;
  277. CertRequest.dwNumCertExtension = pRequest->dwNumCertExtension;
  278. CertRequest.pCertExtensions = (TLSCERT_EXTENSION *)pRequest->pCertExtensions;
  279. return TLSRpcRequestTermServCert(
  280. hHandle,
  281. &CertRequest,
  282. cbChallengeData,
  283. pbChallengeData,
  284. pdwErrCode
  285. );
  286. }
  287. //----------------------------------------------------------------------------
  288. DWORD WINAPI
  289. TLSRetrieveTermServCert(
  290. TLS_HANDLE hHandle,
  291. DWORD cbResponseData,
  292. PBYTE pbResponseData,
  293. PDWORD pcbCert,
  294. PBYTE* ppbCert,
  295. PDWORD pdwErrCode
  296. )
  297. /*++
  298. ++*/
  299. {
  300. return TLSRpcRetrieveTermServCert(
  301. hHandle,
  302. cbResponseData,
  303. pbResponseData,
  304. pcbCert,
  305. ppbCert,
  306. pdwErrCode
  307. );
  308. }
  309. //----------------------------------------------------------------------------
  310. DWORD WINAPI
  311. TLSInstallCertificate(
  312. TLS_HANDLE hHandle,
  313. DWORD dwCertType,
  314. DWORD dwCertLevel,
  315. DWORD cbSingnatureCert,
  316. PBYTE pbSingnatureCert,
  317. DWORD cbExchangeCert,
  318. PBYTE pbExchangeCert,
  319. PDWORD pdwErrCode
  320. )
  321. /*++
  322. ++*/
  323. {
  324. return TLSRpcInstallCertificate(
  325. hHandle,
  326. dwCertType,
  327. dwCertLevel,
  328. cbSingnatureCert,
  329. pbSingnatureCert,
  330. cbExchangeCert,
  331. pbExchangeCert,
  332. pdwErrCode
  333. );
  334. }
  335. //----------------------------------------------------------------------------
  336. DWORD WINAPI
  337. TLSGetServerCertificate(
  338. TLS_HANDLE hHandle,
  339. BOOL bSignCert,
  340. LPBYTE *ppbCertBlob,
  341. LPDWORD lpdwCertBlobLen,
  342. PDWORD pdwErrCode
  343. )
  344. /*++
  345. ++*/
  346. {
  347. return TLSRpcGetServerCertificate(
  348. hHandle,
  349. bSignCert,
  350. ppbCertBlob,
  351. lpdwCertBlobLen,
  352. pdwErrCode
  353. );
  354. }
  355. //----------------------------------------------------------------------------
  356. DWORD WINAPI
  357. TLSKeyPackAdd(
  358. TLS_HANDLE hHandle,
  359. LPLSKeyPack lpKeypack,
  360. PDWORD pdwErrCode
  361. )
  362. /*++
  363. ++*/
  364. {
  365. return TLSRpcKeyPackAdd(
  366. hHandle,
  367. lpKeypack,
  368. pdwErrCode
  369. );
  370. }
  371. //----------------------------------------------------------------------------
  372. DWORD WINAPI
  373. TLSKeyPackSetStatus(
  374. TLS_HANDLE hHandle,
  375. DWORD dwSetParm,
  376. LPLSKeyPack lpKeyPack,
  377. PDWORD pdwErrCode
  378. )
  379. /*++
  380. ++*/
  381. {
  382. return TLSRpcKeyPackSetStatus(
  383. hHandle,
  384. dwSetParm,
  385. lpKeyPack,
  386. pdwErrCode
  387. );
  388. }
  389. //-----------------------------------------------------------------
  390. DWORD WINAPI
  391. TLSAnnounceServer(
  392. IN TLS_HANDLE hHandle,
  393. IN DWORD dwType,
  394. IN FILETIME* pftTime,
  395. IN LPTSTR pszSetupId,
  396. IN LPTSTR pszDomainName,
  397. IN LPTSTR pszMachineName,
  398. OUT PDWORD pdwErrCode
  399. )
  400. /*++
  401. ++*/
  402. {
  403. return TLSRpcAnnounceServer(
  404. hHandle,
  405. dwType,
  406. pftTime,
  407. pszSetupId,
  408. pszDomainName,
  409. pszMachineName,
  410. pdwErrCode
  411. );
  412. }
  413. //-----------------------------------------------------------------
  414. DWORD WINAPI
  415. TLSLookupServer(
  416. IN TLS_HANDLE hHandle,
  417. IN LPTSTR pszLookupSetupId,
  418. OUT LPTSTR pszLsSetupId,
  419. IN OUT PDWORD pcbSetupId,
  420. OUT LPTSTR pszDomainName,
  421. IN OUT PDWORD pcbDomainName,
  422. IN LPTSTR pszLsName,
  423. IN OUT PDWORD pcbMachineName,
  424. OUT PDWORD pdwErrCode
  425. )
  426. /*++
  427. ++*/
  428. {
  429. return TLSRpcLookupServer(
  430. hHandle,
  431. pszLookupSetupId,
  432. pszLsSetupId,
  433. pcbSetupId,
  434. pszDomainName,
  435. pcbDomainName,
  436. pszLsName,
  437. pcbMachineName,
  438. pdwErrCode
  439. );
  440. }
  441. //-----------------------------------------------------------------
  442. DWORD WINAPI
  443. TLSLookupServerFixed(
  444. IN TLS_HANDLE hHandle,
  445. IN LPTSTR pszLookupSetupId,
  446. OUT LPTSTR *pszLsSetupId,
  447. OUT LPTSTR *pszDomainName,
  448. OUT LPTSTR *pszLsName,
  449. IN OUT PDWORD pdwErrCode
  450. )
  451. /*++
  452. ++*/
  453. {
  454. return TLSRpcLookupServerFixed(
  455. hHandle,
  456. pszLookupSetupId,
  457. pszLsSetupId,
  458. pszDomainName,
  459. pszLsName,
  460. pdwErrCode
  461. );
  462. }
  463. //-------------------------------------------------------
  464. DWORD WINAPI
  465. TLSAnnounceLicensePack(
  466. IN TLS_HANDLE hHandle,
  467. IN PTLSReplRecord pReplRecord,
  468. OUT PDWORD pdwErrCode
  469. )
  470. /*++
  471. ++*/
  472. {
  473. return TLSRpcAnnounceLicensePack(
  474. hHandle,
  475. pReplRecord,
  476. pdwErrCode
  477. );
  478. }
  479. //-------------------------------------------------------
  480. DWORD WINAPI
  481. TLSReturnLicensedProduct(
  482. IN TLS_HANDLE hHandle,
  483. IN PTLSLicenseToBeReturn pClientLicense,
  484. OUT PDWORD pdwErrCode
  485. )
  486. /*++
  487. ++*/
  488. {
  489. return TLSRpcReturnLicensedProduct(
  490. hHandle,
  491. pClientLicense,
  492. pdwErrCode
  493. );
  494. }
  495. //-------------------------------------------------------
  496. DWORD WINAPI
  497. TLSChallengeServer(
  498. IN TLS_HANDLE hHandle,
  499. IN DWORD dwClientType,
  500. IN PTLSCHALLENGEDATA pClientChallenge,
  501. OUT PTLSCHALLENGERESPONSEDATA* ppServerResponse,
  502. OUT PTLSCHALLENGEDATA* ppServerChallenge,
  503. OUT PDWORD pdwErrCode
  504. )
  505. /*++
  506. --*/
  507. {
  508. return TLSRpcChallengeServer(
  509. hHandle,
  510. dwClientType,
  511. pClientChallenge,
  512. ppServerResponse,
  513. ppServerChallenge,
  514. pdwErrCode
  515. );
  516. }
  517. //-------------------------------------------------------
  518. DWORD WINAPI
  519. TLSResponseServerChallenge(
  520. IN TLS_HANDLE hHandle,
  521. IN PTLSCHALLENGERESPONSEDATA pClientResponse,
  522. OUT PDWORD pdwErrCode
  523. )
  524. /*++
  525. --*/
  526. {
  527. return TLSRpcResponseServerChallenge(
  528. hHandle,
  529. pClientResponse,
  530. pdwErrCode
  531. );
  532. }
  533. //------------------------------------------------------
  534. DWORD WINAPI
  535. TLSGetTlsPrivateData(
  536. IN TLS_HANDLE hHandle,
  537. IN DWORD dwGetDataType,
  538. IN PTLSPrivateDataUnion pGetParm,
  539. OUT PDWORD pdwRetDataType,
  540. OUT PTLSPrivateDataUnion* ppRetData,
  541. OUT PDWORD pdwErrCode
  542. )
  543. /*++
  544. --*/
  545. {
  546. return TLSRpcGetTlsPrivateData(
  547. hHandle,
  548. dwGetDataType,
  549. pGetParm,
  550. pdwRetDataType,
  551. ppRetData,
  552. pdwErrCode
  553. );
  554. }
  555. //------------------------------------------------------
  556. DWORD WINAPI
  557. TLSTriggerReGenKey(
  558. IN TLS_HANDLE hHandle,
  559. IN BOOL bKeepSPK,
  560. OUT PDWORD pdwErrCode
  561. )
  562. /*++
  563. --*/
  564. {
  565. return TLSRpcTriggerReGenKey(
  566. hHandle,
  567. bKeepSPK,
  568. pdwErrCode
  569. );
  570. }
  571. //------------------------------------------------------
  572. DWORD
  573. GetPrivateBinaryDataFromServer(
  574. TLS_HANDLE hHandle,
  575. DWORD dwType,
  576. PDWORD pcbData,
  577. PBYTE* ppbData,
  578. PDWORD pdwErrCode
  579. )
  580. /*++
  581. --*/
  582. {
  583. TLSPrivateDataUnion SearchParm;
  584. PTLSPrivateDataUnion pPrivateData = NULL;
  585. DWORD dwRetType;
  586. DWORD dwStatus;
  587. memset(
  588. &SearchParm,
  589. 0,
  590. sizeof(TLSPrivateDataUnion)
  591. );
  592. dwStatus = TLSRpcGetTlsPrivateData(
  593. hHandle,
  594. dwType,
  595. &SearchParm,
  596. &dwRetType,
  597. &pPrivateData,
  598. pdwErrCode
  599. );
  600. if(dwStatus != RPC_S_OK || *pdwErrCode != ERROR_SUCCESS)
  601. {
  602. goto cleanup;
  603. }
  604. if(dwRetType != dwType)
  605. {
  606. //
  607. // License Server error
  608. //
  609. *pdwErrCode = LSERVER_E_INVALID_RETURN;
  610. goto cleanup;
  611. }
  612. //
  613. // Copy over unique ID
  614. //
  615. *ppbData = (PBYTE)MIDL_user_allocate(pPrivateData->BinaryData.cbData);
  616. if(*ppbData != NULL)
  617. {
  618. memset(
  619. *ppbData,
  620. 0,
  621. pPrivateData->BinaryData.cbData
  622. );
  623. *pcbData = pPrivateData->BinaryData.cbData;
  624. memcpy(
  625. *ppbData,
  626. pPrivateData->BinaryData.pbData,
  627. pPrivateData->BinaryData.cbData
  628. );
  629. }
  630. else
  631. {
  632. *pdwErrCode = LSERVER_E_OUTOFMEMORY;
  633. }
  634. cleanup:
  635. if(pPrivateData != NULL)
  636. {
  637. midl_user_free(pPrivateData);
  638. }
  639. return dwStatus;
  640. }
  641. //------------------------------------------------------
  642. DWORD WINAPI
  643. TLSGetServerPID(
  644. TLS_HANDLE hHandle,
  645. PDWORD pcbData,
  646. PBYTE* ppbData,
  647. PDWORD pdwErrCode
  648. )
  649. /*++
  650. --*/
  651. {
  652. return GetPrivateBinaryDataFromServer(
  653. hHandle,
  654. TLS_PRIVATEDATA_PID,
  655. pcbData,
  656. ppbData,
  657. pdwErrCode
  658. );
  659. }
  660. //------------------------------------------------------
  661. DWORD WINAPI
  662. TLSGetServerSPK(
  663. TLS_HANDLE hHandle,
  664. PDWORD pcbData,
  665. PBYTE* ppbData,
  666. PDWORD pdwErrCode
  667. )
  668. /*++
  669. --*/
  670. {
  671. TLSPrivateDataUnion SearchParm;
  672. PTLSPrivateDataUnion pPrivateData = NULL;
  673. DWORD dwRetType;
  674. DWORD dwStatus;
  675. memset(
  676. &SearchParm,
  677. 0,
  678. sizeof(TLSPrivateDataUnion)
  679. );
  680. dwStatus = TLSRpcGetTlsPrivateData(
  681. hHandle,
  682. TLS_PRIVATEDATA_SPK,
  683. &SearchParm,
  684. &dwRetType,
  685. &pPrivateData,
  686. pdwErrCode
  687. );
  688. if(dwStatus != RPC_S_OK || *pdwErrCode != ERROR_SUCCESS)
  689. {
  690. goto cleanup;
  691. }
  692. if(dwRetType != TLS_PRIVATEDATA_SPK)
  693. {
  694. //
  695. // License Server error
  696. //
  697. *pdwErrCode = LSERVER_E_INVALID_RETURN;
  698. goto cleanup;
  699. }
  700. //
  701. // Copy over Server's SPK.
  702. // Server never return CH's cert extension.
  703. //
  704. *ppbData = (PBYTE)MIDL_user_allocate(pPrivateData->SPK.cbSPK);
  705. if(*ppbData != NULL)
  706. {
  707. memset(
  708. *ppbData,
  709. 0,
  710. pPrivateData->SPK.cbSPK
  711. );
  712. *pcbData = pPrivateData->SPK.cbSPK;
  713. memcpy(
  714. *ppbData,
  715. pPrivateData->SPK.pbSPK,
  716. pPrivateData->SPK.cbSPK
  717. );
  718. }
  719. else
  720. {
  721. *pdwErrCode = LSERVER_E_OUTOFMEMORY;
  722. }
  723. cleanup:
  724. if(pPrivateData != NULL)
  725. {
  726. midl_user_free(pPrivateData);
  727. }
  728. return dwStatus;
  729. }
  730. //-----------------------------------------------------------
  731. DWORD WINAPI
  732. TLSDepositeServerSPK(
  733. IN TLS_HANDLE hHandle,
  734. IN DWORD cbSPK,
  735. IN PBYTE pbSPK,
  736. IN PCERT_EXTENSIONS pCertExtensions,
  737. OUT PDWORD pdwErrCode
  738. )
  739. /*++
  740. --*/
  741. {
  742. TLSPrivateDataUnion SetData;
  743. DWORD dwStatus;
  744. SetData.SPK.cbSPK = cbSPK;
  745. SetData.SPK.pbSPK = pbSPK;
  746. SetData.SPK.pCertExtensions = pCertExtensions;
  747. return TLSRpcSetTlsPrivateData(
  748. hHandle,
  749. TLS_PRIVATEDATA_SPK,
  750. &SetData,
  751. pdwErrCode
  752. );
  753. }