mirror of
https://github.com/reactos/reactos.git
synced 2025-04-25 08:00:24 +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
|
@ -111,6 +111,8 @@ typedef struct _VCB
|
|||
FAT_METHODS Methods;
|
||||
/* Root Directory Fcb: */
|
||||
struct _FCB *RootFcb;
|
||||
|
||||
ULONG MediaChangeCount;
|
||||
} VCB, *PVCB;
|
||||
|
||||
#define VcbToVolumeDeviceObject(xVcb) \
|
||||
|
|
|
@ -56,6 +56,7 @@ FatMountVolume(PFAT_IRP_CONTEXT IrpContext,
|
|||
{
|
||||
NTSTATUS Status;
|
||||
DISK_GEOMETRY DiskGeometry;
|
||||
ULONG MediaChangeCount = 0;
|
||||
PVOLUME_DEVICE_OBJECT VolumeDevice;
|
||||
|
||||
DPRINT1("FatMountVolume()\n");
|
||||
|
@ -63,7 +64,17 @@ FatMountVolume(PFAT_IRP_CONTEXT IrpContext,
|
|||
/* Make sure this IRP is waitable */
|
||||
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: IOCTL_DISK_GET_PARTITION_INFO_EX */
|
||||
|
||||
|
@ -113,6 +124,12 @@ FatMountVolume(PFAT_IRP_CONTEXT IrpContext,
|
|||
Status = FatInitializeVcb(&VolumeDevice->Vcb, TargetDeviceObject, Vpb);
|
||||
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 STATUS_SUCCESS;
|
||||
|
||||
|
|
Loading…
Reference in a new issue