697e8c80ca1287394067dea75b64621e3ec4c2e1
[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 union
335 {
336 struct
337 {
338 ULONGLONG IndexedFile;
339 } Directory;
340 struct
341 {
342 USHORT DataOffset;
343 USHORT DataLength;
344 ULONG Reserved;
345 } ViewIndex;
346 } Data;
347 USHORT Length;
348 USHORT KeyLength;
349 USHORT Flags;
350 USHORT Reserved;
351 FILENAME_ATTRIBUTE FileName;
352 } INDEX_ENTRY_ATTRIBUTE, *PINDEX_ENTRY_ATTRIBUTE;
353
354 typedef struct
355 {
356 ULONGLONG Unknown1;
357 UCHAR MajorVersion;
358 UCHAR MinorVersion;
359 USHORT Flags;
360 ULONG Unknown2;
361 } VOLINFO_ATTRIBUTE, *PVOLINFO_ATTRIBUTE;
362
363 typedef struct
364 {
365 NTFSIDENTIFIER Identifier;
366 ULONG Flags;
367 UCHAR MajorFunction;
368 UCHAR MinorFunction;
369 WORK_QUEUE_ITEM WorkQueueItem;
370 PIRP Irp;
371 BOOLEAN IsTopLevel;
372 PDEVICE_OBJECT DeviceObject;
373 NTSTATUS SavedExceptionCode;
374 } NTFS_IRP_CONTEXT, *PNTFS_IRP_CONTEXT;
375
376 typedef struct _NTFS_ATTR_CONTEXT
377 {
378 PUCHAR CacheRun;
379 ULONGLONG CacheRunOffset;
380 LONGLONG CacheRunStartLCN;
381 ULONGLONG CacheRunLength;
382 LONGLONG CacheRunLastLCN;
383 ULONGLONG CacheRunCurrentOffset;
384 NTFS_ATTR_RECORD Record;
385 } NTFS_ATTR_CONTEXT, *PNTFS_ATTR_CONTEXT;
386
387 #define FCB_CACHE_INITIALIZED 0x0001
388 #define FCB_IS_VOLUME_STREAM 0x0002
389 #define FCB_IS_VOLUME 0x0004
390 #define MAX_PATH 260
391
392 typedef struct _FCB
393 {
394 NTFSIDENTIFIER Identifier;
395
396 FSRTL_COMMON_FCB_HEADER RFCB;
397 SECTION_OBJECT_POINTERS SectionObjectPointers;
398
399 PFILE_OBJECT FileObject;
400 PNTFS_VCB Vcb;
401
402 WCHAR *ObjectName; /* point on filename (250 chars max) in PathName */
403 WCHAR PathName[MAX_PATH]; /* path+filename 260 max */
404
405 ERESOURCE PagingIoResource;
406 ERESOURCE MainResource;
407
408 LIST_ENTRY FcbListEntry;
409 struct _FCB* ParentFcb;
410
411 ULONG DirIndex;
412
413 LONG RefCount;
414 ULONG Flags;
415
416 ULONGLONG MFTIndex;
417
418 FILENAME_ATTRIBUTE Entry;
419
420 } NTFS_FCB, *PNTFS_FCB;
421
422 extern PNTFS_GLOBAL_DATA NtfsGlobalData;
423
424 //int CdfsStrcmpi( wchar_t *str1, wchar_t *str2 );
425 //void CdfsWstrcpy( wchar_t *str1, wchar_t *str2, int max );
426
427
428 /* attrib.c */
429
430 //VOID
431 //NtfsDumpAttribute(PATTRIBUTE Attribute);
432
433 PUCHAR
434 DecodeRun(PUCHAR DataRun,
435 LONGLONG *DataRunOffset,
436 ULONGLONG *DataRunLength);
437
438 VOID
439 NtfsDumpFileAttributes(PFILE_RECORD_HEADER FileRecord);
440
441 PFILENAME_ATTRIBUTE
442 GetFileNameFromRecord(PFILE_RECORD_HEADER FileRecord);
443
444 /* blockdev.c */
445
446 NTSTATUS
447 NtfsReadDisk(IN PDEVICE_OBJECT DeviceObject,
448 IN LONGLONG StartingOffset,
449 IN ULONG Length,
450 IN OUT PUCHAR Buffer,
451 IN BOOLEAN Override);
452
453 NTSTATUS
454 NtfsReadSectors(IN PDEVICE_OBJECT DeviceObject,
455 IN ULONG DiskSector,
456 IN ULONG SectorCount,
457 IN ULONG SectorSize,
458 IN OUT PUCHAR Buffer,
459 IN BOOLEAN Override);
460
461 NTSTATUS
462 NtfsDeviceIoControl(IN PDEVICE_OBJECT DeviceObject,
463 IN ULONG ControlCode,
464 IN PVOID InputBuffer,
465 IN ULONG InputBufferSize,
466 IN OUT PVOID OutputBuffer,
467 IN OUT PULONG OutputBufferSize,
468 IN BOOLEAN Override);
469
470
471 /* close.c */
472
473 NTSTATUS
474 NtfsCloseFile(PDEVICE_EXTENSION DeviceExt,
475 PFILE_OBJECT FileObject);
476
477 DRIVER_DISPATCH NtfsFsdClose;
478 NTSTATUS NTAPI
479 NtfsFsdClose(PDEVICE_OBJECT DeviceObject,
480 PIRP Irp);
481
482
483 /* create.c */
484
485 DRIVER_DISPATCH NtfsFsdCreate;
486 NTSTATUS NTAPI
487 NtfsFsdCreate(PDEVICE_OBJECT DeviceObject,
488 PIRP Irp);
489
490
491 /* dirctl.c */
492
493 DRIVER_DISPATCH NtfsFsdDirectoryControl;
494 NTSTATUS NTAPI
495 NtfsFsdDirectoryControl(PDEVICE_OBJECT DeviceObject,
496 PIRP Irp);
497
498
499 /* dispatch.c */
500
501 DRIVER_DISPATCH NtfsFsdDispatch;
502 NTSTATUS NTAPI
503 NtfsFsdDispatch(PDEVICE_OBJECT DeviceObject,
504 PIRP Irp);
505
506
507 /* fastio.c */
508
509 BOOLEAN NTAPI
510 NtfsAcqLazyWrite(PVOID Context,
511 BOOLEAN Wait);
512
513 VOID NTAPI
514 NtfsRelLazyWrite(PVOID Context);
515
516 BOOLEAN NTAPI
517 NtfsAcqReadAhead(PVOID Context,
518 BOOLEAN Wait);
519
520 VOID NTAPI
521 NtfsRelReadAhead(PVOID Context);
522
523
524 /* fcb.c */
525
526 PNTFS_FCB
527 NtfsCreateFCB(PCWSTR FileName,
528 PNTFS_VCB Vcb);
529
530 VOID
531 NtfsDestroyFCB(PNTFS_FCB Fcb);
532
533 BOOLEAN
534 NtfsFCBIsDirectory(PNTFS_FCB Fcb);
535
536 BOOLEAN
537 NtfsFCBIsRoot(PNTFS_FCB Fcb);
538
539 VOID
540 NtfsGrabFCB(PNTFS_VCB Vcb,
541 PNTFS_FCB Fcb);
542
543 VOID
544 NtfsReleaseFCB(PNTFS_VCB Vcb,
545 PNTFS_FCB Fcb);
546
547 VOID
548 NtfsAddFCBToTable(PNTFS_VCB Vcb,
549 PNTFS_FCB Fcb);
550
551 PNTFS_FCB
552 NtfsGrabFCBFromTable(PNTFS_VCB Vcb,
553 PCWSTR FileName);
554
555 NTSTATUS
556 NtfsFCBInitializeCache(PNTFS_VCB Vcb,
557 PNTFS_FCB Fcb);
558
559 PNTFS_FCB
560 NtfsMakeRootFCB(PNTFS_VCB Vcb);
561
562 PNTFS_FCB
563 NtfsOpenRootFCB(PNTFS_VCB Vcb);
564
565 NTSTATUS
566 NtfsAttachFCBToFileObject(PNTFS_VCB Vcb,
567 PNTFS_FCB Fcb,
568 PFILE_OBJECT FileObject);
569
570 NTSTATUS
571 NtfsGetFCBForFile(PNTFS_VCB Vcb,
572 PNTFS_FCB *pParentFCB,
573 PNTFS_FCB *pFCB,
574 const PWSTR pFileName);
575
576
577 /* finfo.c */
578
579 DRIVER_DISPATCH NtfsFsdQueryInformation;
580 NTSTATUS NTAPI
581 NtfsFsdQueryInformation(PDEVICE_OBJECT DeviceObject,
582 PIRP Irp);
583
584
585 /* fsctl.c */
586
587 DRIVER_DISPATCH NtfsFsdFileSystemControl;
588 NTSTATUS NTAPI
589 NtfsFsdFileSystemControl(PDEVICE_OBJECT DeviceObject,
590 PIRP Irp);
591
592
593 /* mft.c */
594 ULONG
595 ReadAttribute(PDEVICE_EXTENSION Vcb,
596 PNTFS_ATTR_CONTEXT Context,
597 ULONGLONG Offset,
598 PCHAR Buffer,
599 ULONG Length);
600
601 ULONGLONG
602 AttributeDataLength(PNTFS_ATTR_RECORD AttrRecord);
603
604 ULONG
605 AttributeAllocatedLength(PNTFS_ATTR_RECORD AttrRecord);
606
607 NTSTATUS
608 ReadFileRecord(PDEVICE_EXTENSION Vcb,
609 ULONGLONG index,
610 PFILE_RECORD_HEADER file);
611
612 NTSTATUS
613 FindAttribute(PDEVICE_EXTENSION Vcb,
614 PFILE_RECORD_HEADER MftRecord,
615 ULONG Type,
616 PUNICODE_STRING Name,
617 PNTFS_ATTR_CONTEXT * AttrCtx);
618
619 VOID
620 ReadVCN(PDEVICE_EXTENSION Vcb,
621 PFILE_RECORD_HEADER file,
622 ATTRIBUTE_TYPE type,
623 ULONGLONG vcn,
624 ULONG count,
625 PVOID buffer);
626
627 NTSTATUS
628 FixupUpdateSequenceArray(PDEVICE_EXTENSION Vcb,
629 PNTFS_RECORD_HEADER Record);
630
631 NTSTATUS
632 ReadLCN(PDEVICE_EXTENSION Vcb,
633 ULONGLONG lcn,
634 ULONG count,
635 PVOID buffer);
636
637 VOID
638 EnumerAttribute(PFILE_RECORD_HEADER file,
639 PDEVICE_EXTENSION Vcb,
640 PDEVICE_OBJECT DeviceObject);
641
642 NTSTATUS
643 NtfsLookupFile(PDEVICE_EXTENSION Vcb,
644 PUNICODE_STRING PathName,
645 PFILE_RECORD_HEADER *FileRecord,
646 PNTFS_ATTR_CONTEXT *DataContext,
647 PULONGLONG MFTIndex);
648
649 NTSTATUS
650 NtfsLookupFileAt(PDEVICE_EXTENSION Vcb,
651 PUNICODE_STRING PathName,
652 PFILE_RECORD_HEADER *FileRecord,
653 PNTFS_ATTR_CONTEXT *DataContext,
654 PULONGLONG MFTIndex,
655 ULONGLONG CurrentMFTIndex);
656
657 NTSTATUS
658 NtfsFindFileAt(PDEVICE_EXTENSION Vcb,
659 PUNICODE_STRING SearchPattern,
660 PULONG FirstEntry,
661 PFILE_RECORD_HEADER *FileRecord,
662 PNTFS_ATTR_CONTEXT *DataContext,
663 PULONGLONG MFTIndex,
664 ULONGLONG CurrentMFTIndex);
665
666 /* misc.c */
667
668 BOOLEAN
669 NtfsIsIrpTopLevel(PIRP Irp);
670
671 PNTFS_IRP_CONTEXT
672 NtfsAllocateIrpContext(PDEVICE_OBJECT DeviceObject,
673 PIRP Irp);
674
675 #if 0
676 BOOLEAN
677 wstrcmpjoki(PWSTR s1, PWSTR s2);
678
679 VOID
680 CdfsSwapString(PWCHAR Out,
681 PUCHAR In,
682 ULONG Count);
683 #endif
684
685 VOID
686 NtfsDateTimeToFileTime(ULONGLONG NtfsTime,
687 PLARGE_INTEGER SystemTime);
688
689 VOID
690 NtfsFileFlagsToAttributes(ULONG NtfsAttributes,
691 PULONG FileAttributes);
692
693
694 /* rw.c */
695
696 DRIVER_DISPATCH NtfsFsdRead;
697 NTSTATUS NTAPI
698 NtfsFsdRead(PDEVICE_OBJECT DeviceObject,
699 PIRP Irp);
700
701 DRIVER_DISPATCH NtfsFsdWrite;
702 NTSTATUS NTAPI
703 NtfsFsdWrite(PDEVICE_OBJECT DeviceObject,
704 PIRP Irp);
705
706
707 /* volinfo.c */
708
709 NTSTATUS
710 NtfsQueryVolumeInformation(PNTFS_IRP_CONTEXT IrpContext);
711
712 NTSTATUS
713 NtfsSetVolumeInformation(PNTFS_IRP_CONTEXT IrpContext);
714
715
716 /* ntfs.c */
717
718 DRIVER_INITIALIZE DriverEntry;
719
720 VOID
721 NTAPI
722 NtfsInitializeFunctionPointers(PDRIVER_OBJECT DriverObject);
723
724 #endif /* NTFS_H */