Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenntfs.h
Go to the documentation of this file.
00001 /* 00002 * FreeLoader NTFS support 00003 * Copyright (C) 2004 Filip Navara <xnavara@volny.cz> 00004 * Copyright (C) 2011 Pierre Schweitzer <pierre.schweitzer@reactos.org> 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License along 00017 * with this program; if not, write to the Free Software Foundation, Inc., 00018 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00019 */ 00020 00021 #pragma once 00022 00023 #define NTFS_FILE_MFT 0 00024 #define NTFS_FILE_MFTMIRR 1 00025 #define NTFS_FILE_LOGFILE 2 00026 #define NTFS_FILE_VOLUME 3 00027 #define NTFS_FILE_ATTRDEF 4 00028 #define NTFS_FILE_ROOT 5 00029 #define NTFS_FILE_BITMAP 6 00030 #define NTFS_FILE_BOOT 7 00031 #define NTFS_FILE_BADCLUS 8 00032 #define NTFS_FILE_QUOTA 9 00033 #define NTFS_FILE_UPCASE 10 00034 #define NTFS_FILE_EXTEND 11 00035 00036 #define NTFS_ATTR_TYPE_STANDARD_INFORMATION 0x10 00037 #define NTFS_ATTR_TYPE_ATTRIBUTE_LIST 0x20 00038 #define NTFS_ATTR_TYPE_FILENAME 0x30 00039 #define NTFS_ATTR_TYPE_OBJECT_ID 0x40 00040 #define NTFS_ATTR_TYPE_SECURITY_DESCRIPTOR 0x50 00041 #define NTFS_ATTR_TYPE_VOLUME_NAME 0x60 00042 #define NTFS_ATTR_TYPE_VOLUME_INFORMATION 0x70 00043 #define NTFS_ATTR_TYPE_DATA 0x80 00044 #define NTFS_ATTR_TYPE_INDEX_ROOT 0x90 00045 #define NTFS_ATTR_TYPE_INDEX_ALLOCATION 0xa0 00046 #define NTFS_ATTR_TYPE_BITMAP 0xb0 00047 #define NTFS_ATTR_TYPE_REPARSE_POINT 0xc0 00048 #define NTFS_ATTR_TYPE_EA_INFORMATION 0xd0 00049 #define NTFS_ATTR_TYPE_EA 0xe0 00050 #define NTFS_ATTR_TYPE_END 0xffffffff 00051 00052 #define NTFS_ATTR_NORMAL 0 00053 #define NTFS_ATTR_COMPRESSED 1 00054 #define NTFS_ATTR_RESIDENT 2 00055 #define NTFS_ATTR_ENCRYPTED 0x4000 00056 00057 #define NTFS_SMALL_INDEX 0 00058 #define NTFS_LARGE_INDEX 1 00059 00060 #define NTFS_INDEX_ENTRY_NODE 1 00061 #define NTFS_INDEX_ENTRY_END 2 00062 00063 #define NTFS_FILE_NAME_POSIX 0 00064 #define NTFS_FILE_NAME_WIN32 1 00065 #define NTFS_FILE_NAME_DOS 2 00066 #define NTFS_FILE_NAME_WIN32_AND_DOS 3 00067 00068 #include <pshpack1.h> 00069 typedef struct 00070 { 00071 UCHAR JumpBoot[3]; // Jump to the boot loader routine 00072 CHAR SystemId[8]; // System Id ("NTFS ") 00073 USHORT BytesPerSector; // Bytes per sector 00074 UCHAR SectorsPerCluster; // Number of sectors in a cluster 00075 UCHAR Unused1[7]; 00076 UCHAR MediaDescriptor; // Media descriptor byte 00077 UCHAR Unused2[2]; 00078 USHORT SectorsPerTrack; // Number of sectors in a track 00079 USHORT NumberOfHeads; // Number of heads on the disk 00080 UCHAR Unused3[8]; 00081 UCHAR DriveNumber; // Int 0x13 drive number (e.g. 0x80) 00082 UCHAR CurrentHead; 00083 UCHAR BootSignature; // Extended boot signature (0x80) 00084 UCHAR Unused4; 00085 ULONGLONG VolumeSectorCount; // Number of sectors in the volume 00086 ULONGLONG MftLocation; 00087 ULONGLONG MftMirrorLocation; 00088 CHAR ClustersPerMftRecord; // Clusters per MFT Record 00089 UCHAR Unused5[3]; 00090 CHAR ClustersPerIndexRecord; // Clusters per Index Record 00091 UCHAR Unused6[3]; 00092 ULONGLONG VolumeSerialNumber; // Volume serial number 00093 UCHAR BootCodeAndData[430]; // The remainder of the boot sector 00094 USHORT BootSectorMagic; // 0xAA55 00095 } NTFS_BOOTSECTOR, *PNTFS_BOOTSECTOR; 00096 00097 typedef struct 00098 { 00099 ULONG Magic; 00100 USHORT USAOffset; // Offset to the Update Sequence Array from the start of the ntfs record 00101 USHORT USACount; 00102 } NTFS_RECORD, *PNTFS_RECORD; 00103 00104 typedef struct 00105 { 00106 ULONG Magic; 00107 USHORT USAOffset; // Offset to the Update Sequence Array from the start of the ntfs record 00108 USHORT USACount; 00109 ULONGLONG LogSequenceNumber; 00110 USHORT SequenceNumber; 00111 USHORT LinkCount; 00112 USHORT AttributesOffset; 00113 USHORT Flags; 00114 ULONG BytesInUse; // Number of bytes used in this mft record. 00115 ULONG BytesAllocated; 00116 ULONGLONG BaseMFTRecord; 00117 USHORT NextAttributeInstance; 00118 } NTFS_MFT_RECORD, *PNTFS_MFT_RECORD; 00119 00120 typedef struct 00121 { 00122 ULONG Type; 00123 ULONG Length; 00124 UCHAR IsNonResident; 00125 UCHAR NameLength; 00126 USHORT NameOffset; 00127 USHORT Flags; 00128 USHORT Instance; 00129 union 00130 { 00131 // Resident attributes 00132 struct 00133 { 00134 ULONG ValueLength; 00135 USHORT ValueOffset; 00136 UCHAR Flags; 00137 UCHAR Reserved; 00138 } Resident; 00139 // Non-resident attributes 00140 struct 00141 { 00142 ULONGLONG LowestVCN; 00143 ULONGLONG HighestVCN; 00144 USHORT MappingPairsOffset; 00145 USHORT CompressionUnit; 00146 UCHAR Reserved[4]; 00147 LONGLONG AllocatedSize; 00148 LONGLONG DataSize; 00149 LONGLONG InitializedSize; 00150 LONGLONG CompressedSize; 00151 } NonResident; 00152 }; 00153 } NTFS_ATTR_RECORD, *PNTFS_ATTR_RECORD; 00154 00155 typedef struct 00156 { 00157 ULONG EntriesOffset; 00158 ULONG IndexLength; 00159 ULONG AllocatedSize; 00160 UCHAR Flags; 00161 UCHAR Reserved[3]; 00162 } NTFS_INDEX_HEADER, *PNTFS_INDEX_HEADER; 00163 00164 typedef struct 00165 { 00166 ULONG Type; 00167 ULONG CollationRule; 00168 ULONG IndexBlockSize; 00169 UCHAR ClustersPerIndexBlock; 00170 UCHAR Reserved[3]; 00171 NTFS_INDEX_HEADER IndexHeader; 00172 } NTFS_INDEX_ROOT, *PNTFS_INDEX_ROOT; 00173 00174 typedef struct 00175 { 00176 ULONGLONG ParentDirectory; 00177 LONGLONG CreationTime; 00178 LONGLONG LastDataChangeTime; 00179 LONGLONG LastMftChangeTime; 00180 LONGLONG LastAccessTime; 00181 LONGLONG AllocatedSize; 00182 LONGLONG DataSize; 00183 ULONG FileAttributes; 00184 USHORT PackedExtendedAttributeSize; 00185 USHORT Reserved; 00186 UCHAR FileNameLength; 00187 UCHAR FileNameType; 00188 WCHAR FileName[0]; 00189 } NTFS_FILE_NAME_ATTR, *PNTFS_FILE_NAME_ATTR; 00190 00191 typedef struct 00192 { 00193 ULONG Type; 00194 USHORT RecLength; 00195 UCHAR NameLength; 00196 UCHAR NameOffset; 00197 ULONGLONG StartingVCN; 00198 ULONGLONG BaseFileRef; 00199 USHORT AttrId; 00200 PWCHAR Name; 00201 } NTFS_ATTR_LIST_ATTR, *PNTFS_ATTR_LIST_ATTR; 00202 00203 typedef struct 00204 { 00205 union 00206 { 00207 struct 00208 { 00209 ULONGLONG IndexedFile; 00210 } Directory; 00211 struct 00212 { 00213 USHORT DataOffset; 00214 USHORT DataLength; 00215 ULONG Reserved; 00216 } ViewIndex; 00217 } Data; 00218 USHORT Length; 00219 USHORT KeyLength; 00220 USHORT Flags; 00221 USHORT Reserved; 00222 NTFS_FILE_NAME_ATTR FileName; 00223 } NTFS_INDEX_ENTRY, *PNTFS_INDEX_ENTRY; 00224 #include <poppack.h> 00225 00226 typedef struct 00227 { 00228 PUCHAR CacheRun; 00229 ULONGLONG CacheRunOffset; 00230 LONGLONG CacheRunStartLCN; 00231 ULONGLONG CacheRunLength; 00232 LONGLONG CacheRunLastLCN; 00233 ULONGLONG CacheRunCurrentOffset; 00234 NTFS_ATTR_RECORD Record; 00235 } NTFS_ATTR_CONTEXT, *PNTFS_ATTR_CONTEXT; 00236 00237 typedef struct _NTFS_VOLUME_INFO *PNTFS_VOLUME_INFO; 00238 00239 #include <pshpack1.h> 00240 typedef struct 00241 { 00242 PNTFS_ATTR_CONTEXT DataContext; 00243 ULONGLONG Offset; 00244 PNTFS_VOLUME_INFO Volume; 00245 } NTFS_FILE_HANDLE, *PNTFS_FILE_HANDLE; 00246 #include <poppack.h> 00247 00248 const DEVVTBL* NtfsMount(ULONG DeviceId); Generated on Sat May 26 2012 04:17:59 for ReactOS by
1.7.6.1
|