20#define UDF_BUG_CHECK_ID UDF_FILE_DIR_CONTROL
26#define UDF_FNM_FLAG_CAN_BE_8D3 0x01
27#define UDF_FNM_FLAG_IGNORE_CASE 0x02
28#define UDF_FNM_FLAG_CONTAINS_WC 0x04
84 Irp->IoStatus.Status = RC;
85 Irp->IoStatus.Information = 0;
140 TmPrint((
"UDFCommonDirControl: \n"));
176 Irp->IoStatus.Status = RC;
177 Irp->IoStatus.Information = 0;
244 ULONG LastOffset = 0;
252 ULONG BytesRemainingInBuffer;
259 UDFPrint((
"UDFQueryDirectory: @=%#x\n", &PtrIrpContext));
261#define CanBe8dot3 (FNM_Flags & UDF_FNM_FLAG_CAN_BE_8D3)
262#define IgnoreCase (FNM_Flags & UDF_FNM_FLAG_IGNORE_CASE)
263#define ContainsWC (FNM_Flags & UDF_FNM_FLAG_CONTAINS_WC)
280 DirFileInfo =
Fcb->FileInfo;
292 PtrSearchPattern = &SearchPattern;
330 if(
Irp->MdlAddress) {
350 if(PtrSearchPattern &&
351 PtrSearchPattern->
Buffer &&
360 PtrSearchPattern =
NULL;
362 }
else if(PtrSearchPattern &&
363 PtrSearchPattern->
Buffer &&
372 if(
Ccb->DirectorySearchPattern) {
375 Ccb->DirectorySearchPattern =
NULL;
378 FirstTimeQuery =
TRUE;
384 if(!(
Ccb->DirectorySearchPattern)) {
387 Ccb->DirectorySearchPattern->Length = PtrSearchPattern->
Length;
388 Ccb->DirectorySearchPattern->MaximumLength = PtrSearchPattern->
MaximumLength;
390 if(!(
Ccb->DirectorySearchPattern->Buffer)) {
403 }
else if(!
Ccb->DirectorySearchPattern &&
408 FirstTimeQuery =
TRUE;
409 PtrSearchPattern =
NULL;
419 PtrSearchPattern =
NULL;
423 PtrSearchPattern =
Ccb->DirectorySearchPattern;
425 cur_hashes = &(
Ccb->hashes);
443 NextMatch =
Ccb->CurrentIndex + 1;
464 if(!DirInformation) {
493 RC =
UDFFindNextMatch(
Vcb, hDirIndex,&NextMatch,PtrSearchPattern, FNM_Flags, cur_hashes, &DirNdx);
503 AtLeastOneFound =
TRUE;
511 if ((BaseLength + FileNameBytes) > BytesRemainingInBuffer) {
515 if(NextMatch) NextMatch --;
524 FileNameBytes = BaseLength + FileNameBytes - BytesRemainingInBuffer;
538 BothDirInformation->
FileIndex = NextMatch;
555 DirInformation->
FileName, FileNameBytes );
558 Information = CurrentOffset + BaseLength + FileNameBytes;
561 *((
PULONG)(
Buffer+LastOffset)) = CurrentOffset - LastOffset;
563 FirstTimeQuery =
FALSE;
565 LastOffset = CurrentOffset;
566 PrevMatch = NextMatch;
596 if(
Ccb)
Ccb->CurrentIndex = PrevMatch;
604 Irp->IoStatus.Status = RC;
633 LONG EntryNumber = (*CurrentNumber);
636#define CanBe8dot3 (FNM_Flags & UDF_FNM_FLAG_CAN_BE_8D3)
637#define IgnoreCase (FNM_Flags & UDF_FNM_FLAG_IGNORE_CASE)
638#define ContainsWC (FNM_Flags & UDF_FNM_FLAG_CONTAINS_WC)
640 for(;(DirNdx =
UDFDirIndex(hDirIndex, EntryNumber));EntryNumber++) {
658 *CurrentNumber = EntryNumber;
703 UDFPrint((
"UDFNotifyChangeDirectory\n"));
770 Irp->IoStatus.Status = RC;
771 Irp->IoStatus.Information = 0;
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
NTSTATUS UDFFileDirInfoToNT(IN PVCB Vcb, IN PDIR_INDEX_ITEM FileDirNdx, OUT PFILE_BOTH_DIR_INFORMATION NTFileInfo)
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN PFCB _In_opt_ PCCB Ccb
#define UDF_FNM_FLAG_CONTAINS_WC
NTSTATUS NTAPI UDFDirControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS NTAPI UDFCommonDirControl(PtrUDFIrpContext PtrIrpContext, PIRP Irp)
NTSTATUS NTAPI UDFQueryDirectory(PtrUDFIrpContext PtrIrpContext, PIRP Irp, PIO_STACK_LOCATION IrpSp, PFILE_OBJECT FileObject, PtrUDFFCB Fcb, PtrUDFCCB Ccb)
#define UDF_FNM_FLAG_CAN_BE_8D3
NTSTATUS NTAPI UDFNotifyChangeDirectory(PtrUDFIrpContext PtrIrpContext, PIRP Irp, PIO_STACK_LOCATION IrpSp, PFILE_OBJECT FileObject, PtrUDFFCB Fcb, PtrUDFCCB Ccb)
NTSTATUS UDFFindNextMatch(IN PVCB Vcb, IN PDIR_INDEX_HDR hDirIndex, IN PLONG CurrentNumber, IN PUNICODE_STRING PtrSearchPattern, IN UCHAR FNM_Flags, IN PHASH_ENTRY hashes, OUT PDIR_INDEX_ITEM *_DirNdx)
#define UDF_FNM_FLAG_IGNORE_CASE
uint8 UDFBuildHashEntry(IN PVCB Vcb, IN PUNICODE_STRING Name, OUT PHASH_ENTRY hashes, IN uint8 Mask)
#define NT_SUCCESS(StatCode)
NTSTATUS NTAPI CompleteRequest(IN PIRP Irp, IN NTSTATUS Status, IN ULONG_PTR Information)
_In_ PIO_STACK_LOCATION IrpSp
NTSTATUS UDFExceptionHandler(PtrUDFIrpContext PtrIrpContext, PIRP Irp)
BOOLEAN __fastcall UDFIsIrpTopLevel(PIRP Irp)
VOID UDFLogEvent(NTSTATUS UDFEventLogId, NTSTATUS RC)
NTSTATUS UDFPostRequest(IN PtrUDFIrpContext PtrIrpContext, IN PIRP Irp)
PtrUDFIrpContext UDFAllocateIrpContext(PIRP Irp, PDEVICE_OBJECT PtrTargetDeviceObject)
VOID UDFReleaseIrpContext(PtrUDFIrpContext PtrIrpContext)
long UDFExceptionFilter(PtrUDFIrpContext PtrIrpContext, PEXCEPTION_POINTERS PtrExceptionPointers)
UNICODE_STRING * PUNICODE_STRING
#define UDFReleaseResource(Resource)
NTSTATUS RtlUpcaseUnicodeString(PUNICODE_STRING dst, PUNICODE_STRING src, BOOLEAN Alloc)
#define UDFAcquireResourceShared(Resource, CanWait)
#define UDF_ERROR_INTERNAL_ERROR
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ BOOLEAN ReturnSingleEntry
_Inout_ PLIST_ENTRY _In_ PVOID _In_ PSTRING _In_ BOOLEAN _In_ BOOLEAN _In_ ULONG CompletionFilter
_Inout_ PLIST_ENTRY _In_ PVOID _In_ PSTRING _In_ BOOLEAN WatchTree
VOID UDFFlushTryBreak(IN PVCB Vcb)
struct _FILE_BOTH_DIR_INFORMATION * PFILE_BOTH_DIR_INFORMATION
@ FileDirectoryInformation
@ FileFullDirectoryInformation
@ FileBothDirectoryInformation
enum _FILE_INFORMATION_CLASS FILE_INFORMATION_CLASS
struct _FILE_NAMES_INFORMATION * PFILE_NAMES_INFORMATION
#define FsRtlEnterFileSystem
#define FsRtlExitFileSystem
static OUT PIO_STATUS_BLOCK OUT PVOID IN ULONG IN FILE_INFORMATION_CLASS FileInformationClass
BOOLEAN __fastcall UDFIsMatchAllMask(IN PUNICODE_STRING Name, OUT BOOLEAN *DosOpen)
BOOLEAN UDFIsNameInExpression(IN PVCB Vcb, IN PUNICODE_STRING FileName, IN PUNICODE_STRING PtrSearchPattern, OUT PBOOLEAN DosOpen, IN BOOLEAN IgnoreCase, IN BOOLEAN ContainsWC, IN BOOLEAN CanBe8dot3, IN BOOLEAN KeepIntact)
BOOLEAN __fastcall UDFCanNameBeA8dot3(IN PUNICODE_STRING Name)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
__inline PVOID MmGetSystemAddressForMdlSafer(IN PMDL Mdl)
BOOLEAN NTAPI FsRtlDoesNameContainWildCards(IN PUNICODE_STRING Name)
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)
#define IoCompleteRequest
VOID NTAPI IoSetTopLevelIrp(IN PIRP Irp)
#define STATUS_DELETE_PENDING
#define STATUS_INVALID_INFO_CLASS
NTSTATUS UDFLockCallersBuffer(PtrUDFIrpContext PtrIrpContext, PIRP Irp, BOOLEAN IsReadOperation, uint32 Length)
#define _SEH2_AbnormalTermination()
#define _SEH2_EXCEPT(...)
#define _SEH2_GetExceptionInformation()
#define IRP_MN_QUERY_DIRECTORY
#define IRP_MN_NOTIFY_CHANGE_DIRECTORY
#define STATUS_BUFFER_OVERFLOW
#define UDF_CCB_CAN_BE_8_DOT_3
#define UDF_IRP_CONTEXT_CAN_BLOCK
struct _UDFContextControlBlock * PtrUDFCCB
#define UDF_CCB_CASE_SENSETIVE
#define UDF_FCB_ROOT_DIRECTORY
#define UDF_CCB_WILDCARD_PRESENT
#define UDF_NODE_TYPE_VCB
#define UDF_FCB_DELETE_ON_CLOSE
#define UDF_FCB_DIRECTORY
#define UDF_CCB_MATCH_ALL
struct _FCB::@729::@732 Fcb
struct _IO_STACK_LOCATION::@3974::@3981 NotifyDirectory
union _IO_STACK_LOCATION::@1575 Parameters
struct _IO_STACK_LOCATION::@3974::@3980 QueryDirectory
UNICODE_STRING UnicodeStrRoot
PDEVICE_OBJECT TargetDeviceObject
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define UDFIsDeleted(DirNdx)
__inline PDIR_INDEX_ITEM UDFDirIndex(IN PDIR_INDEX_HDR hDirNdx, IN uint_di i)
#define UDFIsADirectory(FileInfo)
#define UDF_FI_FLAG_FI_INTERNAL
Given entry represents the file used for internal FS purposes & must be invisible.
#define STATUS_INVALID_DEVICE_REQUEST
#define STATUS_INVALID_PARAMETER
#define STATUS_NO_SUCH_FILE
#define STATUS_INVALID_USER_BUFFER
#define STATUS_INSUFFICIENT_RESOURCES
#define STATUS_NO_MORE_FILES
#define UDFQuadAlign(Value)
#define UDF_CHECK_PAGING_IO_RESOURCE(NTReqFCB)
#define PEXTENDED_IO_STACK_LOCATION
_In_ PDEVICE_OBJECT DeviceObject
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
#define SL_INDEX_SPECIFIED
#define SL_RETURN_SINGLE_ENTRY
#define IO_DISK_INCREMENT