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.

248 lines
4.6 KiB

  1. /*++
  2. Copyright (c) 1991-2000 Microsoft Corporation
  3. Module Name:
  4. attrcol.hxx
  5. Abstract:
  6. This module contains the declarations for the
  7. NTFS_ATTRIBUTE_COLUMNS class, which models
  8. the attribute columns of an attribute definition table
  9. file for an NTFS volume.
  10. Author:
  11. Norbert P. Kusters (norbertk) 19-Aug-91
  12. --*/
  13. #if !defined( NTFS_ATRIBUTE_COLUMNS_DEFN )
  14. #define NTFS_ATRIBUTE_COLUMNS_DEFN
  15. DECLARE_CLASS( NTFS_ATTRIBUTE_COLUMNS );
  16. DECLARE_CLASS( NTFS_ATTRIBUTE );
  17. #include "bigint.hxx"
  18. #include "wstring.hxx"
  19. class NTFS_ATTRIBUTE_COLUMNS : public OBJECT {
  20. public:
  21. DECLARE_CONSTRUCTOR( NTFS_ATTRIBUTE_COLUMNS );
  22. VIRTUAL
  23. ~NTFS_ATTRIBUTE_COLUMNS(
  24. );
  25. NONVIRTUAL
  26. BOOLEAN
  27. Initialize(
  28. IN ULONG NumberOfColumns,
  29. IN PCATTRIBUTE_DEFINITION_COLUMNS Columns DEFAULT NULL
  30. );
  31. NONVIRTUAL
  32. BOOLEAN
  33. Read(
  34. IN OUT PNTFS_ATTRIBUTE AttributeDefinitionTableData
  35. );
  36. NONVIRTUAL
  37. BOOLEAN
  38. QueryIndex(
  39. IN ATTRIBUTE_TYPE_CODE AttributeCode,
  40. OUT PULONG Index
  41. ) CONST;
  42. NONVIRTUAL
  43. ULONG
  44. QueryFlags(
  45. IN ULONG Index
  46. ) CONST;
  47. NONVIRTUAL
  48. BOOLEAN
  49. QueryAttributeName(
  50. IN ULONG Index,
  51. OUT PWSTRING AttributeName
  52. ) CONST;
  53. NONVIRTUAL
  54. BIG_INT
  55. QueryMinimumLength(
  56. IN ULONG Index
  57. ) CONST;
  58. NONVIRTUAL
  59. BIG_INT
  60. QueryMaximumLength(
  61. IN ULONG Index
  62. ) CONST;
  63. NONVIRTUAL
  64. PCATTRIBUTE_DEFINITION_COLUMNS
  65. GetColumns(
  66. OUT PULONG NumColumns
  67. ) CONST;
  68. private:
  69. NONVIRTUAL
  70. VOID
  71. Construct(
  72. );
  73. NONVIRTUAL
  74. VOID
  75. Destroy(
  76. );
  77. PATTRIBUTE_DEFINITION_COLUMNS _columns;
  78. ULONG _num_columns;
  79. };
  80. INLINE
  81. ULONG
  82. NTFS_ATTRIBUTE_COLUMNS::QueryFlags(
  83. IN ULONG Index
  84. ) CONST
  85. /*++
  86. Routine Description:
  87. This routine returns the flags for the attribute type
  88. with the supplied index.
  89. Arguments:
  90. Index - Supplies the index of the desired attribute type code.
  91. Return Value:
  92. The flags for the attribute type currently in focus.
  93. --*/
  94. {
  95. return _columns[Index].Flags;
  96. }
  97. INLINE
  98. BOOLEAN
  99. NTFS_ATTRIBUTE_COLUMNS::QueryAttributeName(
  100. IN ULONG Index,
  101. OUT PWSTRING AttributeName
  102. ) CONST
  103. /*++
  104. Routine Description:
  105. This routine returns the attribute name for the attribute type
  106. with the supplied index.
  107. Arguments:
  108. Index - Supplies the index of the desired attribute type code.
  109. AttributeName - Returns the attribute name.
  110. Return Value:
  111. FALSE - Failure.
  112. TRUE - Success.
  113. --*/
  114. {
  115. return AttributeName->Initialize(_columns[Index].AttributeName);
  116. }
  117. INLINE
  118. BIG_INT
  119. NTFS_ATTRIBUTE_COLUMNS::QueryMinimumLength(
  120. IN ULONG Index
  121. ) CONST
  122. /*++
  123. Routine Description:
  124. This routine returns the minimum length for the attribute type
  125. with the supplied index.
  126. Arguments:
  127. Index - Supplies the index of the desired attribute type code.
  128. Return Value:
  129. The minimum length for the attribute type currently in focus.
  130. --*/
  131. {
  132. PLARGE_INTEGER p;
  133. p = (PLARGE_INTEGER)&_columns[Index].MinimumLength;
  134. return *p;
  135. }
  136. INLINE
  137. BIG_INT
  138. NTFS_ATTRIBUTE_COLUMNS::QueryMaximumLength(
  139. IN ULONG Index
  140. ) CONST
  141. /*++
  142. Routine Description:
  143. This routine returns the maximum length for the attribute type
  144. with the supplied index.
  145. Arguments:
  146. Index - Supplies the index of the desired attribute type code.
  147. Return Value:
  148. The maximum length for the attribute type currently in focus.
  149. --*/
  150. {
  151. PLARGE_INTEGER p;
  152. p = (PLARGE_INTEGER)&_columns[Index].MaximumLength;
  153. return *p;
  154. }
  155. INLINE
  156. PCATTRIBUTE_DEFINITION_COLUMNS
  157. NTFS_ATTRIBUTE_COLUMNS::GetColumns(
  158. OUT PULONG NumColumns
  159. ) CONST
  160. /*++
  161. Routine Description:
  162. This routine returns a pointer to the raw columns data.
  163. Arguments:
  164. NumColumns - Returns the number of columns.
  165. Return Value:
  166. The attribute columns data.
  167. --*/
  168. {
  169. *NumColumns = _num_columns;
  170. return _columns;
  171. }
  172. #endif // NTFS_ATRIBUTE_COLUMNS_DEFN