[NTFS]
[reactos.git] / reactos / drivers / filesystems / ntfs / ntfs.h
1 #ifndef NTFS_H
2 #define NTFS_H
3
4 #include <ntifs.h>
5
6 #define CACHEPAGESIZE(pDeviceExt) \
7 ((pDeviceExt)->NtfsInfo.UCHARsPerCluster > PAGE_SIZE ? \
8 (pDeviceExt)->NtfsInfo.UCHARsPerCluster : PAGE_SIZE)
9
10 #define TAG_NTFS 'SFTN'
11
12 #define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
13 #define ROUND_DOWN(N, S) ((N) - ((N) % (S)))
14
15 #define DEVICE_NAME L"\\Ntfs"
16
17 #include <pshpack1.h>
18 typedef struct _BIOS_PARAMETERS_BLOCK
19 {
20 USHORT BytesPerSector; // 0x0B
21 UCHAR SectorsPerCluster; // 0x0D
22 UCHAR Unused0[7]; // 0x0E, checked when volume is mounted
23 UCHAR MediaId; // 0x15
24 UCHAR Unused1[2]; // 0x16
25 USHORT SectorsPerTrack; // 0x18
26 USHORT Heads; // 0x1A
27 UCHAR Unused2[4]; // 0x1C
28 UCHAR Unused3[4]; // 0x20, checked when volume is mounted
29 } BIOS_PARAMETERS_BLOCK, *PBIOS_PARAMETERS_BLOCK;
30
31 typedef struct _EXTENDED_BIOS_PARAMETERS_BLOCK
32 {
33 USHORT Unknown[2]; // 0x24, always 80 00 80 00
34 ULONGLONG SectorCount; // 0x28
35 ULONGLONG MftLocation; // 0x30
36 ULONGLONG MftMirrLocation; // 0x38
37 CHAR ClustersPerMftRecord; // 0x40
38 UCHAR Unused4[3]; // 0x41
39 CHAR ClustersPerIndexRecord; // 0x44
40 UCHAR Unused5[3]; // 0x45
41 ULONGLONG SerialNumber; // 0x48
42 UCHAR Checksum[4]; // 0x50
43 } EXTENDED_BIOS_PARAMETERS_BLOCK, *PEXTENDED_BIOS_PARAMETERS_BLOCK;
44
45 typedef struct _BOOT_SECTOR
46 {
47 UCHAR Jump[3]; // 0x00
48 UCHAR OEMID[8]; // 0x03
49 BIOS_PARAMETERS_BLOCK BPB;
50 EXTENDED_BIOS_PARAMETERS_BLOCK EBPB;
51 UCHAR BootStrap[426]; // 0x54
52 USHORT EndSector; // 0x1FE
53 } BOOT_SECTOR, *PBOOT_SECTOR;
54 #include <poppack.h>
55
56 //typedef struct _BootSector BootSector;
57
58 typedef struct _NTFS_INFO
59 {
60 ULONG BytesPerSector;
61 ULONG SectorsPerCluster;
62 ULONG BytesPerCluster;
63 ULONGLONG SectorCount;
64 ULARGE_INTEGER MftStart;
65 ULARGE_INTEGER MftMirrStart;
66 ULONG BytesPerFileRecord;
67 ULONG BytesPerIndexRecord;
68
69 ULONGLONG SerialNumber;
70 USHORT VolumeLabelLength;
71 WCHAR VolumeLabel[MAXIMUM_VOLUME_LABEL_LENGTH];
72 UCHAR MajorVersion;
73 UCHAR MinorVersion;
74 USHORT Flags;
75
76 } NTFS_INFO, *PNTFS_INFO;
77
78 #define NTFS_TYPE_CCB '20SF'
79 #define NTFS_TYPE_FCB '30SF'
80 #define NTFS_TYPE_VCB '50SF'
81 #define NTFS_TYPE_IRP_CONTEST '60SF'
82 #define NTFS_TYPE_GLOBAL_DATA '70SF'
83
84 typedef struct
85 {
86 ULONG Type;
87 ULONG Size;
88 } NTFSIDENTIFIER, *PNTFSIDENTIFIER;
89
90 typedef struct
91 {
92 NTFSIDENTIFIER Identifier;
93
94 ERESOURCE DirResource;
95 // ERESOURCE FatResource;
96
97 KSPIN_LOCK FcbListLock;
98 LIST_ENTRY FcbListHead;
99
100 PVPB Vpb;
101 PDEVICE_OBJECT StorageDevice;
102 PFILE_OBJECT StreamFileObject;
103
104 struct _NTFS_ATTR_CONTEXT* MFTContext;
105 struct _FILE_RECORD_HEADER* MasterFileTable;
106 struct _FCB *VolumeFcb;
107
108 NTFS_INFO NtfsInfo;
109
110 } DEVICE_EXTENSION, *PDEVICE_EXTENSION, NTFS_VCB, *PNTFS_VCB;
111
112 typedef struct
113 {
114 NTFSIDENTIFIER Identifier;
115 LIST_ENTRY NextCCB;
116 PFILE_OBJECT PtrFileObject;
117 LARGE_INTEGER CurrentByteOffset;
118 /* for DirectoryControl */
119 ULONG Entry;
120 /* for DirectoryControl */
121 PWCHAR DirectorySearchPattern;
122 ULONG LastCluster;
123 ULONG LastOffset;
124 } NTFS_CCB, *PNTFS_CCB;
125
126 #define TAG_CCB 'BCCI'
127
128 typedef struct
129 {
130 NTFSIDENTIFIER Identifier;
131 ERESOURCE Resource;
132 PDRIVER_OBJECT DriverObject;
133 PDEVICE_OBJECT DeviceObject;
134 CACHE_MANAGER_CALLBACKS CacheMgrCallbacks;
135 ULONG Flags;
136 } NTFS_GLOBAL_DATA, *PNTFS_GLOBAL_DATA;
137
138
139 typedef enum
140 {
141 AttributeStandardInformation = 0x10,
142 AttributeAttributeList = 0x20,
143 AttributeFileName = 0x30,
144 AttributeObjectId = 0x40,
145 AttributeSecurityDescriptor = 0x50,
146 AttributeVolumeName = 0x60,
147 AttributeVolumeInformation = 0x70,
148 AttributeData = 0x80,
149 AttributeIndexRoot = 0x90,
150 AttributeIndexAllocation = 0xA0,
151 AttributeBitmap = 0xB0,
152 AttributeReparsePoint = 0xC0,
153 AttributeEAInformation = 0xD0,
154 AttributeEA = 0xE0,
155 AttributePropertySet = 0xF0,
156 AttributeLoggedUtilityStream = 0x100,
157 AttributeEnd = 0xFFFFFFFF
158 } ATTRIBUTE_TYPE, *PATTRIBUTE_TYPE;
159
160 #define NTFS_FILE_MFT 0
161 #define NTFS_FILE_MFTMIRR 1
162 #define NTFS_FILE_LOGFILE 2
163 #define NTFS_FILE_VOLUME 3
164 #define NTFS_FILE_ATTRDEF 4
165 #define NTFS_FILE_ROOT 5
166 #define NTFS_FILE_BITMAP 6
167 #define NTFS_FILE_BOOT 7
168 #define NTFS_FILE_BADCLUS 8
169 #define NTFS_FILE_QUOTA 9
170 #define NTFS_FILE_UPCASE 10
171 #define NTFS_FILE_EXTEND 11
172
173 #define NTFS_MFT_MASK 0x0000FFFFFFFFFFFFULL
174
175 #define COLLATION_BINARY 0x00
176 #define COLLATION_FILE_NAME 0x01
177 #define COLLATION_UNICODE_STRING 0x02
178 #define COLLATION_NTOFS_ULONG 0x10
179 #define COLLATION_NTOFS_SID 0x11
180 #define COLLATION_NTOFS_SECURITY_HASH 0x12
181 #define COLLATION_NTOFS_ULONGS 0x13
182
183 #define INDEX_ROOT_SMALL 0x0
184 #define INDEX_ROOT_LARGE 0x1
185
186 #define NTFS_INDEX_ENTRY_NODE 1
187 #define NTFS_INDEX_ENTRY_END 2
188
189 #define NTFS_FILE_NAME_POSIX 0
190 #define NTFS_FILE_NAME_WIN32 1
191 #define NTFS_FILE_NAME_DOS 2
192 #define NTFS_FILE_NAME_WIN32_AND_DOS 3
193
194 #define NTFS_FILE_TYPE_READ_ONLY 0x1
195 #define NTFS_FILE_TYPE_HIDDEN 0x2
196 #define NTFS_FILE_TYPE_SYSTEM 0x4
197 #define NTFS_FILE_TYPE_ARCHIVE 0x20
198 #define NTFS_FILE_TYPE_COMPRESSED 0x800
199 #define NTFS_FILE_TYPE_DIRECTORY 0x10000000
200
201 typedef struct
202 {
203 ULONG Type; /* Magic number 'FILE' */
204 USHORT UsaOffset; /* Offset to the update sequence */
205 USHORT UsaCount; /* Size in words of Update Sequence Number & Array (S) */
206 ULONGLONG Lsn; /* $LogFile Sequence Number (LSN) */
207 } NTFS_RECORD_HEADER, *PNTFS_RECORD_HEADER;
208
209 /* NTFS_RECORD_HEADER.Type */
210 #define NRH_FILE_TYPE 0x454C4946 /* 'FILE' */
211 #define NRH_INDX_TYPE 0x58444E49 /* 'INDX' */
212
213
214 typedef struct _FILE_RECORD_HEADER
215 {
216 NTFS_RECORD_HEADER Ntfs;
217 USHORT SequenceNumber; /* Sequence number */
218 USHORT LinkCount; /* Hard link count */
219 USHORT AttributeOffset; /* Offset to the first Attribute */
220 USHORT Flags; /* Flags */
221 ULONG BytesInUse; /* Real size of the FILE record */
222 ULONG BytesAllocated; /* Allocated size of the FILE record */
223 ULONGLONG BaseFileRecord; /* File reference to the base FILE record */
224 USHORT NextAttributeNumber; /* Next Attribute Id */
225 USHORT Pading; /* Align to 4 UCHAR boundary (XP) */
226 ULONG MFTRecordNumber; /* Number of this MFT Record (XP) */
227 } FILE_RECORD_HEADER, *PFILE_RECORD_HEADER;
228
229 /* Flags in FILE_RECORD_HEADER */
230
231 #define FRH_IN_USE 0x0001 /* Record is in use */
232 #define FRH_DIRECTORY 0x0002 /* Record is a directory */
233 #define FRH_UNKNOWN1 0x0004 /* Don't know */
234 #define FRH_UNKNOWN2 0x0008 /* Don't know */
235
236 typedef struct
237 {
238 ULONG Type;
239 ULONG Length;
240 UCHAR IsNonResident;
241 UCHAR NameLength;
242 USHORT NameOffset;
243 USHORT Flags;
244 USHORT Instance;
245 union
246 {
247 // Resident attributes
248 struct
249 {
250 ULONG ValueLength;
251 USHORT ValueOffset;
252 UCHAR Flags;
253 UCHAR Reserved;
254 } Resident;
255 // Non-resident attributes
256 struct
257 {
258 ULONGLONG LowestVCN;
259 ULONGLONG HighestVCN;
260 USHORT MappingPairsOffset;
261 USHORT CompressionUnit;
262 UCHAR Reserved[4];
263 LONGLONG AllocatedSize;
264 LONGLONG DataSize;
265 LONGLONG InitializedSize;
266 LONGLONG CompressedSize;
267 } NonResident;
268 };
269 } NTFS_ATTR_RECORD, *PNTFS_ATTR_RECORD;
270
271 typedef struct
272 {
273 ULONGLONG CreationTime;
274 ULONGLONG ChangeTime;
275 ULONGLONG LastWriteTime;
276 ULONGLONG LastAccessTime;
277 ULONG FileAttribute;
278 ULONG AlignmentOrReserved[3];
279 #if 0
280 ULONG QuotaId;
281 ULONG SecurityId;
282 ULONGLONG QuotaCharge;
283 USN Usn;
284 #endif
285 } STANDARD_INFORMATION, *PSTANDARD_INFORMATION;
286
287
288 typedef struct
289 {
290 ATTRIBUTE_TYPE AttributeType;
291 USHORT Length;
292 UCHAR NameLength;
293 UCHAR NameOffset;
294 ULONGLONG StartVcn; // LowVcn
295 ULONGLONG FileReferenceNumber;
296 USHORT AttributeNumber;
297 USHORT AlignmentOrReserved[3];
298 } ATTRIBUTE_LIST, *PATTRIBUTE_LIST;
299
300
301 typedef struct
302 {
303 ULONGLONG DirectoryFileReferenceNumber;
304 ULONGLONG CreationTime;
305 ULONGLONG ChangeTime;
306 ULONGLONG LastWriteTime;
307 ULONGLONG LastAccessTime;
308 ULONGLONG AllocatedSize;
309 ULONGLONG DataSize;
310 ULONG FileAttributes;
311 ULONG AlignmentOrReserved;
312 UCHAR NameLength;
313 UCHAR NameType;
314 WCHAR Name[1];
315 } FILENAME_ATTRIBUTE, *PFILENAME_ATTRIBUTE;
316
317 typedef struct
318 {
319 ULONG FirstEntryOffset;
320 ULONG TotalSizeOfEntries;
321 ULONG AllocatedSize;
322 UCHAR Flags;
323 UCHAR Padding[3];
324 } INDEX_HEADER_ATTRIBUTE, *PINDEX_HEADER_ATTRIBUTE;
325
326 typedef struct
327 {
328 ULONG AttributeType;
329 ULONG CollationRule;
330 ULONG SizeOfEntry;
331 UCHAR ClustersPerIndexRecord;
332 UCHAR Padding[3];
333 INDEX_HEADER_ATTRIBUTE Header;
334 } INDEX_ROOT_ATTRIBUTE, *PINDEX_ROOT_ATTRIBUTE;
335
336 typedef struct
337 {
338 NTFS_RECORD_HEADER Ntfs;
339 ULONGLONG VCN;
340 INDEX_HEADER_ATTRIBUTE Header;
341 } INDEX_BUFFER, *PINDEX_BUFFER;
342
343 typedef struct
344 {
345 union
346 {
347 struct
348 {
349 ULONGLONG IndexedFile;
350 } Directory;
351 struct
352 {
353 USHORT DataOffset;
354 USHORT DataLength;
355 ULONG Reserved;
356 } ViewIndex;
357 } Data;
358 USHORT Length;
359 USHORT KeyLength;
360 USHORT Flags;
361 USHORT Reserved;
362 FILENAME_ATTRIBUTE FileName;
363 } INDEX_ENTRY_ATTRIBUTE, *PINDEX_ENTRY_ATTRIBUTE;
364
365 typedef struct
366 {
367 ULONGLONG Unknown1;
368 UCHAR MajorVersion;
369 UCHAR MinorVersion;
370 USHORT Flags;
371 ULONG Unknown2;
372 } VOLINFO_ATTRIBUTE, *PVOLINFO_ATTRIBUTE;
373
374 typedef struct
375 {
376 NTFSIDENTIFIER Identifier;
377 ULONG Flags;
378 UCHAR MajorFunction;
379 UCHAR MinorFunction;
380 WORK_QUEUE_ITEM WorkQueueItem;
381 PIRP Irp;
382 BOOLEAN IsTopLevel;
383 PDEVICE_OBJECT DeviceObject;
384 NTSTATUS SavedExceptionCode;
385 } NTFS_IRP_CONTEXT, *PNTFS_IRP_CONTEXT;
386
387 typedef struct _NTFS_ATTR_CONTEXT
388 {
389 PUCHAR CacheRun;
390 ULONGLONG CacheRunOffset;
391 LONGLONG CacheRunStartLCN;
392 ULONGLONG CacheRunLength;
393 LONGLONG CacheRunLastLCN;
394 ULONGLONG CacheRunCurrentOffset;
395 NTFS_ATTR_RECORD Record;
396 } NTFS_ATTR_CONTEXT, *PNTFS_ATTR_CONTEXT;
397
398 #define FCB_CACHE_INITIALIZED 0x0001
399 #define FCB_IS_VOLUME_STREAM 0x0002
400 #define FCB_IS_VOLUME 0x0004
401 #define MAX_PATH 260
402
403 typedef struct _FCB
404 {
405 NTFSIDENTIFIER Identifier;
406
407 FSRTL_COMMON_FCB_HEADER RFCB;
408 SECTION_OBJECT_POINTERS SectionObjectPointers;
409
410 PFILE_OBJECT FileObject;
411 PNTFS_VCB Vcb;
412
413 WCHAR *ObjectName; /* point on filename (250 chars max) in PathName */
414 WCHAR PathName[MAX_PATH]; /* path+filename 260 max */
415
416 ERESOURCE PagingIoResource;
417 ERESOURCE MainResource;
418
419 LIST_ENTRY FcbListEntry;
420 struct _FCB* ParentFcb;
421
422 ULONG DirIndex;
423
424 LONG RefCount;
425 ULONG Flags;
426
427 ULONGLONG MFTIndex;
428
429 FILENAME_ATTRIBUTE Entry;
430
431 } NTFS_FCB, *PNTFS_FCB;
432
433 extern PNTFS_GLOBAL_DATA NtfsGlobalData;
434
435 //int CdfsStrcmpi( wchar_t *str1, wchar_t *str2 );
436 //void CdfsWstrcpy( wchar_t *str1, wchar_t *str2, int max );
437
438
439 /* attrib.c */
440
441 //VOID
442 //NtfsDumpAttribute(PATTRIBUTE Attribute);
443
444 PUCHAR
445 DecodeRun(PUCHAR DataRun,
446 LONGLONG *DataRunOffset,
447 ULONGLONG *DataRunLength);
448
449 VOID
450 NtfsDumpFileAttributes(PFILE_RECORD_HEADER FileRecord);
451
452 PFILENAME_ATTRIBUTE
453 GetFileNameFromRecord(PFILE_RECORD_HEADER FileRecord, UCHAR NameType);
454
455 /* blockdev.c */
456
457 NTSTATUS
458 NtfsReadDisk(IN PDEVICE_OBJECT DeviceObject,
459 IN LONGLONG StartingOffset,
460 IN ULONG Length,
461 IN ULONG SectorSize,
462 IN OUT PUCHAR Buffer,
463 IN BOOLEAN Override);
464
465 NTSTATUS
466 NtfsReadSectors(IN PDEVICE_OBJECT DeviceObject,
467 IN ULONG DiskSector,
468 IN ULONG SectorCount,
469 IN ULONG SectorSize,
470 IN OUT PUCHAR Buffer,
471 IN BOOLEAN Override);
472
473 NTSTATUS
474 NtfsDeviceIoControl(IN PDEVICE_OBJECT DeviceObject,
475 IN ULONG ControlCode,
476 IN PVOID InputBuffer,
477 IN ULONG InputBufferSize,
478 IN OUT PVOID OutputBuffer,
479 IN OUT PULONG OutputBufferSize,
480 IN BOOLEAN Override);
481
482
483 /* close.c */
484
485 NTSTATUS
486 NtfsCloseFile(PDEVICE_EXTENSION DeviceExt,
487 PFILE_OBJECT FileObject);
488
489 DRIVER_DISPATCH NtfsFsdClose;
490 NTSTATUS NTAPI
491 NtfsFsdClose(PDEVICE_OBJECT DeviceObject,
492 PIRP Irp);
493
494
495 /* create.c */
496
497 DRIVER_DISPATCH NtfsFsdCreate;
498 NTSTATUS NTAPI
499 NtfsFsdCreate(PDEVICE_OBJECT DeviceObject,
500 PIRP Irp);
501
502
503 /* dirctl.c */
504
505 DRIVER_DISPATCH NtfsFsdDirectoryControl;
506 NTSTATUS NTAPI
507 NtfsFsdDirectoryControl(PDEVICE_OBJECT DeviceObject,
508 PIRP Irp);
509
510
511 /* dispatch.c */
512
513 DRIVER_DISPATCH NtfsFsdDispatch;
514 NTSTATUS NTAPI
515 NtfsFsdDispatch(PDEVICE_OBJECT DeviceObject,
516 PIRP Irp);
517
518
519 /* fastio.c */
520
521 BOOLEAN NTAPI
522 NtfsAcqLazyWrite(PVOID Context,
523 BOOLEAN Wait);
524
525 VOID NTAPI
526 NtfsRelLazyWrite(PVOID Context);
527
528 BOOLEAN NTAPI
529 NtfsAcqReadAhead(PVOID Context,
530 BOOLEAN Wait);
531
532 VOID NTAPI
533 NtfsRelReadAhead(PVOID Context);
534
535
536 /* fcb.c */
537
538 PNTFS_FCB
539 NtfsCreateFCB(PCWSTR FileName,
540 PNTFS_VCB Vcb);
541
542 VOID
543 NtfsDestroyFCB(PNTFS_FCB Fcb);
544
545 BOOLEAN
546 NtfsFCBIsDirectory(PNTFS_FCB Fcb);
547
548 BOOLEAN
549 NtfsFCBIsRoot(PNTFS_FCB Fcb);
550
551 VOID
552 NtfsGrabFCB(PNTFS_VCB Vcb,
553 PNTFS_FCB Fcb);
554
555 VOID
556 NtfsReleaseFCB(PNTFS_VCB Vcb,
557 PNTFS_FCB Fcb);
558
559 VOID
560 NtfsAddFCBToTable(PNTFS_VCB Vcb,
561 PNTFS_FCB Fcb);
562
563 PNTFS_FCB
564 NtfsGrabFCBFromTable(PNTFS_VCB Vcb,
565 PCWSTR FileName);
566
567 NTSTATUS
568 NtfsFCBInitializeCache(PNTFS_VCB Vcb,
569 PNTFS_FCB Fcb);
570
571 PNTFS_FCB
572 NtfsMakeRootFCB(PNTFS_VCB Vcb);
573
574 PNTFS_FCB
575 NtfsOpenRootFCB(PNTFS_VCB Vcb);
576
577 NTSTATUS
578 NtfsAttachFCBToFileObject(PNTFS_VCB Vcb,
579 PNTFS_FCB Fcb,
580 PFILE_OBJECT FileObject);
581
582 NTSTATUS
583 NtfsGetFCBForFile(PNTFS_VCB Vcb,
584 PNTFS_FCB *pParentFCB,
585 PNTFS_FCB *pFCB,
586 const PWSTR pFileName);
587
588
589 /* finfo.c */
590
591 DRIVER_DISPATCH NtfsFsdQueryInformation;
592 NTSTATUS NTAPI
593 NtfsFsdQueryInformation(PDEVICE_OBJECT DeviceObject,
594 PIRP Irp);
595
596
597 /* fsctl.c */
598
599 DRIVER_DISPATCH NtfsFsdFileSystemControl;
600 NTSTATUS NTAPI
601 NtfsFsdFileSystemControl(PDEVICE_OBJECT DeviceObject,
602 PIRP Irp);
603
604
605 /* mft.c */
606 VOID
607 ReleaseAttributeContext(PNTFS_ATTR_CONTEXT Context);
608
609 ULONG
610 ReadAttribute(PDEVICE_EXTENSION Vcb,
611 PNTFS_ATTR_CONTEXT Context,
612 ULONGLONG Offset,
613 PCHAR Buffer,
614 ULONG Length);
615
616 ULONGLONG
617 AttributeDataLength(PNTFS_ATTR_RECORD AttrRecord);
618
619 ULONG
620 AttributeAllocatedLength(PNTFS_ATTR_RECORD AttrRecord);
621
622 NTSTATUS
623 ReadFileRecord(PDEVICE_EXTENSION Vcb,
624 ULONGLONG index,
625 PFILE_RECORD_HEADER file);
626
627 NTSTATUS
628 FindAttribute(PDEVICE_EXTENSION Vcb,
629 PFILE_RECORD_HEADER MftRecord,
630 ULONG Type,
631 PCWSTR Name,
632 ULONG NameLength,
633 PNTFS_ATTR_CONTEXT * AttrCtx);
634
635 VOID
636 ReadVCN(PDEVICE_EXTENSION Vcb,
637 PFILE_RECORD_HEADER file,
638 ATTRIBUTE_TYPE type,
639 ULONGLONG vcn,
640 ULONG count,
641 PVOID buffer);
642
643 NTSTATUS
644 FixupUpdateSequenceArray(PDEVICE_EXTENSION Vcb,
645 PNTFS_RECORD_HEADER Record);
646
647 NTSTATUS
648 ReadLCN(PDEVICE_EXTENSION Vcb,
649 ULONGLONG lcn,
650 ULONG count,
651 PVOID buffer);
652
653 VOID
654 EnumerAttribute(PFILE_RECORD_HEADER file,
655 PDEVICE_EXTENSION Vcb,
656 PDEVICE_OBJECT DeviceObject);
657
658 NTSTATUS
659 NtfsLookupFile(PDEVICE_EXTENSION Vcb,
660 PUNICODE_STRING PathName,
661 PFILE_RECORD_HEADER *FileRecord,
662 PNTFS_ATTR_CONTEXT *DataContext,
663 PULONGLONG MFTIndex);
664
665 NTSTATUS
666 NtfsLookupFileAt(PDEVICE_EXTENSION Vcb,
667 PUNICODE_STRING PathName,
668 PFILE_RECORD_HEADER *FileRecord,
669 PNTFS_ATTR_CONTEXT *DataContext,
670 PULONGLONG MFTIndex,
671 ULONGLONG CurrentMFTIndex);
672
673 NTSTATUS
674 NtfsFindFileAt(PDEVICE_EXTENSION Vcb,
675 PUNICODE_STRING SearchPattern,
676 PULONG FirstEntry,
677 PFILE_RECORD_HEADER *FileRecord,
678 PNTFS_ATTR_CONTEXT *DataContext,
679 PULONGLONG MFTIndex,
680 ULONGLONG CurrentMFTIndex);
681
682 /* misc.c */
683
684 BOOLEAN
685 NtfsIsIrpTopLevel(PIRP Irp);
686
687 PNTFS_IRP_CONTEXT
688 NtfsAllocateIrpContext(PDEVICE_OBJECT DeviceObject,
689 PIRP Irp);
690
691 #if 0
692 BOOLEAN
693 wstrcmpjoki(PWSTR s1, PWSTR s2);
694
695 VOID
696 CdfsSwapString(PWCHAR Out,
697 PUCHAR In,
698 ULONG Count);
699 #endif
700
701 VOID
702 NtfsFileFlagsToAttributes(ULONG NtfsAttributes,
703 PULONG FileAttributes);
704
705
706 /* rw.c */
707
708 DRIVER_DISPATCH NtfsFsdRead;
709 NTSTATUS NTAPI
710 NtfsFsdRead(PDEVICE_OBJECT DeviceObject,
711 PIRP Irp);
712
713 DRIVER_DISPATCH NtfsFsdWrite;
714 NTSTATUS NTAPI
715 NtfsFsdWrite(PDEVICE_OBJECT DeviceObject,
716 PIRP Irp);
717
718
719 /* volinfo.c */
720
721 ULONGLONG
722 NtfsGetFreeClusters(PDEVICE_EXTENSION DeviceExt);
723
724 NTSTATUS
725 NtfsQueryVolumeInformation(PNTFS_IRP_CONTEXT IrpContext);
726
727 NTSTATUS
728 NtfsSetVolumeInformation(PNTFS_IRP_CONTEXT IrpContext);
729
730
731 /* ntfs.c */
732
733 DRIVER_INITIALIZE DriverEntry;
734
735 VOID
736 NTAPI
737 NtfsInitializeFunctionPointers(PDRIVER_OBJECT DriverObject);
738
739 #endif /* NTFS_H */