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.

157 lines
4.1 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. ijetwriter.h
  5. Abstract:
  6. Definition of CVssIJetWriter class
  7. Brian Berkowitz [brianb] 3/17/2000
  8. TBD:
  9. Add comments.
  10. Revision History:
  11. Name Date Comments
  12. brianb 03/17/2000 Created
  13. mikejohn 04/03/2000 Added extra methods for OnIdentify()
  14. mikejohn 08/21/2000 165913: Deallocate memory on class destruction
  15. 161899: Add methods for matching paths in exclude list
  16. mikejohn 09/18/2000 176860: Added calling convention methods where missing
  17. --*/
  18. ////////////////////////////////////////////////////////////////////////
  19. // Standard foo for file name aliasing. This code block must be after
  20. // all includes of VSS header files.
  21. //
  22. #ifdef VSS_FILE_ALIAS
  23. #undef VSS_FILE_ALIAS
  24. #endif
  25. #define VSS_FILE_ALIAS "INCIJWRH"
  26. //
  27. ////////////////////////////////////////////////////////////////////////
  28. class CVssIJetWriter;
  29. typedef CVssIJetWriter *PVSSIJETWRITER;
  30. // actual writer class
  31. class CVssIJetWriter : public CVssWriter
  32. {
  33. // Constructors and destructors
  34. public:
  35. virtual STDMETHODCALLTYPE ~CVssIJetWriter();
  36. STDMETHODCALLTYPE CVssIJetWriter() :
  37. m_wszWriterName(NULL),
  38. m_wszFilesToInclude(NULL),
  39. m_wszFilesToExclude(NULL)
  40. {
  41. InitializeListHead (&m_leFilesToIncludeEntries);
  42. InitializeListHead (&m_leFilesToExcludeEntries);
  43. }
  44. static HRESULT STDMETHODCALLTYPE Initialize
  45. (
  46. IN VSS_ID idWriter,
  47. IN LPCWSTR wszWriterName,
  48. IN bool bSystemService,
  49. IN bool bBootableSystemState,
  50. LPCWSTR wszFilesToInclude,
  51. LPCWSTR wszFilesToExclude,
  52. IN CVssJetWriter *pWriter,
  53. OUT void **ppInstanceCreated
  54. );
  55. static void STDMETHODCALLTYPE Uninitialize(IN PVSSIJETWRITER pInstance);
  56. // callback for identify event
  57. virtual bool STDMETHODCALLTYPE OnIdentify(IN IVssCreateWriterMetadata *pMetadata);
  58. // callback for prepare backup event
  59. virtual bool STDMETHODCALLTYPE OnPrepareBackup(IN IVssWriterComponents *pComponent);
  60. // called at Prepare to freeze
  61. virtual bool STDMETHODCALLTYPE OnPrepareSnapshot();
  62. // called at freeze
  63. virtual bool STDMETHODCALLTYPE OnFreeze();
  64. // called at thaw
  65. virtual bool STDMETHODCALLTYPE OnThaw();
  66. // called at post snapshot
  67. virtual bool STDMETHODCALLTYPE OnPostSnapshot(IN IVssWriterComponents *pComponent);
  68. // called when timeout occurs
  69. virtual bool STDMETHODCALLTYPE OnAbort();
  70. // callback on backup complete event
  71. virtual bool STDMETHODCALLTYPE OnBackupComplete(IN IVssWriterComponents *pComponent);
  72. // callback on prerestore event
  73. virtual bool STDMETHODCALLTYPE OnPreRestore(IN IVssWriterComponents *pComponent);
  74. // callback on postrestore event
  75. virtual bool STDMETHODCALLTYPE OnPostRestore(IN IVssWriterComponents *pComponent);
  76. private:
  77. HRESULT InternalInitialize
  78. (
  79. IN VSS_ID idWriter,
  80. IN LPCWSTR wszWriterName,
  81. IN bool bSystemService,
  82. IN bool bBootableSystemState,
  83. IN LPCWSTR wszFilesToInclude,
  84. IN LPCWSTR wszFilesToExclude
  85. );
  86. bool PreProcessIncludeExcludeLists (bool bProcessingIncludeList);
  87. bool ProcessIncludeExcludeLists (bool bProcessingIncludeList);
  88. void PostProcessIncludeExcludeLists (bool bProcessingIncludeList);
  89. bool ProcessJetInstance (JET_INSTANCE_INFO *pInstanceInfo);
  90. BOOL CheckExcludedFileListForMatch (LPCWSTR pwszDatabaseFilePath,
  91. LPCWSTR pwszDatabaseFileSpec);
  92. bool FCheckInstanceVolumeDependencies
  93. (
  94. IN const JET_INSTANCE_INFO * pInstanceInfo
  95. ) const;
  96. bool FCheckVolumeDependencies
  97. (
  98. IN unsigned long cInstanceInfo,
  99. IN JET_INSTANCE_INFO *aInstanceInfo
  100. ) const;
  101. bool FCheckPathVolumeDependencies(IN const char * szPath) const;
  102. LPCWSTR GetApplicationName() const { return m_wszWriterName; }
  103. VSS_ID m_idWriter;
  104. LPWSTR m_wszWriterName;
  105. JET_OSSNAPID m_idJet;
  106. CVssJetWriter *m_pwrapper;
  107. LPWSTR m_wszFilesToInclude;
  108. LPWSTR m_wszFilesToExclude;
  109. bool m_bSystemService;
  110. bool m_bBootableSystemState;
  111. IVssCreateWriterMetadata *m_pIMetadata;
  112. LIST_ENTRY m_leFilesToIncludeEntries;
  113. LIST_ENTRY m_leFilesToExcludeEntries;
  114. };