ReactOS  0.4.14-dev-114-gc8cbd56
dir.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS kernel
4  * FILE: drivers/fs/vfat/dir.c
5  * PURPOSE: VFAT Filesystem : directory control
6  * UPDATE HISTORY:
7  19-12-1998 : created
8 
9 */
10 
11 /* INCLUDES *****************************************************************/
12 
13 #include "vfat.h"
14 
15 #define NDEBUG
16 #include <debug.h>
17 
18 /* FUNCTIONS ****************************************************************/
19 
20 /* Function like DosDateTimeToFileTime */
21 BOOLEAN
23  PDEVICE_EXTENSION DeviceExt,
24  USHORT DosDate,
25  USHORT DosTime,
26  PLARGE_INTEGER SystemTime)
27 {
28  PDOSTIME pdtime = (PDOSTIME)&DosTime;
29  PDOSDATE pddate = (PDOSDATE)&DosDate;
31  LARGE_INTEGER LocalTime;
32 
33  if (SystemTime == NULL)
34  return FALSE;
35 
37  TimeFields.Second = pdtime->Second * 2;
38  TimeFields.Minute = pdtime->Minute;
39  TimeFields.Hour = pdtime->Hour;
40 
41  TimeFields.Day = pddate->Day;
42  TimeFields.Month = pddate->Month;
43  TimeFields.Year = (CSHORT)(DeviceExt->BaseDateYear + pddate->Year);
44 
45  RtlTimeFieldsToTime(&TimeFields, &LocalTime);
46  ExLocalTimeToSystemTime(&LocalTime, SystemTime);
47 
48  return TRUE;
49 }
50 
51 /* Function like FileTimeToDosDateTime */
52 BOOLEAN
54  PDEVICE_EXTENSION DeviceExt,
55  PLARGE_INTEGER SystemTime,
56  PUSHORT pDosDate,
57  PUSHORT pDosTime)
58 {
59  PDOSTIME pdtime = (PDOSTIME)pDosTime;
60  PDOSDATE pddate = (PDOSDATE)pDosDate;
62  LARGE_INTEGER LocalTime;
63 
64  if (SystemTime == NULL)
65  return FALSE;
66 
67  ExSystemTimeToLocalTime(SystemTime, &LocalTime);
68  RtlTimeToTimeFields(&LocalTime, &TimeFields);
69 
70  if (pdtime)
71  {
72  pdtime->Second = TimeFields.Second / 2;
73  pdtime->Minute = TimeFields.Minute;
74  pdtime->Hour = TimeFields.Hour;
75  }
76 
77  if (pddate)
78  {
79  pddate->Day = TimeFields.Day;
80  pddate->Month = TimeFields.Month;
81  pddate->Year = (USHORT) (TimeFields.Year - DeviceExt->BaseDateYear);
82  }
83 
84  return TRUE;
85 }
86 
87 #define ULONG_ROUND_UP(x) ROUND_UP((x), (sizeof(ULONG)))
88 
89 static
95  PULONG Written,
96  BOOLEAN First)
97 {
99  ULONG BytesToCopy = 0;
100 
101  *Written = 0;
103 
105  return Status;
106 
107  if (First || (BufferLength > FIELD_OFFSET(FILE_NAMES_INFORMATION, FileName) + DirContext->LongNameU.Length))
108  {
109  pInfo->FileNameLength = DirContext->LongNameU.Length;
110 
112  pInfo->NextEntryOffset = 0;
114  {
116  RtlCopyMemory(pInfo->FileName,
117  DirContext->LongNameU.Buffer,
118  BytesToCopy);
119  *Written += BytesToCopy;
120 
121  if (BytesToCopy == DirContext->LongNameU.Length)
122  {
124  BytesToCopy);
126  }
127  }
128  }
129 
130  return Status;
131 }
132 
133 static
134 NTSTATUS
137  PDEVICE_EXTENSION DeviceExt,
140  PULONG Written,
141  BOOLEAN First)
142 {
144  ULONG BytesToCopy = 0;
145 
146  *Written = 0;
148 
150  return Status;
151 
153  {
154  pInfo->FileNameLength = DirContext->LongNameU.Length;
155  /* pInfo->FileIndex = ; */
156 
158  pInfo->NextEntryOffset = 0;
160  {
162  RtlCopyMemory(pInfo->FileName,
163  DirContext->LongNameU.Buffer,
164  BytesToCopy);
165  *Written += BytesToCopy;
166 
167  if (BytesToCopy == DirContext->LongNameU.Length)
168  {
170  BytesToCopy);
172  }
173  }
174 
175 
176 
177  if (vfatVolumeIsFatX(DeviceExt))
178  {
179  FsdDosDateTimeToSystemTime(DeviceExt,
180  DirContext->DirEntry.FatX.CreationDate,
181  DirContext->DirEntry.FatX.CreationTime,
182  &pInfo->CreationTime);
183  FsdDosDateTimeToSystemTime(DeviceExt,
184  DirContext->DirEntry.FatX.AccessDate,
185  DirContext->DirEntry.FatX.AccessTime,
186  &pInfo->LastAccessTime);
187  FsdDosDateTimeToSystemTime(DeviceExt,
188  DirContext->DirEntry.FatX.UpdateDate,
189  DirContext->DirEntry.FatX.UpdateTime,
190  &pInfo->LastWriteTime);
191 
192  pInfo->ChangeTime = pInfo->LastWriteTime;
193 
194  if (BooleanFlagOn(DirContext->DirEntry.FatX.Attrib, FILE_ATTRIBUTE_DIRECTORY))
195  {
196  pInfo->EndOfFile.QuadPart = 0;
197  pInfo->AllocationSize.QuadPart = 0;
198  }
199  else
200  {
201  pInfo->EndOfFile.u.HighPart = 0;
202  pInfo->EndOfFile.u.LowPart = DirContext->DirEntry.FatX.FileSize;
203  /* Make allocsize a rounded up multiple of BytesPerCluster */
204  pInfo->AllocationSize.u.HighPart = 0;
205  pInfo->AllocationSize.u.LowPart = ROUND_UP(DirContext->DirEntry.FatX.FileSize,
206  DeviceExt->FatInfo.BytesPerCluster);
207  }
208 
209  pInfo->FileAttributes = DirContext->DirEntry.FatX.Attrib & 0x3f;
210  }
211  else
212  {
213  FsdDosDateTimeToSystemTime(DeviceExt,
214  DirContext->DirEntry.Fat.CreationDate,
215  DirContext->DirEntry.Fat.CreationTime,
216  &pInfo->CreationTime);
217  FsdDosDateTimeToSystemTime(DeviceExt,
218  DirContext->DirEntry.Fat.AccessDate,
219  0,
220  &pInfo->LastAccessTime);
221  FsdDosDateTimeToSystemTime(DeviceExt,
222  DirContext->DirEntry.Fat.UpdateDate,
223  DirContext->DirEntry.Fat.UpdateTime,
224  &pInfo->LastWriteTime);
225 
226  pInfo->ChangeTime = pInfo->LastWriteTime;
227 
228  if (BooleanFlagOn(DirContext->DirEntry.Fat.Attrib, FILE_ATTRIBUTE_DIRECTORY))
229  {
230  pInfo->EndOfFile.QuadPart = 0;
231  pInfo->AllocationSize.QuadPart = 0;
232  }
233  else
234  {
235  pInfo->EndOfFile.u.HighPart = 0;
236  pInfo->EndOfFile.u.LowPart = DirContext->DirEntry.Fat.FileSize;
237  /* Make allocsize a rounded up multiple of BytesPerCluster */
238  pInfo->AllocationSize.u.HighPart = 0;
239  pInfo->AllocationSize.u.LowPart = ROUND_UP(DirContext->DirEntry.Fat.FileSize,
240  DeviceExt->FatInfo.BytesPerCluster);
241  }
242 
243  pInfo->FileAttributes = DirContext->DirEntry.Fat.Attrib & 0x3f;
244  }
245  }
246 
247  return Status;
248 }
249 
250 static
251 NTSTATUS
254  PDEVICE_EXTENSION DeviceExt,
257  PULONG Written,
258  BOOLEAN First)
259 {
261  ULONG BytesToCopy = 0;
262 
263  *Written = 0;
265 
267  return Status;
268 
270  {
271  pInfo->FileNameLength = DirContext->LongNameU.Length;
272  /* pInfo->FileIndex = ; */
273  pInfo->EaSize = 0;
274 
276  pInfo->NextEntryOffset = 0;
278  {
280  RtlCopyMemory(pInfo->FileName,
281  DirContext->LongNameU.Buffer,
282  BytesToCopy);
283  *Written += BytesToCopy;
284 
285  if (BytesToCopy == DirContext->LongNameU.Length)
286  {
288  BytesToCopy);
290  }
291  }
292 
293  if (vfatVolumeIsFatX(DeviceExt))
294  {
295  FsdDosDateTimeToSystemTime(DeviceExt,
296  DirContext->DirEntry.FatX.CreationDate,
297  DirContext->DirEntry.FatX.CreationTime,
298  &pInfo->CreationTime);
299  FsdDosDateTimeToSystemTime(DeviceExt,
300  DirContext->DirEntry.FatX.AccessDate,
301  DirContext->DirEntry.FatX.AccessTime,
302  &pInfo->LastAccessTime);
303  FsdDosDateTimeToSystemTime(DeviceExt,
304  DirContext->DirEntry.FatX.UpdateDate,
305  DirContext->DirEntry.FatX.UpdateTime,
306  &pInfo->LastWriteTime);
307 
308  pInfo->ChangeTime = pInfo->LastWriteTime;
309  pInfo->EndOfFile.u.HighPart = 0;
310  pInfo->EndOfFile.u.LowPart = DirContext->DirEntry.FatX.FileSize;
311  /* Make allocsize a rounded up multiple of BytesPerCluster */
312  pInfo->AllocationSize.u.HighPart = 0;
313  pInfo->AllocationSize.u.LowPart = ROUND_UP(DirContext->DirEntry.FatX.FileSize,
314  DeviceExt->FatInfo.BytesPerCluster);
315  pInfo->FileAttributes = DirContext->DirEntry.FatX.Attrib & 0x3f;
316  }
317  else
318  {
319  FsdDosDateTimeToSystemTime(DeviceExt,
320  DirContext->DirEntry.Fat.CreationDate,
321  DirContext->DirEntry.Fat.CreationTime,
322  &pInfo->CreationTime);
323  FsdDosDateTimeToSystemTime(DeviceExt,
324  DirContext->DirEntry.Fat.AccessDate,
325  0,
326  &pInfo->LastAccessTime);
327  FsdDosDateTimeToSystemTime(DeviceExt,
328  DirContext->DirEntry.Fat.UpdateDate,
329  DirContext->DirEntry.Fat.UpdateTime,
330  &pInfo->LastWriteTime);
331 
332  pInfo->ChangeTime = pInfo->LastWriteTime;
333  pInfo->EndOfFile.u.HighPart = 0;
334  pInfo->EndOfFile.u.LowPart = DirContext->DirEntry.Fat.FileSize;
335  /* Make allocsize a rounded up multiple of BytesPerCluster */
336  pInfo->AllocationSize.u.HighPart = 0;
337  pInfo->AllocationSize.u.LowPart = ROUND_UP(DirContext->DirEntry.Fat.FileSize,
338  DeviceExt->FatInfo.BytesPerCluster);
339  pInfo->FileAttributes = DirContext->DirEntry.Fat.Attrib & 0x3f;
340  }
341  }
342 
343  return Status;
344 }
345 
346 static
347 NTSTATUS
350  PDEVICE_EXTENSION DeviceExt,
353  PULONG Written,
354  BOOLEAN First)
355 {
357  ULONG BytesToCopy = 0;
358 
359  *Written = 0;
361 
363  return Status;
364 
366  {
367  pInfo->FileNameLength = DirContext->LongNameU.Length;
368  pInfo->EaSize = 0;
369 
371  pInfo->NextEntryOffset = 0;
373  {
375  RtlCopyMemory(pInfo->FileName,
376  DirContext->LongNameU.Buffer,
377  BytesToCopy);
378  *Written += BytesToCopy;
379 
380  if (BytesToCopy == DirContext->LongNameU.Length)
381  {
383  BytesToCopy);
385  }
386  }
387 
388  if (vfatVolumeIsFatX(DeviceExt))
389  {
390  pInfo->ShortName[0] = 0;
391  pInfo->ShortNameLength = 0;
392  /* pInfo->FileIndex = ; */
393 
394  FsdDosDateTimeToSystemTime(DeviceExt,
395  DirContext->DirEntry.FatX.CreationDate,
396  DirContext->DirEntry.FatX.CreationTime,
397  &pInfo->CreationTime);
398  FsdDosDateTimeToSystemTime(DeviceExt,
399  DirContext->DirEntry.FatX.AccessDate,
400  DirContext->DirEntry.FatX.AccessTime,
401  &pInfo->LastAccessTime);
402  FsdDosDateTimeToSystemTime(DeviceExt,
403  DirContext->DirEntry.FatX.UpdateDate,
404  DirContext->DirEntry.FatX.UpdateTime,
405  &pInfo->LastWriteTime);
406 
407  pInfo->ChangeTime = pInfo->LastWriteTime;
408 
409  if (BooleanFlagOn(DirContext->DirEntry.FatX.Attrib, FILE_ATTRIBUTE_DIRECTORY))
410  {
411  pInfo->EndOfFile.QuadPart = 0;
412  pInfo->AllocationSize.QuadPart = 0;
413  }
414  else
415  {
416  pInfo->EndOfFile.u.HighPart = 0;
417  pInfo->EndOfFile.u.LowPart = DirContext->DirEntry.FatX.FileSize;
418  /* Make allocsize a rounded up multiple of BytesPerCluster */
419  pInfo->AllocationSize.u.HighPart = 0;
420  pInfo->AllocationSize.u.LowPart = ROUND_UP(DirContext->DirEntry.FatX.FileSize,
421  DeviceExt->FatInfo.BytesPerCluster);
422  }
423 
424  pInfo->FileAttributes = DirContext->DirEntry.FatX.Attrib & 0x3f;
425  }
426  else
427  {
428  pInfo->ShortNameLength = (CCHAR)DirContext->ShortNameU.Length;
429 
430  ASSERT(pInfo->ShortNameLength / sizeof(WCHAR) <= 12);
431  RtlCopyMemory(pInfo->ShortName,
432  DirContext->ShortNameU.Buffer,
433  DirContext->ShortNameU.Length);
434 
435  /* pInfo->FileIndex = ; */
436 
437  FsdDosDateTimeToSystemTime(DeviceExt,
438  DirContext->DirEntry.Fat.CreationDate,
439  DirContext->DirEntry.Fat.CreationTime,
440  &pInfo->CreationTime);
441  FsdDosDateTimeToSystemTime(DeviceExt,
442  DirContext->DirEntry.Fat.AccessDate,
443  0,
444  &pInfo->LastAccessTime);
445  FsdDosDateTimeToSystemTime(DeviceExt,
446  DirContext->DirEntry.Fat.UpdateDate,
447  DirContext->DirEntry.Fat.UpdateTime,
448  &pInfo->LastWriteTime);
449 
450  pInfo->ChangeTime = pInfo->LastWriteTime;
451 
452  if (BooleanFlagOn(DirContext->DirEntry.Fat.Attrib, FILE_ATTRIBUTE_DIRECTORY))
453  {
454  pInfo->EndOfFile.QuadPart = 0;
455  pInfo->AllocationSize.QuadPart = 0;
456  }
457  else
458  {
459  pInfo->EndOfFile.u.HighPart = 0;
460  pInfo->EndOfFile.u.LowPart = DirContext->DirEntry.Fat.FileSize;
461  /* Make allocsize a rounded up multiple of BytesPerCluster */
462  pInfo->AllocationSize.u.HighPart = 0;
463  pInfo->AllocationSize.u.LowPart = ROUND_UP(DirContext->DirEntry.Fat.FileSize, DeviceExt->FatInfo.BytesPerCluster);
464  }
465 
466  pInfo->FileAttributes = DirContext->DirEntry.Fat.Attrib & 0x3f;
467  }
468  }
469 
470  return Status;
471 }
472 
473 static
474 NTSTATUS
476  PVFAT_IRP_CONTEXT IrpContext)
477 {
479  LONG BufferLength = 0;
480  PUNICODE_STRING pSearchPattern = NULL;
482  PUCHAR Buffer = NULL;
483  PFILE_NAMES_INFORMATION Buffer0 = NULL;
484  PVFATFCB pFcb;
485  PVFATCCB pCcb;
486  BOOLEAN FirstQuery = FALSE;
487  BOOLEAN FirstCall = TRUE;
489  WCHAR LongNameBuffer[LONGNAME_MAX_LENGTH + 1];
490  WCHAR ShortNameBuffer[13];
491  ULONG Written;
492 
493  PIO_STACK_LOCATION Stack = IrpContext->Stack;
494 
495  pCcb = (PVFATCCB)IrpContext->FileObject->FsContext2;
496  pFcb = (PVFATFCB)IrpContext->FileObject->FsContext;
497 
498  /* Determine Buffer for result : */
499  BufferLength = Stack->Parameters.QueryDirectory.Length;
500 #if 0
501  /* Do not probe the user buffer until SEH is available */
502  if (IrpContext->Irp->RequestorMode != KernelMode &&
503  IrpContext->Irp->MdlAddress == NULL &&
504  IrpContext->Irp->UserBuffer != NULL)
505  {
506  ProbeForWrite(IrpContext->Irp->UserBuffer, BufferLength, 1);
507  }
508 #endif
509  Buffer = VfatGetUserBuffer(IrpContext->Irp, FALSE);
510 
511  if (!ExAcquireResourceExclusiveLite(&IrpContext->DeviceExt->DirResource,
512  BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT)))
513  {
515  if (NT_SUCCESS(Status))
517 
518  return Status;
519  }
520 
522  BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT)))
523  {
524  ExReleaseResourceLite(&IrpContext->DeviceExt->DirResource);
526  if (NT_SUCCESS(Status))
528 
529  return Status;
530  }
531 
532  /* Obtain the callers parameters */
533  pSearchPattern = (PUNICODE_STRING)Stack->Parameters.QueryDirectory.FileName;
534  FileInformationClass = Stack->Parameters.QueryDirectory.FileInformationClass;
535 
536  /* Allocate search pattern in case:
537  * -> We don't have one already in context
538  * -> We have been given an input pattern
539  * -> The pattern length is not null
540  * -> The pattern buffer is not null
541  * Otherwise, we'll fall later and allocate a match all (*) pattern
542  */
543  if (pSearchPattern &&
544  pSearchPattern->Length != 0 && pSearchPattern->Buffer != NULL)
545  {
546  if (!pCcb->SearchPattern.Buffer)
547  {
548  FirstQuery = TRUE;
549  pCcb->SearchPattern.MaximumLength = pSearchPattern->Length + sizeof(WCHAR);
552  TAG_SEARCH);
553  if (!pCcb->SearchPattern.Buffer)
554  {
556  ExReleaseResourceLite(&IrpContext->DeviceExt->DirResource);
558  }
559  RtlCopyUnicodeString(&pCcb->SearchPattern, pSearchPattern);
560  pCcb->SearchPattern.Buffer[pCcb->SearchPattern.Length / sizeof(WCHAR)] = 0;
561  }
562  }
563  else if (!pCcb->SearchPattern.Buffer)
564  {
565  FirstQuery = TRUE;
566  pCcb->SearchPattern.MaximumLength = 2 * sizeof(WCHAR);
568  2 * sizeof(WCHAR),
569  TAG_SEARCH);
570  if (!pCcb->SearchPattern.Buffer)
571  {
573  ExReleaseResourceLite(&IrpContext->DeviceExt->DirResource);
575  }
576  pCcb->SearchPattern.Buffer[0] = L'*';
577  pCcb->SearchPattern.Buffer[1] = 0;
578  pCcb->SearchPattern.Length = sizeof(WCHAR);
579  }
580 
581  if (BooleanFlagOn(IrpContext->Stack->Flags, SL_INDEX_SPECIFIED))
582  {
583  DirContext.DirIndex = pCcb->Entry = Stack->Parameters.QueryDirectory.FileIndex;
584  }
585  else if (FirstQuery || BooleanFlagOn(IrpContext->Stack->Flags, SL_RESTART_SCAN))
586  {
587  DirContext.DirIndex = pCcb->Entry = 0;
588  }
589  else
590  {
591  DirContext.DirIndex = pCcb->Entry;
592  }
593 
594  DPRINT("Buffer=%p tofind=%wZ\n", Buffer, &pCcb->SearchPattern);
595 
596  DirContext.DeviceExt = IrpContext->DeviceExt;
597  DirContext.LongNameU.Buffer = LongNameBuffer;
598  DirContext.LongNameU.MaximumLength = sizeof(LongNameBuffer);
599  DirContext.ShortNameU.Buffer = ShortNameBuffer;
600  DirContext.ShortNameU.MaximumLength = sizeof(ShortNameBuffer);
601 
602  Written = 0;
603  while ((Status == STATUS_SUCCESS) && (BufferLength > 0))
604  {
605  Status = FindFile(IrpContext->DeviceExt,
606  pFcb,
607  &pCcb->SearchPattern,
608  &DirContext,
609  FirstCall);
610  pCcb->Entry = DirContext.DirIndex;
611 
612  DPRINT("Found %wZ, Status=%x, entry %x\n", &DirContext.LongNameU, Status, pCcb->Entry);
613 
614  FirstCall = FALSE;
615  if (NT_SUCCESS(Status))
616  {
617  switch (FileInformationClass)
618  {
621  IrpContext->DeviceExt,
623  BufferLength,
624  &Written,
625  Buffer0 == NULL);
626  break;
627 
630  IrpContext->DeviceExt,
632  BufferLength,
633  &Written,
634  Buffer0 == NULL);
635  break;
636 
639  IrpContext->DeviceExt,
641  BufferLength,
642  &Written,
643  Buffer0 == NULL);
644  break;
645 
649  BufferLength,
650  &Written,
651  Buffer0 == NULL);
652  break;
653 
654  default:
656  break;
657  }
658 
660  break;
661  }
662  else
663  {
665  break;
666  }
667 
668  Buffer0 = (PFILE_NAMES_INFORMATION) Buffer;
669  Buffer0->FileIndex = DirContext.DirIndex;
670  pCcb->Entry = ++DirContext.DirIndex;
671  BufferLength -= Buffer0->NextEntryOffset;
672 
673  if (BooleanFlagOn(IrpContext->Stack->Flags, SL_RETURN_SINGLE_ENTRY))
674  break;
675 
676  Buffer += Buffer0->NextEntryOffset;
677  }
678 
679  if (Buffer0)
680  {
681  Buffer0->NextEntryOffset = 0;
683  IrpContext->Irp->IoStatus.Information = Stack->Parameters.QueryDirectory.Length - BufferLength;
684  }
685  else
686  {
688  ASSERT(Written <= Stack->Parameters.QueryDirectory.Length);
689  IrpContext->Irp->IoStatus.Information = Written;
690  }
691 
693  ExReleaseResourceLite(&IrpContext->DeviceExt->DirResource);
694 
695  return Status;
696 }
697 
699 {
700  PVCB pVcb;
701  PVFATFCB pFcb;
702  PIO_STACK_LOCATION Stack;
703  Stack = IrpContext->Stack;
704  pVcb = IrpContext->DeviceExt;
705  pFcb = (PVFATFCB) IrpContext->FileObject->FsContext;
706 
708  &(pVcb->NotifyList),
709  IrpContext->FileObject->FsContext2,
710  (PSTRING)&(pFcb->PathNameU),
712  FALSE,
713  Stack->Parameters.NotifyDirectory.CompletionFilter,
714  IrpContext->Irp,
715  NULL,
716  NULL);
717 
718  /* We won't handle IRP completion */
719  IrpContext->Flags &= ~IRPCONTEXT_COMPLETE;
720 
721  return STATUS_PENDING;
722 }
723 
724 /*
725  * FUNCTION: directory control : read/write directory informations
726  */
727 NTSTATUS
729  PVFAT_IRP_CONTEXT IrpContext)
730 {
732 
733  IrpContext->Irp->IoStatus.Information = 0;
734 
735  switch (IrpContext->MinorFunction)
736  {
738  Status = DoQuery (IrpContext);
739  break;
740 
742  Status = VfatNotifyChangeDirectory(IrpContext);
743  break;
744 
745  default:
746  /* Error */
747  DPRINT("Unexpected minor function %x in VFAT driver\n",
748  IrpContext->MinorFunction);
750  break;
751  }
752 
754  {
755  return VfatMarkIrpContextForQueue(IrpContext);
756  }
757 
758  return Status;
759 }
760 
761 /* EOF */
LARGE_INTEGER LastAccessTime
Definition: winternl.h:517
LONGLONG CreationTime
Definition: cdstruc.h:1036
#define IRP_MN_NOTIFY_CHANGE_DIRECTORY
Definition: rdpdr.c:56
WORD Month
Definition: cabinet.c:40
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define ROUND_UP(n, align)
Definition: eventvwr.h:31
#define SL_INDEX_SPECIFIED
Definition: iotypes.h:1794
Definition: vfat.h:441
USHORT MaximumLength
Definition: env_spec_w32.h:370
#define IRPCONTEXT_COMPLETE
Definition: vfat.h:570
Definition: vfat.h:530
VOID NTAPI FsRtlNotifyFullChangeDirectory(IN PNOTIFY_SYNC NotifySync, IN PLIST_ENTRY NotifyList, IN PVOID FsContext, IN PSTRING FullDirectoryName, IN BOOLEAN WatchTree, IN BOOLEAN IgnoreBuffer, IN ULONG CompletionFilter, IN PIRP NotifyIrp, IN PCHECK_FOR_TRAVERSE_ACCESS TraverseCallback OPTIONAL, IN PSECURITY_SUBJECT_CONTEXT SubjectContext OPTIONAL)
Definition: notify.c:1458
PDEVICE_EXTENSION DeviceExt
Definition: vfat.h:579
static NTSTATUS VfatGetFileFullDirectoryInformation(PVFAT_DIRENTRY_CONTEXT DirContext, PDEVICE_EXTENSION DeviceExt, PFILE_FULL_DIR_INFORMATION pInfo, ULONG BufferLength, PULONG Written, BOOLEAN First)
Definition: dir.c:252
struct _VFATCCB * PVFATCCB
#define BooleanFlagOn(F, SF)
Definition: ext2fs.h:183
WORD Year
Definition: cabinet.c:41
unsigned char * PUCHAR
Definition: retypes.h:3
LONG NTSTATUS
Definition: precomp.h:26
ULONG DirIndex
Definition: ntfs.h:529
WORD Second
Definition: cabinet.c:32
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define IRP_MN_QUERY_DIRECTORY
Definition: rdpdr.c:55
Definition: cdstruc.h:504
ULONG Entry
Definition: vfat.h:535
struct _DOSDATE * PDOSDATE
UNICODE_STRING SearchPattern
Definition: vfat.h:537
static OUT PIO_STATUS_BLOCK OUT PVOID IN ULONG IN FILE_INFORMATION_CLASS FileInformationClass
Definition: pipe.c:75
WORD Minute
Definition: cabinet.c:33
PFILE_OBJECT FileObject
Definition: vfat.h:585
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
_In_ UINT _In_ UINT BytesToCopy
Definition: ndis.h:3167
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PUNICODE_STRING SourceString)
struct _DOSTIME * PDOSTIME
BOOLEAN NTAPI ExAcquireResourceExclusiveLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:770
static NTSTATUS VfatGetFileDirectoryInformation(PVFAT_DIRENTRY_CONTEXT DirContext, PDEVICE_EXTENSION DeviceExt, PFILE_DIRECTORY_INFORMATION pInfo, ULONG BufferLength, PULONG Written, BOOLEAN First)
Definition: dir.c:135
WCHAR First[]
Definition: FormatMessage.c:11
LARGE_INTEGER ChangeTime
Definition: winternl.h:519
BOOLEAN FsdSystemTimeToDosDateTime(PDEVICE_EXTENSION DeviceExt, PLARGE_INTEGER SystemTime, PUSHORT pDosDate, PUSHORT pDosTime)
Definition: dir.c:53
LARGE_INTEGER LastWriteTime
Definition: from_kernel.h:143
long LONG
Definition: pedump.c:60
_In_ ULONG BufferLength
Definition: usbdlib.h:225
struct _STRING * PSTRING
LARGE_INTEGER EndOfFile
Definition: winternl.h:520
WORD Hour
Definition: cabinet.c:34
LARGE_INTEGER AllocationSize
Definition: from_kernel.h:146
static NTSTATUS DoQuery(PVFAT_IRP_CONTEXT IrpContext)
Definition: dir.c:475
unsigned char BOOLEAN
struct _LARGE_INTEGER::@2205 u
NTSTATUS VfatNotifyChangeDirectory(PVFAT_IRP_CONTEXT IrpContext)
Definition: dir.c:698
smooth NULL
Definition: ftsmooth.c:416
#define IRPCONTEXT_CANWAIT
Definition: vfat.h:569
void DPRINT(...)
Definition: polytest.cpp:61
struct _FILE_NAMES_INFORMATION * PFILE_NAMES_INFORMATION
Definition: bufpool.h:45
PVOID VfatGetUserBuffer(IN PIRP Irp, IN BOOLEAN Paging)
Definition: misc.c:365
USHORT Milliseconds
Definition: env_spec_w32.h:717
#define ExSystemTimeToLocalTime(SysTime, LocTime)
Definition: env_spec_w32.h:729
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
FORCEINLINE BOOLEAN vfatVolumeIsFatX(PDEVICE_EXTENSION DeviceExt)
Definition: vfat.h:645
BOOLEAN RtlTimeToTimeFields(IN PLARGE_INTEGER Time, IN PTIME_FIELDS TimeFields)
enum _FILE_INFORMATION_CLASS FILE_INFORMATION_CLASS
Definition: directory.c:44
static NTSTATUS VfatGetFileBothInformation(PVFAT_DIRENTRY_CONTEXT DirContext, PDEVICE_EXTENSION DeviceExt, PFILE_BOTH_DIR_INFORMATION pInfo, ULONG BufferLength, PULONG Written, BOOLEAN First)
Definition: dir.c:348
if(!(yy_init))
Definition: macro.lex.yy.c:714
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define STATUS_PENDING
Definition: ntstatus.h:82
#define STATUS_NO_MORE_FILES
Definition: udferr_usr.h:128
char CCHAR
Definition: typedefs.h:50
#define TAG_SEARCH
Definition: vfat.h:548
#define ULONG_ROUND_UP(x)
Definition: dir.c:87
LARGE_INTEGER LastWriteTime
Definition: winternl.h:518
_In_ PFCB _In_ PDIRENT_ENUM_CONTEXT DirContext
Definition: cdprocs.h:429
FORCEINLINE NTSTATUS VfatMarkIrpContextForQueue(PVFAT_IRP_CONTEXT IrpContext)
Definition: vfat.h:619
BOOLEAN FsdDosDateTimeToSystemTime(PDEVICE_EXTENSION DeviceExt, USHORT DosDate, USHORT DosTime, PLARGE_INTEGER SystemTime)
Definition: dir.c:22
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1817
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
_In_ PPCI_DEVICE_PRESENCE_PARAMETERS Parameters
Definition: iotypes.h:872
#define STATUS_INVALID_INFO_CLASS
Definition: ntstatus.h:226
static const WCHAR L[]
Definition: oid.c:1250
#define SL_WATCH_TREE
Definition: iotypes.h:1796
UCHAR MinorFunction
Definition: vfat.h:584
struct _VFATFCB * PVFATFCB
Status
Definition: gdiplustypes.h:24
NTSTATUS VfatDirectoryControl(PVFAT_IRP_CONTEXT IrpContext)
Definition: dir.c:728
#define SL_RETURN_SINGLE_ENTRY
Definition: iotypes.h:1793
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:61
unsigned short USHORT
Definition: pedump.c:61
#define ExLocalTimeToSystemTime(LocTime, SysTime)
Definition: env_spec_w32.h:738
LARGE_INTEGER CreationTime
Definition: winternl.h:516
#define STATUS_NO_SUCH_FILE
Definition: udferr_usr.h:137
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
unsigned int * PULONG
Definition: retypes.h:1
#define min(a, b)
Definition: monoChain.cc:55
ERESOURCE MainResource
Definition: vfat.h:446
#define SL_RESTART_SCAN
Definition: iotypes.h:1792
UNICODE_STRING * PUNICODE_STRING
Definition: env_spec_w32.h:373
BOOLEAN NTAPI ExAcquireResourceSharedLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:885
LARGE_INTEGER CreationTime
Definition: from_kernel.h:141
WORD Day
Definition: cabinet.c:39
UNICODE_STRING PathNameU
Definition: vfat.h:466
#define LONGNAME_MAX_LENGTH
Definition: vfat.h:203
unsigned int ULONG
Definition: retypes.h:1
PNOTIFY_SYNC NotifySync
Definition: cdstruc.h:613
ULONG Flags
Definition: vfat.h:580
LARGE_INTEGER LastAccessTime
Definition: from_kernel.h:142
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2772
BOOLEAN RtlTimeFieldsToTime(IN PTIME_FIELDS TimeFields, IN PLARGE_INTEGER Time)
static PTIME_FIELDS TimeFields
Definition: time.c:104
WCHAR FileName[ANYSIZE_ARRAY]
Definition: winternl.h:524
PIO_STACK_LOCATION Stack
Definition: vfat.h:582
return STATUS_SUCCESS
Definition: btrfs.c:2966
NTSTATUS VfatLockUserBuffer(IN PIRP Irp, IN ULONG Length, IN LOCK_OPERATION Operation)
Definition: misc.c:382
short CSHORT
Definition: umtypes.h:127
unsigned short * PUSHORT
Definition: retypes.h:2
LARGE_INTEGER AllocationSize
Definition: winternl.h:521
LONGLONG QuadPart
Definition: typedefs.h:112
Definition: find.c:28
WCHAR FileName[ANYSIZE_ARRAY]
Definition: winternl.h:539
static NTSTATUS VfatGetFileNamesInformation(PVFAT_DIRENTRY_CONTEXT DirContext, PFILE_NAMES_INFORMATION pInfo, ULONG BufferLength, PULONG Written, BOOLEAN First)
Definition: dir.c:91