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.

844 lines
17 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1995 - 1999
  6. //
  7. // File: request.cpp
  8. //
  9. // Contents: ICertRequest IDispatch helper functions
  10. //
  11. //--------------------------------------------------------------------------
  12. #include <pch.cpp>
  13. #pragma hdrstop
  14. #include <stdlib.h>
  15. #include "csdisp.h"
  16. //+------------------------------------------------------------------------
  17. // ICertRequest dispatch support
  18. //TCHAR szRegKeyRequestClsid[] = wszCLASS_CERTREQUEST TEXT("\\Clsid");
  19. //+------------------------------------
  20. // Submit method:
  21. static OLECHAR *_apszSubmit[] = {
  22. TEXT("Submit"),
  23. TEXT("Flags"),
  24. TEXT("strRequest"),
  25. TEXT("strAttributes"),
  26. TEXT("strConfig"),
  27. };
  28. //+------------------------------------
  29. // RetrievePending method:
  30. static OLECHAR *_apszRetrievePending[] = {
  31. TEXT("RetrievePending"),
  32. TEXT("RequestId"),
  33. TEXT("strConfig"),
  34. };
  35. //+------------------------------------
  36. // GetLastStatus method:
  37. static OLECHAR *_apszGetLastStatus[] = {
  38. TEXT("GetLastStatus"),
  39. };
  40. //+------------------------------------
  41. // GetRequestId method:
  42. static OLECHAR *_apszGetRequestId[] = {
  43. TEXT("GetRequestId"),
  44. };
  45. //+------------------------------------
  46. // GetDispositionMessage method:
  47. static OLECHAR *_apszGetDispositionMessage[] = {
  48. TEXT("GetDispositionMessage"),
  49. };
  50. //+------------------------------------
  51. // GetCACertificate method:
  52. static OLECHAR *_apszGetCACertificate[] = {
  53. TEXT("GetCACertificate"),
  54. TEXT("fExchangeCertificate"),
  55. TEXT("strConfig"),
  56. TEXT("Flags"),
  57. };
  58. //+------------------------------------
  59. // GetCertificate method:
  60. static OLECHAR *_apszGetCertificate[] = {
  61. TEXT("GetCertificate"),
  62. TEXT("Flags"),
  63. };
  64. //+------------------------------------
  65. // GetIssuedCertificate method:
  66. static OLECHAR *_apszGetIssuedCertificate[] = {
  67. TEXT("GetIssuedCertificate"),
  68. TEXT("strConfig"),
  69. TEXT("RequestId"),
  70. TEXT("strSerialNumber"),
  71. };
  72. //+------------------------------------
  73. // GetErrorMessageText method:
  74. static OLECHAR *_apszGetErrorMessageText[] = {
  75. TEXT("GetErrorMessageText"),
  76. TEXT("hrMessage"),
  77. TEXT("Flags"),
  78. };
  79. //+------------------------------------
  80. // GetCAProperty method:
  81. static OLECHAR *_apszGetCAProperty[] = {
  82. TEXT("GetCAProperty"),
  83. TEXT("strConfig"),
  84. TEXT("PropId"),
  85. TEXT("PropIndex"),
  86. TEXT("PropType"),
  87. TEXT("Flags"),
  88. };
  89. //+------------------------------------
  90. // GetCAPropertyFlags method:
  91. static OLECHAR *_apszGetCAPropertyFlags[] = {
  92. TEXT("GetCAPropertyFlags"),
  93. TEXT("strConfig"),
  94. TEXT("PropId"),
  95. };
  96. //+------------------------------------
  97. // GetCAPropertyDisplayName method:
  98. static OLECHAR *_apszGetCAPropertyDisplayName[] = {
  99. TEXT("GetCAPropertyDisplayName"),
  100. TEXT("strConfig"),
  101. TEXT("PropId"),
  102. };
  103. //+------------------------------------
  104. // GetFullResponseProperty method:
  105. static OLECHAR *_apszGetFullResponseProperty[] = {
  106. TEXT("GetFullResponseProperty"),
  107. TEXT("PropId"),
  108. TEXT("PropIndex"),
  109. TEXT("PropType"),
  110. TEXT("Flags"),
  111. };
  112. //+------------------------------------
  113. // Dispatch Table:
  114. DISPATCHTABLE s_adtRequest[] =
  115. {
  116. #define REQUEST_SUBMIT 0
  117. DECLARE_DISPATCH_ENTRY(_apszSubmit)
  118. #define REQUEST_RETRIEVEPENDING 1
  119. DECLARE_DISPATCH_ENTRY(_apszRetrievePending)
  120. #define REQUEST_GETLASTSTATUS 2
  121. DECLARE_DISPATCH_ENTRY(_apszGetLastStatus)
  122. #define REQUEST_GETREQUESTID 3
  123. DECLARE_DISPATCH_ENTRY(_apszGetRequestId)
  124. #define REQUEST_GETDISPOSITIONMESSAGE 4
  125. DECLARE_DISPATCH_ENTRY(_apszGetDispositionMessage)
  126. #define REQUEST_GETCACERTIFICATE 5
  127. DECLARE_DISPATCH_ENTRY(_apszGetCACertificate)
  128. #define REQUEST_GETCERTIFICATE 6
  129. DECLARE_DISPATCH_ENTRY(_apszGetCertificate)
  130. #define REQUEST2_GETISSUEDCERTIFICATE 7
  131. DECLARE_DISPATCH_ENTRY(_apszGetIssuedCertificate)
  132. #define REQUEST2_GETERRORMESSAGETEXT 8
  133. DECLARE_DISPATCH_ENTRY(_apszGetErrorMessageText)
  134. #define REQUEST2_GETCAPROPERTY 9
  135. DECLARE_DISPATCH_ENTRY(_apszGetCAProperty)
  136. #define REQUEST2_GETCAPROPERTYFLAGS 10
  137. DECLARE_DISPATCH_ENTRY(_apszGetCAPropertyFlags)
  138. #define REQUEST2_GETCAPROPERTYDISPLAYNAME 11
  139. DECLARE_DISPATCH_ENTRY(_apszGetCAPropertyDisplayName)
  140. #define REQUEST2_GETFULLRESPONSEPROPERTY 12
  141. DECLARE_DISPATCH_ENTRY(_apszGetFullResponseProperty)
  142. };
  143. #define CREQUESTDISPATCH (ARRAYSIZE(s_adtRequest))
  144. #define CREQUESTDISPATCH_V1 REQUEST2_GETISSUEDCERTIFICATE
  145. #define CREQUESTDISPATCH_V2 CREQUESTDISPATCH
  146. DWORD s_acRequestDispatch[] = {
  147. CREQUESTDISPATCH_V2,
  148. CREQUESTDISPATCH_V1,
  149. };
  150. IID const *s_apRequestiid[] = {
  151. &IID_ICertRequest2,
  152. &IID_ICertRequest,
  153. };
  154. HRESULT
  155. Request_Init(
  156. IN DWORD Flags,
  157. OUT DISPATCHINTERFACE *pdiRequest)
  158. {
  159. HRESULT hr;
  160. hr = DispatchSetup2(
  161. Flags,
  162. CLSCTX_INPROC_SERVER,
  163. wszCLASS_CERTREQUEST,
  164. &CLSID_CCertRequest,
  165. ARRAYSIZE(s_acRequestDispatch), // cver
  166. s_apRequestiid,
  167. s_acRequestDispatch,
  168. s_adtRequest,
  169. pdiRequest);
  170. _JumpIfError(hr, error, "DispatchSetup2(ICertRequest)");
  171. error:
  172. return(hr);
  173. }
  174. VOID
  175. Request_Release(
  176. IN OUT DISPATCHINTERFACE *pdiRequest)
  177. {
  178. DispatchRelease(pdiRequest);
  179. }
  180. HRESULT
  181. RequestVerifyVersion(
  182. IN DISPATCHINTERFACE *pdiRequest,
  183. IN DWORD RequiredVersion)
  184. {
  185. HRESULT hr;
  186. CSASSERT(NULL != pdiRequest && NULL != pdiRequest->pDispatchTable);
  187. switch (pdiRequest->m_dwVersion)
  188. {
  189. case 1:
  190. CSASSERT(
  191. NULL == pdiRequest->pDispatch ||
  192. CREQUESTDISPATCH_V1 == pdiRequest->m_cDispatchTable);
  193. break;
  194. case 2:
  195. CSASSERT(
  196. NULL == pdiRequest->pDispatch ||
  197. CREQUESTDISPATCH_V2 == pdiRequest->m_cDispatchTable);
  198. break;
  199. default:
  200. hr = HRESULT_FROM_WIN32(ERROR_INTERNAL_ERROR);
  201. _JumpError(hr, error, "m_dwVersion");
  202. }
  203. if (pdiRequest->m_dwVersion < RequiredVersion)
  204. {
  205. hr = E_NOTIMPL;
  206. _JumpError(hr, error, "old interface");
  207. }
  208. hr = S_OK;
  209. error:
  210. return(hr);
  211. }
  212. HRESULT
  213. Request_Submit(
  214. IN DISPATCHINTERFACE *pdiRequest,
  215. IN LONG Flags,
  216. IN WCHAR const *pwszRequest,
  217. IN DWORD cbRequest,
  218. IN WCHAR const *pwszAttributes,
  219. IN WCHAR const *pwszConfig,
  220. OUT LONG *pDisposition)
  221. {
  222. HRESULT hr;
  223. BSTR strRequest = NULL;
  224. BSTR strAttributes = NULL;
  225. BSTR strConfig = NULL;
  226. CSASSERT(NULL != pdiRequest && NULL != pdiRequest->pDispatchTable);
  227. if (NULL == pwszRequest || NULL == pwszConfig)
  228. {
  229. hr = E_INVALIDARG;
  230. _JumpError(hr, error, "NULL parm");
  231. }
  232. hr = E_OUTOFMEMORY;
  233. if (!ConvertWszToBstr(&strRequest, pwszRequest, cbRequest))
  234. {
  235. _JumpError(hr, error, "ConvertWszToBstr");
  236. }
  237. if (!ConvertWszToBstr(&strAttributes, pwszAttributes, -1))
  238. {
  239. _JumpError(hr, error, "ConvertWszToBstr");
  240. }
  241. if (!ConvertWszToBstr(&strConfig, pwszConfig, -1))
  242. {
  243. _JumpError(hr, error, "ConvertWszToBstr");
  244. }
  245. if (NULL != pdiRequest->pDispatch)
  246. {
  247. VARIANT avar[4];
  248. avar[0].vt = VT_I4;
  249. avar[0].lVal = Flags;
  250. avar[1].vt = VT_BSTR;
  251. avar[1].bstrVal = strRequest;
  252. avar[2].vt = VT_BSTR;
  253. avar[2].bstrVal = strAttributes;
  254. avar[3].vt = VT_BSTR;
  255. avar[3].bstrVal = strConfig;
  256. hr = DispatchInvoke(
  257. pdiRequest,
  258. REQUEST_SUBMIT,
  259. ARRAYSIZE(avar),
  260. avar,
  261. VT_I4,
  262. pDisposition);
  263. _JumpIfError(hr, error, "Invoke(Submit)");
  264. }
  265. else
  266. {
  267. hr = ((ICertRequest *) pdiRequest->pUnknown)->Submit(
  268. Flags,
  269. strRequest,
  270. strAttributes,
  271. strConfig,
  272. pDisposition);
  273. _JumpIfError2(
  274. hr,
  275. error,
  276. "ICertRequest::Submit",
  277. HRESULT_FROM_WIN32(ERROR_INVALID_DATA));
  278. }
  279. error:
  280. if (NULL != strRequest)
  281. {
  282. SysFreeString(strRequest);
  283. }
  284. if (NULL != strAttributes)
  285. {
  286. SysFreeString(strAttributes);
  287. }
  288. if (NULL != strConfig)
  289. {
  290. SysFreeString(strConfig);
  291. }
  292. return(hr);
  293. }
  294. HRESULT
  295. Request_RetrievePending(
  296. IN DISPATCHINTERFACE *pdiRequest,
  297. IN LONG RequestId,
  298. IN WCHAR const *pwszConfig,
  299. OUT LONG *pDisposition)
  300. {
  301. HRESULT hr;
  302. BSTR strConfig = NULL;
  303. CSASSERT(NULL != pdiRequest && NULL != pdiRequest->pDispatchTable);
  304. if (!ConvertWszToBstr(&strConfig, pwszConfig, -1))
  305. {
  306. hr = E_OUTOFMEMORY;
  307. _JumpError(hr, error, "ConvertWszToBstr");
  308. }
  309. if (NULL != pdiRequest->pDispatch)
  310. {
  311. VARIANT avar[2];
  312. avar[0].vt = VT_I4;
  313. avar[0].lVal = RequestId;
  314. avar[1].vt = VT_BSTR;
  315. avar[1].bstrVal = strConfig;
  316. hr = DispatchInvoke(
  317. pdiRequest,
  318. REQUEST_RETRIEVEPENDING,
  319. ARRAYSIZE(avar),
  320. avar,
  321. VT_I4,
  322. pDisposition);
  323. _JumpIfError(hr, error, "Invoke(RetrievePending)");
  324. }
  325. else
  326. {
  327. hr = ((ICertRequest *) pdiRequest->pUnknown)->RetrievePending(
  328. RequestId,
  329. strConfig,
  330. pDisposition);
  331. _JumpIfError(hr, error, "ICertRequest::RetrievePending");
  332. }
  333. error:
  334. if (NULL != strConfig)
  335. {
  336. SysFreeString(strConfig);
  337. }
  338. return(hr);
  339. }
  340. HRESULT
  341. Request_GetLastStatus(
  342. IN DISPATCHINTERFACE *pdiRequest,
  343. OUT LONG *pLastStatus)
  344. {
  345. HRESULT hr;
  346. CSASSERT(NULL != pdiRequest && NULL != pdiRequest->pDispatchTable);
  347. if (NULL != pdiRequest->pDispatch)
  348. {
  349. hr = DispatchInvoke(
  350. pdiRequest,
  351. REQUEST_GETLASTSTATUS,
  352. 0,
  353. NULL,
  354. VT_I4,
  355. pLastStatus);
  356. _JumpIfError(hr, error, "Invoke(GetLastStatus)");
  357. }
  358. else
  359. {
  360. hr = ((ICertRequest *) pdiRequest->pUnknown)->GetLastStatus(
  361. pLastStatus);
  362. _JumpIfError(hr, error, "ICertRequest::GetLastStatus");
  363. }
  364. error:
  365. return(hr);
  366. }
  367. HRESULT
  368. Request_GetRequestId(
  369. IN DISPATCHINTERFACE *pdiRequest,
  370. OUT LONG *pRequestId)
  371. {
  372. HRESULT hr;
  373. CSASSERT(NULL != pdiRequest && NULL != pdiRequest->pDispatchTable);
  374. if (NULL != pdiRequest->pDispatch)
  375. {
  376. hr = DispatchInvoke(
  377. pdiRequest,
  378. REQUEST_GETREQUESTID,
  379. 0,
  380. NULL,
  381. VT_I4,
  382. pRequestId);
  383. _JumpIfError(hr, error, "Invoke(GetRequestId)");
  384. }
  385. else
  386. {
  387. hr = ((ICertRequest *) pdiRequest->pUnknown)->GetRequestId(pRequestId);
  388. _JumpIfError(hr, error, "ICertRequest::GetRequestId");
  389. }
  390. error:
  391. return(hr);
  392. }
  393. HRESULT
  394. Request_GetDispositionMessage(
  395. IN DISPATCHINTERFACE *pdiRequest,
  396. OUT BSTR *pstrMessage)
  397. {
  398. HRESULT hr;
  399. CSASSERT(NULL != pdiRequest && NULL != pdiRequest->pDispatchTable);
  400. if (NULL != pdiRequest->pDispatch)
  401. {
  402. hr = DispatchInvoke(
  403. pdiRequest,
  404. REQUEST_GETDISPOSITIONMESSAGE,
  405. 0,
  406. NULL,
  407. VT_BSTR,
  408. pstrMessage);
  409. _JumpIfError(hr, error, "Invoke(GetDispositionMessage)");
  410. }
  411. else
  412. {
  413. hr = ((ICertRequest *) pdiRequest->pUnknown)->GetDispositionMessage(
  414. pstrMessage);
  415. _JumpIfError(hr, error, "ICertRequest::GetDispositionMessage");
  416. }
  417. error:
  418. return(hr);
  419. }
  420. HRESULT
  421. Request_GetCertificate(
  422. IN DISPATCHINTERFACE *pdiRequest,
  423. IN DWORD Flags,
  424. OUT BSTR *pstrCert)
  425. {
  426. HRESULT hr;
  427. CSASSERT(NULL != pdiRequest && NULL != pdiRequest->pDispatchTable);
  428. if (NULL != pdiRequest->pDispatch)
  429. {
  430. VARIANT avar[1];
  431. avar[0].vt = VT_I4;
  432. avar[0].lVal = Flags;
  433. hr = DispatchInvoke(
  434. pdiRequest,
  435. REQUEST_GETCERTIFICATE,
  436. ARRAYSIZE(avar),
  437. avar,
  438. VT_BSTR,
  439. pstrCert);
  440. _JumpIfError(hr, error, "Invoke(GetCertificate)");
  441. }
  442. else
  443. {
  444. hr = ((ICertRequest *) pdiRequest->pUnknown)->GetCertificate(
  445. Flags,
  446. pstrCert);
  447. _JumpIfError(hr, error, "ICertRequest::GetCertificate");
  448. }
  449. error:
  450. return(hr);
  451. }
  452. HRESULT
  453. Request_GetCACertificate(
  454. IN DISPATCHINTERFACE *pdiRequest,
  455. IN LONG fExchangeCertificate,
  456. IN WCHAR const *pwszConfig,
  457. IN DWORD Flags,
  458. OUT BSTR *pstrCert)
  459. {
  460. HRESULT hr;
  461. BSTR strConfig = NULL;
  462. CSASSERT(NULL != pdiRequest && NULL != pdiRequest->pDispatchTable);
  463. if (!ConvertWszToBstr(&strConfig, pwszConfig, -1))
  464. {
  465. hr = E_OUTOFMEMORY;
  466. _JumpError(hr, error, "ConvertWszToBstr");
  467. }
  468. if (NULL != pdiRequest->pDispatch)
  469. {
  470. VARIANT avar[3];
  471. avar[0].vt = VT_I4;
  472. avar[0].lVal = fExchangeCertificate;
  473. avar[1].vt = VT_BSTR;
  474. avar[1].bstrVal = strConfig;
  475. avar[2].vt = VT_I4;
  476. avar[2].lVal = Flags;
  477. hr = DispatchInvoke(
  478. pdiRequest,
  479. REQUEST_GETCACERTIFICATE,
  480. ARRAYSIZE(avar),
  481. avar,
  482. VT_BSTR,
  483. pstrCert);
  484. _JumpIfError(hr, error, "Invoke(GetCACertificate)");
  485. }
  486. else
  487. {
  488. hr = ((ICertRequest *) pdiRequest->pUnknown)->GetCACertificate(
  489. fExchangeCertificate,
  490. strConfig,
  491. Flags,
  492. pstrCert);
  493. _JumpIfError2(
  494. hr,
  495. error,
  496. "ICertRequest::GetCACertificate",
  497. HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND));
  498. }
  499. error:
  500. if (NULL != strConfig)
  501. {
  502. SysFreeString(strConfig);
  503. }
  504. return(hr);
  505. }
  506. HRESULT
  507. Request2_GetIssuedCertificate(
  508. IN DISPATCHINTERFACE *pdiRequest,
  509. IN WCHAR const *pwszConfig,
  510. IN LONG RequestId,
  511. IN WCHAR const *pwszSerialNumber,
  512. OUT LONG *pDisposition)
  513. {
  514. HRESULT hr;
  515. BSTR strConfig = NULL;
  516. BSTR strSerialNumber = NULL;
  517. CSASSERT(NULL != pdiRequest && NULL != pdiRequest->pDispatchTable);
  518. hr = RequestVerifyVersion(pdiRequest, 2);
  519. _JumpIfError(hr, error, "RequestVerifyVersion");
  520. hr = E_OUTOFMEMORY;
  521. if (!ConvertWszToBstr(&strConfig, pwszConfig, -1))
  522. {
  523. _JumpError(hr, error, "ConvertWszToBstr");
  524. }
  525. if (NULL != pwszSerialNumber &&
  526. !ConvertWszToBstr(&strSerialNumber, pwszSerialNumber, -1))
  527. {
  528. _JumpError(hr, error, "ConvertWszToBstr");
  529. }
  530. if (NULL != pdiRequest->pDispatch)
  531. {
  532. VARIANT avar[3];
  533. avar[0].vt = VT_BSTR;
  534. avar[0].bstrVal = strConfig;
  535. avar[1].vt = VT_I4;
  536. avar[1].lVal = RequestId;
  537. avar[2].vt = VT_BSTR;
  538. avar[2].bstrVal = strSerialNumber;
  539. hr = DispatchInvoke(
  540. pdiRequest,
  541. REQUEST2_GETISSUEDCERTIFICATE,
  542. ARRAYSIZE(avar),
  543. avar,
  544. VT_I4,
  545. pDisposition);
  546. _JumpIfError(hr, error, "Invoke(GetIssuedCertificate)");
  547. }
  548. else
  549. {
  550. hr = ((ICertRequest2 *) pdiRequest->pUnknown)->GetIssuedCertificate(
  551. strConfig,
  552. RequestId,
  553. strSerialNumber,
  554. pDisposition);
  555. _JumpIfError(hr, error, "ICertRequest2::GetIssuedCertificate");
  556. }
  557. error:
  558. if (NULL != strConfig)
  559. {
  560. SysFreeString(strConfig);
  561. }
  562. if (NULL != strSerialNumber)
  563. {
  564. SysFreeString(strSerialNumber);
  565. }
  566. return(hr);
  567. }
  568. HRESULT
  569. Request2_GetErrorMessageText(
  570. IN DISPATCHINTERFACE *pdiRequest,
  571. IN LONG hrMessage,
  572. IN LONG Flags,
  573. OUT BSTR *pstrErrorMessageText)
  574. {
  575. HRESULT hr;
  576. CSASSERT(NULL != pdiRequest && NULL != pdiRequest->pDispatchTable);
  577. hr = RequestVerifyVersion(pdiRequest, 2);
  578. _JumpIfError(hr, error, "RequestVerifyVersion");
  579. if (NULL != pdiRequest->pDispatch)
  580. {
  581. VARIANT avar[2];
  582. avar[0].vt = VT_I4;
  583. avar[0].lVal = hrMessage;
  584. avar[1].vt = VT_I4;
  585. avar[1].lVal = Flags;
  586. hr = DispatchInvoke(
  587. pdiRequest,
  588. REQUEST2_GETERRORMESSAGETEXT,
  589. ARRAYSIZE(avar),
  590. avar,
  591. VT_BSTR,
  592. pstrErrorMessageText);
  593. _JumpIfError(hr, error, "Invoke(GetErrorMessageText)");
  594. }
  595. else
  596. {
  597. hr = ((ICertRequest2 *) pdiRequest->pUnknown)->GetErrorMessageText(
  598. hrMessage,
  599. Flags,
  600. pstrErrorMessageText);
  601. _JumpIfError(hr, error, "ICertRequest2::GetErrorMessageText");
  602. }
  603. error:
  604. return(hr);
  605. }
  606. HRESULT
  607. Request2_GetFullResponseProperty(
  608. IN DISPATCHINTERFACE *pdiRequest,
  609. IN LONG PropId,
  610. IN LONG PropIndex,
  611. IN LONG PropType,
  612. IN LONG Flags, // CR_OUT_*
  613. OUT VOID *pPropertyValue)
  614. {
  615. HRESULT hr;
  616. LONG RetType;
  617. VARIANT varResult;
  618. VariantInit(&varResult);
  619. CSASSERT(NULL != pdiRequest && NULL != pdiRequest->pDispatchTable);
  620. switch (PropType)
  621. {
  622. case PROPTYPE_BINARY:
  623. case PROPTYPE_STRING:
  624. RetType = VT_BSTR;
  625. break;
  626. case PROPTYPE_DATE:
  627. RetType = VT_DATE;
  628. break;
  629. case PROPTYPE_LONG:
  630. RetType = VT_I4;
  631. break;
  632. default:
  633. hr = E_INVALIDARG;
  634. _JumpError(hr, error, "PropType");
  635. }
  636. if (NULL != pdiRequest->pDispatch)
  637. {
  638. VARIANT avar[4];
  639. avar[0].vt = VT_I4;
  640. avar[0].lVal = PropId;
  641. avar[1].vt = VT_I4;
  642. avar[1].lVal = PropIndex;
  643. avar[2].vt = VT_I4;
  644. avar[2].lVal = PropType;
  645. avar[3].vt = VT_I4;
  646. avar[3].lVal = Flags;
  647. hr = DispatchInvoke(
  648. pdiRequest,
  649. REQUEST2_GETFULLRESPONSEPROPERTY,
  650. ARRAYSIZE(avar),
  651. avar,
  652. RetType,
  653. pPropertyValue);
  654. if (S_OK != hr)
  655. {
  656. DBGPRINT((
  657. DBG_SS_CERTLIB,
  658. "GetFullResponseProperty: PropId=%x Index=%x Type=%x Flags=%x\n",
  659. PropId,
  660. PropIndex,
  661. PropType,
  662. Flags));
  663. }
  664. _JumpIfError2(
  665. hr,
  666. error,
  667. "GetFullResponseProperty",
  668. CERTSRV_E_PROPERTY_EMPTY);
  669. }
  670. else
  671. {
  672. hr = ((ICertRequest2 *) pdiRequest->pUnknown)->GetFullResponseProperty(
  673. PropId,
  674. PropIndex,
  675. PropType,
  676. Flags,
  677. &varResult);
  678. _JumpIfError2(
  679. hr,
  680. error,
  681. "ICertRequest2::GetFullResponseProperty",
  682. CERTSRV_E_PROPERTY_EMPTY);
  683. hr = DispatchGetReturnValue(&varResult, RetType, pPropertyValue);
  684. _JumpIfError(hr, error, "DispatchGetReturnValue");
  685. }
  686. error:
  687. VariantClear(&varResult);
  688. return(hr);
  689. }
  690. #define CCERTREQUEST
  691. #include "prop2.cpp"