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