170 DPRINT(
"grabbing FCB at %p: %S, refCount:%d\n",
187 DPRINT(
"releasing FCB at %p: %S, refCount:%d\n",
233 DPRINT(
"Return FCB for stream file object\n");
234 Fcb =
Vcb->StreamFileObject->FsContext;
240 current_entry =
Vcb->FcbListHead.Flink;
241 while (current_entry != &
Vcb->FcbListHead)
255 current_entry = current_entry->
Flink;
325 MftRecord = ExAllocateFromNPagedLookasideList(&
Vcb->FileRecLookasideList);
326 if (MftRecord ==
NULL)
333 ExFreeToNPagedLookasideList(&
Vcb->FileRecLookasideList, MftRecord);
340 ExFreeToNPagedLookasideList(&
Vcb->FileRecLookasideList, MftRecord);
347 ExFreeToNPagedLookasideList(&
Vcb->FileRecLookasideList, MftRecord);
367 ExFreeToNPagedLookasideList(&
Vcb->FileRecLookasideList, MftRecord);
403 DPRINT(
"NtfsMakeFCBFromDirEntry(%p, %p, %wZ, %p, %p, %p)\n",
Vcb, DirectoryFCB,
Name,
Stream,
Record, fileFCB);
411 if (DirectoryFCB &&
Name)
530 DPRINT(
"NtfsDirFindFile(%p, %p, %S, %s, %p)\n",
534 CaseSensitive ?
"TRUE" :
"FALSE",
539 CurrentDir = DirectoryFcb->
MFTIndex;
582 ExFreeToNPagedLookasideList(&
Vcb->FileRecLookasideList, FileRecord);
596 ExFreeToNPagedLookasideList(&
Vcb->FileRecLookasideList, FileRecord);
616 DPRINT(
"NtfsGetFCBForFile(%p, %p, %p, '%S', %s)\n",
621 CaseSensitive ?
"TRUE" :
"FALSE");
630 if (pFileName[0] ==
L'\0' ||
wcscmp(pFileName,
L"\\") == 0)
632 DPRINT(
"returning root FCB\n");
642 currentElement = pFileName + 1;
659 DPRINT(
"Parsing, currentElement:%S\n", currentElement);
660 DPRINT(
" parentFCB:%p FCB:%p\n", parentFCB,
FCB);
672 DPRINT(
"Element in requested path is not a directory\n");
688 DPRINT(
" pathName:%S\n", pathName);
696 DPRINT(
" elementName:%S\n", elementName);
701 *pParentFCB = parentFCB;
726 *pParentFCB = parentFCB;
747 FileRecord = ExAllocateFromNPagedLookasideList(&
Vcb->FileRecLookasideList);
748 if (FileRecord ==
NULL)
756 ExFreeToNPagedLookasideList(&
Vcb->FileRecLookasideList, FileRecord);
763 ExFreeToNPagedLookasideList(&
Vcb->FileRecLookasideList, FileRecord);
772 ExFreeToNPagedLookasideList(&
Vcb->FileRecLookasideList, FileRecord);
779 ExFreeToNPagedLookasideList(&
Vcb->FileRecLookasideList, FileRecord);
#define NTFS_FILE_NAME_WIN32
#define NT_SUCCESS(StatCode)
PSTANDARD_INFORMATION GetStandardInformationFromRecord(PDEVICE_EXTENSION Vcb, PFILE_RECORD_HEADER FileRecord)
PFILENAME_ATTRIBUTE GetFileNameFromRecord(PDEVICE_EXTENSION Vcb, PFILE_RECORD_HEADER FileRecord, UCHAR NameType)
PFILENAME_ATTRIBUTE GetBestFileNameFromRecord(PDEVICE_EXTENSION Vcb, PFILE_RECORD_HEADER FileRecord)
PNTFS_GLOBAL_DATA NtfsGlobalData
#define NTFS_FILE_TYPE_DIRECTORY
#define NTFS_FILE_TYPE_REPARSE
#define NTFS_FILE_TYPE_ENCRYPTED
#define NTFS_FILE_TYPE_COMPRESSED
#define FCB_CACHE_INITIALIZED
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
#define ExAllocatePoolWithTag(hernya, size, tag)
NTSTATUS ExInitializeResourceLite(PULONG res)
#define KeReleaseSpinLock(sl, irql)
#define KeAcquireSpinLock(sl, irql)
#define ExDeleteResourceLite(res)
struct _FileName FileName
VOID NTAPI CcInitializeCacheMap(IN PFILE_OBJECT FileObject, IN PCC_FILE_SIZES FileSizes, IN BOOLEAN PinAccess, IN PCACHE_MANAGER_CALLBACKS Callbacks, IN PVOID LazyWriteContext)
BOOLEAN NTAPI CcUninitializeCacheMap(IN PFILE_OBJECT FileObject, IN OPTIONAL PLARGE_INTEGER TruncateSize, IN OPTIONAL PCACHE_UNINITIALIZE_EVENT UninitializeEvent)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define EXCEPTION_EXECUTE_HANDLER
NTSTATUS ReadFileRecord(PDEVICE_EXTENSION Vcb, ULONGLONG index, PFILE_RECORD_HEADER file)
NTSTATUS NtfsLookupFileAt(PDEVICE_EXTENSION Vcb, PUNICODE_STRING PathName, BOOLEAN CaseSensitive, PFILE_RECORD_HEADER *FileRecord, PULONGLONG MFTIndex, ULONGLONG CurrentMFTIndex)
VOID ReleaseAttributeContext(PNTFS_ATTR_CONTEXT Context)
ULONGLONG AttributeDataLength(PNTFS_ATTR_RECORD AttrRecord)
NTSTATUS FindAttribute(PDEVICE_EXTENSION Vcb, PFILE_RECORD_HEADER MftRecord, ULONG Type, PCWSTR Name, ULONG NameLength, PNTFS_ATTR_CONTEXT *AttrCtx, PULONG Offset)
ULONG ReadAttribute(PDEVICE_EXTENSION Vcb, PNTFS_ATTR_CONTEXT Context, ULONGLONG Offset, PCHAR Buffer, ULONG Length)
#define memcpy(s1, s2, n)
#define ExFreePoolWithTag(_P, _T)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
_In_ ULONG _In_ ULONG _In_ ULONG Length
ULONGLONG NtfsGetFileSize(PDEVICE_EXTENSION DeviceExt, PFILE_RECORD_HEADER FileRecord, PCWSTR Stream, ULONG StreamLength, PULONGLONG AllocatedSize)
static VOID NtfsWSubString(PWCHAR pTarget, PCWSTR pSource, size_t pLength)
BOOLEAN NtfsFCBIsDirectory(PNTFS_FCB Fcb)
NTSTATUS NtfsReadFCBAttribute(PNTFS_VCB Vcb, PNTFS_FCB pFCB, ULONG Type, PCWSTR Name, ULONG NameLength, PVOID *Data)
PNTFS_FCB NtfsGrabFCBFromTable(PNTFS_VCB Vcb, PCWSTR FileName)
BOOLEAN NtfsFCBIsRoot(PNTFS_FCB Fcb)
NTSTATUS NtfsFCBInitializeCache(PNTFS_VCB Vcb, PNTFS_FCB Fcb)
static NTSTATUS NtfsDirFindFile(PNTFS_VCB Vcb, PNTFS_FCB DirectoryFcb, PWSTR FileToFind, BOOLEAN CaseSensitive, PNTFS_FCB *FoundFCB)
BOOLEAN NtfsFCBIsReparsePoint(PNTFS_FCB Fcb)
NTSTATUS NtfsMakeFCBFromDirEntry(PNTFS_VCB Vcb, PNTFS_FCB DirectoryFCB, PUNICODE_STRING Name, PCWSTR Stream, PFILE_RECORD_HEADER Record, ULONGLONG MFTIndex, PNTFS_FCB *fileFCB)
BOOLEAN NtfsFCBIsEncrypted(PNTFS_FCB Fcb)
PNTFS_FCB NtfsCreateFCB(PCWSTR FileName, PCWSTR Stream, PNTFS_VCB Vcb)
NTSTATUS NtfsAttachFCBToFileObject(PNTFS_VCB Vcb, PNTFS_FCB Fcb, PFILE_OBJECT FileObject)
BOOLEAN NtfsFCBIsCompressed(PNTFS_FCB Fcb)
VOID NtfsDestroyFCB(PNTFS_FCB Fcb)
NTSTATUS NtfsGetFCBForFile(PNTFS_VCB Vcb, PNTFS_FCB *pParentFCB, PNTFS_FCB *pFCB, PCWSTR pFileName, BOOLEAN CaseSensitive)
PNTFS_FCB NtfsOpenRootFCB(PNTFS_VCB Vcb)
VOID NtfsGrabFCB(PNTFS_VCB Vcb, PNTFS_FCB Fcb)
VOID NtfsAddFCBToTable(PNTFS_VCB Vcb, PNTFS_FCB Fcb)
VOID NtfsReleaseFCB(PNTFS_VCB Vcb, PNTFS_FCB Fcb)
static PCWSTR NtfsGetNextPathElement(PCWSTR FileName)
PNTFS_FCB NtfsMakeRootFCB(PNTFS_VCB Vcb)
PFILE_OBJECT NTAPI IoCreateStreamFileObject(IN PFILE_OBJECT FileObject, IN PDEVICE_OBJECT DeviceObject)
#define _SEH2_GetExceptionCode()
#define _SEH2_EXCEPT(...)
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
PFILE_OBJECT PtrFileObject
NTFSIDENTIFIER Identifier
NPAGED_LOOKASIDE_LIST FcbLookasideList
CACHE_MANAGER_CALLBACKS CacheMgrCallbacks
FSRTL_COMMON_FCB_HEADER RFCB
NTFSIDENTIFIER Identifier
SECTION_OBJECT_POINTERS SectionObjectPointers
struct _LIST_ENTRY * Flink
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_OBJECT_PATH_NOT_FOUND
#define STATUS_INVALID_PARAMETER
#define STATUS_OBJECT_NAME_INVALID
#define STATUS_INSUFFICIENT_RESOURCES
#define STATUS_OBJECT_NAME_NOT_FOUND
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
_In_ struct _KBUGCHECK_REASON_CALLBACK_RECORD * Record
#define ObDereferenceObject