Commit 7a90e7a4 authored by André Hentschel's avatar André Hentschel Committed by Alexandre Julliard

mountmgr.sys: Handle IOCTL_DISK_GET_DRIVE_GEOMETRY_EX.

parent 73f743f6
...@@ -895,6 +895,26 @@ static NTSTATUS WINAPI harddisk_ioctl( DEVICE_OBJECT *device, IRP *irp ) ...@@ -895,6 +895,26 @@ static NTSTATUS WINAPI harddisk_ioctl( DEVICE_OBJECT *device, IRP *irp )
irp->IoStatus.u.Status = STATUS_SUCCESS; irp->IoStatus.u.Status = STATUS_SUCCESS;
break; break;
} }
case IOCTL_DISK_GET_DRIVE_GEOMETRY_EX:
{
DISK_GEOMETRY_EX info;
DWORD len = min( sizeof(info), irpsp->Parameters.DeviceIoControl.OutputBufferLength );
FIXME("The DISK_PARTITION_INFO and DISK_DETECTION_INFO structures will not be filled\n");
info.Geometry.Cylinders.QuadPart = 10000;
info.Geometry.MediaType = (dev->devnum.DeviceType == FILE_DEVICE_DISK) ? FixedMedia : RemovableMedia;
info.Geometry.TracksPerCylinder = 255;
info.Geometry.SectorsPerTrack = 63;
info.Geometry.BytesPerSector = 512;
info.DiskSize.QuadPart = info.Geometry.Cylinders.QuadPart * info.Geometry.TracksPerCylinder *
info.Geometry.SectorsPerTrack * info.Geometry.BytesPerSector;
info.Data[0] = 0;
memcpy( irp->MdlAddress->StartVa, &info, len );
irp->IoStatus.Information = len;
irp->IoStatus.u.Status = STATUS_SUCCESS;
break;
}
case IOCTL_STORAGE_GET_DEVICE_NUMBER: case IOCTL_STORAGE_GET_DEVICE_NUMBER:
{ {
DWORD len = min( sizeof(dev->devnum), irpsp->Parameters.DeviceIoControl.OutputBufferLength ); DWORD len = min( sizeof(dev->devnum), irpsp->Parameters.DeviceIoControl.OutputBufferLength );
......
...@@ -264,6 +264,7 @@ ...@@ -264,6 +264,7 @@
#define SMART_GET_VERSION CTL_CODE(IOCTL_DISK_BASE, 0x0020, METHOD_BUFFERED, FILE_READ_ACCESS) #define SMART_GET_VERSION CTL_CODE(IOCTL_DISK_BASE, 0x0020, METHOD_BUFFERED, FILE_READ_ACCESS)
#define SMART_SEND_DRIVE_COMMAND CTL_CODE(IOCTL_DISK_BASE, 0x0021, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) #define SMART_SEND_DRIVE_COMMAND CTL_CODE(IOCTL_DISK_BASE, 0x0021, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define SMART_RCV_DRIVE_DATA CTL_CODE(IOCTL_DISK_BASE, 0x0022, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) #define SMART_RCV_DRIVE_DATA CTL_CODE(IOCTL_DISK_BASE, 0x0022, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_DISK_GET_DRIVE_GEOMETRY_EX CTL_CODE(IOCTL_DISK_BASE, 0x0028, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_VOLUME_BASE ((DWORD)'V') #define IOCTL_VOLUME_BASE ((DWORD)'V')
#define IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS CTL_CODE(IOCTL_VOLUME_BASE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS) #define IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS CTL_CODE(IOCTL_VOLUME_BASE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
...@@ -325,6 +326,12 @@ typedef struct _DISK_GEOMETRY { ...@@ -325,6 +326,12 @@ typedef struct _DISK_GEOMETRY {
DWORD BytesPerSector; DWORD BytesPerSector;
} DISK_GEOMETRY, *PDISK_GEOMETRY; } DISK_GEOMETRY, *PDISK_GEOMETRY;
typedef struct _DISK_GEOMETRY_EX {
DISK_GEOMETRY Geometry;
LARGE_INTEGER DiskSize;
BYTE Data[1];
} DISK_GEOMETRY_EX, *PDISK_GEOMETRY_EX;
typedef struct _PARTITION_INFORMATION { typedef struct _PARTITION_INFORMATION {
LARGE_INTEGER StartingOffset; LARGE_INTEGER StartingOffset;
LARGE_INTEGER PartitionLength; LARGE_INTEGER PartitionLength;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment