209 DPRINT(
"NtfsGetVolumeData() called\n");
221 DPRINT(
"NtfsDeviceIoControl() failed (Status %lx)\n",
Status);
251 NtfsInfo->
ClusterCount = DeviceExt->NtfsInfo.SectorCount / (
ULONGLONG)DeviceExt->NtfsInfo.SectorsPerCluster;
260 if (
BootSector->EBPB.ClustersPerIndexRecord > 0)
265 DPRINT(
"Boot sector information:\n");
271 DPRINT(
" ClustersPerMftRecord: %lx\n",
BootSector->EBPB.ClustersPerMftRecord);
272 DPRINT(
" ClustersPerIndexRecord: %lx\n",
BootSector->EBPB.ClustersPerIndexRecord);
280 DeviceExt->MasterFileTable = ExAllocateFromNPagedLookasideList(&DeviceExt->FileRecLookasideList);
281 if (DeviceExt->MasterFileTable ==
NULL)
291 (
PVOID)DeviceExt->MasterFileTable,
295 DPRINT1(
"Failed reading MFT.\n");
296 ExFreeToNPagedLookasideList(&DeviceExt->FileRecLookasideList, DeviceExt->MasterFileTable);
302 DeviceExt->MasterFileTable,
306 &DeviceExt->MFTContext,
307 &DeviceExt->MftDataOffset);
310 DPRINT1(
"Can't find data attribute for Master File Table.\n");
311 ExFreeToNPagedLookasideList(&DeviceExt->FileRecLookasideList, DeviceExt->MasterFileTable);
316 VolumeRecord = ExAllocateFromNPagedLookasideList(&DeviceExt->FileRecLookasideList);
317 if (VolumeRecord ==
NULL)
319 DPRINT1(
"Allocation failed for volume record\n");
320 ExFreeToNPagedLookasideList(&DeviceExt->FileRecLookasideList, DeviceExt->MasterFileTable);
332 DPRINT1(
"Failed reading volume file\n");
333 ExFreeToNPagedLookasideList(&DeviceExt->FileRecLookasideList, VolumeRecord);
334 ExFreeToNPagedLookasideList(&DeviceExt->FileRecLookasideList, DeviceExt->MasterFileTable);
350 Attribute = AttrCtxt->pRecord;
371 if (VolumeFcb ==
NULL)
373 DPRINT1(
"Failed allocating volume FCB\n");
374 ExFreeToNPagedLookasideList(&DeviceExt->FileRecLookasideList, VolumeRecord);
375 ExFreeToNPagedLookasideList(&DeviceExt->FileRecLookasideList, DeviceExt->MasterFileTable);
381 VolumeFcb->
RFCB.
FileSize.
QuadPart = DeviceExt->NtfsInfo.SectorCount * DeviceExt->NtfsInfo.BytesPerSector;
385 DeviceExt->VolumeFcb = VolumeFcb;
392 Attribute = AttrCtxt->pRecord;
406 ExFreeToNPagedLookasideList(&DeviceExt->FileRecLookasideList, VolumeRecord);
#define STATUS_INSUFFICIENT_RESOURCES
IN PVOID IN PVOID IN USHORT IN USHORT Size
PNTFS_FCB NtfsCreateFCB(PCWSTR FileName, PCWSTR Stream, PNTFS_VCB Vcb)
NTSTATUS FindAttribute(PDEVICE_EXTENSION Vcb, PFILE_RECORD_HEADER MftRecord, ULONG Type, PCWSTR Name, ULONG NameLength, PNTFS_ATTR_CONTEXT *AttrCtx, PULONG Offset)
struct _BootSector BootSector
_In_ PDEVICE_OBJECT DeviceObject
NTSTATUS NtfsDeviceIoControl(IN PDEVICE_OBJECT DeviceObject, IN ULONG ControlCode, IN PVOID InputBuffer, IN ULONG InputBufferSize, IN OUT PVOID OutputBuffer, IN OUT PULONG OutputBufferSize, IN BOOLEAN Override)
VOID NtfsDumpFileAttributes(PDEVICE_EXTENSION Vcb, PFILE_RECORD_HEADER FileRecord)
ULARGE_INTEGER MftMirrStart
#define MAXIMUM_VOLUME_LABEL_LENGTH
ULONG BytesPerIndexRecord
FSRTL_COMMON_FCB_HEADER RFCB
VOID NTAPI ExInitializeNPagedLookasideList(IN PNPAGED_LOOKASIDE_LIST Lookaside, IN PALLOCATE_FUNCTION Allocate OPTIONAL, IN PFREE_FUNCTION Free OPTIONAL, IN ULONG Flags, IN SIZE_T Size, IN ULONG Tag, IN USHORT Depth)
#define NT_SUCCESS(StatCode)
#define ExAllocatePoolWithTag(hernya, size, tag)
static ULONG NtfsQueryMftZoneReservation(VOID)
struct _DISK_GEOMETRY DISK_GEOMETRY
NTSTATUS NtfsReadSectors(IN PDEVICE_OBJECT DeviceObject, IN ULONG DiskSector, IN ULONG SectorCount, IN ULONG SectorSize, IN OUT PUCHAR Buffer, IN BOOLEAN Override)
struct NTFS_ATTR_RECORD::@163::@165 Resident
NTSTATUS ReadFileRecord(PDEVICE_EXTENSION Vcb, ULONGLONG index, PFILE_RECORD_HEADER file)
VOID ReleaseAttributeContext(PNTFS_ATTR_CONTEXT Context)
WCHAR VolumeLabel[MAXIMUM_VOLUME_LABEL_LENGTH]
struct _ULARGE_INTEGER::@3918 u
#define RtlCopyMemory(Destination, Source, Length)
VOID NTAPI ExDeleteNPagedLookasideList(IN PNPAGED_LOOKASIDE_LIST Lookaside)
ULONGLONG AttributeDataLength(PNTFS_ATTR_RECORD AttrRecord)
#define IOCTL_DISK_GET_DRIVE_GEOMETRY