- Fix CD-ROM disc change handling
- Fixes CORE-6119

svn path=/trunk/; revision=65635
This commit is contained in:
Cameron Gutman 2014-12-14 09:27:11 +00:00
parent 5d774268db
commit 2021ab5899
2 changed files with 9 additions and 22 deletions

View file

@ -140,10 +140,6 @@ CdfsOpenFile(PDEVICE_EXTENSION DeviceExt,
DPRINT ("Status %lx\n", Status);
if (!NT_SUCCESS(Status))
{
if (Status == STATUS_NO_MEDIA_IN_DEVICE || Status == STATUS_VERIFY_REQUIRED)
{
DeviceExt->VolumeDevice->Flags |= DO_VERIFY_VOLUME;
}
DPRINT1 ("Status %lx\n", Status);
return Status;
}

View file

@ -453,34 +453,25 @@ CdfsVerifyVolume(PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
PDEVICE_EXTENSION DeviceExt;
PDEVICE_OBJECT DeviceToVerify;
PIO_STACK_LOCATION Stack;
NTSTATUS Status;
CDINFO CdInfo;
PLIST_ENTRY Entry;
PFCB Fcb;
PVPB VpbToVerify;
DPRINT1 ("CdfsVerifyVolume() called\n");
#if 0
if (DeviceObject != CdfsGlobalData->DeviceObject)
{
DPRINT1("DeviceObject != CdfsGlobalData->DeviceObject\n");
return(STATUS_INVALID_DEVICE_REQUEST);
}
#endif
DeviceExt = DeviceObject->DeviceExtension;
Stack = IoGetCurrentIrpStackLocation (Irp);
DeviceToVerify = Stack->Parameters.VerifyVolume.DeviceObject;
VpbToVerify = Stack->Parameters.VerifyVolume.Vpb;
FsRtlEnterFileSystem();
ExAcquireResourceExclusiveLite (&DeviceExt->VcbResource,
TRUE);
if (!(DeviceToVerify->Flags & DO_VERIFY_VOLUME))
if (!(VpbToVerify->RealDevice->Flags & DO_VERIFY_VOLUME))
{
DPRINT1 ("Volume has been verified!\n");
ExReleaseResourceLite (&DeviceExt->VcbResource);
@ -488,14 +479,14 @@ CdfsVerifyVolume(PDEVICE_OBJECT DeviceObject,
return STATUS_SUCCESS;
}
DPRINT1 ("Device object %p Device to verify %p\n", DeviceObject, DeviceToVerify);
DPRINT1("Device object %p Device to verify %p\n", DeviceObject, VpbToVerify->RealDevice);
Status = CdfsGetVolumeData (DeviceToVerify,
Status = CdfsGetVolumeData(VpbToVerify->RealDevice,
&CdInfo);
if (NT_SUCCESS(Status) &&
CdInfo.SerialNumber == DeviceToVerify->Vpb->SerialNumber &&
CdInfo.VolumeLabelLength == DeviceToVerify->Vpb->VolumeLabelLength &&
!wcsncmp (CdInfo.VolumeLabel, DeviceToVerify->Vpb->VolumeLabel, CdInfo.VolumeLabelLength))
CdInfo.SerialNumber == VpbToVerify->SerialNumber &&
CdInfo.VolumeLabelLength == VpbToVerify->VolumeLabelLength &&
!wcsncmp(CdInfo.VolumeLabel, VpbToVerify->VolumeLabel, CdInfo.VolumeLabelLength))
{
DPRINT1 ("Same volume!\n");
@ -520,7 +511,7 @@ CdfsVerifyVolume(PDEVICE_OBJECT DeviceObject,
Status = STATUS_WRONG_VOLUME;
}
DeviceToVerify->Flags &= ~DO_VERIFY_VOLUME;
VpbToVerify->RealDevice->Flags &= ~DO_VERIFY_VOLUME;
ExReleaseResourceLite (&DeviceExt->VcbResource);
FsRtlExitFileSystem();