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.

141 lines
2.2 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. mdwriter.h
  5. Abstract:
  6. This is the header file for snapshot writer class
  7. Author:
  8. Ming Lu (MingLu) 30-Apr-2000
  9. --*/
  10. #include <imd.h>
  11. #include <vss.h>
  12. #include <vswriter.h>
  13. class CIISVssWriter : public CVssWriter
  14. {
  15. public:
  16. CIISVssWriter()
  17. : m_pMdObject( NULL ),
  18. m_hTimer( NULL ),
  19. m_fMBLocked( FALSE ),
  20. m_mdhRoot( METADATA_MASTER_ROOT_HANDLE )
  21. {
  22. InitializeCriticalSection( &m_csMBLock );
  23. }
  24. ~CIISVssWriter()
  25. {
  26. DeleteCriticalSection( &m_csMBLock );
  27. if( m_hTimer )
  28. {
  29. DBG_REQUIRE( CloseHandle( m_hTimer ) );
  30. m_hTimer = NULL;
  31. }
  32. if( m_pMdObject )
  33. {
  34. m_pMdObject->ComMDTerminate(TRUE);
  35. m_pMdObject->Release();
  36. m_pMdObject = NULL;
  37. }
  38. }
  39. BOOL Initialize(
  40. VOID
  41. );
  42. virtual bool STDMETHODCALLTYPE
  43. OnIdentify(
  44. IN IVssCreateWriterMetadata *pMetadata
  45. );
  46. virtual bool STDMETHODCALLTYPE
  47. OnPrepareBackup(
  48. IN IVssWriterComponents *pComponent
  49. );
  50. virtual bool STDMETHODCALLTYPE
  51. OnPrepareSnapshot(
  52. VOID
  53. );
  54. virtual bool STDMETHODCALLTYPE
  55. OnFreeze(
  56. VOID
  57. );
  58. virtual bool STDMETHODCALLTYPE
  59. OnThaw(
  60. VOID
  61. );
  62. virtual bool STDMETHODCALLTYPE
  63. OnAbort(
  64. VOID
  65. );
  66. virtual bool STDMETHODCALLTYPE
  67. OnBackupComplete(
  68. IN IVssWriterComponents * pComponent
  69. );
  70. BOOL
  71. ResetTimer(
  72. HANDLE hTimer,
  73. DWORD dwDuration
  74. );
  75. VOID
  76. UnlockMetaBase(
  77. VOID
  78. );
  79. private:
  80. IMDCOM * m_pMdObject;
  81. //
  82. // Handle to the internal timer object
  83. //
  84. HANDLE m_hTimer;
  85. //
  86. // Keep track of the status of metabase
  87. //
  88. BOOL m_fMBLocked;
  89. //
  90. // Metadata root handle
  91. //
  92. METADATA_HANDLE m_mdhRoot;
  93. CRITICAL_SECTION m_csMBLock;
  94. };
  95. VOID
  96. InitMDWriterThread(
  97. IN HANDLE hMDWriterEvent
  98. );
  99. HRESULT
  100. InitializeMDWriter(
  101. IN HANDLE hMDWriterEvent
  102. );
  103. VOID
  104. TerminateMDWriter(
  105. IN HANDLE hMDWriterEvent
  106. );