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.

111 lines
2.1 KiB

  1. /*++
  2. Copyright (c) 1999 Microsoft Corporation
  3. Abstract:
  4. @doc
  5. @module sqlwriter.h | Declaration of the sql wrier
  6. @end
  7. Author:
  8. Brian Berkowitz [brianb] 04/17/2000
  9. TBD:
  10. Add comments.
  11. Revision History:
  12. Name Date Comments
  13. brianb 04/17/2000 created
  14. brianb 05/05/2000 added OnIdentify support
  15. mikejohn 09/18/2000 176860: Added calling convention methods where missing
  16. --*/
  17. ////////////////////////////////////////////////////////////////////////
  18. // Standard foo for file name aliasing. This code block must be after
  19. // all includes of VSS header files.
  20. //
  21. #ifdef VSS_FILE_ALIAS
  22. #undef VSS_FILE_ALIAS
  23. #endif
  24. #define VSS_FILE_ALIAS "INCSQLWH"
  25. //
  26. ////////////////////////////////////////////////////////////////////////
  27. #ifndef __SQLWRITER_H_
  28. #define __SQLWRITER_H_
  29. class CSqlWriter :
  30. public CVssWriter,
  31. public CCheckPath
  32. {
  33. public:
  34. STDMETHODCALLTYPE CSqlWriter() :
  35. m_pSqlSnapshot(NULL),
  36. m_fFrozen(false)
  37. {
  38. }
  39. STDMETHODCALLTYPE ~CSqlWriter()
  40. {
  41. delete m_pSqlSnapshot;
  42. }
  43. bool STDMETHODCALLTYPE OnIdentify(IVssCreateWriterMetadata *pMetadata);
  44. bool STDMETHODCALLTYPE OnPrepareSnapshot();
  45. bool STDMETHODCALLTYPE OnFreeze();
  46. bool STDMETHODCALLTYPE OnThaw();
  47. bool STDMETHODCALLTYPE OnAbort();
  48. bool IsPathInSnapshot(const WCHAR *path) throw();
  49. HRESULT STDMETHODCALLTYPE Initialize();
  50. HRESULT STDMETHODCALLTYPE Uninitialize();
  51. private:
  52. CSqlSnapshot *m_pSqlSnapshot;
  53. void TranslateWriterError(HRESULT hr);
  54. bool m_fFrozen;
  55. };
  56. // wrapper class used to create and destroy the writer
  57. // used by coordinator
  58. class CVssSqlWriterWrapper
  59. {
  60. public:
  61. __declspec(dllexport)
  62. CVssSqlWriterWrapper();
  63. __declspec(dllexport)
  64. ~CVssSqlWriterWrapper();
  65. __declspec(dllexport)
  66. HRESULT CreateSqlWriter();
  67. __declspec(dllexport)
  68. void DestroySqlWriter();
  69. private:
  70. // initialization function
  71. static DWORD InitializeThreadFunc(VOID *pv);
  72. CSqlWriter *m_pSqlWriter;
  73. // result of initialization
  74. HRESULT m_hrInitialize;
  75. };
  76. #endif // _SQLWRITER_H_