47 #pragma alloc_text(PAGE, RfsdGetInfoLength) 48 #pragma alloc_text(PAGE, RfsdProcessDirEntry) 49 #pragma alloc_text(PAGE, RfsdQueryDirectory) 50 #pragma alloc_text(PAGE, RfsdNotifyChangeDirectory) 51 #pragma alloc_text(PAGE, RfsdDirectoryControl) 52 #pragma alloc_text(PAGE, RfsdIsDirectoryEmpty) 53 #pragma alloc_text(PAGE, RfsdDirectoryCallback) 106 ULONG InfoLength = 0;
107 ULONG NameLength = 0;
115 NameLength =
pName->Length;
118 if (!InfoLength || InfoLength + NameLength -
sizeof(
WCHAR) >
Length) {
126 key.k_dir_id = Key_ParentDirectoryID;
127 key.k_objectid = Key_ObjectID;
130 RfsdPrint((
DBG_ERROR,
"RfsdPricessDirEntry: Loading stat data %xh, %xh error.\n", Key_ParentDirectoryID, Key_ObjectID));
140 if (pPreviousEntry) {
170 dwBytes = InfoLength + NameLength -
sizeof(
WCHAR);
196 dwBytes = InfoLength + NameLength -
sizeof(
WCHAR);
224 dwBytes = InfoLength + NameLength -
sizeof(
WCHAR);
235 dwBytes = InfoLength + NameLength -
sizeof(
WCHAR);
275 ULONG UsedLength = 0;
308 pQueryKey = &(
Fcb->RfsdMcb->Key);
312 KdPrint((
"QueryDirectory on Key {%x,%x,%x,%x}\n",
338 Irp = IrpContext->Irp;
345 IoStackLocation->
Parameters.QueryDirectory.FileInformationClass;
351 FileIndex = IoStackLocation->
Parameters.QueryDirectory.FileIndex;
362 IoStackLocation)->Parameters.QueryDirectory.FileInformationClass;
365 IoStackLocation)->Parameters.QueryDirectory.Length;
368 IoStackLocation)->Parameters.QueryDirectory.FileName;
371 IoStackLocation)->Parameters.QueryDirectory.FileIndex;
382 #endif // _GNU_NTIFS_ 400 if (!IrpContext->IsSynchronous) {
407 IrpContext->IsSynchronous )) {
412 FcbResourceAcquired =
TRUE;
417 if (
Ccb->DirectorySearchPattern.Buffer !=
NULL) {
423 Ccb->DirectorySearchPattern.Length =
424 Ccb->DirectorySearchPattern.MaximumLength =
427 Ccb->DirectorySearchPattern.Buffer =
430 if (
Ccb->DirectorySearchPattern.Buffer ==
NULL) {
436 &(
Ccb->DirectorySearchPattern),
443 }
else if (
Ccb->DirectorySearchPattern.Buffer !=
NULL) {
451 Ccb->DirectorySearchPattern.Length =
452 Ccb->DirectorySearchPattern.MaximumLength = 2;
454 Ccb->DirectorySearchPattern.Buffer =
457 if (
Ccb->DirectorySearchPattern.Buffer ==
NULL) {
463 Ccb->DirectorySearchPattern.Buffer,
467 if (!IndexSpecified) {
469 FileIndex =
Fcb->RfsdMcb->DeOffset = 0;
473 FileIndex =
Ccb->CurrentByteOffset;
481 if (
Fcb->Inode->i_size <= FileIndex) {
492 ULONG CurrentFileIndex;
527 if (FcbResourceAcquired) {
533 if (!IrpContext->ExceptionInProgress) {
546 IrpContext->Irp->IoStatus.Information = UsedLength;
638 Irp = IrpContext->Irp;
650 IrpSp)->Parameters.NotifyDirectory.CompletionFilter;
652 #endif // _GNU_NTIFS_ 731 if (!IrpContext->ExceptionInProgress) {
734 IrpContext->Irp =
NULL;
795 switch (IrpContext->MinorFunction) {
847 while ((
LONGLONG)dwBytes <
Dcb->Header.AllocationSize.QuadPart) {
892 #endif // !RFSD_READ_ONLY 931 ( &pDirectoryItemHeader ),
938 KdPrint((
"Block %i did not contain the appropriate diritem header\n", BlockNumber));
961 ULONG offsetDentry_toSequentialSpan;
982 USHORT InodeFileNameLength = 0;
990 {
goto ProcessNextEntry; }
1011 InodeFileName.
Length = 0;
1014 if (InodeFileNameLength <= 0)
1021 if (!InodeFileName.
Buffer) {
1046 ULONG dwBytesWritten;
1051 pCallbackContext->
Buffer,
1054 offsetDentry_toSequentialSpan,
1059 if (dwBytesWritten <= 0) {
1066 *(pCallbackContext->
pUsedLength) += dwBytesWritten;
1071 if (InodeFileName.
Buffer) {
1079 pPrevDentry = pCurrentDentry;
struct _RFSD_CCB * PRFSD_CCB
while(CdLookupNextInitialFileDirent(IrpContext, Fcb, FileContext))
#define ExGetCurrentResourceThread()
BOOLEAN ReturnSingleEntry
union _FCB::@703 LongName
struct _RFSD_CALLBACK_CONTEXT RFSD_CALLBACK_CONTEXT
#define RfsdIsReadOnly(m)
#define STATUS_DELETE_PENDING
#define IRP_MN_NOTIFY_CHANGE_DIRECTORY
NTSTATUS RfsdCompleteIrpContext(IN PRFSD_IRP_CONTEXT IrpContext, IN NTSTATUS Status)
struct _FILE_BOTH_DIR_INFORMATION * PFILE_BOTH_DIR_INFORMATION
#define IRP_CONTEXT_FLAG_WAIT
struct _RFSD_CALLBACK_CONTEXT * PRFSD_CALLBACK_CONTEXT
#define STATUS_INSUFFICIENT_RESOURCES
NTSTATUS RtlUpcaseUnicodeString(PUNICODE_STRING dst, PUNICODE_STRING src, BOOLEAN Alloc)
_In_ ULONG _In_ ULONG _In_ ULONG Length
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR _In_ ULONGLONG _In_ ULONGLONG _In_opt_ PEVENT_FILTER_DESCRIPTOR _Inout_opt_ PVOID CallbackContext
PRFSD_KEY_IN_MEMORY pDirectoryKey
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ BOOLEAN _In_ ULONG _In_opt_ PULONG _In_ BOOLEAN RestartScan
#define STATUS_NO_SUCH_MEMBER
#define __drv_mustHoldCriticalRegion
#define SL_INDEX_SPECIFIED
struct _FILE_DIRECTORY_INFORMATION * PFILE_DIRECTORY_INFORMATION
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)
IN BOOLEAN OUT PSTR Buffer
#define CEILING_ALIGNED(T, A, B)
NTSTATUS RfsdFindItemHeaderInBlock(IN PRFSD_VCB Vcb, IN PRFSD_KEY_IN_MEMORY pKey, IN PUCHAR pBlockBuffer, OUT PRFSD_ITEM_HEAD *ppTargetItemHeader, IN RFSD_KEY_COMPARISON(*fpComparisonFunction)(PRFSD_KEY_IN_MEMORY, PRFSD_KEY_IN_MEMORY))
#define STATUS_INVALID_PARAMETER
#define STATUS_EVENT_DONE
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ BOOLEAN ReturnSingleEntry
PUCHAR RfsdAllocateAndLoadBlock(IN PRFSD_VCB Vcb, IN ULONG BlockIndex)
#define STATUS_INVALID_DEVICE_REQUEST
#define IRP_MN_QUERY_DIRECTORY
ULONG POINTER_ALIGNMENT Key
_Inout_ PLIST_ENTRY _In_ PVOID _In_ PSTRING _In_ BOOLEAN WatchTree
static OUT PIO_STATUS_BLOCK OUT PVOID IN ULONG IN FILE_INFORMATION_CLASS FileInformationClass
VOID NTAPI FsRtlNotifyFullReportChange(IN PNOTIFY_SYNC NotifySync, IN PLIST_ENTRY NotifyList, IN PSTRING FullTargetName, IN USHORT TargetNameOffset, IN PSTRING StreamName OPTIONAL, IN PSTRING NormalizedParentName OPTIONAL, IN ULONG FilterMatch, IN ULONG Action, IN PVOID TargetContext)
NTSTATUS RfsdQueueRequest(IN PRFSD_IRP_CONTEXT IrpContext)
ULONG RfsdOEMToUnicodeSize(IN PANSI_STRING Oem)
UNICODE_STRING DirectorySearchPattern
NTSTATUS RfsdParseFilesystemTree(IN PRFSD_VCB Vcb, IN PRFSD_KEY_IN_MEMORY Key, IN ULONG StartingBlockNumber, IN RFSD_CALLBACK(fpDirectoryCallback), IN PVOID Context)
VOID RfsdNotifyReportChange(IN PRFSD_IRP_CONTEXT IrpContext, IN PRFSD_VCB Vcb, IN PRFSD_FCB Fcb, IN ULONG Filter, IN ULONG Action)
BOOLEAN NTAPI FsRtlDoesNameContainWildCards(IN PUNICODE_STRING Name)
BOOLEAN NTAPI FsRtlIsNameInExpression(IN PUNICODE_STRING Expression, IN PUNICODE_STRING Name, IN BOOLEAN IgnoreCase, IN PWCHAR UpcaseTable OPTIONAL)
#define FCB_DELETE_PENDING
__drv_mustHoldCriticalRegion NTSTATUS RfsdDirectoryControl(IN PRFSD_IRP_CONTEXT IrpContext)
PDEVICE_OBJECT DeviceObject
struct reiserfs_de_head * PRFSD_DENTRY_HEAD
BOOLEAN NTAPI ExAcquireResourceExclusiveLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
struct _FILE_FULL_DIRECTORY_INFORMATION FILE_FULL_DIR_INFORMATION
#define STATUS_INTERNAL_ERROR
ULONG RfsdGetInfoLength(IN FILE_INFORMATION_CLASS FileInformationClass)
LARGE_INTEGER RfsdSysTime(IN ULONG i_time)
_In_ PDEVICE_OBJECT DeviceObject
struct _RFSD_FCB * PRFSD_FCB
NTFSIDENTIFIER Identifier
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
struct reiserfs_de_head RFSD_DENTRY_HEAD
#define STATUS_INVALID_USER_BUFFER
BOOLEAN RfsdIsDirectoryEmpty(PRFSD_VCB Vcb, PRFSD_FCB Dcb)
NTSTATUS RfsdReadInode(IN PRFSD_IRP_CONTEXT IrpContext, IN PRFSD_VCB Vcb, IN PRFSD_KEY_IN_MEMORY Key, IN PRFSD_INODE Inode, IN ULONGLONG Offset, IN PVOID Buffer, IN ULONG Size, OUT PULONG dwReturn)
struct _FILE_NAMES_INFORMATION * PFILE_NAMES_INFORMATION
struct _FILE_BOTH_DIR_INFORMATION FILE_BOTH_DIR_INFORMATION
ULONG RfsdProcessDirEntry(IN PRFSD_VCB Vcb, IN FILE_INFORMATION_CLASS FileInformationClass, IN __u32 Key_ParentDirectoryID, IN __u32 Key_ObjectID, IN PVOID Buffer, IN ULONG UsedLength, IN ULONG Length, IN ULONG FileIndex, IN PUNICODE_STRING pName, IN BOOLEAN Single, IN PVOID pPreviousEntry)
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
#define FILE_ATTRIBUTE_DIRECTORY
struct _RFSD_VCB * PRFSD_VCB
enum _FILE_INFORMATION_CLASS FILE_INFORMATION_CLASS
_Must_inspect_result_ _In_ ULONG Flags
#define NT_SUCCESS(StatCode)
#define STATUS_NO_MORE_FILES
#define FILE_ATTRIBUTE_READONLY
__drv_mustHoldCriticalRegion NTSTATUS RfsdQueryDirectory(IN PRFSD_IRP_CONTEXT IrpContext)
_In_ ULONGLONG DirectoryKey
NTSTATUS NTAPI CompleteRequest(IN PIRP Irp, IN NTSTATUS Status, IN ULONG_PTR Information)
NTSTATUS RfsdDirectoryCallback(ULONG BlockNumber, PVOID pContext)
#define DBG_TRACE(fmt,...)
#define STATUS_UNSUCCESSFUL
#define ExAllocatePoolWithTag(hernya, size, tag)
struct _FILE_DIRECTORY_INFORMATION FILE_DIRECTORY_INFORMATION
struct _FILE_NAMES_INFORMATION FILE_NAMES_INFORMATION
#define FILE_ATTRIBUTE_NORMAL
ULONG RtlCompareUnicodeString(PUNICODE_STRING s1, PUNICODE_STRING s2, BOOLEAN UpCase)
_Must_inspect_result_ _In_ PFLT_INSTANCE _Out_ PBOOLEAN IsDirectory
_Must_inspect_result_ _Out_ PLARGE_INTEGER FileSize
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN PFCB _In_opt_ PCCB Ccb
BOOLEAN RfsdLoadInode(IN PRFSD_VCB Vcb, IN PRFSD_KEY_IN_MEMORY pKey, IN OUT PRFSD_INODE Inode)
_In_ ULONG _In_ ULONG Offset
IN PFCB IN PFILE_OBJECT FileObject IN ULONG AllocationSize
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
struct _FileName FileName
#define SL_RETURN_SINGLE_ENTRY
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
_In_ PIO_STACK_LOCATION IrpSp
#define STATUS_NO_SUCH_FILE
RFSD_KEY_COMPARISON CompareKeysWithoutOffset(IN PRFSD_KEY_IN_MEMORY a, IN PRFSD_KEY_IN_MEMORY b)
NTSTATUS RfsdLockUserBuffer(IN PIRP Irp, IN ULONG Length, IN LOCK_OPERATION Operation)
NTSTATUS RfsdOEMToUnicode(IN OUT PUNICODE_STRING Oem, IN POEM_STRING Unicode)
struct _FILE_FULL_DIRECTORY_INFORMATION * PFILE_FULL_DIR_INFORMATION
#define RFSD_KEY_TYPE_v2_DIRENTRY
_Inout_ PLIST_ENTRY _In_ PVOID _In_ PSTRING _In_ BOOLEAN _In_ BOOLEAN _In_ ULONG CompletionFilter
BOOLEAN NTAPI ExAcquireResourceSharedLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
PVOID RfsdGetUserBuffer(IN PIRP Irp)
static USHORT RfsdStringLength(PUCHAR buffer, USHORT MaximumLength)
#define RtlZeroMemory(Destination, Length)
#define RtlCopyMemory(Destination, Source, Length)
VOID NTAPI ExReleaseResourceForThreadLite(IN PERESOURCE Resource, IN ERESOURCE_THREAD Thread)
IO_STACK_LOCATION * PEXTENDED_IO_STACK_LOCATION
__drv_mustHoldCriticalRegion NTSTATUS RfsdNotifyChangeDirectory(IN PRFSD_IRP_CONTEXT IrpContext)
IN PDCB IN POEM_STRING OemName
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB * Dcb
BOOLEAN RfsdGetFullFileName(PRFSD_MCB Mcb, PUNICODE_STRING FileName)
FILE_INFORMATION_CLASS FileInformationClass