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.

166 lines
4.9 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. m_idWriter(GUID_NULL),
  41. m_pwrapper(NULL),
  42. m_bSystemService(false),
  43. m_bBootableSystemState(false),
  44. m_pIMetadata(NULL)
  45. {
  46. InitializeListHead (&m_leFilesToIncludeEntries);
  47. InitializeListHead (&m_leFilesToExcludeEntries);
  48. }
  49. static HRESULT STDMETHODCALLTYPE Initialize
  50. (
  51. IN VSS_ID idWriter,
  52. IN LPCWSTR wszWriterName,
  53. IN bool bSystemService,
  54. IN bool bBootableSystemState,
  55. LPCWSTR wszFilesToInclude,
  56. LPCWSTR wszFilesToExclude,
  57. IN CVssJetWriter *pWriter,
  58. OUT void **ppInstanceCreated
  59. );
  60. static void STDMETHODCALLTYPE Uninitialize(IN PVSSIJETWRITER pInstance);
  61. // callback for identify event
  62. virtual bool STDMETHODCALLTYPE OnIdentify(IN IVssCreateWriterMetadata *pMetadata);
  63. // callback for prepare backup event
  64. virtual bool STDMETHODCALLTYPE OnPrepareBackup(IN IVssWriterComponents *pComponent);
  65. // called at Prepare to freeze
  66. virtual bool STDMETHODCALLTYPE OnPrepareSnapshot();
  67. // called at freeze
  68. virtual bool STDMETHODCALLTYPE OnFreeze();
  69. // called at thaw
  70. virtual bool STDMETHODCALLTYPE OnThaw();
  71. // called at post snapshot
  72. virtual bool STDMETHODCALLTYPE OnPostSnapshot(IN IVssWriterComponents *pComponent);
  73. // called when timeout occurs
  74. virtual bool STDMETHODCALLTYPE OnAbort();
  75. // callback on backup complete event
  76. virtual bool STDMETHODCALLTYPE OnBackupComplete(IN IVssWriterComponents *pComponent);
  77. // callback on prerestore event
  78. virtual bool STDMETHODCALLTYPE OnPreRestore(IN IVssWriterComponents *pComponent);
  79. // callback on postrestore event
  80. virtual bool STDMETHODCALLTYPE OnPostRestore(IN IVssWriterComponents *pComponent);
  81. private:
  82. JET_ERR CVssIJetWriter::TranslateJetError(JET_ERR err, CVssFunctionTracer &ft, CVssDebugInfo &dbgInfo);
  83. HRESULT InternalInitialize
  84. (
  85. IN VSS_ID idWriter,
  86. IN LPCWSTR wszWriterName,
  87. IN bool bSystemService,
  88. IN bool bBootableSystemState,
  89. IN LPCWSTR wszFilesToInclude,
  90. IN LPCWSTR wszFilesToExclude
  91. );
  92. bool PreProcessIncludeExcludeLists (bool bProcessingIncludeList);
  93. bool ProcessIncludeExcludeLists (bool bProcessingIncludeList);
  94. void PostProcessIncludeExcludeLists (bool bProcessingIncludeList);
  95. bool ProcessJetInstance (JET_INSTANCE_INFO *pInstanceInfo);
  96. BOOL CheckExcludedFileListForMatch (LPCWSTR pwszDatabaseFilePath,
  97. LPCWSTR pwszDatabaseFileSpec);
  98. bool FCheckInstanceVolumeDependencies
  99. (
  100. IN const JET_INSTANCE_INFO * pInstanceInfo
  101. ) const;
  102. bool FCheckVolumeDependencies
  103. (
  104. IN unsigned long cInstanceInfo,
  105. IN JET_INSTANCE_INFO *aInstanceInfo
  106. ) const;
  107. bool FCheckPathVolumeDependencies(IN const char * szPath) const;
  108. LPCWSTR GetApplicationName() const { return m_wszWriterName; }
  109. VSS_ID m_idWriter;
  110. LPWSTR m_wszWriterName;
  111. JET_OSSNAPID m_idJet;
  112. CVssJetWriter *m_pwrapper;
  113. LPWSTR m_wszFilesToInclude;
  114. LPWSTR m_wszFilesToExclude;
  115. bool m_bSystemService;
  116. bool m_bBootableSystemState;
  117. IVssCreateWriterMetadata *m_pIMetadata;
  118. LIST_ENTRY m_leFilesToIncludeEntries;
  119. LIST_ENTRY m_leFilesToExcludeEntries;
  120. };