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.

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