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.

70 lines
2.0 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. // HsmMgdRs.h : Declaration of the CHsmServer
  3. /////////////////////////////////////////////////////////////////////////////
  4. #include "resource.h"
  5. #include "wsb.h"
  6. /////////////////////////////////////////////////////////////////////////////
  7. class CHsmManagedResource :
  8. public CWsbObject,
  9. public IHsmManagedResource,
  10. public CComCoClass<CHsmManagedResource,&CLSID_CHsmManagedResource>
  11. {
  12. public:
  13. CHsmManagedResource( ) {}
  14. BEGIN_COM_MAP( CHsmManagedResource )
  15. COM_INTERFACE_ENTRY( IHsmManagedResource )
  16. COM_INTERFACE_ENTRY2(IPersist, IPersistStream)
  17. COM_INTERFACE_ENTRY(IPersistStream)
  18. COM_INTERFACE_ENTRY2(IWsbCollectable, IHsmManagedResource)
  19. COM_INTERFACE_ENTRY(IWsbPersistStream)
  20. COM_INTERFACE_ENTRY(IWsbTestable)
  21. END_COM_MAP( )
  22. DECLARE_REGISTRY_RESOURCEID( IDR_CHsmManagedResource )
  23. //CComObjectRoot
  24. STDMETHOD(FinalConstruct)(void);
  25. void FinalRelease(void);
  26. // IPersist
  27. public:
  28. STDMETHOD(GetClassID)(LPCLSID pClsid);
  29. // IPersistStream
  30. public:
  31. STDMETHOD(GetSizeMax)(ULARGE_INTEGER* pSize);
  32. STDMETHOD(Load)(IStream* pStream);
  33. STDMETHOD(Save)(IStream* pStream, BOOL clearDirty);
  34. // IWsbCollectable
  35. public:
  36. STDMETHOD(CompareTo)(IUnknown* pCollectable, SHORT* pResult);
  37. WSB_FROM_CWSBOBJECT;
  38. // IWsbTestable
  39. public:
  40. STDMETHOD(Test)(USHORT *pTestsPassed, USHORT* pTestsFailed);
  41. // IHsmManagedResource
  42. public:
  43. STDMETHOD( GetResourceId )( GUID *pResourceId );
  44. STDMETHOD( SetResourceId )( GUID resourceId );
  45. STDMETHOD( InitFromFsaResource )( IUnknown *pFsa );
  46. STDMETHOD( GetFsaResource )( IUnknown **ppFsa );
  47. STDMETHOD( CompareToIHsmManagedResource )( IHsmManagedResource* pHsmManagedResource, short* psResult );
  48. // Internal Helper functions
  49. private:
  50. GUID m_ResourceId;
  51. GUID m_HsmId;
  52. CComPtr<IUnknown> m_pFsaResourceInterface;
  53. };