ReactOS  0.4.10-dev-34-g4db10a4
dirctl.c
Go to the documentation of this file.
1 /*
2  * ReactOS kernel
3  * Copyright (C) 2002, 2003, 2014 ReactOS Team
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
18  *
19  * COPYRIGHT: See COPYING in the top level directory
20  * PROJECT: ReactOS kernel
21  * FILE: drivers/filesystem/ntfs/dirctl.c
22  * PURPOSE: NTFS filesystem driver
23  * PROGRAMMERS: Eric Kohl
24  * Pierre Schweitzer (pierre@reactos.org)
25  * HervĂ© Poussineau (hpoussin@reactos.org)
26  */
27 
28 /* INCLUDES *****************************************************************/
29 
30 #include "ntfs.h"
31 
32 #define NDEBUG
33 #include <debug.h>
34 
35 /* FUNCTIONS ****************************************************************/
36 
39  PFILE_RECORD_HEADER FileRecord,
40  PCWSTR Stream,
41  ULONG StreamLength,
42  PULONGLONG AllocatedSize)
43 {
44  ULONGLONG Size = 0ULL;
47  PNTFS_ATTR_CONTEXT DataContext;
48 
49  Status = FindAttribute(DeviceExt, FileRecord, AttributeData, Stream, StreamLength, &DataContext, NULL);
50  if (NT_SUCCESS(Status))
51  {
52  Size = AttributeDataLength(DataContext->pRecord);
53  Allocated = AttributeAllocatedLength(DataContext->pRecord);
54  ReleaseAttributeContext(DataContext);
55  }
56 
57  if (AllocatedSize != NULL) *AllocatedSize = Allocated;
58 
59  return Size;
60 }
61 
62 
63 #define ULONG_ROUND_UP(x) ROUND_UP((x), (sizeof(ULONG)))
64 
65 
66 static NTSTATUS
68  PFILE_RECORD_HEADER FileRecord,
69  ULONGLONG MFTIndex,
72  PULONG Written,
73  BOOLEAN First)
74 {
75  ULONG Length;
77  ULONG BytesToCopy = 0;
79 
80  DPRINT("NtfsGetNamesInformation() called\n");
81 
82  *Written = 0;
83  Status = STATUS_BUFFER_OVERFLOW;
84  if (FIELD_OFFSET(FILE_NAMES_INFORMATION, FileName) > BufferLength)
85  {
86  return Status;
87  }
88 
89  FileName = GetBestFileNameFromRecord(DeviceExt, FileRecord);
90  if (FileName == NULL)
91  {
92  DPRINT1("No name information for file ID: %#I64x\n", MFTIndex);
93  NtfsDumpFileAttributes(DeviceExt, FileRecord);
95  }
96 
97  Length = FileName->NameLength * sizeof (WCHAR);
98  if (First || (BufferLength >= FIELD_OFFSET(FILE_NAMES_INFORMATION, FileName) + Length))
99  {
100  Info->FileNameLength = Length;
101 
102  *Written = FIELD_OFFSET(FILE_NAMES_INFORMATION, FileName);
103  Info->NextEntryOffset = 0;
104  if (BufferLength > FIELD_OFFSET(FILE_NAMES_INFORMATION, FileName))
105  {
106  BytesToCopy = min(Length, BufferLength - FIELD_OFFSET(FILE_NAMES_INFORMATION, FileName));
107  RtlCopyMemory(Info->FileName, FileName->Name, BytesToCopy);
108  *Written += BytesToCopy;
109 
110  if (BytesToCopy == Length)
111  {
113  BytesToCopy);
114  Status = STATUS_SUCCESS;
115  }
116  }
117  }
118 
119  return Status;
120 }
121 
122 
123 static NTSTATUS
125  PFILE_RECORD_HEADER FileRecord,
126  ULONGLONG MFTIndex,
129  PULONG Written,
130  BOOLEAN First)
131 {
132  ULONG Length;
134  ULONG BytesToCopy = 0;
136  PSTANDARD_INFORMATION StdInfo;
137 
138  DPRINT("NtfsGetDirectoryInformation() called\n");
139 
140  *Written = 0;
141  Status = STATUS_BUFFER_OVERFLOW;
142  if (FIELD_OFFSET(FILE_DIRECTORY_INFORMATION, FileName) > BufferLength)
143  {
144  return Status;
145  }
146 
147  FileName = GetBestFileNameFromRecord(DeviceExt, FileRecord);
148  if (FileName == NULL)
149  {
150  DPRINT1("No name information for file ID: %#I64x\n", MFTIndex);
151  NtfsDumpFileAttributes(DeviceExt, FileRecord);
153  }
154 
155  StdInfo = GetStandardInformationFromRecord(DeviceExt, FileRecord);
156  ASSERT(StdInfo != NULL);
157 
158  Length = FileName->NameLength * sizeof (WCHAR);
159  if (First || (BufferLength >= FIELD_OFFSET(FILE_DIRECTORY_INFORMATION, FileName) + Length))
160  {
161  Info->FileNameLength = Length;
162 
163  *Written = FIELD_OFFSET(FILE_DIRECTORY_INFORMATION, FileName);
164  Info->NextEntryOffset = 0;
165  if (BufferLength > FIELD_OFFSET(FILE_DIRECTORY_INFORMATION, FileName))
166  {
167  BytesToCopy = min(Length, BufferLength - FIELD_OFFSET(FILE_DIRECTORY_INFORMATION, FileName));
168  RtlCopyMemory(Info->FileName, FileName->Name, BytesToCopy);
169  *Written += BytesToCopy;
170 
171  if (BytesToCopy == Length)
172  {
174  BytesToCopy);
175  Status = STATUS_SUCCESS;
176  }
177  }
178 
179  Info->CreationTime.QuadPart = FileName->CreationTime;
180  Info->LastAccessTime.QuadPart = FileName->LastAccessTime;
181  Info->LastWriteTime.QuadPart = FileName->LastWriteTime;
182  Info->ChangeTime.QuadPart = FileName->ChangeTime;
183 
184  /* Convert file flags */
186 
187  Info->EndOfFile.QuadPart = NtfsGetFileSize(DeviceExt, FileRecord, L"", 0, (PULONGLONG)&Info->AllocationSize.QuadPart);
188 
189  Info->FileIndex = MFTIndex;
190  }
191 
192  return Status;
193 }
194 
195 
196 static NTSTATUS
198  PFILE_RECORD_HEADER FileRecord,
199  ULONGLONG MFTIndex,
202  PULONG Written,
203  BOOLEAN First)
204 {
205  ULONG Length;
207  ULONG BytesToCopy = 0;
209  PSTANDARD_INFORMATION StdInfo;
210 
211  DPRINT("NtfsGetFullDirectoryInformation() called\n");
212 
213  *Written = 0;
214  Status = STATUS_BUFFER_OVERFLOW;
215  if (FIELD_OFFSET(FILE_FULL_DIR_INFORMATION, FileName) > BufferLength)
216  {
217  return Status;
218  }
219 
220  FileName = GetBestFileNameFromRecord(DeviceExt, FileRecord);
221  if (FileName == NULL)
222  {
223  DPRINT1("No name information for file ID: %#I64x\n", MFTIndex);
224  NtfsDumpFileAttributes(DeviceExt, FileRecord);
226  }
227 
228  StdInfo = GetStandardInformationFromRecord(DeviceExt, FileRecord);
229  ASSERT(StdInfo != NULL);
230 
231  Length = FileName->NameLength * sizeof (WCHAR);
232  if (First || (BufferLength >= FIELD_OFFSET(FILE_FULL_DIR_INFORMATION, FileName) + Length))
233  {
234  Info->FileNameLength = Length;
235 
236  *Written = FIELD_OFFSET(FILE_FULL_DIR_INFORMATION, FileName);
237  Info->NextEntryOffset = 0;
238  if (BufferLength > FIELD_OFFSET(FILE_FULL_DIR_INFORMATION, FileName))
239  {
240  BytesToCopy = min(Length, BufferLength - FIELD_OFFSET(FILE_FULL_DIR_INFORMATION, FileName));
241  RtlCopyMemory(Info->FileName, FileName->Name, BytesToCopy);
242  *Written += BytesToCopy;
243 
244  if (BytesToCopy == Length)
245  {
247  BytesToCopy);
248  Status = STATUS_SUCCESS;
249  }
250  }
251 
252  Info->CreationTime.QuadPart = FileName->CreationTime;
253  Info->LastAccessTime.QuadPart = FileName->LastAccessTime;
254  Info->LastWriteTime.QuadPart = FileName->LastWriteTime;
255  Info->ChangeTime.QuadPart = FileName->ChangeTime;
256 
257  /* Convert file flags */
259 
260  Info->EndOfFile.QuadPart = NtfsGetFileSize(DeviceExt, FileRecord, L"", 0, (PULONGLONG)&Info->AllocationSize.QuadPart);
261 
262  Info->FileIndex = MFTIndex;
263  Info->EaSize = 0;
264  }
265 
266  return Status;
267 }
268 
269 
270 static NTSTATUS
272  PFILE_RECORD_HEADER FileRecord,
273  ULONGLONG MFTIndex,
276  PULONG Written,
277  BOOLEAN First)
278 {
279  ULONG Length;
281  ULONG BytesToCopy = 0;
282  PFILENAME_ATTRIBUTE FileName, ShortFileName;
283  PSTANDARD_INFORMATION StdInfo;
284 
285  DPRINT("NtfsGetBothDirectoryInformation() called\n");
286 
287  *Written = 0;
288  Status = STATUS_BUFFER_OVERFLOW;
289  if (FIELD_OFFSET(FILE_BOTH_DIR_INFORMATION, FileName) > BufferLength)
290  {
291  return Status;
292  }
293 
294  FileName = GetBestFileNameFromRecord(DeviceExt, FileRecord);
295  if (FileName == NULL)
296  {
297  DPRINT1("No name information for file ID: %#I64x\n", MFTIndex);
298  NtfsDumpFileAttributes(DeviceExt, FileRecord);
300  }
301  ShortFileName = GetFileNameFromRecord(DeviceExt, FileRecord, NTFS_FILE_NAME_DOS);
302 
303  StdInfo = GetStandardInformationFromRecord(DeviceExt, FileRecord);
304  ASSERT(StdInfo != NULL);
305 
306  Length = FileName->NameLength * sizeof (WCHAR);
307  if (First || (BufferLength >= FIELD_OFFSET(FILE_BOTH_DIR_INFORMATION, FileName) + Length))
308  {
309  Info->FileNameLength = Length;
310 
311  *Written = FIELD_OFFSET(FILE_BOTH_DIR_INFORMATION, FileName);
312  Info->NextEntryOffset = 0;
313  if (BufferLength > FIELD_OFFSET(FILE_BOTH_DIR_INFORMATION, FileName))
314  {
315  BytesToCopy = min(Length, BufferLength - FIELD_OFFSET(FILE_BOTH_DIR_INFORMATION, FileName));
316  RtlCopyMemory(Info->FileName, FileName->Name, BytesToCopy);
317  *Written += BytesToCopy;
318 
319  if (BytesToCopy == Length)
320  {
322  BytesToCopy);
323  Status = STATUS_SUCCESS;
324  }
325  }
326 
327  if (ShortFileName)
328  {
329  /* Should we upcase the filename? */
330  ASSERT(ShortFileName->NameLength <= ARRAYSIZE(Info->ShortName));
331  Info->ShortNameLength = ShortFileName->NameLength * sizeof(WCHAR);
332  RtlCopyMemory(Info->ShortName, ShortFileName->Name, Info->ShortNameLength);
333  }
334  else
335  {
336  Info->ShortName[0] = 0;
337  Info->ShortNameLength = 0;
338  }
339 
340  Info->CreationTime.QuadPart = FileName->CreationTime;
341  Info->LastAccessTime.QuadPart = FileName->LastAccessTime;
342  Info->LastWriteTime.QuadPart = FileName->LastWriteTime;
343  Info->ChangeTime.QuadPart = FileName->ChangeTime;
344 
345  /* Convert file flags */
347 
348  Info->EndOfFile.QuadPart = NtfsGetFileSize(DeviceExt, FileRecord, L"", 0, (PULONGLONG)&Info->AllocationSize.QuadPart);
349 
350  Info->FileIndex = MFTIndex;
351  Info->EaSize = 0;
352  }
353 
354  return Status;
355 }
356 
357 
358 NTSTATUS
360 {
361  PIRP Irp;
363  PDEVICE_EXTENSION DeviceExtension;
364  LONG BufferLength = 0;
365  PUNICODE_STRING SearchPattern = NULL;
367  ULONG FileIndex = 0;
368  PUCHAR Buffer = NULL;
369  PFILE_NAMES_INFORMATION Buffer0 = NULL;
370  PNTFS_FCB Fcb;
371  PNTFS_CCB Ccb;
372  BOOLEAN First = FALSE;
373  PIO_STACK_LOCATION Stack;
376  PFILE_RECORD_HEADER FileRecord;
377  ULONGLONG MFTRecord, OldMFTRecord = 0;
378  UNICODE_STRING Pattern;
379  ULONG Written;
380 
381  DPRINT1("NtfsQueryDirectory() called\n");
382 
383  ASSERT(IrpContext);
384  Irp = IrpContext->Irp;
385  DeviceObject = IrpContext->DeviceObject;
386 
387  DeviceExtension = DeviceObject->DeviceExtension;
388  Stack = IoGetCurrentIrpStackLocation(Irp);
389  FileObject = Stack->FileObject;
390 
391  Ccb = (PNTFS_CCB)FileObject->FsContext2;
392  Fcb = (PNTFS_FCB)FileObject->FsContext;
393 
394  /* Obtain the callers parameters */
395  BufferLength = Stack->Parameters.QueryDirectory.Length;
396  SearchPattern = Stack->Parameters.QueryDirectory.FileName;
397  FileInformationClass = Stack->Parameters.QueryDirectory.FileInformationClass;
398  FileIndex = Stack->Parameters.QueryDirectory.FileIndex;
399 
400  if (NtfsFCBIsCompressed(Fcb))
401  {
402  DPRINT1("Compressed directory!\n");
404  return STATUS_NOT_IMPLEMENTED;
405  }
406 
408  BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT)))
409  {
410  return STATUS_PENDING;
411  }
412 
413  if (SearchPattern != NULL)
414  {
415  if (!Ccb->DirectorySearchPattern)
416  {
417  First = TRUE;
418  Pattern.Length = 0;
419  Pattern.MaximumLength = SearchPattern->Length + sizeof(WCHAR);
420  Ccb->DirectorySearchPattern = Pattern.Buffer =
422  if (!Ccb->DirectorySearchPattern)
423  {
426  }
427 
428  memcpy(Ccb->DirectorySearchPattern, SearchPattern->Buffer, SearchPattern->Length);
429  Ccb->DirectorySearchPattern[SearchPattern->Length / sizeof(WCHAR)] = 0;
430  }
431  }
432  else if (!Ccb->DirectorySearchPattern)
433  {
434  First = TRUE;
436  if (!Ccb->DirectorySearchPattern)
437  {
440  }
441 
442  Ccb->DirectorySearchPattern[0] = L'*';
443  Ccb->DirectorySearchPattern[1] = 0;
444  }
445 
447  DPRINT("Search pattern '%S'\n", Ccb->DirectorySearchPattern);
448  DPRINT("In: '%S'\n", Fcb->PathName);
449 
450  /* Determine directory index */
451  if (Stack->Flags & SL_INDEX_SPECIFIED)
452  {
453  Ccb->Entry = FileIndex;
454  }
455  else if (First || (Stack->Flags & SL_RESTART_SCAN))
456  {
457  Ccb->Entry = 0;
458  }
459 
460  /* Get Buffer for result */
461  Buffer = NtfsGetUserBuffer(Irp, FALSE);
462 
463  DPRINT("Buffer=%p tofind=%S\n", Buffer, Ccb->DirectorySearchPattern);
464 
465  if (!ExAcquireResourceExclusiveLite(&DeviceExtension->DirResource,
466  BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT)))
467  {
469  return STATUS_PENDING;
470  }
471 
472  Written = 0;
473  while (Status == STATUS_SUCCESS && BufferLength > 0)
474  {
475  Status = NtfsFindFileAt(DeviceExtension,
476  &Pattern,
477  &Ccb->Entry,
478  &FileRecord,
479  &MFTRecord,
480  Fcb->MFTIndex,
482 
483  if (NT_SUCCESS(Status))
484  {
485  /* HACK: files with both a short name and a long name are present twice in the index.
486  * Ignore the second entry, if it is immediately following the first one.
487  */
488  if (MFTRecord == OldMFTRecord)
489  {
490  DPRINT1("Ignoring duplicate MFT entry 0x%x\n", MFTRecord);
491  Ccb->Entry++;
492  ExFreeToNPagedLookasideList(&DeviceExtension->FileRecLookasideList, FileRecord);
493  continue;
494  }
495  OldMFTRecord = MFTRecord;
496 
497  switch (FileInformationClass)
498  {
500  Status = NtfsGetNamesInformation(DeviceExtension,
501  FileRecord,
502  MFTRecord,
503  (PFILE_NAMES_INFORMATION)Buffer,
504  BufferLength,
505  &Written,
506  Buffer0 == NULL);
507  break;
508 
510  Status = NtfsGetDirectoryInformation(DeviceExtension,
511  FileRecord,
512  MFTRecord,
514  BufferLength,
515  &Written,
516  Buffer0 == NULL);
517  break;
518 
520  Status = NtfsGetFullDirectoryInformation(DeviceExtension,
521  FileRecord,
522  MFTRecord,
524  BufferLength,
525  &Written,
526  Buffer0 == NULL);
527  break;
528 
530  Status = NtfsGetBothDirectoryInformation(DeviceExtension,
531  FileRecord,
532  MFTRecord,
534  BufferLength,
535  &Written,
536  Buffer0 == NULL);
537  break;
538 
539  default:
540  Status = STATUS_INVALID_INFO_CLASS;
541  }
542 
543  if (Status == STATUS_BUFFER_OVERFLOW || Status == STATUS_INVALID_INFO_CLASS)
544  {
545  break;
546  }
547  }
548  else
549  {
550  Status = (First ? STATUS_NO_SUCH_FILE : STATUS_NO_MORE_FILES);
551  break;
552  }
553 
554  Buffer0 = (PFILE_NAMES_INFORMATION)Buffer;
555  Buffer0->FileIndex = FileIndex++;
556  Ccb->Entry++;
557  BufferLength -= Buffer0->NextEntryOffset;
558 
559  ExFreeToNPagedLookasideList(&DeviceExtension->FileRecLookasideList, FileRecord);
560 
561  if (Stack->Flags & SL_RETURN_SINGLE_ENTRY)
562  {
563  break;
564  }
565 
566  Buffer += Buffer0->NextEntryOffset;
567  }
568 
569  if (Buffer0)
570  {
571  Buffer0->NextEntryOffset = 0;
572  Status = STATUS_SUCCESS;
573  IrpContext->Irp->IoStatus.Information = Stack->Parameters.QueryDirectory.Length - BufferLength;
574  }
575  else
576  {
577  ASSERT(Status != STATUS_SUCCESS || BufferLength == 0);
578  ASSERT(Written <= Stack->Parameters.QueryDirectory.Length);
579  IrpContext->Irp->IoStatus.Information = Written;
580  }
581 
582  ExReleaseResourceLite(&DeviceExtension->DirResource);
584 
585  return Status;
586 }
587 
588 
589 NTSTATUS
591 {
593 
594  DPRINT1("NtfsDirectoryControl() called\n");
595 
596  switch (IrpContext->MinorFunction)
597  {
599  Status = NtfsQueryDirectory(IrpContext);
600  break;
601 
603  DPRINT1("IRP_MN_NOTIFY_CHANGE_DIRECTORY\n");
604  Status = STATUS_NOT_IMPLEMENTED;
605  break;
606 
607  default:
609  break;
610  }
611 
612  if (Status == STATUS_PENDING && IrpContext->Flags & IRPCONTEXT_COMPLETE)
613  {
614  return NtfsMarkIrpContextForQueue(IrpContext);
615  }
616 
617  IrpContext->Irp->IoStatus.Information = 0;
618 
619  return Status;
620 }
621 
622 /* EOF */
LARGE_INTEGER LastAccessTime
Definition: winternl.h:504
static NTSTATUS NtfsGetFullDirectoryInformation(PDEVICE_EXTENSION DeviceExt, PFILE_RECORD_HEADER FileRecord, ULONGLONG MFTIndex, PFILE_FULL_DIRECTORY_INFORMATION Info, ULONG BufferLength, PULONG Written, BOOLEAN First)
Definition: dirctl.c:197
ULONGLONG AttributeAllocatedLength(PNTFS_ATTR_RECORD AttrRecord)
Definition: mft.c:193
#define IRP_MN_NOTIFY_CHANGE_DIRECTORY
Definition: rdpdr.c:56
#define NTFS_FILE_NAME_DOS
Definition: ntfs.h:65
PFILENAME_ATTRIBUTE GetBestFileNameFromRecord(PDEVICE_EXTENSION Vcb, PFILE_RECORD_HEADER FileRecord)
Definition: attrib.c:1942
PDEVICE_OBJECT DeviceObject
Definition: ntfs.h:478
static NTSTATUS NtfsGetNamesInformation(PDEVICE_EXTENSION DeviceExt, PFILE_RECORD_HEADER FileRecord, ULONGLONG MFTIndex, PFILE_NAMES_INFORMATION Info, ULONG BufferLength, PULONG Written, BOOLEAN First)
Definition: dirctl.c:67
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define SL_CASE_SENSITIVE
Definition: iotypes.h:1771
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
UCHAR MinorFunction
Definition: ntfs.h:474
#define SL_INDEX_SPECIFIED
Definition: iotypes.h:1788
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
ULONGLONG ChangeTime
Definition: ntfs.h:352
USHORT MaximumLength
Definition: env_spec_w32.h:370
Definition: bidi.c:85
WCHAR Name[1]
Definition: ntfs.h:369
_In_ PIRP Irp
Definition: csq.h:116
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel)?(CompletionRoutine!=NULL):TRUE)
Definition: cdfs.h:197
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define BooleanFlagOn(F, SF)
Definition: ext2fs.h:182
#define ULONG_ROUND_UP(x)
Definition: dirctl.c:63
FORCEINLINE NTSTATUS NtfsMarkIrpContextForQueue(PNTFS_IRP_CONTEXT IrpContext)
Definition: ntfs.h:557
PFILENAME_ATTRIBUTE GetFileNameFromRecord(PDEVICE_EXTENSION Vcb, PFILE_RECORD_HEADER FileRecord, UCHAR NameType)
Definition: attrib.c:1766
return STATUS_SUCCESS
Definition: btrfs.c:2690
unsigned char * PUCHAR
Definition: retypes.h:3
ULONG FileAttribute
Definition: ntfs.h:324
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define IRP_MN_QUERY_DIRECTORY
Definition: rdpdr.c:55
UCHAR NameLength
Definition: ntfs.h:367
static OUT PIO_STATUS_BLOCK OUT PVOID IN ULONG IN FILE_INFORMATION_CLASS FileInformationClass
Definition: pipe.c:75
NTSTATUS FindAttribute(PDEVICE_EXTENSION Vcb, PFILE_RECORD_HEADER MftRecord, ULONG Type, PCWSTR Name, ULONG NameLength, PNTFS_ATTR_CONTEXT *AttrCtx, PULONG Offset)
Definition: mft.c:131
ULONGLONG MFTIndex
Definition: ntfs.h:528
#define WCHAR
Definition: msvc.h:43
ULONGLONG LastAccessTime
Definition: ntfs.h:354
ULONG Entry
Definition: ntfs.h:141
PSTANDARD_INFORMATION GetStandardInformationFromRecord(PDEVICE_EXTENSION Vcb, PFILE_RECORD_HEADER FileRecord)
Definition: attrib.c:1897
struct TraceInfo Info
_In_ UINT _In_ UINT BytesToCopy
Definition: ndis.h:3149
ULONG FileAttributes
Definition: ntfs.h:357
BOOLEAN NTAPI ExAcquireResourceExclusiveLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:770
WCHAR First[]
Definition: FormatMessage.c:11
Definition: ntfs.h:134
LARGE_INTEGER ChangeTime
Definition: winternl.h:506
UNICODE_STRING PathName
Definition: cdfs.h:210
static NTSTATUS NtfsGetDirectoryInformation(PDEVICE_EXTENSION DeviceExt, PFILE_RECORD_HEADER FileRecord, ULONGLONG MFTIndex, PFILE_DIRECTORY_INFORMATION Info, ULONG BufferLength, PULONG Written, BOOLEAN First)
Definition: dirctl.c:124
LARGE_INTEGER LastWriteTime
Definition: from_kernel.h:143
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
_In_ ULONG BufferLength
Definition: usbdlib.h:225
VOID NtfsDumpFileAttributes(PDEVICE_EXTENSION Vcb, PFILE_RECORD_HEADER FileRecord)
Definition: attrib.c:1747
LARGE_INTEGER EndOfFile
Definition: winternl.h:507
LARGE_INTEGER AllocationSize
Definition: from_kernel.h:146
#define IRPCONTEXT_COMPLETE
Definition: cdfs.h:266
union _IO_STACK_LOCATION::@3564 Parameters
PVOID DeviceExtension
Definition: env_spec_w32.h:418
IN PFCB IN VBO OUT PLBO OUT PULONG OUT PBOOLEAN Allocated
Definition: fatprocs.h:297
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
struct _FILE_NAMES_INFORMATION * PFILE_NAMES_INFORMATION
Definition: bufpool.h:45
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
#define ULL(a, b)
Definition: format_msg.c:27
ULONGLONG NtfsGetFileSize(PDEVICE_EXTENSION DeviceExt, PFILE_RECORD_HEADER FileRecord, PCWSTR Stream, ULONG StreamLength, PULONGLONG AllocatedSize)
Definition: dirctl.c:38
UINTN Size
Definition: acefiex.h:555
enum _FILE_INFORMATION_CLASS FILE_INFORMATION_CLASS
Definition: directory.c:44
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
VOID NtfsFileFlagsToAttributes(ULONG NtfsAttributes, PULONG FileAttributes)
Definition: misc.c:105
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
#define STATUS_PENDING
Definition: ntstatus.h:82
#define STATUS_NO_MORE_FILES
Definition: udferr_usr.h:128
uint64_t ULONGLONG
Definition: typedefs.h:65
LARGE_INTEGER LastWriteTime
Definition: winternl.h:505
ULONGLONG CreationTime
Definition: ntfs.h:351
NTSTATUS NtfsQueryDirectory(PNTFS_IRP_CONTEXT IrpContext)
Definition: dirctl.c:359
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1817
* PFILE_OBJECT
Definition: iotypes.h:1949
#define TAG_NTFS
Definition: ntfs.h:17
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define IRPCONTEXT_CANWAIT
Definition: cdfs.h:265
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
PWCHAR DirectorySearchPattern
Definition: ntfs.h:143
struct NTFS_CCB * PNTFS_CCB
#define STATUS_INVALID_INFO_CLASS
Definition: ntstatus.h:226
VOID UINTN Length
Definition: acefiex.h:744
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN PFCB _In_opt_ PCCB Ccb
Definition: cdprocs.h:593
ULONG Flags
Definition: ntfs.h:471
ERESOURCE MainResource
Definition: cdfs.h:201
NTSTATUS NtfsDirectoryControl(PNTFS_IRP_CONTEXT IrpContext)
Definition: dirctl.c:590
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
ULONGLONG LastWriteTime
Definition: ntfs.h:353
struct _FileName FileName
Definition: fatprocs.h:884
PFILE_OBJECT FileObject
Definition: iotypes.h:2787
#define SL_RETURN_SINGLE_ENTRY
Definition: iotypes.h:1787
#define STATUS_OBJECT_NAME_NOT_FOUND
Definition: udferr_usr.h:149
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:49
VOID ReleaseAttributeContext(PNTFS_ATTR_CONTEXT Context)
Definition: mft.c:104
LARGE_INTEGER CreationTime
Definition: winternl.h:503
#define STATUS_NO_SUCH_FILE
Definition: udferr_usr.h:137
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
struct _IO_STACK_LOCATION::@3564::@3568 QueryDirectory
unsigned int * PULONG
Definition: retypes.h:1
#define min(a, b)
Definition: monoChain.cc:55
#define SL_RESTART_SCAN
Definition: iotypes.h:1786
BOOLEAN NTAPI ExAcquireResourceSharedLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:885
LARGE_INTEGER CreationTime
Definition: from_kernel.h:141
#define DPRINT1
Definition: precomp.h:8
PVOID NtfsGetUserBuffer(PIRP Irp, BOOLEAN Paging)
Definition: misc.c:120
BOOLEAN NtfsFCBIsCompressed(PNTFS_FCB Fcb)
Definition: fcb.c:141
__GNU_EXTENSION typedef unsigned __int64 * PULONGLONG
Definition: ntbasedef.h:390
PVOID PIRP
Definition: usb.h:38
unsigned int ULONG
Definition: retypes.h:1
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define UNIMPLEMENTED
Definition: debug.h:114
static NTSTATUS NtfsGetBothDirectoryInformation(PDEVICE_EXTENSION DeviceExt, PFILE_RECORD_HEADER FileRecord, ULONGLONG MFTIndex, PFILE_BOTH_DIR_INFORMATION Info, ULONG BufferLength, PULONG Written, BOOLEAN First)
Definition: dirctl.c:271
NTSTATUS NtfsFindFileAt(PDEVICE_EXTENSION Vcb, PUNICODE_STRING SearchPattern, PULONG FirstEntry, PFILE_RECORD_HEADER *FileRecord, PULONGLONG MFTIndex, ULONGLONG CurrentMFTIndex, BOOLEAN CaseSensitive)
Definition: mft.c:3302
LARGE_INTEGER LastAccessTime
Definition: from_kernel.h:142
const uint16_t * PCWSTR
Definition: typedefs.h:55
_In_ PFCB Fcb
Definition: cdprocs.h:151
WCHAR FileName[ANYSIZE_ARRAY]
Definition: winternl.h:511
ULONGLONG AttributeDataLength(PNTFS_ATTR_RECORD AttrRecord)
Definition: mft.c:203
_Inout_opt_ PUNICODE_STRING _Inout_opt_ PUNICODE_STRING Stream
Definition: fltkernel.h:1092
LARGE_INTEGER AllocationSize
Definition: winternl.h:508
IN SCSI_ADAPTER_CONTROL_TYPE IN PVOID Parameters
Definition: srb.h:488
LONGLONG QuadPart
Definition: typedefs.h:112
WCHAR FileName[ANYSIZE_ARRAY]
Definition: winternl.h:526