44 SIZE_T PathSize, PathSizeWithNull;
45 PWCHAR Backslash, ParentCopy;
50 if (PathSizeWithNull < PathSize)
62 Backslash =
wcsrchr(ParentCopy,
'\\');
69 if (Backslash == ParentCopy)
83 PWCHAR Separator, FileCopy;
100 wcsncpy(FileCopy, Separator + 1, PathSize /
sizeof(
WCHAR));
122 if ((FileEntry->
DeviceId == DeviceId) &&
128 if ((!(
Flags & 4) || (FileEntry->
Flags & 0x10000)) && ((
Flags & 4) || !(FileEntry->
Flags & 0x10000)))
155 if ((FileEntry->
DeviceId == DeviceId) &&
161 if ((!(
Flags & 4) || (FileEntry->
Flags & 0x10000)) && ((
Flags & 4) || !(FileEntry->
Flags & 0x10000)))
180 DeviceId = FileEntry->DeviceId;
190 Status = FileEntry->Callbacks.Close(FileEntry);
198#define BL_FILE_PURGE_LIMIT 512
209 (FileEntry->
Flags & 0x10000)) &&
250 FileEntry->
Flags &= ~BL_FILE_ENTRY_OPENED;
271 ULONG FileId, CheckFlags;
276 DirectoryEntry =
NULL;
371 NextEntry = ListHead->
Flink;
372 while (NextEntry != ListHead)
384 NextEntry = NextEntry->
Flink;
427 FileEntry->
FileId = FileId;
450 *NewFileEntry = FileEntry;
525 *FileId = FileEntry->
FileId;
629 if (
Size >= *InputSize)
673 ChangedUnknown =
FALSE;
731 ChangedUnknown =
TRUE;
779 DeviceInfo.BlockDeviceInfo.Unknown = OldUnknown;
929 NetRegisterFunctionTable.Destroy,
930 NetRegisterFunctionTable.Mount,
931 NetRegisterFunctionTable.Purge,
937 NtfsRegisterFunctionTable.Destroy,
938 NtfsRegisterFunctionTable.Mount,
939 NtfsRegisterFunctionTable.Purge,
959 FppRegisterFunctionTable.Destroy,
960 FppRegisterFunctionTable.Mount,
961 FppRegisterFunctionTable.Purge,
969 WimRegisterFunctionTable.Destroy,
970 WimRegisterFunctionTable.Mount,
971 WimRegisterFunctionTable.Purge,
979 UdfsRegisterFunctionTable.Destroy,
980 UdfsRegisterFunctionTable.Mount,
981 UdfsRegisterFunctionTable.Purge,
#define OBJ_NAME_PATH_SEPARATOR
NTSTATUS BlDeviceGetInformation(_In_ ULONG DeviceId, _Out_ PBL_DEVICE_INFORMATION DeviceInformation)
#define BL_DEVICE_ENTRY_WRITE_ACCESS
NTSTATUS FatInitialize(VOID)
VOID EfiPrintf(_In_ PWCHAR Format,...)
#define BL_FILE_WRITE_ACCESS
NTSTATUS(* PBL_FS_INIT_CALLBACK)(VOID)
#define BL_FILE_ENTRY_OPENED
NTSTATUS FatMount(_In_ ULONG DeviceId, _In_ ULONG Unknown, _Out_ PBL_FILE_ENTRY *FileEntry)
PVOID BlMmAllocateHeap(_In_ SIZE_T Size)
NTSTATUS(* PBL_FS_MOUNT_CALLBACK)(_In_ ULONG DeviceId, _In_ ULONG Unknown, _Out_ struct _BL_FILE_ENTRY **FileEntry)
PVOID BlTblFindEntry(_In_ PVOID *Table, _In_ ULONG Count, _Out_ PULONG EntryIndex, _In_ PBL_TBL_LOOKUP_ROUTINE Callback, _In_ PVOID Argument1, _In_ PVOID Argument2, _In_ PVOID Argument3, _In_ PVOID Argument4)
#define BL_UNKNOWN_ACCESS
#define BL_DIRECTORY_ACCESS
#define BL_FILE_ENTRY_UNKNOWN_ACCESS
BOOLEAN(* PBL_TBL_LOOKUP_ROUTINE)(_In_ PVOID Entry, _In_ PVOID Argument1, _In_ PVOID Argument2, _In_ PVOID Argument3, _In_ PVOID Argument4)
#define BL_DEVICE_ENTRY_OPENED
#define BL_FILE_ENTRY_READ_ACCESS
NTSTATUS BlTblSetEntry(_Inout_ PVOID **Table, _Inout_ PULONG Count, _In_ PVOID Entry, _Out_ PULONG EntryIndex, _In_ PBL_TBL_SET_ROUTINE Callback)
NTSTATUS BlDeviceSetInformation(_In_ ULONG DeviceId, _In_ PBL_DEVICE_INFORMATION DeviceInformation)
#define BL_FILE_ENTRY_WRITE_ACCESS
#define BL_FILE_READ_ACCESS
NTSTATUS(* PBL_FS_PURGE_CALLBACK)(VOID)
#define BL_DEVICE_ENTRY_READ_ACCESS
NTSTATUS EtfsInitialize(VOID)
NTSTATUS EtfsMount(_In_ ULONG DeviceId, _In_ ULONG Unknown, _Out_ PBL_FILE_ENTRY *FileEntry)
NTSTATUS BlMmFreeHeap(_In_ PVOID Buffer)
#define BL_FS_REGISTER_AT_HEAD_FLAG
struct _BL_FILE_ENTRY * PBL_FILE_ENTRY
NTSTATUS(* PBL_FS_DESTROY_CALLBACK)(VOID)
NTSTATUS BlFileOpen(_In_ ULONG DeviceId, _In_ PWCHAR FileName, _In_ ULONG Flags, _Out_ PULONG FileId)
BL_FILE_SYSTEM_REGISTRATION_TABLE FatRegisterFunctionTable
BL_FILE_SYSTEM_REGISTRATION_TABLE EtfsRegisterFunctionTable
NTSTATUS BlFileSetInformation(_In_ ULONG FileId, _Out_ PBL_FILE_INFORMATION FileInfo)
NTSTATUS BlFileGetInformation(_In_ ULONG FileId, _In_ PBL_FILE_INFORMATION FileInfo)
NTSTATUS FileInformationCheck(_In_ PBL_FILE_INFORMATION FileInformation, _In_ BOOLEAN Write, _In_opt_ PULONG InputSize, _In_opt_ PULONG BytesReturned, _Out_opt_ PULONG RequiredSize)
NTSTATUS FileTablePurgeEntry(_In_ PVOID Entry)
LIST_ENTRY RegisteredFileSystems
BOOLEAN FileTableCompareWithSameAttributes(_In_ PVOID Entry, _In_ PVOID Argument1, _In_ PVOID Argument2, _In_ PVOID Argument3, _In_ PVOID Argument4)
PWCHAR FileIoCopyParentDirectoryPath(_In_ PWCHAR FilePath)
NTSTATUS FileIoOpen(_In_ ULONG DeviceId, _In_ PWCHAR FileName, _In_ ULONG Flags, _In_ ULONG Unknown, _In_ PBL_TBL_LOOKUP_ROUTINE CompareRoutine, _Out_opt_ PBL_FILE_ENTRY *NewFileEntry)
NTSTATUS BlpFileRegisterFileSystem(_In_ PBL_FS_INIT_CALLBACK InitCallback, _In_ PBL_FS_DESTROY_CALLBACK DestroyCallback, _In_ PBL_FS_MOUNT_CALLBACK MountCallback, _In_ PBL_FS_PURGE_CALLBACK PurgeCallback, _In_ ULONG Flags)
NTSTATUS BlFileReadEx(_In_ ULONG FileId, _Out_ PVOID Buffer, _In_ ULONG Size, _Out_ PULONG BytesReturned, _In_ ULONG Flags)
#define BL_FILE_PURGE_LIMIT
NTSTATUS BlFileClose(_In_ ULONG FileId)
NTSTATUS BlFileReadAtOffsetEx(_In_ ULONG FileId, _In_ ULONG Size, _In_ ULONGLONG ByteOffset, _In_ PVOID Buffer, _Out_ PULONG BytesReturned, _In_ ULONG Flags)
BOOLEAN FileTableCompareWithSubsetAttributes(_In_ PVOID Entry, _In_ PVOID Argument1, _In_ PVOID Argument2, _In_ PVOID Argument3, _In_ PVOID Argument4)
NTSTATUS FileTableDestroyEntry(_In_ PBL_FILE_ENTRY FileEntry, _In_ ULONG Index)
NTSTATUS BlpFileInitialize(VOID)
PWCHAR FileIoCopyFileName(_In_ PWCHAR FilePath)
_In_ PFCB _In_ LONGLONG FileOffset
#define NT_SUCCESS(StatCode)
#define InsertTailList(ListHead, Entry)
#define InsertHeadList(ListHead, Entry)
#define InitializeListHead(ListHead)
IN PDCB IN PCCB IN VBO IN OUT PULONG OUT PDIRENT OUT PBCB OUT PVBO ByteOffset
InternalIoctlParams Argument4
VOID WINAPI InitCallback(_In_ RUNONCEEX_CALLBACK Callback, _In_ BOOL bSilence)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
static OUT PIO_STATUS_BLOCK OUT PVOID FileInformation
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
base of all file and directory entries
PBL_FILE_SET_INFO SetInfo
PBL_FILE_GET_INFO GetInfo
BL_FILE_CALLBACKS Callbacks
PBL_FS_PURGE_CALLBACK PurgeCallback
PBL_FS_DESTROY_CALLBACK DestroyCallback
PBL_FS_INIT_CALLBACK InitCallback
PBL_FS_MOUNT_CALLBACK MountCallback
PBL_FS_PURGE_CALLBACK Purge
PBL_FS_MOUNT_CALLBACK Mount
PBL_FS_DESTROY_CALLBACK Destroy
PBL_FS_INIT_CALLBACK Init
struct _LIST_ENTRY * Flink
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_ACCESS_DENIED
#define STATUS_INVALID_PARAMETER
#define STATUS_UNSUCCESSFUL
static BOOL Write(PBYTE Address, PBYTE Data, SIZE_T Size)
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ ULONG _Out_ PVOID _Out_ PULONG RequiredSize
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_ ULONG _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesReturned
_Must_inspect_result_ _In_ ULONG Flags
_IRQL_requires_same_ _In_opt_ PVOID Argument1
_In_ PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine