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.

105 lines
2.6 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1999
  6. //
  7. // File: altname.h
  8. //
  9. //--------------------------------------------------------------------------
  10. // altname.h: Declaration of the CCertEncodeAltName
  11. #include "resource.h" // main symbols
  12. /////////////////////////////////////////////////////////////////////////////
  13. // certenc
  14. #define wszCLASS_CERTENCODEALTNAME wszCLASS_CERTENCODE TEXT("AltName")
  15. class CCertEncodeAltName:
  16. public IDispatchImpl<ICertEncodeAltName, &IID_ICertEncodeAltName, &LIBID_CERTENCODELib>,
  17. public ISupportErrorInfoImpl<&IID_ICertEncodeAltName>,
  18. public CComObjectRoot,
  19. public CComCoClass<CCertEncodeAltName, &CLSID_CCertEncodeAltName>
  20. {
  21. public:
  22. CCertEncodeAltName();
  23. ~CCertEncodeAltName();
  24. BEGIN_COM_MAP(CCertEncodeAltName)
  25. COM_INTERFACE_ENTRY(IDispatch)
  26. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  27. COM_INTERFACE_ENTRY(ICertEncodeAltName)
  28. END_COM_MAP()
  29. DECLARE_NOT_AGGREGATABLE(CCertEncodeAltName)
  30. // Remove the comment from the line above if you don't want your object to
  31. // support aggregation. The default is to support it
  32. DECLARE_REGISTRY(
  33. CCertEncodeAltName,
  34. wszCLASS_CERTENCODEALTNAME TEXT(".1"),
  35. wszCLASS_CERTENCODEALTNAME,
  36. IDS_CERTENCODEALTNAME_DESC,
  37. THREADFLAGS_BOTH)
  38. // ICertEncodeAltName
  39. public:
  40. STDMETHOD(Decode)(
  41. /* [in] */ BSTR const strBinary);
  42. STDMETHOD(GetNameCount)(
  43. /* [out, retval] */ LONG __RPC_FAR *pNameCount);
  44. STDMETHOD(GetNameChoice)(
  45. /* [in] */ LONG NameIndex,
  46. /* [out, retval] */ LONG __RPC_FAR *pNameChoice);
  47. STDMETHOD(GetName)(
  48. /* [in] */ LONG NameIndex, // NameIndex | EAN_*
  49. /* [out, retval] */ BSTR __RPC_FAR *pstrName);
  50. STDMETHOD(Reset)(
  51. /* [in] */ LONG NameCount);
  52. STDMETHOD(SetNameEntry)(
  53. /* [in] */ LONG NameIndex, // NameIndex | EAN_*
  54. /* [in] */ LONG NameChoice,
  55. /* [in] */ BSTR const strName);
  56. STDMETHOD(Encode)(
  57. /* [out, retval] */ BSTR *pstrBinary);
  58. private:
  59. VOID _Cleanup(VOID);
  60. BOOL _VerifyName(
  61. IN LONG NameIndex);
  62. HRESULT _MapName(
  63. IN BOOL fEncode,
  64. IN LONG NameIndex,
  65. OUT CERT_ALT_NAME_ENTRY **ppName);
  66. HRESULT _SetErrorInfo(
  67. IN HRESULT hrError,
  68. IN WCHAR const *pwszDescription);
  69. typedef enum _enumNameType {
  70. enumUnknown = 0,
  71. enumUnicode,
  72. enumAnsi,
  73. enumBlob,
  74. enumOther,
  75. } enumNameType;
  76. enumNameType _NameType(
  77. IN DWORD NameChoice);
  78. CERT_ALT_NAME_ENTRY *m_aValue;
  79. LONG m_cValue;
  80. CERT_ALT_NAME_INFO *m_DecodeInfo;
  81. DWORD m_DecodeLength;
  82. BOOL m_fConstructing;
  83. };