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.

75 lines
2.0 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1999
  6. //
  7. // File: bitstr.h
  8. //
  9. //--------------------------------------------------------------------------
  10. // bitstr.h: Declaration of the CCertEncodeBitString
  11. #include "resource.h" // main symbols
  12. /////////////////////////////////////////////////////////////////////////////
  13. // certenc
  14. #define wszCLASS_CERTENCODEBITSTRING wszCLASS_CERTENCODE TEXT("BitString")
  15. class CCertEncodeBitString:
  16. public IDispatchImpl<ICertEncodeBitString, &IID_ICertEncodeBitString, &LIBID_CERTENCODELib>,
  17. public ISupportErrorInfoImpl<&IID_ICertEncodeBitString>,
  18. public CComObjectRoot,
  19. public CComCoClass<CCertEncodeBitString, &CLSID_CCertEncodeBitString>
  20. {
  21. public:
  22. CCertEncodeBitString()
  23. {
  24. m_DecodeInfo = NULL;
  25. }
  26. ~CCertEncodeBitString();
  27. BEGIN_COM_MAP(CCertEncodeBitString)
  28. COM_INTERFACE_ENTRY(IDispatch)
  29. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  30. COM_INTERFACE_ENTRY(ICertEncodeBitString)
  31. END_COM_MAP()
  32. DECLARE_NOT_AGGREGATABLE(CCertEncodeBitString)
  33. // Remove the comment from the line above if you don't want your object to
  34. // support aggregation. The default is to support it
  35. DECLARE_REGISTRY(
  36. CCertEncodeBitString,
  37. wszCLASS_CERTENCODEBITSTRING TEXT(".1"),
  38. wszCLASS_CERTENCODEBITSTRING,
  39. IDS_CERTENCODEBITSTRING_DESC,
  40. THREADFLAGS_BOTH)
  41. // ICertEncodeBitString
  42. public:
  43. STDMETHOD(Decode)(
  44. /* [in] */ BSTR const strBinary);
  45. STDMETHOD(GetBitCount)(
  46. /* [out, retval] */ LONG __RPC_FAR *pBitCount);
  47. STDMETHOD(GetBitString)(
  48. /* [out, retval] */ BSTR __RPC_FAR *pstrBitString);
  49. STDMETHOD(Encode)(
  50. /* [in] */ LONG BitCount,
  51. /* [in] */ BSTR strBitString,
  52. /* [out, retval] */ BSTR *pstrBinary);
  53. private:
  54. VOID _Cleanup(VOID);
  55. HRESULT _SetErrorInfo(
  56. IN HRESULT hrError,
  57. IN WCHAR const *pwszDescription);
  58. LONG m_cBits;
  59. CRYPT_BIT_BLOB *m_DecodeInfo;
  60. };