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.

130 lines
3.0 KiB

  1. #ifndef _COMPONTH_
  2. #define _COMPONTH_
  3. #include "vs_hash.hxx"
  4. class CWriterComponentsSelection
  5. {
  6. public:
  7. // Construction Destruction
  8. CWriterComponentsSelection();
  9. ~CWriterComponentsSelection();
  10. // methods
  11. void SetWriter
  12. (
  13. IN VSS_ID WriterId
  14. );
  15. HRESULT AddSelectedComponent
  16. (
  17. IN WCHAR* pwszComponentLogicalPath
  18. );
  19. HRESULT AddSelectedSubcomponent
  20. (
  21. IN WCHAR* pwszSubcomponentLogicalPath
  22. );
  23. BOOL IsComponentSelected
  24. (
  25. IN WCHAR* pwszComponentLogicalPath,
  26. IN WCHAR* pwszComponentName
  27. );
  28. BOOL IsSubcomponentSelected
  29. (
  30. IN WCHAR* pwszSubcomponentLogicalPath,
  31. IN WCHAR* pwszSubcomponentName
  32. );
  33. UINT GetComponentsCount()
  34. { return m_uNumComponents; }
  35. UINT GetSubcomponentsCount()
  36. { return m_uNumSubcomponents; }
  37. const WCHAR* const * GetComponents()
  38. { return m_ppwszComponentLogicalPaths; }
  39. const WCHAR* const * GetSubcomponents()
  40. { return m_ppwszSubcomponentLogicalPaths; }
  41. private:
  42. HRESULT AddSelected(IN WCHAR* pwszLogicalPath, WCHAR**& ppwszLogicalPaths, UINT& uSize);
  43. BOOL IsSelected(IN WCHAR* pwszLogicalPath, IN WCHAR* pwszName, IN WCHAR** pwszLogicalPaths,
  44. IN UINT uSize);
  45. VSS_ID m_WriterId;
  46. UINT m_uNumComponents;
  47. WCHAR** m_ppwszComponentLogicalPaths;
  48. UINT m_uNumSubcomponents;
  49. WCHAR** m_ppwszSubcomponentLogicalPaths;
  50. };
  51. class CWritersSelection :
  52. public IUnknown // Must be the FIRST base class since we use CComPtr<CVssSnapshotSetObject>
  53. {
  54. protected:
  55. // Construction Destruction
  56. CWritersSelection();
  57. ~CWritersSelection();
  58. public:
  59. // Creation
  60. static CWritersSelection* CreateInstance();
  61. // Chosen writers & components management
  62. STDMETHOD(BuildChosenComponents)
  63. (
  64. WCHAR *pwszComponentsFileName
  65. );
  66. BOOL IsComponentSelected
  67. (
  68. IN VSS_ID WriterId,
  69. IN WCHAR* pwszComponentLogicalPath,
  70. IN WCHAR* pwszComponentName
  71. );
  72. BOOL IsSubcomponentSelected
  73. (
  74. IN VSS_ID WriterId,
  75. IN WCHAR* pwszComponentLogicalPath,
  76. IN WCHAR* pwszComponentName
  77. );
  78. const WCHAR* const * GetComponents
  79. (
  80. IN VSS_ID WriterId
  81. );
  82. const WCHAR* const * GetSubcomponents
  83. (
  84. IN VSS_ID WriterId
  85. );
  86. const UINT GetComponentsCount
  87. (
  88. IN VSS_ID WriterId
  89. );
  90. const UINT GetSubcomponentsCount
  91. (
  92. IN VSS_ID WriterId
  93. );
  94. // IUnknown
  95. STDMETHOD(QueryInterface)(REFIID iid, void** pp);
  96. STDMETHOD_(ULONG, AddRef)();
  97. STDMETHOD_(ULONG, Release)();
  98. private:
  99. // Chosen writers
  100. CVssSimpleMap<VSS_ID, CWriterComponentsSelection*> m_WritersMap;
  101. // For life management
  102. LONG m_lRef;
  103. };
  104. #endif // _COMPONTH_