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.

63 lines
1.4 KiB

  1. // CoMD5.h : Declaration of the CCoMD5
  2. #ifndef __COMD5_H_
  3. #define __COMD5_H_
  4. #include "resource.h" // main symbols
  5. #include "passportservice.h"
  6. /////////////////////////////////////////////////////////////////////////////
  7. // CCoMD5
  8. class ATL_NO_VTABLE CCoMD5 :
  9. public CComObjectRootEx<CComMultiThreadModel>,
  10. public CComCoClass<CCoMD5, &CLSID_CoMD5>,
  11. public IPassportService,
  12. public IDispatchImpl<IMD5, &IID_IMD5, &LIBID_COMMD5Lib>
  13. {
  14. public:
  15. CCoMD5()
  16. {
  17. m_pUnkMarshaler = NULL;
  18. }
  19. DECLARE_REGISTRY_RESOURCEID(IDR_COMD5)
  20. DECLARE_GET_CONTROLLING_UNKNOWN()
  21. BEGIN_COM_MAP(CCoMD5)
  22. COM_INTERFACE_ENTRY(IMD5)
  23. COM_INTERFACE_ENTRY(IDispatch)
  24. COM_INTERFACE_ENTRY(IPassportService)
  25. COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pUnkMarshaler.p)
  26. END_COM_MAP()
  27. HRESULT FinalConstruct()
  28. {
  29. return CoCreateFreeThreadedMarshaler(
  30. GetControllingUnknown(), &m_pUnkMarshaler.p);
  31. }
  32. void FinalRelease()
  33. {
  34. m_pUnkMarshaler.Release();
  35. }
  36. CComPtr<IUnknown> m_pUnkMarshaler;
  37. public:
  38. // IMD5
  39. STDMETHOD(MD5Hash)(BSTR bstrSource, BSTR* pbstrDigest);
  40. STDMETHOD(MD5HashASCII)(BSTR bstrSource, BSTR* pbstrDigest);
  41. // IPassportService
  42. public:
  43. STDMETHOD(Initialize)(BSTR configfile, IServiceProvider* p);
  44. STDMETHOD(Shutdown)();
  45. STDMETHOD(ReloadState)(IServiceProvider*);
  46. STDMETHOD(CommitState)(IServiceProvider*);
  47. STDMETHOD(DumpState)( BSTR* );
  48. };
  49. #endif //__COMD5_H_