mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Implemented FloppyDispatchDeviceControl for IOCTL_DISK_GET_DRIVE_GEOMETRY (not complete).
svn path=/trunk/; revision=2734
This commit is contained in:
parent
3f6956a59c
commit
933c073785
1 changed files with 36 additions and 1 deletions
|
@ -468,8 +468,43 @@ NTSTATUS STDCALL
|
|||
FloppyDispatchDeviceControl(PDEVICE_OBJECT DeviceObject,
|
||||
PIRP Irp)
|
||||
{
|
||||
PIO_STACK_LOCATION IrpStack;
|
||||
ULONG ControlCode, InputLength, OutputLength;
|
||||
NTSTATUS Status;
|
||||
|
||||
DPRINT("FloppyDispatchDeviceControl\n");
|
||||
return(STATUS_UNSUCCESSFUL);
|
||||
|
||||
IrpStack = IoGetCurrentIrpStackLocation(Irp);
|
||||
ControlCode = IrpStack->Parameters.DeviceIoControl.IoControlCode;
|
||||
InputLength = IrpStack->Parameters.DeviceIoControl.InputBufferLength;
|
||||
OutputLength = IrpStack->Parameters.DeviceIoControl.OutputBufferLength;
|
||||
|
||||
switch (ControlCode)
|
||||
{
|
||||
case IOCTL_DISK_GET_DRIVE_GEOMETRY:
|
||||
if (OutputLength < sizeof(DISK_GEOMETRY))
|
||||
{
|
||||
Status = STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
else
|
||||
{
|
||||
PDISK_GEOMETRY Geometry = Irp->AssociatedIrp.SystemBuffer;
|
||||
// FIXME: read the first sector of the diskette
|
||||
Geometry->MediaType = F3_1Pt44_512;
|
||||
Geometry->Cylinders.QuadPart = 80;
|
||||
Geometry->TracksPerCylinder = 2 * 18;
|
||||
Geometry->SectorsPerTrack = 18;
|
||||
Geometry->BytesPerSector = 512;
|
||||
Status = STATUS_SUCCESS;
|
||||
Irp->IoStatus.Information = sizeof(DISK_GEOMETRY);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
Status = STATUS_INVALID_DEVICE_REQUEST;
|
||||
}
|
||||
Irp->IoStatus.Status = Status;
|
||||
IoCompleteRequest(Irp, NT_SUCCESS(Status) ? IO_DISK_INCREMENT : IO_NO_INCREMENT);
|
||||
return Status;
|
||||
}
|
||||
|
||||
/* ModuleEntry
|
||||
|
|
Loading…
Reference in a new issue