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.

109 lines
3.3 KiB

  1. /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. Microsoft Windows
  3. Copyright (C) Microsoft Corporation, 1995 - 1999.
  4. File: CertificatePolicies.h
  5. Content: Declaration of CCertificatePolicies.
  6. History: 11-17-2001 dsie created
  7. ------------------------------------------------------------------------------*/
  8. #ifndef __CERTIFICATEPOLICIES_H_
  9. #define __CERTIFICATEPOLICIES_H_
  10. #include "Resource.h"
  11. #include "Debug.h"
  12. #include "CopyItem.h"
  13. #include "CertificatePolicies.h"
  14. #include "PolicyInformation.h"
  15. //
  16. // typdefs to make life easier.
  17. //
  18. typedef std::map<CComBSTR, CComPtr<IPolicyInformation> > PolicyInformationMap;
  19. typedef CComEnumOnSTL<IEnumVARIANT, &IID_IEnumVARIANT, VARIANT, _CopyMapItem<IPolicyInformation>, PolicyInformationMap> PolicyInformationEnum;
  20. typedef ICollectionOnSTLImpl<ICertificatePolicies, PolicyInformationMap, VARIANT, _CopyMapItem<IPolicyInformation>, PolicyInformationEnum> ICertificatePoliciesCollection;
  21. ////////////////////////////////////////////////////////////////////////////////
  22. //
  23. // Exported functions.
  24. //
  25. /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  26. Function : CreateCertificatePoliciesObject
  27. Synopsis : Create a CertificatePolicies collection object and populate the
  28. collection with policy information from the specified certificate
  29. policies.
  30. Parameter: LPSTR pszOid - OID string.
  31. CRYPT_DATA_BLOB * pEncodedBlob - Pointer to encoded data blob.
  32. IDispatch ** ppICertificatePolicies - Pointer to pointer
  33. IDispatch to recieve the
  34. interface pointer.
  35. Remark :
  36. ------------------------------------------------------------------------------*/
  37. HRESULT CreateCertificatePoliciesObject (LPSTR pszOid,
  38. CRYPT_DATA_BLOB * pEncodedBlob,
  39. IDispatch ** ppICertificatePolicies);
  40. ////////////////////////////////////////////////////////////////////////////////
  41. //
  42. // CCertificatePolicies
  43. //
  44. class ATL_NO_VTABLE CCertificatePolicies :
  45. public CComObjectRootEx<CComMultiThreadModel>,
  46. public CComCoClass<CCertificatePolicies, &CLSID_CertificatePolicies>,
  47. public ICAPICOMError<CCertificatePolicies, &IID_ICertificatePolicies>,
  48. public IDispatchImpl<ICertificatePoliciesCollection, &IID_ICertificatePolicies, &LIBID_CAPICOM,
  49. CAPICOM_MAJOR_VERSION, CAPICOM_MINOR_VERSION>
  50. {
  51. public:
  52. CCertificatePolicies()
  53. {
  54. }
  55. DECLARE_NO_REGISTRY()
  56. DECLARE_GET_CONTROLLING_UNKNOWN()
  57. DECLARE_PROTECT_FINAL_CONSTRUCT()
  58. BEGIN_COM_MAP(CCertificatePolicies)
  59. COM_INTERFACE_ENTRY(ICertificatePolicies)
  60. COM_INTERFACE_ENTRY(IDispatch)
  61. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  62. END_COM_MAP()
  63. BEGIN_CATEGORY_MAP(CCertificatePolicies)
  64. END_CATEGORY_MAP()
  65. //
  66. // ICertificatePolicies
  67. //
  68. public:
  69. //
  70. // These are the only ones that we need to implemented, others will be
  71. // handled by ATL ICollectionOnSTLImpl.
  72. //
  73. //
  74. // None COM functions.
  75. //
  76. STDMETHOD(Init)
  77. (LPSTR pszOid, CRYPT_DATA_BLOB * pEncodedBlob);
  78. };
  79. #endif //__CERTIFICATEPOLICIES_H_