23#define BugCheckFileId (CDFS_BUG_CHECK_DIRCTRL)
41CdNotifyChangeDirectory (
69#pragma alloc_text(PAGE, CdCommonDirControl)
70#pragma alloc_text(PAGE, CdEnumerateIndex)
71#pragma alloc_text(PAGE, CdInitializeEnumeration)
72#pragma alloc_text(PAGE, CdNotifyChangeDirectory)
73#pragma alloc_text(PAGE, CdQueryDirectory)
117 if (CdDecodeFileObject( IrpContext,
201 ULONG SeparatorBytes;
202 ULONG VersionStringBytes;
213 ULONG BytesRemainingInBuffer;
362 ReturnNextEntry =
TRUE;
372 if (NextEntry == 0) {
413 VersionStringBytes = 0;
426 if (((
Ccb->SearchExpression.VersionString.Length != 0) ||
443 ReturnNextEntry =
FALSE;
461 if ((BaseLength + FileNameBytes + SeparatorBytes + VersionStringBytes) > BytesRemainingInBuffer) {
467 if (NextEntry != 0) {
469 ReturnNextEntry =
FALSE;
479 if ((BaseLength + FileNameBytes) > BytesRemainingInBuffer) {
481 FileNameBytes = BytesRemainingInBuffer - BaseLength;
569 DirInfo->
FileNameLength = FileNameBytes + SeparatorBytes + VersionStringBytes;
579 NamesInfo->
FileNameLength = FileNameBytes + SeparatorBytes + VersionStringBytes;
614 if (FileNameBytes != 0) {
624 if (SeparatorBytes != 0) {
627 NextEntry + BaseLength + FileNameBytes,
630 if (VersionStringBytes != 0) {
633 NextEntry + BaseLength + FileNameBytes +
sizeof(
WCHAR ),
636 VersionStringBytes );
651 (
Ccb->SearchExpression.VersionString.Length == 0) &&
693 FileNameBytes += SeparatorBytes + VersionStringBytes;
701 Information = NextEntry + BaseLength + FileNameBytes;
707 *(
Add2Ptr( UserBuffer, LastEntry,
PULONG )) = NextEntry - LastEntry;
713 InitialQuery =
FALSE;
715 LastEntry = NextEntry;
719#pragma warning(suppress: 6320)
762 if (ReturnNextEntry) {
794CdNotifyChangeDirectory (
859 &IrpContext->Vcb->DirNotifyList,
949 ULONG LastDirentOffset;
1004 RtlZeroMemory( &SearchExpression,
sizeof( SearchExpression ));
1021 CdConvertNameToCdName( IrpContext, &WildCardName );
1132 Ccb->CurrentDirentOffset =
Fcb->StreamOffset;
1133 Ccb->SearchExpression = SearchExpression;
1171 KnownOffset =
FALSE;
1173 *ReturnNextEntry =
TRUE;
1183 *ReturnNextEntry =
FALSE;
1209 *InitialQuery =
FALSE;
1212 !(*ReturnNextEntry)) {
1214 *InitialQuery =
TRUE;
1244 LastDirentOffset =
Fcb->StreamOffset;
1256 *ReturnNextEntry =
FALSE;
1286 LastDirentOffset =
FileContext->InitialDirent->Dirent.DirentOffset;
1325 if (!(*ReturnNextEntry) ||
1326 (
Ccb->SearchExpression.VersionString.Length == 0)) {
1410 if (ReturnNextEntry) {
1417 PreviousDirent = ThisDirent;
1424 ReturnNextEntry =
TRUE;
1457 if ((PreviousDirent ==
NULL) ||
1458 (
Ccb->SearchExpression.VersionString.Length != 0) ||
1482 &
Ccb->SearchExpression,
1503 if ((
Ccb->SearchExpression.VersionString.Length == 0) &&
1520 &
Ccb->SearchExpression,
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define CD_ATTRIBUTE_DIRECTORY
#define CD_ATTRIBUTE_ASSOC
#define CD_ATTRIBUTE_HIDDEN
#define CdConvertCdTimeToNtTime(IC, CD, NT)
VOID CdCompleteRequest(_Inout_opt_ PIRP_CONTEXT IrpContext, _Inout_opt_ PIRP Irp, _In_ NTSTATUS Status)
VOID CdInitializeEnumeration(_In_ PIRP_CONTEXT IrpContext, _In_ PIO_STACK_LOCATION IrpSp, _In_ PFCB Fcb, _Inout_ PCCB Ccb, _Inout_ PFILE_ENUM_CONTEXT FileContext, _Out_ PBOOLEAN ReturnNextEntry, _Out_ PBOOLEAN ReturnSingleEntry, _Out_ PBOOLEAN InitialQuery)
BOOLEAN CdEnumerateIndex(_In_ PIRP_CONTEXT IrpContext, _In_ PCCB Ccb, _Inout_ PFILE_ENUM_CONTEXT FileContext, _In_ BOOLEAN ReturnNextEntry)
static INLINE VOID CdVerifyOrCreateDirStreamFile(_In_ PIRP_CONTEXT IrpContext, _In_ PFCB Fcb)
#define CdMapUserBuffer(IC, UB)
#define CdReleaseFile(IC, F)
#define CdReleaseVcb(IC, V)
VOID CdVerifyVcb(_In_ PIRP_CONTEXT IrpContext, _Inout_ PVCB Vcb)
VOID CdLookupLastFileDirent(_In_ PIRP_CONTEXT IrpContext, _In_ PFCB Fcb, _In_ PFILE_ENUM_CONTEXT FileContext)
VOID CdUpdateDirentName(_In_ PIRP_CONTEXT IrpContext, _Inout_ PDIRENT Dirent, _In_ ULONG IgnoreCase)
#define CdInitializeFileContext(IC, FC)
_In_ PFCB _In_ PCD_NAME _In_ BOOLEAN _Inout_ PFILE_ENUM_CONTEXT FileContext
BOOLEAN CdIsNameInExpression(_In_ PIRP_CONTEXT IrpContext, _In_ PCD_NAME CurrentName, _In_ PCD_NAME SearchExpression, _In_ ULONG WildcardFlags, _In_ BOOLEAN CheckVersion)
#define CdAcquireVcbShared(IC, V, I)
#define TAG_ENUM_EXPRESSION
#define CdLookupInitialFileDirent(IC, F, FC, DO)
VOID CdGenerate8dot3Name(_In_ PIRP_CONTEXT IrpContext, _In_ PUNICODE_STRING FileName, _In_ ULONG DirentOffset, _Out_writes_bytes_to_(BYTE_COUNT_8_DOT_3, *ShortByteCount) PWCHAR ShortFileName, _Out_ PUSHORT ShortByteCount)
BOOLEAN CdLookupNextInitialFileDirent(_In_ PIRP_CONTEXT IrpContext, _In_ PFCB Fcb, _Inout_ PFILE_ENUM_CONTEXT FileContext)
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN PFCB _In_opt_ PCCB Ccb
BOOLEAN CdVerifyFcbOperation(_In_opt_ PIRP_CONTEXT IrpContext, _In_ PFCB Fcb)
#define CdAcquireFileShared(IC, F)
VOID CdCleanupFileContext(_In_ PIRP_CONTEXT IrpContext, _In_ PFILE_ENUM_CONTEXT FileContext)
BOOLEAN CdIs8dot3Name(_In_ PIRP_CONTEXT IrpContext, _In_ UNICODE_STRING FileName)
#define CdUnlockFcb(IC, F)
#define CdRaiseStatus(IC, S)
#define CCB_FLAG_IGNORE_CASE
#define DIRENT_FLAG_CONSTANT_ENTRY
#define CCB_FLAG_ENUM_MATCH_ALL
#define CCB_FLAG_ENUM_RETURN_NEXT
#define IRP_CONTEXT_FLAG_WAIT
#define CCB_FLAG_ENUM_NAME_EXP_HAS_WILD
#define CdSetFidFromParentAndDirent(I, F, D)
#define CCB_FLAG_ENUM_NOMATCH_CONSTANT_ENTRY
#define CCB_FLAG_ENUM_INITIALIZED
#define CCB_FLAG_ENUM_VERSION_EXP_HAS_WILD
#define CCB_FLAG_ENUM_VERSION_MATCH_ALL
#define _Requires_lock_held_(lock)
_In_ PIO_STACK_LOCATION IrpSp
UNICODE_STRING * PUNICODE_STRING
NTSTATUS RtlUpcaseUnicodeString(PUNICODE_STRING dst, PUNICODE_STRING src, BOOLEAN Alloc)
#define ClearFlag(_F, _SF)
#define BooleanFlagOn(F, SF)
struct _FileName FileName
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ BOOLEAN ReturnSingleEntry
@ FileDirectoryInformation
@ FileIdBothDirectoryInformation
@ FileFullDirectoryInformation
@ FileBothDirectoryInformation
@ FileIdFullDirectoryInformation
#define EXCEPTION_EXECUTE_HANDLER
#define Add2Ptr(PTR, INC)
#define RtlEqualMemory(dst, src, len)
#define FILE_ATTRIBUTE_READONLY
#define FILE_ATTRIBUTE_HIDDEN
#define FILE_ATTRIBUTE_DIRECTORY
PVOID NTAPI FsRtlAllocatePoolWithTag(IN POOL_TYPE PoolType, IN ULONG NumberOfBytes, IN ULONG Tag)
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 STATUS_INVALID_INFO_CLASS
#define _SEH2_GetExceptionCode()
#define _SEH2_EXCEPT(...)
#define IRP_MN_QUERY_DIRECTORY
#define IRP_MN_NOTIFY_CHANGE_DIRECTORY
#define STATUS_BUFFER_OVERFLOW
#define __analysis_assert(e)
UNICODE_STRING VersionString
struct _FCB::@729::@732 Fcb
union _IO_STACK_LOCATION::@1579 Parameters
struct _IO_STACK_LOCATION::@3978::@3985 NotifyDirectory
struct _IO_STACK_LOCATION::@3978::@3984 QueryDirectory
struct _FCB * RootIndexFcb
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define STATUS_INVALID_DEVICE_REQUEST
#define STATUS_INVALID_PARAMETER
#define STATUS_NO_SUCH_FILE
#define STATUS_NO_MORE_FILES
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
#define SL_INDEX_SPECIFIED
#define SL_RETURN_SINGLE_ENTRY