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.

182 lines
3.3 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. mpmap.hxx
  5. Abstract:
  6. This class implements a mapping among a set of three elements.
  7. The three elements are guid volume name, drive letter, and device name.
  8. Author:
  9. Daniel Chan (danielch) May 20, 1998
  10. --*/
  11. #if !defined(MOUNT_POINT_MAP_DEFN)
  12. #define MOUNT_POINT_MAP_DEFN
  13. #include "arrayit.hxx"
  14. #if defined ( _AUTOCHECK_ )
  15. #define IFSUTIL_EXPORT
  16. #elif defined ( _IFSUTIL_MEMBER_ )
  17. #define IFSUTIL_EXPORT __declspec(dllexport)
  18. #else
  19. #define IFSUTIL_EXPORT __declspec(dllimport)
  20. #endif
  21. DECLARE_CLASS( MOUNT_POINT_MAP );
  22. class MOUNT_POINT_TUPLE : public OBJECT {
  23. public:
  24. IFSUTIL_EXPORT
  25. DECLARE_CONSTRUCTOR( MOUNT_POINT_TUPLE );
  26. DSTRING _DeviceName;
  27. DSTRING _VolumeName;
  28. DSTRING _DriveName;
  29. };
  30. DEFINE_POINTER_TYPES(MOUNT_POINT_TUPLE);
  31. class MOUNT_POINT_MAP : public OBJECT {
  32. public:
  33. IFSUTIL_EXPORT
  34. DECLARE_CONSTRUCTOR( MOUNT_POINT_MAP );
  35. VIRTUAL
  36. IFSUTIL_EXPORT
  37. ~MOUNT_POINT_MAP(
  38. );
  39. NONVIRTUAL
  40. IFSUTIL_EXPORT
  41. BOOLEAN
  42. Initialize(
  43. );
  44. NONVIRTUAL
  45. IFSUTIL_EXPORT
  46. BOOLEAN
  47. AddVolumeName(
  48. IN PWSTRING DeviceName,
  49. IN PWSTRING VolumeName
  50. );
  51. NONVIRTUAL
  52. IFSUTIL_EXPORT
  53. BOOLEAN
  54. AddDriveName(
  55. IN PWSTRING DeviceName,
  56. IN PWSTRING DriveName
  57. );
  58. NONVIRTUAL
  59. IFSUTIL_EXPORT
  60. BOOLEAN
  61. QueryVolumeName(
  62. IN PWSTRING DeviceName,
  63. OUT PWSTRING VolumeName
  64. );
  65. NONVIRTUAL
  66. IFSUTIL_EXPORT
  67. BOOLEAN
  68. QueryDriveName(
  69. IN PWSTRING DeviceName,
  70. OUT PWSTRING DriveName
  71. );
  72. NONVIRTUAL
  73. BOOLEAN
  74. Put(
  75. IN PMOUNT_POINT_TUPLE mptuple
  76. );
  77. NONVIRTUAL
  78. PMOUNT_POINT_TUPLE
  79. GetAt(
  80. IN ULONG Index
  81. );
  82. NONVIRTUAL
  83. IFSUTIL_EXPORT
  84. BOOLEAN
  85. GetAt(
  86. IN ULONG Index,
  87. OUT PWSTRING DriveName,
  88. OUT PWSTRING VolumeName
  89. );
  90. NONVIRTUAL
  91. ULONG
  92. QueryMemberCount(
  93. ) CONST;
  94. NONVIRTUAL
  95. PARRAY_ITERATOR
  96. QueryIterator(
  97. ) CONST;
  98. private:
  99. NONVIRTUAL
  100. VOID
  101. Construct (
  102. );
  103. NONVIRTUAL
  104. VOID
  105. Destroy(
  106. );
  107. PARRAY _parr;
  108. };
  109. INLINE
  110. PMOUNT_POINT_TUPLE
  111. MOUNT_POINT_MAP::GetAt(
  112. IN ULONG Index
  113. )
  114. {
  115. return (PMOUNT_POINT_TUPLE)_parr->GetAt(Index);
  116. }
  117. INLINE
  118. BOOLEAN
  119. MOUNT_POINT_MAP::Put(
  120. IN PMOUNT_POINT_TUPLE mptuple
  121. )
  122. {
  123. return _parr->Put(mptuple);
  124. }
  125. INLINE
  126. ULONG
  127. MOUNT_POINT_MAP::QueryMemberCount(
  128. ) CONST
  129. {
  130. return _parr->QueryMemberCount();
  131. }
  132. INLINE
  133. PARRAY_ITERATOR
  134. MOUNT_POINT_MAP::QueryIterator(
  135. ) CONST
  136. {
  137. return (PARRAY_ITERATOR)_parr->QueryIterator();
  138. }
  139. #endif // MOUNT_POINT_MAP_DEFN