Author: pschweitzer
Date: Thu Sep 25 20:15:00 2014
New Revision: 64288
URL:
http://svn.reactos.org/svn/reactos?rev=64288&view=rev
Log:
[NTFS]
- Create the volume FCB and save it in VCB.
- Fix a memory leak
Modified:
trunk/reactos/drivers/filesystems/ntfs/fsctl.c
trunk/reactos/drivers/filesystems/ntfs/ntfs.h
Modified: trunk/reactos/drivers/filesystems/ntfs/fsctl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/f…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/fsctl.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/fsctl.c [iso-8859-1] Thu Sep 25 20:15:00 2014
@@ -181,6 +181,8 @@
ULONG Size;
PNTFS_INFO NtfsInfo = &DeviceExt->NtfsInfo;
NTSTATUS Status;
+ PNTFS_FCB VolumeFcb;
+ PWSTR VolumeNameU;
DPRINT("NtfsGetVolumeData() called\n");
@@ -286,6 +288,7 @@
MftRecord);
if (!NT_SUCCESS(Status))
{
+ ExFreePool(VolumeRecord);
ExFreePool(MftRecord);
return Status;
}
@@ -308,11 +311,27 @@
RtlCopyMemory(NtfsInfo->VolumeLabel,
(PVOID)((ULONG_PTR)Attribute +
((PRESIDENT_ATTRIBUTE)Attribute)->ValueOffset),
NtfsInfo->VolumeLabelLength);
+ VolumeNameU = NtfsInfo->VolumeLabel;
}
else
{
NtfsInfo->VolumeLabelLength = 0;
- }
+ VolumeNameU = L"\0";
+ }
+
+ VolumeFcb = NtfsCreateFCB(VolumeNameU, DeviceExt);
+ if (VolumeFcb == NULL)
+ {
+ ExFreePool(VolumeRecord);
+ ExFreePool(MftRecord);
+ return STATUS_INSUFFICIENT_RESOURCES;
+ }
+
+ VolumeFcb->Flags = FCB_IS_VOLUME;
+ VolumeFcb->RFCB.FileSize.QuadPart = DeviceExt->NtfsInfo.SectorCount *
DeviceExt->NtfsInfo.BytesPerSector;
+ VolumeFcb->RFCB.ValidDataLength = VolumeFcb->RFCB.FileSize;
+ VolumeFcb->RFCB.AllocationSize = VolumeFcb->RFCB.FileSize;
+ DeviceExt->VolumeFcb = VolumeFcb;
/* Get volume information */
Attribute = FindAttribute (VolumeRecord, AttributeVolumeInformation, NULL);
Modified: trunk/reactos/drivers/filesystems/ntfs/ntfs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/n…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/ntfs.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/ntfs.h [iso-8859-1] Thu Sep 25 20:15:00 2014
@@ -100,6 +100,8 @@
PVPB Vpb;
PDEVICE_OBJECT StorageDevice;
PFILE_OBJECT StreamFileObject;
+
+ struct _FCB *VolumeFcb;
NTFS_INFO NtfsInfo;