mirror of
https://github.com/reactos/reactos.git
synced 2025-07-27 08:01:53 +00:00
- Fixed a TODO.
- Added volume mount notification svn path=/trunk/; revision=39077
This commit is contained in:
parent
69eda17b58
commit
052bf353f4
2 changed files with 20 additions and 1 deletions
reactos/drivers/filesystems/fastfat_new
|
@ -111,6 +111,8 @@ typedef struct _VCB
|
||||||
FAT_METHODS Methods;
|
FAT_METHODS Methods;
|
||||||
/* Root Directory Fcb: */
|
/* Root Directory Fcb: */
|
||||||
struct _FCB *RootFcb;
|
struct _FCB *RootFcb;
|
||||||
|
|
||||||
|
ULONG MediaChangeCount;
|
||||||
} VCB, *PVCB;
|
} VCB, *PVCB;
|
||||||
|
|
||||||
#define VcbToVolumeDeviceObject(xVcb) \
|
#define VcbToVolumeDeviceObject(xVcb) \
|
||||||
|
|
|
@ -56,6 +56,7 @@ FatMountVolume(PFAT_IRP_CONTEXT IrpContext,
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
DISK_GEOMETRY DiskGeometry;
|
DISK_GEOMETRY DiskGeometry;
|
||||||
|
ULONG MediaChangeCount = 0;
|
||||||
PVOLUME_DEVICE_OBJECT VolumeDevice;
|
PVOLUME_DEVICE_OBJECT VolumeDevice;
|
||||||
|
|
||||||
DPRINT1("FatMountVolume()\n");
|
DPRINT1("FatMountVolume()\n");
|
||||||
|
@ -63,7 +64,17 @@ FatMountVolume(PFAT_IRP_CONTEXT IrpContext,
|
||||||
/* Make sure this IRP is waitable */
|
/* Make sure this IRP is waitable */
|
||||||
ASSERT(IrpContext->Flags & IRPCONTEXT_CANWAIT);
|
ASSERT(IrpContext->Flags & IRPCONTEXT_CANWAIT);
|
||||||
|
|
||||||
/* TODO: IOCTL_DISK_CHECK_VERIFY */
|
/* Request media changes count, mostly usefull for removable devices */
|
||||||
|
Status = FatPerformDevIoCtrl(TargetDeviceObject,
|
||||||
|
IOCTL_STORAGE_CHECK_VERIFY,
|
||||||
|
NULL,
|
||||||
|
0,
|
||||||
|
&MediaChangeCount,
|
||||||
|
sizeof(ULONG),
|
||||||
|
TRUE);
|
||||||
|
|
||||||
|
if (!NT_SUCCESS(Status)) return Status;
|
||||||
|
|
||||||
/* TODO: Check if data-track present in case of a CD drive */
|
/* TODO: Check if data-track present in case of a CD drive */
|
||||||
/* TODO: IOCTL_DISK_GET_PARTITION_INFO_EX */
|
/* TODO: IOCTL_DISK_GET_PARTITION_INFO_EX */
|
||||||
|
|
||||||
|
@ -113,6 +124,12 @@ FatMountVolume(PFAT_IRP_CONTEXT IrpContext,
|
||||||
Status = FatInitializeVcb(&VolumeDevice->Vcb, TargetDeviceObject, Vpb);
|
Status = FatInitializeVcb(&VolumeDevice->Vcb, TargetDeviceObject, Vpb);
|
||||||
if (!NT_SUCCESS(Status)) goto FatMountVolumeCleanup;
|
if (!NT_SUCCESS(Status)) goto FatMountVolumeCleanup;
|
||||||
|
|
||||||
|
/* Keep trace of media changes */
|
||||||
|
VolumeDevice->Vcb.MediaChangeCount = MediaChangeCount;
|
||||||
|
|
||||||
|
/* Notify about volume mount */
|
||||||
|
FsRtlNotifyVolumeEvent(VolumeDevice->Vcb.VolumeFileObject, FSRTL_VOLUME_MOUNT);
|
||||||
|
|
||||||
/* Return success */
|
/* Return success */
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue