29 if (cString[0] == 0x05)
34 StringA.Buffer = cString;
35 for (StringA.Length = 0;
36 StringA.Length < 8 && StringA.Buffer[StringA.Length] !=
' ';
38 StringA.MaximumLength = StringA.Length;
47 if (cString[8] !=
' ')
60 StringA.Buffer = &cString[8];
61 for (StringA.Length = 0;
62 StringA.Length < 3 && StringA.Buffer[StringA.Length] !=
' ';
64 StringA.MaximumLength = StringA.Length;
91 USHORT PathNameBufferLength;
102 DPRINT(
"FindFile(Parent %p, FileToFind '%wZ', DirIndex: %u)\n",
113 PathNameU.
Buffer = PathNameBuffer;
122 if (WildCard ==
FALSE)
148 DPRINT(
"FindFile: new Name %wZ, DirIndex %u (%u)\n",
154 DPRINT(
"FCB not found for %wZ\n", &PathNameU);
188 DPRINT1(
"WARNING: File system corruption detected. You may need to run a disk repair utility.\n");
228 DPRINT(
"FindFile: new Name %wZ, DirIndex %u\n",
261 ULONG RequestedDisposition,
262 ULONG RequestedOptions,
281 if (!DeviceExt->FatInfo.FixedMedia)
304 DPRINT(
"Checking for existing FCB in memory\n");
309 DPRINT (
"Could not make a new FCB, status: %x\n",
Status);
360 CloseContext =
Fcb->CloseContext;
362 if (CloseContext !=
NULL)
364 ConcurrentDeletion =
FALSE;
372 ConcurrentDeletion =
TRUE;
382 if (!ConcurrentDeletion)
388 DPRINT(
"Reusing delayed close FCB for %wZ\n", &
Fcb->PathNameU);
391 DPRINT(
"Attaching FCB to fileObject\n");
412 ULONG RequestedDisposition, RequestedOptions;
427 RequestedDisposition = ((
Stack->Parameters.Create.Options >> 24) & 0xff);
463 FileObject->RelatedFileObject->FsContext == DeviceExt->VolumeFcb))
465 DPRINT(
"Volume opening\n");
491 pFcb = DeviceExt->VolumeFcb;
496 Stack->Parameters.Create.ShareAccess,
503 Stack->Parameters.Create.ShareAccess,
515 DeviceExt->OpenHandleCount++;
524 FileObject->RelatedFileObject->FsContext == DeviceExt->VolumeFcb)
538 if (*
c ==
L'\\' ||
c == PathNameU.
Buffer)
540 if (Dots &&
last >
c)
544 if (*
c ==
L'\\' && (
c - 1) > PathNameU.
Buffer &&
576 TrailingBackslash =
FALSE;
580 TrailingBackslash =
TRUE;
679 Stack->Parameters.Create.ShareAccess,
686 Stack->Parameters.Create.ShareAccess,
705 DeviceExt->OpenHandleCount++;
744 DPRINT1(
"VfatOpenFile failed for '%wZ', status %x\n", &PathNameU,
Status);
765 if (TrailingBackslash)
798 &
Irp->Overlay.AllocationSize);
800 Irp->AssociatedIrp.SystemBuffer,
801 Stack->Parameters.Create.EaLength);
803 if (PagingFileCreate)
848 Stack->Parameters.Create.ShareAccess,
883#ifndef USE_ROS_CC_AND_FS
904 if (PagingFileCreate)
986 &
Irp->Overlay.AllocationSize);
1014 Stack->Parameters.Create.ShareAccess,
1048 DeviceExt->OpenHandleCount++;
1080 DPRINT (
"FsdCreate called with file system\n");
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE Parent
#define FILE_DIRECTORY_FILE
#define FILE_NON_DIRECTORY_FILE
#define FILE_DELETE_ON_CLOSE
_In_ PFCB _In_ PDIRENT_ENUM_CONTEXT DirContext
#define IOCTL_DISK_CHECK_VERIFY
#define STATUS_NOT_IMPLEMENTED
NTSTATUS VfatUpdateEntry(IN PDEVICE_EXTENSION DeviceExt, IN PVFATFCB pFcb)
#define NT_SUCCESS(StatCode)
NTSTATUS VfatCloseFile(PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject)
VOID vfat8Dot3ToString(PFAT_DIR_ENTRY pEntry, PUNICODE_STRING NameU)
static NTSTATUS VfatCreateFile(PDEVICE_OBJECT DeviceObject, PIRP Irp)
static NTSTATUS VfatOpenFile(PDEVICE_EXTENSION DeviceExt, PUNICODE_STRING PathNameU, PFILE_OBJECT FileObject, ULONG RequestedDisposition, ULONG RequestedOptions, PVFATFCB *ParentFcb)
NTSTATUS VfatCreate(PVFAT_IRP_CONTEXT IrpContext)
BOOLEAN FsdSystemTimeToDosDateTime(PDEVICE_EXTENSION DeviceExt, PLARGE_INTEGER SystemTime, PUSHORT pDosDate, PUSHORT pDosTime)
NTSTATUS VfatSetExtendedAttributes(PFILE_OBJECT FileObject, PVOID Ea, ULONG EaLength)
BOOLEAN vfatIsLongIllegal(WCHAR c)
BOOLEAN IsDotOrDotDot(PCUNICODE_STRING Name)
#define RemoveEntryList(Entry)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define IsListEmpty(ListHead)
NTSTATUS RtlUpcaseUnicodeString(PUNICODE_STRING dst, PUNICODE_STRING src, BOOLEAN Alloc)
#define KeQuerySystemTime(t)
#define ExAcquireResourceExclusiveLite(res, wait)
#define ClearFlag(_F, _SF)
#define VCB_VOLUME_LOCKED
#define FCB_DELETE_PENDING
#define CCB_DELETE_ON_CLOSE
#define BooleanFlagOn(F, SF)
PVFAT_GLOBAL_DATA VfatGlobalData
#define FILE_OPEN_BY_FILE_ID
#define FILE_OVERWRITE_IF
VOID FASTCALL ExAcquireFastMutex(IN PFAST_MUTEX FastMutex)
VOID FASTCALL ExReleaseFastMutex(IN PFAST_MUTEX FastMutex)
NTSYSAPI NTSTATUS WINAPI RtlDowncaseUnicodeString(UNICODE_STRING *, const UNICODE_STRING *, BOOLEAN)
#define ExFreePoolWithTag(_P, _T)
NTSYSAPI NTSTATUS NTAPI RtlOemStringToUnicodeString(PUNICODE_STRING DestinationString, PCOEM_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PUNICODE_STRING SourceString)
#define FILE_DOES_NOT_EXIST
#define FILE_ATTRIBUTE_READONLY
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, PUNICODE_STRING Source)
#define FILE_ATTRIBUTE_HIDDEN
#define FILE_ATTRIBUTE_SYSTEM
#define FILE_VALID_OPTION_FLAGS
#define FILE_ATTRIBUTE_ARCHIVE
#define FILE_ATTRIBUTE_DIRECTORY
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
_In_ ULONG _In_ ULONG _In_ ULONG Length
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
BOOLEAN NTAPI FsRtlIsNameInExpression(IN PUNICODE_STRING Expression, IN PUNICODE_STRING Name, IN BOOLEAN IgnoreCase, IN PWCHAR UpcaseTable OPTIONAL)
BOOLEAN NTAPI FsRtlAreNamesEqual(IN PCUNICODE_STRING Name1, IN PCUNICODE_STRING Name2, IN BOOLEAN IgnoreCase, IN PCWCH UpcaseTable OPTIONAL)
BOOLEAN NTAPI FsRtlDoesNameContainWildCards(IN PUNICODE_STRING Name)
_In_ PVOID _Out_opt_ BOOLEAN _Out_opt_ PPFN_NUMBER Page
VOID NTAPI IoSetShareAccess(IN ACCESS_MASK DesiredAccess, IN ULONG DesiredShareAccess, IN PFILE_OBJECT FileObject, OUT PSHARE_ACCESS ShareAccess)
NTSTATUS NTAPI IoCheckShareAccess(IN ACCESS_MASK DesiredAccess, IN ULONG DesiredShareAccess, IN PFILE_OBJECT FileObject, IN PSHARE_ACCESS ShareAccess, IN BOOLEAN Update)
VOID NTAPI IoUpdateShareAccess(IN PFILE_OBJECT FileObject, OUT PSHARE_ACCESS ShareAccess)
#define STATUS_DELETE_PENDING
#define STATUS_NO_MORE_ENTRIES
VOID NTAPI CcUnpinData(IN PVOID Bcb)
BOOLEAN NTAPI MmFlushImageSection(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, IN MMFLUSH_TYPE FlushType)
#define STATUS_CANNOT_DELETE
PAGED_LOOKASIDE_LIST CloseContextLookasideList
PDEVICE_OBJECT DeviceObject
PDEVICE_OBJECT DeviceObject
PDEVICE_EXTENSION DeviceExt
unsigned short UpdateDate
unsigned short UpdateTime
unsigned short UpdateDate
unsigned short UpdateTime
UNICODE_STRING ShortNameU
SHARE_ACCESS FCBShareAccess
SECTION_OBJECT_POINTERS SectionObjectPointers
LIST_ENTRY CloseListEntry
#define RtlCopyMemory(Destination, Source, Length)
#define RtlMoveMemory(Destination, Source, Length)
#define STATUS_FILE_IS_A_DIRECTORY
#define STATUS_NOT_A_DIRECTORY
#define STATUS_ACCESS_DENIED
#define STATUS_OBJECT_PATH_NOT_FOUND
#define STATUS_INVALID_PARAMETER
#define STATUS_UNSUCCESSFUL
#define STATUS_OBJECT_NAME_COLLISION
#define STATUS_SHARING_VIOLATION
#define STATUS_OBJECT_NAME_INVALID
#define STATUS_INSUFFICIENT_RESOURCES
#define FCB_DELAYED_CLOSE
#define vfatAddToStat(Vcb, Stat, Inc)
#define VCB_IS_SYS_OR_HAS_PAGE
FORCEINLINE BOOLEAN vfatFCBIsReadOnly(PVFATFCB FCB)
#define ENTRY_VOLUME(IsFatX, DirEntry)
FORCEINLINE NTSTATUS VfatAddEntry(PDEVICE_EXTENSION DeviceExt, PUNICODE_STRING NameU, struct _VFATFCB **Fcb, struct _VFATFCB *ParentFcb, ULONG RequestedOptions, UCHAR ReqAttr, struct _VFAT_MOVE_CONTEXT *MoveContext)
#define VFAT_CASE_LOWER_EXT
FORCEINLINE BOOLEAN vfatFCBIsDirectory(PVFATFCB FCB)
#define VFAT_BREAK_ON_CORRUPTION
FORCEINLINE NTSTATUS VfatGetNextDirEntry(PDEVICE_EXTENSION DeviceExt, PVOID *pContext, PVOID *pPage, struct _VFATFCB *pDirFcb, struct _VFAT_DIRENTRY_CONTEXT *DirContext, BOOLEAN First)
#define LONGNAME_MAX_LENGTH
#define FAT_ENTRY_VOLUME(DirEntry)
#define VFAT_CASE_LOWER_BASE
FORCEINLINE BOOLEAN vfatVolumeIsFatX(PDEVICE_EXTENSION DeviceExt)
FORCEINLINE VOID vfatReportChange(IN PDEVICE_EXTENSION DeviceExt, IN PVFATFCB Fcb, IN ULONG FilterMatch, IN ULONG Action)
NTSTATUS VfatBlockDeviceIoControl(IN PDEVICE_OBJECT DeviceObject, IN ULONG CtlCode, IN PVOID InputBuffer OPTIONAL, IN ULONG InputBufferSize, IN OUT PVOID OutputBuffer OPTIONAL, IN OUT PULONG OutputBufferSize, IN BOOLEAN Override)
VOID vfatSplitPathName(PUNICODE_STRING PathNameU, PUNICODE_STRING DirNameU, PUNICODE_STRING FileNameU)
BOOLEAN vfatFCBIsRoot(PVFATFCB FCB)
NTSTATUS vfatAttachFCBToFileObject(PDEVICE_EXTENSION vcb, PVFATFCB fcb, PFILE_OBJECT fileObject)
NTSTATUS vfatGetFCBForFile(PDEVICE_EXTENSION pVCB, PVFATFCB *pParentFCB, PVFATFCB *pFCB, PUNICODE_STRING pFileNameU)
VOID vfatReleaseFCB(PDEVICE_EXTENSION pVCB, PVFATFCB pFCB)
PVFATFCB vfatGrabFCBFromTable(PDEVICE_EXTENSION pVCB, PUNICODE_STRING PathNameU)
VOID vfatGrabFCB(PDEVICE_EXTENSION pVCB, PVFATFCB pFCB)
NTSTATUS VfatSetAllocationSizeInformation(PFILE_OBJECT FileObject, PVFATFCB Fcb, PDEVICE_EXTENSION DeviceExt, PLARGE_INTEGER AllocationSize)
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
_In_ PDEVICE_OBJECT DeviceObject
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
#define SL_OPEN_PAGING_FILE
#define FILE_NOTIFY_CHANGE_SIZE
#define FILE_ACTION_MODIFIED
#define FILE_NOTIFY_CHANGE_ATTRIBUTES
#define FILE_NOTIFY_CHANGE_FILE_NAME
#define IO_DISK_INCREMENT
#define FILE_NOTIFY_CHANGE_LAST_WRITE
#define SL_OPEN_TARGET_DIRECTORY
#define FILE_ACTION_ADDED
#define FILE_NOTIFY_CHANGE_DIR_NAME