2002-06-25 22:23:06 +00:00
|
|
|
#ifndef NTFS_H
|
|
|
|
#define NTFS_H
|
|
|
|
|
2005-12-01 21:37:19 +00:00
|
|
|
#include <ntifs.h>
|
2006-01-07 06:20:59 +00:00
|
|
|
#include <ntddk.h>
|
2005-12-01 21:37:19 +00:00
|
|
|
#include <ntdddisk.h>
|
2002-06-25 22:23:06 +00:00
|
|
|
|
|
|
|
#define CACHEPAGESIZE(pDeviceExt) \
|
2006-01-07 06:20:59 +00:00
|
|
|
((pDeviceExt)->NtfsInfo.UCHARsPerCluster > PAGE_SIZE ? \
|
|
|
|
(pDeviceExt)->NtfsInfo.UCHARsPerCluster : PAGE_SIZE)
|
2002-09-08 10:23:54 +00:00
|
|
|
|
2009-08-24 17:12:25 +00:00
|
|
|
#define TAG_NTFS 'SFTN'
|
2008-01-13 11:36:54 +00:00
|
|
|
|
2002-06-25 22:23:06 +00:00
|
|
|
#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
|
|
|
|
|
2008-01-12 20:54:41 +00:00
|
|
|
#define DEVICE_NAME L"\\Ntfs"
|
|
|
|
|
2006-01-07 06:20:59 +00:00
|
|
|
#include <pshpack1.h>
|
2007-12-28 21:56:19 +00:00
|
|
|
typedef struct _BIOS_PARAMETERS_BLOCK
|
2002-06-25 22:23:06 +00:00
|
|
|
{
|
|
|
|
USHORT BytesPerSector; // 0x0B
|
2007-12-28 21:56:19 +00:00
|
|
|
UCHAR SectorsPerCluster; // 0x0D
|
2008-01-01 19:26:26 +00:00
|
|
|
UCHAR Unused0[7]; // 0x0E, checked when volume is mounted
|
2002-06-25 22:23:06 +00:00
|
|
|
UCHAR MediaId; // 0x15
|
|
|
|
UCHAR Unused1[2]; // 0x16
|
2007-12-28 21:56:19 +00:00
|
|
|
USHORT SectorsPerTrack; // 0x18
|
|
|
|
USHORT Heads; // 0x1A
|
2008-01-01 19:26:26 +00:00
|
|
|
UCHAR Unused2[4]; // 0x1C
|
|
|
|
UCHAR Unused3[4]; // 0x20, checked when volume is mounted
|
2007-12-28 21:56:19 +00:00
|
|
|
} BIOS_PARAMETERS_BLOCK, *PBIOS_PARAMETERS_BLOCK;
|
|
|
|
|
|
|
|
typedef struct _EXTENDED_BIOS_PARAMETERS_BLOCK
|
|
|
|
{
|
2008-02-24 10:06:37 +00:00
|
|
|
USHORT Unknown[2]; // 0x24, always 80 00 80 00
|
2007-12-28 21:56:19 +00:00
|
|
|
ULONGLONG SectorCount; // 0x28
|
|
|
|
ULONGLONG MftLocation; // 0x30
|
|
|
|
ULONGLONG MftMirrLocation; // 0x38
|
|
|
|
CHAR ClustersPerMftRecord; // 0x40
|
2008-01-01 19:26:26 +00:00
|
|
|
UCHAR Unused4[3]; // 0x41
|
2007-12-28 21:56:19 +00:00
|
|
|
CHAR ClustersPerIndexRecord; // 0x44
|
2008-01-01 19:26:26 +00:00
|
|
|
UCHAR Unused5[3]; // 0x45
|
2002-06-25 22:23:06 +00:00
|
|
|
ULONGLONG SerialNumber; // 0x48
|
2007-12-28 21:56:19 +00:00
|
|
|
UCHAR Checksum[4]; // 0x50
|
|
|
|
} EXTENDED_BIOS_PARAMETERS_BLOCK, *PEXTENDED_BIOS_PARAMETERS_BLOCK;
|
|
|
|
|
|
|
|
typedef struct _BOOT_SECTOR
|
|
|
|
{
|
|
|
|
UCHAR Jump[3]; // 0x00
|
|
|
|
UCHAR OEMID[8]; // 0x03
|
|
|
|
BIOS_PARAMETERS_BLOCK BPB;
|
|
|
|
EXTENDED_BIOS_PARAMETERS_BLOCK EBPB;
|
|
|
|
UCHAR BootStrap[426]; // 0x54
|
|
|
|
USHORT EndSector; // 0x1FE
|
2006-01-07 06:20:59 +00:00
|
|
|
} BOOT_SECTOR, *PBOOT_SECTOR;
|
|
|
|
#include <poppack.h>
|
2002-06-25 22:23:06 +00:00
|
|
|
|
|
|
|
//typedef struct _BootSector BootSector;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _NTFS_INFO
|
|
|
|
{
|
|
|
|
ULONG BytesPerSector;
|
|
|
|
ULONG SectorsPerCluster;
|
|
|
|
ULONG BytesPerCluster;
|
|
|
|
ULONGLONG SectorCount;
|
2002-07-15 15:37:33 +00:00
|
|
|
ULARGE_INTEGER MftStart;
|
|
|
|
ULARGE_INTEGER MftMirrStart;
|
2004-06-05 08:28:37 +00:00
|
|
|
ULONG BytesPerFileRecord;
|
2002-06-25 22:23:06 +00:00
|
|
|
|
2003-11-12 15:30:21 +00:00
|
|
|
ULONGLONG SerialNumber;
|
|
|
|
USHORT VolumeLabelLength;
|
|
|
|
WCHAR VolumeLabel[MAXIMUM_VOLUME_LABEL_LENGTH];
|
|
|
|
UCHAR MajorVersion;
|
|
|
|
UCHAR MinorVersion;
|
|
|
|
USHORT Flags;
|
|
|
|
|
2002-06-25 22:23:06 +00:00
|
|
|
} NTFS_INFO, *PNTFS_INFO;
|
|
|
|
|
2009-08-24 17:12:25 +00:00
|
|
|
#define NTFS_TYPE_CCB '20SF'
|
|
|
|
#define NTFS_TYPE_FCB '30SF'
|
|
|
|
#define NTFS_TYPE_VCB '50SF'
|
|
|
|
#define NTFS_TYPE_IRP_CONTEST '60SF'
|
|
|
|
#define NTFS_TYPE_GLOBAL_DATA '70SF'
|
2008-03-15 08:51:47 +00:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
ULONG Type;
|
|
|
|
ULONG Size;
|
|
|
|
} NTFSIDENTIFIER, *PNTFSIDENTIFIER;
|
|
|
|
|
2002-06-25 22:23:06 +00:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2008-03-15 08:51:47 +00:00
|
|
|
NTFSIDENTIFIER Identifier;
|
|
|
|
|
2002-06-25 22:23:06 +00:00
|
|
|
ERESOURCE DirResource;
|
|
|
|
// ERESOURCE FatResource;
|
|
|
|
|
|
|
|
KSPIN_LOCK FcbListLock;
|
|
|
|
LIST_ENTRY FcbListHead;
|
|
|
|
|
|
|
|
PVPB Vpb;
|
|
|
|
PDEVICE_OBJECT StorageDevice;
|
|
|
|
PFILE_OBJECT StreamFileObject;
|
|
|
|
|
|
|
|
NTFS_INFO NtfsInfo;
|
|
|
|
|
|
|
|
|
2008-03-15 08:51:47 +00:00
|
|
|
} DEVICE_EXTENSION, *PDEVICE_EXTENSION, NTFS_VCB, *PNTFS_VCB;
|
2002-06-25 22:23:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
#define FCB_CACHE_INITIALIZED 0x0001
|
|
|
|
#define FCB_IS_VOLUME_STREAM 0x0002
|
|
|
|
#define FCB_IS_VOLUME 0x0004
|
2006-01-07 06:20:59 +00:00
|
|
|
#define MAX_PATH 260
|
2002-06-25 22:23:06 +00:00
|
|
|
|
|
|
|
typedef struct _FCB
|
|
|
|
{
|
2008-03-15 08:51:47 +00:00
|
|
|
NTFSIDENTIFIER Identifier;
|
|
|
|
|
2003-06-07 Casper S. Hornstrup <chorns@users.sourceforge.net>
Changes for compiling with w32api
* include/ddk/cctypes.h (PREACTOS_COMMON_FCB_HEADER): Remove.
(FSRTL_COMMON_FCB_HEADER): Add.
* include/ddk/iotypes.h (FILE_OBJECT): Rename field
SectionObjectPointers to SectionObjectPointer.
* ntoskrnl/cc/copy.c, ntoskrnl/cc/misc.c, ntoskrnl/cc/pin.c,
ntoskrnl/cc/view.c, ntoskrnl/io/rawfs.c, ntoskrnl/mm/section.c,
drivers/fs/cdfs/cleanup.c, drivers/fs/cdfs/fcb.c,
drivers/fs/cdfs/fsctl.c, drivers/fs/ntfs/fcb.c, drivers/fs/ntfs/fsctl.c,
drivers/fs/vfat/close.c, drivers/fs/vfat/create.c,
drivers/fs/vfat/finfo.c, drivers/fs/vfat/fcb.c, drivers/fs/vfat/fsctl.c:
Use new FILE_OBJECT structure.
* drivers/fs/cdfs/cdfs.h, drivers/fs/ntfs/ntfs.h, drivers/fs/vfat/vfat.h:
Use new FSRTL_COMMON_FCB_HEADER structure.
* drivers/net/afd/include/afd.h (FSRTL_COMMON_FCB_HEADER): Remove.
* include/ddk/ketypes.h (KQUEUE): Match w32api structure.
* ntoskrnl/ke/queue.c, ntoskrnl/ke/wait.c: Use new structure.
* ntoskrnl/ke/spinlock.c (KeAcquireSpinLockAtDpcLevel,
KeReleaseSpinLockFromDpcLevel): Undefine before declaring.
svn path=/trunk/; revision=4865
2003-06-07 11:34:36 +00:00
|
|
|
FSRTL_COMMON_FCB_HEADER RFCB;
|
2002-06-25 22:23:06 +00:00
|
|
|
SECTION_OBJECT_POINTERS SectionObjectPointers;
|
|
|
|
|
|
|
|
PFILE_OBJECT FileObject;
|
2008-06-20 18:40:57 +00:00
|
|
|
PNTFS_VCB Vcb;
|
2002-06-25 22:23:06 +00:00
|
|
|
|
|
|
|
WCHAR *ObjectName; /* point on filename (250 chars max) in PathName */
|
|
|
|
WCHAR PathName[MAX_PATH]; /* path+filename 260 max */
|
|
|
|
|
|
|
|
ERESOURCE PagingIoResource;
|
|
|
|
ERESOURCE MainResource;
|
|
|
|
|
|
|
|
LIST_ENTRY FcbListEntry;
|
|
|
|
struct _FCB* ParentFcb;
|
|
|
|
|
|
|
|
ULONG DirIndex;
|
|
|
|
|
|
|
|
LONG RefCount;
|
|
|
|
ULONG Flags;
|
|
|
|
|
|
|
|
// DIR_RECORD Entry;
|
|
|
|
|
|
|
|
|
2008-03-15 08:51:47 +00:00
|
|
|
} NTFS_FCB, *PNTFS_FCB;
|
2002-06-25 22:23:06 +00:00
|
|
|
|
|
|
|
|
2008-03-15 08:51:47 +00:00
|
|
|
typedef struct
|
2002-06-25 22:23:06 +00:00
|
|
|
{
|
2008-03-15 08:51:47 +00:00
|
|
|
NTFSIDENTIFIER Identifier;
|
2002-06-25 22:23:06 +00:00
|
|
|
LIST_ENTRY NextCCB;
|
|
|
|
PFILE_OBJECT PtrFileObject;
|
|
|
|
LARGE_INTEGER CurrentByteOffset;
|
|
|
|
/* for DirectoryControl */
|
|
|
|
ULONG Entry;
|
|
|
|
/* for DirectoryControl */
|
|
|
|
PWCHAR DirectorySearchPattern;
|
|
|
|
ULONG LastCluster;
|
|
|
|
ULONG LastOffset;
|
2008-03-15 08:51:47 +00:00
|
|
|
} NTFS_CCB, *PNTFS_CCB;
|
2002-06-25 22:23:06 +00:00
|
|
|
|
2009-08-24 17:12:25 +00:00
|
|
|
#define TAG_CCB 'BCCI'
|
2002-06-25 22:23:06 +00:00
|
|
|
|
2008-01-12 20:54:41 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
NTFSIDENTIFIER Identifier;
|
|
|
|
ERESOURCE Resource;
|
2002-06-25 22:23:06 +00:00
|
|
|
PDRIVER_OBJECT DriverObject;
|
|
|
|
PDEVICE_OBJECT DeviceObject;
|
2008-03-08 13:17:48 +00:00
|
|
|
CACHE_MANAGER_CALLBACKS CacheMgrCallbacks;
|
2002-06-25 22:23:06 +00:00
|
|
|
ULONG Flags;
|
|
|
|
} NTFS_GLOBAL_DATA, *PNTFS_GLOBAL_DATA;
|
|
|
|
|
2002-07-15 15:37:33 +00:00
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
AttributeStandardInformation = 0x10,
|
|
|
|
AttributeAttributeList = 0x20,
|
|
|
|
AttributeFileName = 0x30,
|
|
|
|
AttributeObjectId = 0x40,
|
|
|
|
AttributeSecurityDescriptor = 0x50,
|
|
|
|
AttributeVolumeName = 0x60,
|
|
|
|
AttributeVolumeInformation = 0x70,
|
|
|
|
AttributeData = 0x80,
|
|
|
|
AttributeIndexRoot = 0x90,
|
|
|
|
AttributeIndexAllocation = 0xA0,
|
|
|
|
AttributeBitmap = 0xB0,
|
|
|
|
AttributeReparsePoint = 0xC0,
|
|
|
|
AttributeEAInformation = 0xD0,
|
|
|
|
AttributeEA = 0xE0,
|
|
|
|
AttributePropertySet = 0xF0,
|
|
|
|
AttributeLoggedUtilityStream = 0x100
|
|
|
|
} ATTRIBUTE_TYPE, *PATTRIBUTE_TYPE;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2003-07-17 13:31:39 +00:00
|
|
|
ULONG Type; /* Magic number 'FILE' */
|
2003-09-15 16:01:16 +00:00
|
|
|
USHORT UsaOffset; /* Offset to the update sequence */
|
2003-11-12 15:30:21 +00:00
|
|
|
USHORT UsaCount; /* Size in words of Update Sequence Number & Array (S) */
|
2003-07-17 13:31:39 +00:00
|
|
|
ULONGLONG Lsn; /* $LogFile Sequence Number (LSN) */
|
2002-07-15 15:37:33 +00:00
|
|
|
} NTFS_RECORD_HEADER, *PNTFS_RECORD_HEADER;
|
|
|
|
|
2003-11-12 15:30:21 +00:00
|
|
|
/* NTFS_RECORD_HEADER.Type */
|
|
|
|
#define NRH_FILE_TYPE 0x454C4946 /* 'FILE' */
|
|
|
|
|
|
|
|
|
2002-07-15 15:37:33 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
NTFS_RECORD_HEADER Ntfs;
|
2003-07-17 13:31:39 +00:00
|
|
|
USHORT SequenceNumber; /* Sequence number */
|
|
|
|
USHORT LinkCount; /* Hard link count */
|
|
|
|
USHORT AttributeOffset; /* Offset to the first Attribute */
|
|
|
|
USHORT Flags; /* Flags */
|
|
|
|
ULONG BytesInUse; /* Real size of the FILE record */
|
|
|
|
ULONG BytesAllocated; /* Allocated size of the FILE record */
|
|
|
|
ULONGLONG BaseFileRecord; /* File reference to the base FILE record */
|
|
|
|
USHORT NextAttributeNumber; /* Next Attribute Id */
|
2006-01-07 06:20:59 +00:00
|
|
|
USHORT Pading; /* Align to 4 UCHAR boundary (XP) */
|
2003-07-17 13:31:39 +00:00
|
|
|
ULONG MFTRecordNumber; /* Number of this MFT Record (XP) */
|
2002-07-15 15:37:33 +00:00
|
|
|
} FILE_RECORD_HEADER, *PFILE_RECORD_HEADER;
|
|
|
|
|
2003-07-17 13:31:39 +00:00
|
|
|
/* Flags in FILE_RECORD_HEADER */
|
|
|
|
|
2003-11-12 15:30:21 +00:00
|
|
|
#define FRH_IN_USE 0x0001 /* Record is in use */
|
|
|
|
#define FRH_DIRECTORY 0x0002 /* Record is a directory */
|
|
|
|
#define FRH_UNKNOWN1 0x0004 /* Don't know */
|
|
|
|
#define FRH_UNKNOWN2 0x0008 /* Don't know */
|
2003-07-17 13:31:39 +00:00
|
|
|
|
2002-07-15 15:37:33 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
ATTRIBUTE_TYPE AttributeType;
|
|
|
|
ULONG Length;
|
|
|
|
BOOLEAN Nonresident;
|
|
|
|
UCHAR NameLength;
|
|
|
|
USHORT NameOffset;
|
|
|
|
USHORT Flags;
|
|
|
|
USHORT AttributeNumber;
|
|
|
|
} ATTRIBUTE, *PATTRIBUTE;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
ATTRIBUTE Attribute;
|
|
|
|
ULONG ValueLength;
|
|
|
|
USHORT ValueOffset;
|
|
|
|
UCHAR Flags;
|
|
|
|
// UCHAR Padding0;
|
|
|
|
} RESIDENT_ATTRIBUTE, *PRESIDENT_ATTRIBUTE;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
ATTRIBUTE Attribute;
|
|
|
|
ULONGLONG StartVcn; // LowVcn
|
|
|
|
ULONGLONG LastVcn; // HighVcn
|
|
|
|
USHORT RunArrayOffset;
|
|
|
|
USHORT CompressionUnit;
|
|
|
|
ULONG Padding0;
|
|
|
|
UCHAR IndexedFlag;
|
|
|
|
ULONGLONG AllocatedSize;
|
|
|
|
ULONGLONG DataSize;
|
|
|
|
ULONGLONG InitializedSize;
|
|
|
|
ULONGLONG CompressedSize;
|
|
|
|
} NONRESIDENT_ATTRIBUTE, *PNONRESIDENT_ATTRIBUTE;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
ULONGLONG CreationTime;
|
|
|
|
ULONGLONG ChangeTime;
|
|
|
|
ULONGLONG LastWriteTime;
|
|
|
|
ULONGLONG LastAccessTime;
|
|
|
|
ULONG FileAttribute;
|
|
|
|
ULONG AlignmentOrReserved[3];
|
|
|
|
#if 0
|
|
|
|
ULONG QuotaId;
|
|
|
|
ULONG SecurityId;
|
|
|
|
ULONGLONG QuotaCharge;
|
|
|
|
USN Usn;
|
|
|
|
#endif
|
|
|
|
} STANDARD_INFORMATION, *PSTANDARD_INFORMATION;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
ATTRIBUTE_TYPE AttributeType;
|
|
|
|
USHORT Length;
|
|
|
|
UCHAR NameLength;
|
|
|
|
UCHAR NameOffset;
|
|
|
|
ULONGLONG StartVcn; // LowVcn
|
|
|
|
ULONGLONG FileReferenceNumber;
|
|
|
|
USHORT AttributeNumber;
|
|
|
|
USHORT AlignmentOrReserved[3];
|
|
|
|
} ATTRIBUTE_LIST, *PATTRIBUTE_LIST;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
ULONGLONG DirectoryFileReferenceNumber;
|
|
|
|
ULONGLONG CreationTime;
|
|
|
|
ULONGLONG ChangeTime;
|
|
|
|
ULONGLONG LastWriteTime;
|
|
|
|
ULONGLONG LastAccessTime;
|
|
|
|
ULONGLONG AllocatedSize;
|
|
|
|
ULONGLONG DataSize;
|
|
|
|
ULONG FileAttributes;
|
|
|
|
ULONG AlignmentOrReserved;
|
|
|
|
UCHAR NameLength;
|
|
|
|
UCHAR NameType;
|
|
|
|
WCHAR Name[1];
|
|
|
|
} FILENAME_ATTRIBUTE, *PFILENAME_ATTRIBUTE;
|
2002-06-25 22:23:06 +00:00
|
|
|
|
2003-01-17 19:57:31 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
ULONGLONG Unknown1;
|
|
|
|
UCHAR MajorVersion;
|
|
|
|
UCHAR MinorVersion;
|
|
|
|
USHORT Flags;
|
|
|
|
ULONG Unknown2;
|
|
|
|
} VOLINFO_ATTRIBUTE, *PVOLINFO_ATTRIBUTE;
|
2002-06-25 22:23:06 +00:00
|
|
|
|
2008-02-10 11:20:29 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
NTFSIDENTIFIER Identifier;
|
|
|
|
ULONG Flags;
|
|
|
|
UCHAR MajorFunction;
|
|
|
|
UCHAR MinorFunction;
|
|
|
|
WORK_QUEUE_ITEM WorkQueueItem;
|
|
|
|
PIRP Irp;
|
|
|
|
BOOLEAN IsTopLevel;
|
|
|
|
PDEVICE_OBJECT DeviceObject;
|
|
|
|
NTSTATUS SavedExceptionCode;
|
|
|
|
} NTFS_IRP_CONTEXT, *PNTFS_IRP_CONTEXT;
|
|
|
|
|
2002-06-25 22:23:06 +00:00
|
|
|
|
2002-07-15 15:37:33 +00:00
|
|
|
extern PNTFS_GLOBAL_DATA NtfsGlobalData;
|
2002-06-25 22:23:06 +00:00
|
|
|
|
|
|
|
//int CdfsStrcmpi( wchar_t *str1, wchar_t *str2 );
|
|
|
|
//void CdfsWstrcpy( wchar_t *str1, wchar_t *str2, int max );
|
|
|
|
|
|
|
|
|
2002-07-15 15:37:33 +00:00
|
|
|
/* attrib.c */
|
|
|
|
|
2003-11-12 15:30:21 +00:00
|
|
|
//VOID
|
|
|
|
//NtfsDumpAttribute(PATTRIBUTE Attribute);
|
2002-07-15 15:37:33 +00:00
|
|
|
|
2003-11-12 15:30:21 +00:00
|
|
|
//LONGLONG RunLCN(PUCHAR run);
|
2003-09-15 16:01:16 +00:00
|
|
|
|
2003-11-12 15:30:21 +00:00
|
|
|
//ULONG RunLength(PUCHAR run);
|
2003-11-13 15:26:34 +00:00
|
|
|
|
|
|
|
BOOLEAN
|
|
|
|
FindRun (PNONRESIDENT_ATTRIBUTE NresAttr,
|
|
|
|
ULONGLONG vcn,
|
|
|
|
PULONGLONG lcn,
|
|
|
|
PULONGLONG count);
|
|
|
|
|
2003-11-12 15:30:21 +00:00
|
|
|
VOID
|
|
|
|
NtfsDumpFileAttributes (PFILE_RECORD_HEADER FileRecord);
|
2002-07-15 15:37:33 +00:00
|
|
|
|
2002-06-25 22:23:06 +00:00
|
|
|
/* blockdev.c */
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NtfsReadSectors(IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN ULONG DiskSector,
|
|
|
|
IN ULONG SectorCount,
|
|
|
|
IN ULONG SectorSize,
|
2003-11-12 15:30:21 +00:00
|
|
|
IN OUT PUCHAR Buffer,
|
|
|
|
IN BOOLEAN Override);
|
2002-06-25 22:23:06 +00:00
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NtfsDeviceIoControl(IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN ULONG ControlCode,
|
|
|
|
IN PVOID InputBuffer,
|
|
|
|
IN ULONG InputBufferSize,
|
|
|
|
IN OUT PVOID OutputBuffer,
|
2003-11-12 15:30:21 +00:00
|
|
|
IN OUT PULONG OutputBufferSize,
|
|
|
|
IN BOOLEAN Override);
|
2002-06-25 22:23:06 +00:00
|
|
|
|
|
|
|
/* close.c */
|
|
|
|
|
2008-02-10 11:20:29 +00:00
|
|
|
DRIVER_DISPATCH NtfsFsdClose;
|
|
|
|
NTSTATUS NTAPI
|
|
|
|
NtfsFsdClose(PDEVICE_OBJECT DeviceObject,
|
2002-06-25 22:23:06 +00:00
|
|
|
PIRP Irp);
|
|
|
|
|
|
|
|
/* create.c */
|
|
|
|
|
2008-02-10 11:20:29 +00:00
|
|
|
DRIVER_DISPATCH NtfsFsdCreate;
|
|
|
|
NTSTATUS NTAPI
|
|
|
|
NtfsFsdCreate(PDEVICE_OBJECT DeviceObject,
|
2002-06-25 22:23:06 +00:00
|
|
|
PIRP Irp);
|
|
|
|
|
|
|
|
|
|
|
|
/* dirctl.c */
|
|
|
|
|
2008-02-10 11:20:29 +00:00
|
|
|
DRIVER_DISPATCH NtfsFsdDirectoryControl;
|
|
|
|
NTSTATUS NTAPI
|
|
|
|
NtfsFsdDirectoryControl(PDEVICE_OBJECT DeviceObject,
|
2002-06-25 22:23:06 +00:00
|
|
|
PIRP Irp);
|
|
|
|
|
2008-02-10 11:20:29 +00:00
|
|
|
/* dispatch.c */
|
|
|
|
DRIVER_DISPATCH NtfsFsdDispatch;
|
|
|
|
NTSTATUS NTAPI
|
|
|
|
NtfsFsdDispatch(PDEVICE_OBJECT DeviceObject,
|
|
|
|
PIRP Irp);
|
|
|
|
|
2008-03-08 13:17:48 +00:00
|
|
|
/* fastio.c */
|
|
|
|
BOOLEAN NTAPI
|
|
|
|
NtfsAcqLazyWrite(PVOID Context,
|
|
|
|
BOOLEAN Wait);
|
|
|
|
|
|
|
|
VOID NTAPI
|
|
|
|
NtfsRelLazyWrite(PVOID Context);
|
|
|
|
|
|
|
|
BOOLEAN NTAPI
|
|
|
|
NtfsAcqReadAhead(PVOID Context,
|
|
|
|
BOOLEAN Wait);
|
|
|
|
|
|
|
|
VOID NTAPI
|
|
|
|
NtfsRelReadAhead(PVOID Context);
|
|
|
|
|
2002-06-25 22:23:06 +00:00
|
|
|
/* fcb.c */
|
|
|
|
|
2008-03-15 08:51:47 +00:00
|
|
|
PNTFS_FCB
|
2008-06-20 18:40:57 +00:00
|
|
|
NtfsCreateFCB(PCWSTR FileName, PNTFS_VCB Vcb);
|
2002-06-25 22:23:06 +00:00
|
|
|
|
|
|
|
VOID
|
2008-03-15 08:51:47 +00:00
|
|
|
NtfsDestroyFCB(PNTFS_FCB Fcb);
|
2002-06-25 22:23:06 +00:00
|
|
|
|
|
|
|
BOOLEAN
|
2008-03-15 08:51:47 +00:00
|
|
|
NtfsFCBIsDirectory(PNTFS_FCB Fcb);
|
2002-06-25 22:23:06 +00:00
|
|
|
|
|
|
|
BOOLEAN
|
2008-03-15 08:51:47 +00:00
|
|
|
NtfsFCBIsRoot(PNTFS_FCB Fcb);
|
2002-06-25 22:23:06 +00:00
|
|
|
|
|
|
|
VOID
|
2008-03-15 08:51:47 +00:00
|
|
|
NtfsGrabFCB(PNTFS_VCB Vcb,
|
|
|
|
PNTFS_FCB Fcb);
|
2002-06-25 22:23:06 +00:00
|
|
|
|
|
|
|
VOID
|
2008-03-15 08:51:47 +00:00
|
|
|
NtfsReleaseFCB(PNTFS_VCB Vcb,
|
|
|
|
PNTFS_FCB Fcb);
|
2002-06-25 22:23:06 +00:00
|
|
|
|
|
|
|
VOID
|
2008-03-15 08:51:47 +00:00
|
|
|
NtfsAddFCBToTable(PNTFS_VCB Vcb,
|
|
|
|
PNTFS_FCB Fcb);
|
2002-06-25 22:23:06 +00:00
|
|
|
|
2008-03-15 08:51:47 +00:00
|
|
|
PNTFS_FCB
|
|
|
|
NtfsGrabFCBFromTable(PNTFS_VCB Vcb,
|
2005-11-11 19:59:38 +00:00
|
|
|
PCWSTR FileName);
|
2002-06-25 22:23:06 +00:00
|
|
|
|
|
|
|
NTSTATUS
|
2008-03-15 08:51:47 +00:00
|
|
|
NtfsFCBInitializeCache(PNTFS_VCB Vcb,
|
|
|
|
PNTFS_FCB Fcb);
|
2002-06-25 22:23:06 +00:00
|
|
|
|
2008-03-15 08:51:47 +00:00
|
|
|
PNTFS_FCB
|
|
|
|
NtfsMakeRootFCB(PNTFS_VCB Vcb);
|
2002-06-25 22:23:06 +00:00
|
|
|
|
2008-03-15 08:51:47 +00:00
|
|
|
PNTFS_FCB
|
|
|
|
NtfsOpenRootFCB(PNTFS_VCB Vcb);
|
2002-06-25 22:23:06 +00:00
|
|
|
|
|
|
|
NTSTATUS
|
2008-03-15 08:51:47 +00:00
|
|
|
NtfsAttachFCBToFileObject(PNTFS_VCB Vcb,
|
|
|
|
PNTFS_FCB Fcb,
|
2002-06-25 22:23:06 +00:00
|
|
|
PFILE_OBJECT FileObject);
|
|
|
|
|
|
|
|
NTSTATUS
|
2008-03-15 08:51:47 +00:00
|
|
|
NtfsGetFCBForFile(PNTFS_VCB Vcb,
|
|
|
|
PNTFS_FCB *pParentFCB,
|
|
|
|
PNTFS_FCB *pFCB,
|
2002-06-25 22:23:06 +00:00
|
|
|
const PWSTR pFileName);
|
|
|
|
|
|
|
|
|
|
|
|
/* finfo.c */
|
|
|
|
|
2008-02-10 11:20:29 +00:00
|
|
|
DRIVER_DISPATCH NtfsFsdQueryInformation;
|
|
|
|
NTSTATUS NTAPI
|
|
|
|
NtfsFsdQueryInformation(PDEVICE_OBJECT DeviceObject,
|
2002-06-25 22:23:06 +00:00
|
|
|
PIRP Irp);
|
|
|
|
|
|
|
|
|
|
|
|
/* fsctl.c */
|
|
|
|
|
2008-02-10 11:20:29 +00:00
|
|
|
DRIVER_DISPATCH NtfsFsdFileSystemControl;
|
|
|
|
NTSTATUS NTAPI
|
|
|
|
NtfsFsdFileSystemControl(PDEVICE_OBJECT DeviceObject,
|
2002-06-25 22:23:06 +00:00
|
|
|
PIRP Irp);
|
|
|
|
|
2002-07-15 15:37:33 +00:00
|
|
|
|
|
|
|
/* mft.c */
|
|
|
|
NTSTATUS
|
2003-11-12 15:30:21 +00:00
|
|
|
NtfsOpenMft (PDEVICE_EXTENSION Vcb);
|
2002-07-15 15:37:33 +00:00
|
|
|
|
|
|
|
|
2003-11-12 15:30:21 +00:00
|
|
|
VOID
|
2005-05-08 02:16:32 +00:00
|
|
|
ReadAttribute(PATTRIBUTE attr, PVOID buffer, PDEVICE_EXTENSION Vcb,
|
2003-09-15 16:01:16 +00:00
|
|
|
PDEVICE_OBJECT DeviceObject);
|
|
|
|
|
2003-11-12 15:30:21 +00:00
|
|
|
ULONG
|
|
|
|
AttributeDataLength(PATTRIBUTE attr);
|
2003-09-15 16:01:16 +00:00
|
|
|
|
2005-10-06 21:39:18 +00:00
|
|
|
ULONG
|
|
|
|
AttributeAllocatedLength (PATTRIBUTE Attribute);
|
|
|
|
|
2004-06-05 08:28:37 +00:00
|
|
|
NTSTATUS
|
2003-11-12 15:30:21 +00:00
|
|
|
ReadFileRecord (PDEVICE_EXTENSION Vcb,
|
|
|
|
ULONG index,
|
|
|
|
PFILE_RECORD_HEADER file,
|
|
|
|
PFILE_RECORD_HEADER Mft);
|
2003-09-15 16:01:16 +00:00
|
|
|
|
2003-11-12 15:30:21 +00:00
|
|
|
PATTRIBUTE
|
|
|
|
FindAttribute(PFILE_RECORD_HEADER file,
|
|
|
|
ATTRIBUTE_TYPE type,
|
|
|
|
PWSTR name);
|
2003-09-15 16:01:16 +00:00
|
|
|
|
2003-11-12 15:30:21 +00:00
|
|
|
ULONG
|
|
|
|
AttributeLengthAllocated(PATTRIBUTE attr);
|
2003-09-15 16:01:16 +00:00
|
|
|
|
2003-11-12 15:30:21 +00:00
|
|
|
VOID
|
|
|
|
ReadVCN (PDEVICE_EXTENSION Vcb,
|
|
|
|
PFILE_RECORD_HEADER file,
|
|
|
|
ATTRIBUTE_TYPE type,
|
|
|
|
ULONGLONG vcn,
|
|
|
|
ULONG count,
|
|
|
|
PVOID buffer);
|
2003-09-15 16:01:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
VOID FixupUpdateSequenceArray(PFILE_RECORD_HEADER file);
|
|
|
|
|
2003-11-12 15:30:21 +00:00
|
|
|
VOID
|
|
|
|
ReadExternalAttribute (PDEVICE_EXTENSION Vcb,
|
|
|
|
PNONRESIDENT_ATTRIBUTE NresAttr,
|
|
|
|
ULONGLONG vcn,
|
|
|
|
ULONG count,
|
|
|
|
PVOID buffer);
|
2003-09-15 16:01:16 +00:00
|
|
|
|
2003-11-12 15:30:21 +00:00
|
|
|
NTSTATUS
|
|
|
|
ReadLCN (PDEVICE_EXTENSION Vcb,
|
|
|
|
ULONGLONG lcn,
|
|
|
|
ULONG count,
|
|
|
|
PVOID buffer);
|
2003-09-15 16:01:16 +00:00
|
|
|
|
|
|
|
|
2003-11-12 15:30:21 +00:00
|
|
|
VOID
|
|
|
|
EnumerAttribute(PFILE_RECORD_HEADER file,
|
|
|
|
PDEVICE_EXTENSION Vcb,
|
|
|
|
PDEVICE_OBJECT DeviceObject);
|
2003-09-15 16:01:16 +00:00
|
|
|
|
2002-06-25 22:23:06 +00:00
|
|
|
/* misc.c */
|
2008-02-10 11:20:29 +00:00
|
|
|
BOOLEAN
|
|
|
|
NtfsIsIrpTopLevel(PIRP Irp);
|
|
|
|
|
|
|
|
PNTFS_IRP_CONTEXT
|
|
|
|
NtfsAllocateIrpContext(PDEVICE_OBJECT DeviceObject,
|
|
|
|
PIRP Irp);
|
2002-06-25 22:23:06 +00:00
|
|
|
|
2008-02-10 11:20:29 +00:00
|
|
|
#if 0
|
2002-06-25 22:23:06 +00:00
|
|
|
BOOLEAN
|
|
|
|
wstrcmpjoki(PWSTR s1, PWSTR s2);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
CdfsSwapString(PWCHAR Out,
|
|
|
|
PUCHAR In,
|
|
|
|
ULONG Count);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
CdfsDateTimeToFileTime(PFCB Fcb,
|
|
|
|
TIME *FileTime);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
CdfsFileFlagsToAttributes(PFCB Fcb,
|
|
|
|
PULONG FileAttributes);
|
2003-07-17 13:31:39 +00:00
|
|
|
#endif
|
2002-06-25 22:23:06 +00:00
|
|
|
|
|
|
|
/* rw.c */
|
|
|
|
|
2008-02-10 11:20:29 +00:00
|
|
|
DRIVER_DISPATCH NtfsFsdRead;
|
|
|
|
NTSTATUS NTAPI
|
|
|
|
NtfsFsdRead(PDEVICE_OBJECT DeviceObject,
|
2002-06-25 22:23:06 +00:00
|
|
|
PIRP Irp);
|
|
|
|
|
2008-02-10 11:20:29 +00:00
|
|
|
DRIVER_DISPATCH NtfsFsdWrite;
|
|
|
|
NTSTATUS NTAPI
|
|
|
|
NtfsFsdWrite(PDEVICE_OBJECT DeviceObject,
|
2002-06-25 22:23:06 +00:00
|
|
|
PIRP Irp);
|
|
|
|
|
|
|
|
|
|
|
|
/* volinfo.c */
|
|
|
|
|
2008-02-10 11:20:29 +00:00
|
|
|
NTSTATUS
|
|
|
|
NtfsQueryVolumeInformation(PNTFS_IRP_CONTEXT IrpContext);
|
2002-06-25 22:23:06 +00:00
|
|
|
|
2008-02-10 11:20:29 +00:00
|
|
|
NTSTATUS
|
|
|
|
NtfsSetVolumeInformation(PNTFS_IRP_CONTEXT IrpContext);
|
2002-06-25 22:23:06 +00:00
|
|
|
|
2005-10-06 21:39:18 +00:00
|
|
|
/* ntfs.c */
|
|
|
|
|
2008-01-12 20:54:41 +00:00
|
|
|
DRIVER_INITIALIZE DriverEntry;
|
2005-10-06 21:39:18 +00:00
|
|
|
|
2008-01-12 20:54:41 +00:00
|
|
|
VOID NTAPI NtfsInitializeFunctionPointers(PDRIVER_OBJECT DriverObject);
|
2002-06-25 22:23:06 +00:00
|
|
|
#endif /* NTFS_H */
|