mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[FLOPPY] Correctly return media changed information
If disk changed since last time, we must either return STATUS_IO_DEVICE_ERROR or STATUS_VERIFY_REQUIRED, depending of VPB_MOUNTED flag. This is already handled by the SignalMediaChanged() function. CORE-18244
This commit is contained in:
parent
55343f04b0
commit
0676247932
2 changed files with 5 additions and 16 deletions
|
@ -153,16 +153,10 @@ DeviceIoctlPassive(PDRIVE_INFO DriveInfo, PIRP Irp)
|
||||||
if(DiskChanged)
|
if(DiskChanged)
|
||||||
{
|
{
|
||||||
INFO_(FLOPPY, "DeviceIoctl(): detected disk changed; signalling media change and completing\n");
|
INFO_(FLOPPY, "DeviceIoctl(): detected disk changed; signalling media change and completing\n");
|
||||||
SignalMediaChanged(DriveInfo->DeviceObject, Irp);
|
|
||||||
|
|
||||||
/*
|
/* The following call sets IoStatus.Status and IoStatus.Information */
|
||||||
* Just guessing here - I have a choice of returning NO_MEDIA or VERIFY_REQUIRED. If there's
|
SignalMediaChanged(DriveInfo->DeviceObject, Irp);
|
||||||
* really no disk in the drive, I'm thinking I can save time by just reporting that fact, rather
|
ResetChangeFlag(DriveInfo);
|
||||||
* than forcing windows to ask me twice. If this doesn't work, we'll need to split this up and
|
|
||||||
* handle the CHECK_VERIFY IOCTL separately.
|
|
||||||
*/
|
|
||||||
if(ResetChangeFlag(DriveInfo) == STATUS_NO_MEDIA_IN_DEVICE)
|
|
||||||
Irp->IoStatus.Status = STATUS_NO_MEDIA_IN_DEVICE;
|
|
||||||
|
|
||||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||||
StopMotor(DriveInfo->ControllerInfo);
|
StopMotor(DriveInfo->ControllerInfo);
|
||||||
|
|
|
@ -478,16 +478,11 @@ ReadWritePassive(PDRIVE_INFO DriveInfo, PIRP Irp)
|
||||||
|
|
||||||
if(DiskChanged)
|
if(DiskChanged)
|
||||||
{
|
{
|
||||||
INFO_(FLOPPY, "ReadWritePhase1(): signalling media changed; Completing with STATUS_MEDIA_CHANGED\n");
|
INFO_(FLOPPY, "ReadWritePhase1(): detected disk changed: signalling media change and completing\n");
|
||||||
|
|
||||||
/* The following call sets IoStatus.Status and IoStatus.Information */
|
/* The following call sets IoStatus.Status and IoStatus.Information */
|
||||||
SignalMediaChanged(DeviceObject, Irp);
|
SignalMediaChanged(DeviceObject, Irp);
|
||||||
|
ResetChangeFlag(DriveInfo);
|
||||||
/*
|
|
||||||
* Guessing at something... see ioctl.c for more info
|
|
||||||
*/
|
|
||||||
if(ResetChangeFlag(DriveInfo) == STATUS_NO_MEDIA_IN_DEVICE)
|
|
||||||
Irp->IoStatus.Status = STATUS_NO_MEDIA_IN_DEVICE;
|
|
||||||
|
|
||||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||||
StopMotor(DriveInfo->ControllerInfo);
|
StopMotor(DriveInfo->ControllerInfo);
|
||||||
|
|
Loading…
Reference in a new issue