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.

158 lines
5.2 KiB

  1. #ifndef _FSASRVR_
  2. #define _FSASRVR_
  3. /*++
  4. 1998 Seagate Software, Inc. All rights reserved.
  5. Module Name:
  6. fsasvr.h
  7. Abstract:
  8. This module represents the root object for an FSA service for NTFS50.
  9. Author:
  10. Chuck Bardeen [cbardeen] 1-Dec-1996
  11. Revision History:
  12. --*/
  13. #define FSA_DB_DIRECTORY OLESTR("FsaDb")
  14. #define UNMANAGE_DB_DIRECTORY OLESTR("UnmanageDb")
  15. /*++
  16. Class Name:
  17. CFsaServer
  18. Class Description:
  19. This class represents the root object for an FSA service for NTFS50.
  20. --*/
  21. class CFsaServer :
  22. public CWsbPersistable,
  23. public IWsbCreateLocalObject,
  24. public IFsaServer,
  25. public IWsbServer,
  26. public CComCoClass<CFsaServer,&CLSID_CFsaServerNTFS>
  27. {
  28. public:
  29. CFsaServer() {}
  30. BEGIN_COM_MAP(CFsaServer)
  31. COM_INTERFACE_ENTRY(IFsaServer)
  32. COM_INTERFACE_ENTRY(IWsbServer)
  33. COM_INTERFACE_ENTRY2(IPersist, IPersistStream)
  34. COM_INTERFACE_ENTRY(IPersistStream)
  35. COM_INTERFACE_ENTRY(IPersistFile)
  36. COM_INTERFACE_ENTRY(IWsbPersistable)
  37. COM_INTERFACE_ENTRY(IWsbCreateLocalObject)
  38. END_COM_MAP()
  39. DECLARE_NOT_AGGREGATABLE( CFsaServer)
  40. DECLARE_REGISTRY_RESOURCEID(IDR_FsaServer)
  41. DECLARE_PROTECT_FINAL_CONSTRUCT()
  42. // CFsaServer
  43. STDMETHOD(Autosave)(void);
  44. STDMETHOD(IsUpdatingAccessDates)(void);
  45. STDMETHOD(SetIsUpdatingAccessDates)(BOOL isUpdating);
  46. // CComObjectRoot
  47. public:
  48. STDMETHOD(FinalConstruct)(void);
  49. void FinalRelease(void);
  50. // IPersist
  51. public:
  52. STDMETHOD(GetClassID)(LPCLSID pClsid);
  53. // IPersistStream
  54. public:
  55. STDMETHOD(GetSizeMax)(ULARGE_INTEGER* pSize);
  56. STDMETHOD(Load)(IStream* pStream);
  57. STDMETHOD(Save)(IStream* pStream, BOOL clearDirty);
  58. // IWsbCreateLocalServer
  59. STDMETHOD(CreateInstance)(REFCLSID rclsid, REFIID riid, void **ppv);
  60. // IWsbServer
  61. public:
  62. STDMETHOD( GetBuildVersion )( ULONG *pBuildVersion );
  63. STDMETHOD( GetNtProductVersion )( OLECHAR **pNtProductVersion, ULONG bufferSize );
  64. STDMETHOD( GetNtProductBuild )( ULONG *pNtProductBuild );
  65. STDMETHOD( GetDatabaseVersion )( ULONG *pDatabaseVersion );
  66. STDMETHOD( GetId )( GUID* pId );
  67. STDMETHOD( GetRegistryName )( OLECHAR **pRegistryName, ULONG bufferSize );
  68. STDMETHOD( SetId )( GUID id );
  69. STDMETHOD( SaveAll )( void );
  70. STDMETHOD( Unload )( void );
  71. STDMETHOD( CheckAccess )( WSB_ACCESS_TYPE AccessType );
  72. STDMETHOD( GetTrace )( OUT IWsbTrace ** ppTrace );
  73. STDMETHOD( SetTrace )( IN IWsbTrace *pTrace );
  74. STDMETHOD( DestroyObject )( void );
  75. // IHsmSystemState
  76. STDMETHOD( ChangeSysState )( HSM_SYSTEM_STATE* pSysState );
  77. // IFsaServer
  78. public:
  79. STDMETHOD(EnumResources)(IWsbEnum** ppEnum);
  80. STDMETHOD(FindResourceByAlternatePath)(OLECHAR* path, IFsaResource** ppResource);
  81. STDMETHOD(FindResourceById)(GUID id, IFsaResource** ppResource);
  82. STDMETHOD(FindResourceByName)(OLECHAR* name, IFsaResource** ppResource);
  83. STDMETHOD(FindResourceByPath)(OLECHAR* path, IFsaResource** ppResource);
  84. STDMETHOD(FindResourceBySerial)(ULONG serial, IFsaResource** ppResource);
  85. STDMETHOD(FindResourceByStickyName)(OLECHAR* name, IFsaResource** ppResource);
  86. STDMETHOD(GetAutosave)(ULONG* pMilliseconds);
  87. STDMETHOD(GetDbPath)(OLECHAR** pPath, ULONG bufferSize);
  88. STDMETHOD(GetDbPathAndName)(OLECHAR** pPath, ULONG bufferSize);
  89. STDMETHOD(GetIDbPath)(OLECHAR** pPath, ULONG bufferSize);
  90. STDMETHOD(GetUnmanageIDbPath)(OLECHAR** pPath, ULONG bufferSize);
  91. STDMETHOD(GetIDbSys)(IWsbDbSys** ppDbSys);
  92. STDMETHOD(GetUnmanageIDbSys)(IWsbDbSys** ppDbSys);
  93. STDMETHOD(GetFilter)(IFsaFilter** ppFilter);
  94. STDMETHOD(GetIdentifier)(GUID* pId);
  95. STDMETHOD(GetLogicalName)(OLECHAR** pName, ULONG bufferSize);
  96. STDMETHOD(GetName)(OLECHAR** pName, ULONG bufferSize);
  97. STDMETHOD(Init)(void);
  98. STDMETHOD(ScanForResources)(void);
  99. STDMETHOD(SetAutosave)(ULONG milliseconds);
  100. // Internal functions
  101. private:
  102. STDMETHOD(DoRecovery)(void);
  103. void StopAutosaveThread(void);
  104. STDMETHOD(CreateMetadataSaveEvent)(void);
  105. protected:
  106. ULONG m_autosaveInterval; // Autosave interval in milliseconds;
  107. // zero turns if off.
  108. HANDLE m_autosaveThread;
  109. HANDLE m_terminateEvent; // An event for signaling termination to the autosave thread
  110. HANDLE m_savingEvent; // An event for synchronizing saving of persistent data
  111. BOOL m_Suspended;
  112. BOOL m_isUnmanageDbSysInitialized;
  113. GUID m_id;
  114. CWsbStringPtr m_dbPath;
  115. CWsbStringPtr m_name;
  116. CComPtr<IWsbCollection> m_pResources; // persisted collection of manageable
  117. // resources.
  118. CComPtr<IFsaFilter> m_pFilter;
  119. CComPtr<IWsbDbSys> m_pDbSys;
  120. CComPtr<IWsbDbSys> m_pUnmanageDbSys;
  121. CComPtr<IWsbTrace> m_pTrace;
  122. ULONG m_buildVersion;
  123. ULONG m_databaseVersion;
  124. };
  125. #endif // _FSASRVR_