ReactOS  0.4.14-dev-77-gd9e7c48
finfo.c
Go to the documentation of this file.
1 /*
2  * ReactOS kernel
3  * Copyright (C) 2002 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  * HervĂ© Poussineau (hpoussin@reactos.org)
25  * Pierre Schweitzer (pierre@reactos.org)
26  */
27 
28 /* INCLUDES *****************************************************************/
29 
30 #include "ntfs.h"
31 
32 #define NDEBUG
33 #include <debug.h>
34 
35 /* FUNCTIONS ****************************************************************/
36 
37 /*
38  * FUNCTION: Retrieve the standard file information
39  */
40 static
44  PFILE_STANDARD_INFORMATION StandardInfo,
46 {
48 
49  DPRINT("NtfsGetStandardInformation(%p, %p, %p, %p)\n", Fcb, DeviceObject, StandardInfo, BufferLength);
50 
53 
54  /* PRECONDITION */
55  ASSERT(StandardInfo != NULL);
56  ASSERT(Fcb != NULL);
57 
58  RtlZeroMemory(StandardInfo,
60 
61  StandardInfo->AllocationSize = Fcb->RFCB.AllocationSize;
62  StandardInfo->EndOfFile = Fcb->RFCB.FileSize;
63  StandardInfo->NumberOfLinks = Fcb->LinkCount;
64  StandardInfo->DeletePending = FALSE;
65  StandardInfo->Directory = NtfsFCBIsDirectory(Fcb);
66 
68 
69  return STATUS_SUCCESS;
70 }
71 
72 
73 static
76  PFILE_POSITION_INFORMATION PositionInfo,
78 {
79  DPRINT1("NtfsGetPositionInformation(%p, %p, %p)\n", FileObject, PositionInfo, BufferLength);
80 
83 
84  PositionInfo->CurrentByteOffset.QuadPart = FileObject->CurrentByteOffset.QuadPart;
85 
86  DPRINT("Getting position %I64x\n",
87  PositionInfo->CurrentByteOffset.QuadPart);
88 
90 
91  return STATUS_SUCCESS;
92 }
93 
94 
95 static
98  PNTFS_FCB Fcb,
100  PFILE_BASIC_INFORMATION BasicInfo,
102 {
104 
105  DPRINT("NtfsGetBasicInformation(%p, %p, %p, %p, %p)\n", FileObject, Fcb, DeviceObject, BasicInfo, BufferLength);
106 
107  if (*BufferLength < sizeof(FILE_BASIC_INFORMATION))
109 
110  BasicInfo->CreationTime.QuadPart = FileName->CreationTime;
111  BasicInfo->LastAccessTime.QuadPart = FileName->LastAccessTime;
112  BasicInfo->LastWriteTime.QuadPart = FileName->LastWriteTime;
113  BasicInfo->ChangeTime.QuadPart = FileName->ChangeTime;
114 
115  NtfsFileFlagsToAttributes(FileName->FileAttributes, &BasicInfo->FileAttributes);
116 
118 
119  return STATUS_SUCCESS;
120 }
121 
122 
123 /*
124  * FUNCTION: Retrieve the file name information
125  */
126 static
127 NTSTATUS
129  PNTFS_FCB Fcb,
131  PFILE_NAME_INFORMATION NameInfo,
133 {
135 
138 
139  DPRINT("NtfsGetNameInformation(%p, %p, %p, %p, %p)\n", FileObject, Fcb, DeviceObject, NameInfo, BufferLength);
140 
141  ASSERT(NameInfo != NULL);
142  ASSERT(Fcb != NULL);
143 
144  /* If buffer can't hold at least the file name length, bail out */
147 
148  /* Save file name length, and as much file len, as buffer length allows */
149  NameInfo->FileNameLength = wcslen(Fcb->PathName) * sizeof(WCHAR);
150 
151  /* Calculate amount of bytes to copy not to overflow the buffer */
152  BytesToCopy = min(NameInfo->FileNameLength,
154 
155  /* Fill in the bytes */
157 
158  /* Check if we could write more but are not able to */
159  if (*BufferLength < NameInfo->FileNameLength + (ULONG)FIELD_OFFSET(FILE_NAME_INFORMATION, FileName[0]))
160  {
161  /* Return number of bytes written */
163  return STATUS_BUFFER_OVERFLOW;
164  }
165 
166  /* We filled up as many bytes, as needed */
168 
169  return STATUS_SUCCESS;
170 }
171 
172 
173 static
174 NTSTATUS
176  PFILE_INTERNAL_INFORMATION InternalInfo,
178 {
179  DPRINT1("NtfsGetInternalInformation(%p, %p, %p)\n", Fcb, InternalInfo, BufferLength);
180 
181  ASSERT(InternalInfo);
182  ASSERT(Fcb);
183 
186 
187  InternalInfo->IndexNumber.QuadPart = Fcb->MFTIndex;
188 
190 
191  return STATUS_SUCCESS;
192 }
193 
194 static
195 NTSTATUS
197  PDEVICE_EXTENSION DeviceExt,
198  PFILE_NETWORK_OPEN_INFORMATION NetworkInfo,
200 {
202 
203  DPRINT("NtfsGetNetworkOpenInformation(%p, %p, %p, %p)\n", Fcb, DeviceExt, NetworkInfo, BufferLength);
204 
207 
208  NetworkInfo->CreationTime.QuadPart = FileName->CreationTime;
209  NetworkInfo->LastAccessTime.QuadPart = FileName->LastAccessTime;
210  NetworkInfo->LastWriteTime.QuadPart = FileName->LastWriteTime;
211  NetworkInfo->ChangeTime.QuadPart = FileName->ChangeTime;
212 
213  NetworkInfo->EndOfFile = Fcb->RFCB.FileSize;
214  NetworkInfo->AllocationSize = Fcb->RFCB.AllocationSize;
215 
216  NtfsFileFlagsToAttributes(FileName->FileAttributes, &NetworkInfo->FileAttributes);
217 
219  return STATUS_SUCCESS;
220 }
221 
222 static
223 NTSTATUS
225  PDEVICE_EXTENSION DeviceExt,
226  PFILE_STREAM_INFORMATION StreamInfo,
228 {
229  ULONG CurrentSize;
231  PNTFS_ATTR_RECORD Attribute;
232  NTSTATUS Status, BrowseStatus;
233  PFILE_RECORD_HEADER FileRecord;
234  PFILE_STREAM_INFORMATION CurrentInfo = StreamInfo, Previous = NULL;
235 
236  if (*BufferLength < sizeof(FILE_STREAM_INFORMATION))
238 
239  FileRecord = ExAllocateFromNPagedLookasideList(&DeviceExt->FileRecLookasideList);
240  if (FileRecord == NULL)
241  {
242  DPRINT1("Not enough memory!\n");
244  }
245 
246  Status = ReadFileRecord(DeviceExt, Fcb->MFTIndex, FileRecord);
247  if (!NT_SUCCESS(Status))
248  {
249  DPRINT1("Can't find record!\n");
250  ExFreeToNPagedLookasideList(&DeviceExt->FileRecLookasideList, FileRecord);
251  return Status;
252  }
253 
254  BrowseStatus = FindFirstAttribute(&Context, DeviceExt, FileRecord, FALSE, &Attribute);
255  while (NT_SUCCESS(BrowseStatus))
256  {
257  if (Attribute->Type == AttributeData)
258  {
259  CurrentSize = FIELD_OFFSET(FILE_STREAM_INFORMATION, StreamName) + Attribute->NameLength * sizeof(WCHAR) + wcslen(L"::$DATA") * sizeof(WCHAR);
260 
261  if (CurrentSize > *BufferLength)
262  {
264  break;
265  }
266 
267  CurrentInfo->NextEntryOffset = 0;
268  CurrentInfo->StreamNameLength = (Attribute->NameLength + wcslen(L"::$DATA")) * sizeof(WCHAR);
269  CurrentInfo->StreamSize.QuadPart = AttributeDataLength(Attribute);
270  CurrentInfo->StreamAllocationSize.QuadPart = AttributeAllocatedLength(Attribute);
271  CurrentInfo->StreamName[0] = L':';
272  RtlMoveMemory(&CurrentInfo->StreamName[1], (PWCHAR)((ULONG_PTR)Attribute + Attribute->NameOffset), CurrentInfo->StreamNameLength);
273  RtlMoveMemory(&CurrentInfo->StreamName[Attribute->NameLength + 1], L":$DATA", sizeof(L":$DATA") - sizeof(UNICODE_NULL));
274 
275  if (Previous != NULL)
276  {
277  Previous->NextEntryOffset = (ULONG_PTR)CurrentInfo - (ULONG_PTR)Previous;
278  }
279  Previous = CurrentInfo;
280  CurrentInfo = (PFILE_STREAM_INFORMATION)((ULONG_PTR)CurrentInfo + CurrentSize);
281  *BufferLength -= CurrentSize;
282  }
283 
284  BrowseStatus = FindNextAttribute(&Context, &Attribute);
285  }
286 
288  ExFreeToNPagedLookasideList(&DeviceExt->FileRecLookasideList, FileRecord);
289  return Status;
290 }
291 
292 // Convert enum value to friendly name
293 const PCSTR
295 {
296  const PCSTR fileInfoClassNames[] = { "???????",
297  "FileDirectoryInformation",
298  "FileFullDirectoryInformation",
299  "FileBothDirectoryInformation",
300  "FileBasicInformation",
301  "FileStandardInformation",
302  "FileInternalInformation",
303  "FileEaInformation",
304  "FileAccessInformation",
305  "FileNameInformation",
306  "FileRenameInformation",
307  "FileLinkInformation",
308  "FileNamesInformation",
309  "FileDispositionInformation",
310  "FilePositionInformation",
311  "FileFullEaInformation",
312  "FileModeInformation",
313  "FileAlignmentInformation",
314  "FileAllInformation",
315  "FileAllocationInformation",
316  "FileEndOfFileInformation",
317  "FileAlternateNameInformation",
318  "FileStreamInformation",
319  "FilePipeInformation",
320  "FilePipeLocalInformation",
321  "FilePipeRemoteInformation",
322  "FileMailslotQueryInformation",
323  "FileMailslotSetInformation",
324  "FileCompressionInformation",
325  "FileObjectIdInformation",
326  "FileCompletionInformation",
327  "FileMoveClusterInformation",
328  "FileQuotaInformation",
329  "FileReparsePointInformation",
330  "FileNetworkOpenInformation",
331  "FileAttributeTagInformation",
332  "FileTrackingInformation",
333  "FileIdBothDirectoryInformation",
334  "FileIdFullDirectoryInformation",
335  "FileValidDataLengthInformation",
336  "FileShortNameInformation",
337  "FileIoCompletionNotificationInformation",
338  "FileIoStatusBlockRangeInformation",
339  "FileIoPriorityHintInformation",
340  "FileSfioReserveInformation",
341  "FileSfioVolumeInformation",
342  "FileHardLinkInformation",
343  "FileProcessIdsUsingFileInformation",
344  "FileNormalizedNameInformation",
345  "FileNetworkPhysicalNameInformation",
346  "FileIdGlobalTxDirectoryInformation",
347  "FileIsRemoteDeviceInformation",
348  "FileAttributeCacheInformation",
349  "FileNumaNodeInformation",
350  "FileStandardLinkInformation",
351  "FileRemoteProtocolInformation",
352  "FileReplaceCompletionInformation",
353  "FileMaximumInformation",
354  "FileDirectoryInformation",
355  "FileFullDirectoryInformation",
356  "FileBothDirectoryInformation",
357  "FileBasicInformation",
358  "FileStandardInformation",
359  "FileInternalInformation",
360  "FileEaInformation",
361  "FileAccessInformation",
362  "FileNameInformation",
363  "FileRenameInformation",
364  "FileLinkInformation",
365  "FileNamesInformation",
366  "FileDispositionInformation",
367  "FilePositionInformation",
368  "FileFullEaInformation",
369  "FileModeInformation",
370  "FileAlignmentInformation",
371  "FileAllInformation",
372  "FileAllocationInformation",
373  "FileEndOfFileInformation",
374  "FileAlternateNameInformation",
375  "FileStreamInformation",
376  "FilePipeInformation",
377  "FilePipeLocalInformation",
378  "FilePipeRemoteInformation",
379  "FileMailslotQueryInformation",
380  "FileMailslotSetInformation",
381  "FileCompressionInformation",
382  "FileObjectIdInformation",
383  "FileCompletionInformation",
384  "FileMoveClusterInformation",
385  "FileQuotaInformation",
386  "FileReparsePointInformation",
387  "FileNetworkOpenInformation",
388  "FileAttributeTagInformation",
389  "FileTrackingInformation",
390  "FileIdBothDirectoryInformation",
391  "FileIdFullDirectoryInformation",
392  "FileValidDataLengthInformation",
393  "FileShortNameInformation",
394  "FileIoCompletionNotificationInformation",
395  "FileIoStatusBlockRangeInformation",
396  "FileIoPriorityHintInformation",
397  "FileSfioReserveInformation",
398  "FileSfioVolumeInformation",
399  "FileHardLinkInformation",
400  "FileProcessIdsUsingFileInformation",
401  "FileNormalizedNameInformation",
402  "FileNetworkPhysicalNameInformation",
403  "FileIdGlobalTxDirectoryInformation",
404  "FileIsRemoteDeviceInformation",
405  "FileAttributeCacheInformation",
406  "FileNumaNodeInformation",
407  "FileStandardLinkInformation",
408  "FileRemoteProtocolInformation",
409  "FileReplaceCompletionInformation",
410  "FileMaximumInformation" };
411  return fileInfoClassNames[infoClass];
412 }
413 
414 /*
415  * FUNCTION: Retrieve the specified file information
416  */
417 NTSTATUS
419 {
421  PIO_STACK_LOCATION Stack;
423  PNTFS_FCB Fcb;
424  PVOID SystemBuffer;
426  PIRP Irp;
429 
430  DPRINT1("NtfsQueryInformation(%p)\n", IrpContext);
431 
432  Irp = IrpContext->Irp;
433  Stack = IrpContext->Stack;
434  DeviceObject = IrpContext->DeviceObject;
435  FileInformationClass = Stack->Parameters.QueryFile.FileInformationClass;
436  FileObject = IrpContext->FileObject;
437  Fcb = FileObject->FsContext;
438 
439  SystemBuffer = Irp->AssociatedIrp.SystemBuffer;
440  BufferLength = Stack->Parameters.QueryFile.Length;
441 
443  BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT)))
444  {
445  return NtfsMarkIrpContextForQueue(IrpContext);
446  }
447 
448  switch (FileInformationClass)
449  {
452  DeviceObject,
453  SystemBuffer,
454  &BufferLength);
455  break;
456 
459  SystemBuffer,
460  &BufferLength);
461  break;
462 
465  Fcb,
466  DeviceObject,
467  SystemBuffer,
468  &BufferLength);
469  break;
470 
471  case FileNameInformation:
473  Fcb,
474  DeviceObject,
475  SystemBuffer,
476  &BufferLength);
477  break;
478 
481  SystemBuffer,
482  &BufferLength);
483  break;
484 
488  SystemBuffer,
489  &BufferLength);
490  break;
491 
495  SystemBuffer,
496  &BufferLength);
497  break;
498 
500  case FileAllInformation:
501  DPRINT1("Unimplemented information class: %s\n", GetInfoClassName(FileInformationClass));
503  break;
504 
505  default:
506  DPRINT1("Unimplemented information class: %s\n", GetInfoClassName(FileInformationClass));
508  }
509 
511 
512  if (NT_SUCCESS(Status))
513  Irp->IoStatus.Information =
514  Stack->Parameters.QueryFile.Length - BufferLength;
515  else
516  Irp->IoStatus.Information = 0;
517 
518  return Status;
519 }
520 
560 NTSTATUS
563  PDEVICE_EXTENSION DeviceExt,
564  ULONG IrpFlags,
565  BOOLEAN CaseSensitive,
567 {
568  LARGE_INTEGER CurrentFileSize;
569  PFILE_RECORD_HEADER FileRecord;
570  PNTFS_ATTR_CONTEXT DataContext;
571  ULONG AttributeOffset;
574  PFILENAME_ATTRIBUTE FileNameAttribute;
575  ULONGLONG ParentMFTId;
577 
578 
579  // Allocate non-paged memory for the file record
580  FileRecord = ExAllocateFromNPagedLookasideList(&DeviceExt->FileRecLookasideList);
581  if (FileRecord == NULL)
582  {
583  DPRINT1("Couldn't allocate memory for file record!");
585  }
586 
587  // read the file record
588  DPRINT("Reading file record...\n");
589  Status = ReadFileRecord(DeviceExt, Fcb->MFTIndex, FileRecord);
590  if (!NT_SUCCESS(Status))
591  {
592  // We couldn't get the file's record. Free the memory and return the error
593  DPRINT1("Can't find record for %wS!\n", Fcb->ObjectName);
594  ExFreeToNPagedLookasideList(&DeviceExt->FileRecLookasideList, FileRecord);
595  return Status;
596  }
597 
598  DPRINT("Found record for %wS\n", Fcb->ObjectName);
599 
600  CurrentFileSize.QuadPart = NtfsGetFileSize(DeviceExt, FileRecord, L"", 0, NULL);
601 
602  // Are we trying to decrease the file size?
603  if (NewFileSize->QuadPart < CurrentFileSize.QuadPart)
604  {
605  // Is the file mapped?
606  if (!MmCanFileBeTruncated(FileObject->SectionObjectPointer,
607  NewFileSize))
608  {
609  DPRINT1("Couldn't decrease file size!\n");
610  ExFreeToNPagedLookasideList(&DeviceExt->FileRecLookasideList, FileRecord);
612  }
613  }
614 
615  // Find the attribute with the data stream for our file
616  DPRINT("Finding Data Attribute...\n");
617  Status = FindAttribute(DeviceExt,
618  FileRecord,
620  Fcb->Stream,
621  wcslen(Fcb->Stream),
622  &DataContext,
623  &AttributeOffset);
624 
625  // Did we fail to find the attribute?
626  if (!NT_SUCCESS(Status))
627  {
628  DPRINT1("No '%S' data stream associated with file!\n", Fcb->Stream);
629  ExFreeToNPagedLookasideList(&DeviceExt->FileRecLookasideList, FileRecord);
630  return Status;
631  }
632 
633  // Get the size of the data attribute
634  CurrentFileSize.QuadPart = AttributeDataLength(DataContext->pRecord);
635 
636  // Are we enlarging the attribute?
637  if (NewFileSize->QuadPart > CurrentFileSize.QuadPart)
638  {
639  // is increasing the stream size not allowed?
640  if ((Fcb->Flags & FCB_IS_VOLUME) ||
641  (IrpFlags & IRP_PAGING_IO))
642  {
643  // TODO - just fail for now
644  ReleaseAttributeContext(DataContext);
645  ExFreeToNPagedLookasideList(&DeviceExt->FileRecLookasideList, FileRecord);
646  return STATUS_ACCESS_DENIED;
647  }
648  }
649 
650  // set the attribute data length
651  Status = SetAttributeDataLength(FileObject, Fcb, DataContext, AttributeOffset, FileRecord, NewFileSize);
652  if (!NT_SUCCESS(Status))
653  {
654  ReleaseAttributeContext(DataContext);
655  ExFreeToNPagedLookasideList(&DeviceExt->FileRecLookasideList, FileRecord);
656  return Status;
657  }
658 
659  // now we need to update this file's size in every directory index entry that references it
660  // TODO: expand to work with every filename / hardlink stored in the file record.
661  FileNameAttribute = GetBestFileNameFromRecord(Fcb->Vcb, FileRecord);
662  if (FileNameAttribute == NULL)
663  {
664  DPRINT1("Unable to find FileName attribute associated with file!\n");
665  ReleaseAttributeContext(DataContext);
666  ExFreeToNPagedLookasideList(&DeviceExt->FileRecLookasideList, FileRecord);
668  }
669 
670  ParentMFTId = FileNameAttribute->DirectoryFileReferenceNumber & NTFS_MFT_MASK;
671 
672  FileName.Buffer = FileNameAttribute->Name;
673  FileName.Length = FileNameAttribute->NameLength * sizeof(WCHAR);
674  FileName.MaximumLength = FileName.Length;
675 
676  AllocationSize = AttributeAllocatedLength(DataContext->pRecord);
677 
679  ParentMFTId,
680  &FileName,
681  FALSE,
684  CaseSensitive);
685 
686  ReleaseAttributeContext(DataContext);
687  ExFreeToNPagedLookasideList(&DeviceExt->FileRecLookasideList, FileRecord);
688 
689  return Status;
690 }
691 
716 NTSTATUS
718 {
720  PIO_STACK_LOCATION Stack;
721  PDEVICE_EXTENSION DeviceExt;
723  PNTFS_FCB Fcb;
724  PVOID SystemBuffer;
726  PIRP Irp;
729 
730  DPRINT("NtfsSetInformation(%p)\n", IrpContext);
731 
732  Irp = IrpContext->Irp;
733  Stack = IrpContext->Stack;
734  DeviceObject = IrpContext->DeviceObject;
735  DeviceExt = DeviceObject->DeviceExtension;
736  FileInformationClass = Stack->Parameters.QueryFile.FileInformationClass;
737  FileObject = IrpContext->FileObject;
738  Fcb = FileObject->FsContext;
739 
740  SystemBuffer = Irp->AssociatedIrp.SystemBuffer;
741  BufferLength = Stack->Parameters.QueryFile.Length;
742 
744  BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT)))
745  {
746  return NtfsMarkIrpContextForQueue(IrpContext);
747  }
748 
749  switch (FileInformationClass)
750  {
751  PFILE_END_OF_FILE_INFORMATION EndOfFileInfo;
752 
753  /* TODO: Allocation size is not actually the same as file end for NTFS,
754  however, few applications are likely to make the distinction. */
756  DPRINT1("FIXME: Using hacky method of setting FileAllocationInformation.\n");
758  EndOfFileInfo = (PFILE_END_OF_FILE_INFORMATION)SystemBuffer;
760  FileObject,
761  DeviceExt,
762  Irp->Flags,
764  &EndOfFileInfo->EndOfFile);
765  break;
766 
767  // TODO: all other information classes
768 
769  default:
770  DPRINT1("FIXME: Unimplemented information class: %s\n", GetInfoClassName(FileInformationClass));
772  }
773 
775 
776  if (NT_SUCCESS(Status))
777  Irp->IoStatus.Information =
778  Stack->Parameters.QueryFile.Length - BufferLength;
779  else
780  Irp->IoStatus.Information = 0;
781 
782  return Status;
783 }
784 /* EOF */
BOOLEAN NTAPI MmCanFileBeTruncated(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, IN PLARGE_INTEGER NewFileSize)
Definition: section.c:4724
#define NTFS_MFT_MASK
Definition: ntfs.h:198
ULONGLONG AttributeAllocatedLength(PNTFS_ATTR_RECORD AttrRecord)
Definition: mft.c:249
PFILENAME_ATTRIBUTE GetBestFileNameFromRecord(PDEVICE_EXTENSION Vcb, PFILE_RECORD_HEADER FileRecord)
Definition: attrib.c:1985
struct _FILE_INTERNAL_INFORMATION FILE_INTERNAL_INFORMATION
PDEVICE_OBJECT DeviceObject
Definition: ntfs.h:484
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define SL_CASE_SENSITIVE
Definition: iotypes.h:1777
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
USHORT NameOffset
Definition: ntfs.h:126
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
WCHAR Name[1]
Definition: ntfs.h:375
PIO_STACK_LOCATION Stack
Definition: ntfs.h:478
LARGE_INTEGER LastAccessTime
Definition: nt_native.h:940
_In_ PIRP Irp
Definition: csq.h:116
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
Definition: cdstruc.h:908
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define BooleanFlagOn(F, SF)
Definition: ext2fs.h:183
FORCEINLINE NTSTATUS NtfsMarkIrpContextForQueue(PNTFS_IRP_CONTEXT IrpContext)
Definition: ntfs.h:565
LONG NTSTATUS
Definition: precomp.h:26
USHORT LinkCount
Definition: ntfs.h:536
ULONG Type
Definition: ntfs.h:122
UCHAR NameLength
Definition: ntfs.h:373
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
uint16_t * PWCHAR
Definition: typedefs.h:54
WCHAR PathName[MAX_PATH]
Definition: ntfs.h:521
BOOLEAN NtfsFCBIsDirectory(PNTFS_FCB Fcb)
Definition: fcb.c:127
ULONGLONG MFTIndex
Definition: ntfs.h:535
struct _FILE_POSITION_INFORMATION FILE_POSITION_INFORMATION
_In_ UINT _In_ UINT BytesToCopy
Definition: ndis.h:3167
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:263
struct _FILE_NETWORK_OPEN_INFORMATION FILE_NETWORK_OPEN_INFORMATION
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:64
LARGE_INTEGER StreamAllocationSize
Definition: winternl.h:722
uint32_t ULONG_PTR
Definition: typedefs.h:63
struct _FILE_STREAM_INFORMATION * PFILE_STREAM_INFORMATION
#define UNICODE_NULL
LARGE_INTEGER StreamSize
Definition: winternl.h:721
_In_ ULONG BufferLength
Definition: usbdlib.h:225
PVOID DeviceExtension
Definition: env_spec_w32.h:418
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
WCHAR Stream[MAX_PATH]
Definition: ntfs.h:519
#define IRPCONTEXT_CANWAIT
Definition: vfat.h:569
LARGE_INTEGER CurrentByteOffset
Definition: nt_native.h:955
void DPRINT(...)
Definition: polytest.cpp:61
WCHAR * ObjectName
Definition: ntfs.h:520
#define STATUS_USER_MAPPED_FILE
Definition: ntstatus.h:697
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
NTSTATUS FindNextAttribute(PFIND_ATTR_CONTXT Context, PNTFS_ATTR_RECORD *Attribute)
Definition: attrib.c:1431
FSRTL_COMMON_FCB_HEADER RFCB
Definition: ntfs.h:513
ULONGLONG NtfsGetFileSize(PDEVICE_EXTENSION DeviceExt, PFILE_RECORD_HEADER FileRecord, PCWSTR Stream, ULONG StreamLength, PULONGLONG AllocatedSize)
Definition: dirctl.c:38
struct _FILE_END_OF_FILE_INFORMATION * PFILE_END_OF_FILE_INFORMATION
_In_ PLIST_ENTRY _In_ PSTRING _In_ USHORT _In_opt_ PSTRING StreamName
Definition: fsrtlfuncs.h:738
const PCSTR GetInfoClassName(FILE_INFORMATION_CLASS infoClass)
Definition: finfo.c:294
enum _FILE_INFORMATION_CLASS FILE_INFORMATION_CLASS
Definition: directory.c:44
LARGE_INTEGER LastWriteTime
Definition: nt_native.h:941
VOID NtfsFileFlagsToAttributes(ULONG NtfsAttributes, PULONG FileAttributes)
Definition: misc.c:105
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
uint64_t ULONGLONG
Definition: typedefs.h:65
static NTSTATUS NtfsGetInternalInformation(PNTFS_FCB Fcb, PFILE_INTERNAL_INFORMATION InternalInfo, PULONG BufferLength)
Definition: finfo.c:175
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145
LARGE_INTEGER AllocationSize
Definition: propsheet.cpp:54
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1817
NTSTATUS UpdateFileNameRecord(PDEVICE_EXTENSION Vcb, ULONGLONG ParentMFTIndex, PUNICODE_STRING FileName, BOOLEAN DirSearch, ULONGLONG NewDataSize, ULONGLONG NewAllocationSize, BOOLEAN CaseSensitive)
Definition: mft.c:1660
* PFILE_OBJECT
Definition: iotypes.h:1955
_In_opt_ PLARGE_INTEGER NewFileSize
Definition: mmfuncs.h:609
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
ULONG Flags
Definition: ntfs.h:532
static NTSTATUS NtfsGetNameInformation(PFILE_OBJECT FileObject, PNTFS_FCB Fcb, PDEVICE_OBJECT DeviceObject, PFILE_NAME_INFORMATION NameInfo, PULONG BufferLength)
Definition: finfo.c:128
LARGE_INTEGER CreationTime
Definition: nt_native.h:939
static const WCHAR L[]
Definition: oid.c:1250
#define FILE_STANDARD_INFORMATION
Definition: disk.h:54
ULONG Flags
Definition: ntfs.h:477
VOID FindCloseAttribute(PFIND_ATTR_CONTXT Context)
Definition: attrib.c:1465
LARGE_INTEGER AllocationSize
Definition: env_spec_w32.h:755
ULONGLONG DirectoryFileReferenceNumber
Definition: ntfs.h:356
NTSTATUS NtfsQueryInformation(PNTFS_IRP_CONTEXT IrpContext)
Definition: finfo.c:418
ERESOURCE MainResource
Definition: ntfs.h:524
LARGE_INTEGER ChangeTime
Definition: nt_native.h:942
_Must_inspect_result_ _In_ PFILE_OBJECT _In_opt_ HANDLE _In_ ULONG FileNameLength
Definition: fltkernel.h:1129
Status
Definition: gdiplustypes.h:24
IN PFCB IN PFILE_OBJECT FileObject IN ULONG AllocationSize
Definition: fatprocs.h:310
#define FCB_IS_VOLUME
Definition: vfat.h:431
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
static NTSTATUS NtfsGetBasicInformation(PFILE_OBJECT FileObject, PNTFS_FCB Fcb, PDEVICE_OBJECT DeviceObject, PFILE_BASIC_INFORMATION BasicInfo, PULONG BufferLength)
Definition: finfo.c:97
UCHAR NameLength
Definition: ntfs.h:125
struct _FileName FileName
Definition: fatprocs.h:884
NTSTATUS FindFirstAttribute(PFIND_ATTR_CONTXT Context, PDEVICE_EXTENSION Vcb, PFILE_RECORD_HEADER FileRecord, BOOLEAN OnlyResident, PNTFS_ATTR_RECORD *Attribute)
Definition: attrib.c:1383
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:61
NTSTATUS ReadFileRecord(PDEVICE_EXTENSION Vcb, ULONGLONG index, PFILE_RECORD_HEADER file)
Definition: mft.c:1631
VOID ReleaseAttributeContext(PNTFS_ATTR_CONTEXT Context)
Definition: mft.c:104
static NTSTATUS NtfsGetStandardInformation(PNTFS_FCB Fcb, PDEVICE_OBJECT DeviceObject, PFILE_STANDARD_INFORMATION StandardInfo, PULONG BufferLength)
Definition: finfo.c:42
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
unsigned int * PULONG
Definition: retypes.h:1
#define min(a, b)
Definition: monoChain.cc:55
NTSTATUS SetAttributeDataLength(PFILE_OBJECT FileObject, PNTFS_FCB Fcb, PNTFS_ATTR_CONTEXT AttrContext, ULONG AttrOffset, PFILE_RECORD_HEADER FileRecord, PLARGE_INTEGER DataSize)
Definition: mft.c:615
#define IRP_PAGING_IO
BOOLEAN NTAPI ExAcquireResourceSharedLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:885
#define DPRINT1
Definition: precomp.h:8
#define FileStandardInformation
Definition: propsheet.cpp:61
struct tagContext Context
Definition: acpixf.h:1024
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
static NTSTATUS NtfsGetNetworkOpenInformation(PNTFS_FCB Fcb, PDEVICE_EXTENSION DeviceExt, PFILE_NETWORK_OPEN_INFORMATION NetworkInfo, PULONG BufferLength)
Definition: finfo.c:196
#define ULONG_PTR
Definition: config.h:101
PVCB Vcb
Definition: cdstruc.h:939
const char * PCSTR
Definition: typedefs.h:51
static NTSTATUS NtfsGetPositionInformation(PFILE_OBJECT FileObject, PFILE_POSITION_INFORMATION PositionInfo, PULONG BufferLength)
Definition: finfo.c:75
static NTSTATUS NtfsGetSteamInformation(PNTFS_FCB Fcb, PDEVICE_EXTENSION DeviceExt, PFILE_STREAM_INFORMATION StreamInfo, PULONG BufferLength)
Definition: finfo.c:224
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2772
_In_ PFCB Fcb
Definition: cdprocs.h:151
return STATUS_SUCCESS
Definition: btrfs.c:2966
FILENAME_ATTRIBUTE Entry
Definition: ntfs.h:538
NTSTATUS NtfsSetInformation(PNTFS_IRP_CONTEXT IrpContext)
Definition: finfo.c:717
ULONGLONG AttributeDataLength(PNTFS_ATTR_RECORD AttrRecord)
Definition: mft.c:259
NTSTATUS NtfsSetEndOfFile(PNTFS_FCB Fcb, PFILE_OBJECT FileObject, PDEVICE_EXTENSION DeviceExt, ULONG IrpFlags, BOOLEAN CaseSensitive, PLARGE_INTEGER NewFileSize)
Definition: finfo.c:561
PFILE_OBJECT FileObject
Definition: ntfs.h:485
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
LONGLONG QuadPart
Definition: typedefs.h:112
#define FILE_BASIC_INFORMATION
Definition: disk.h:53