André Hentschel : mountmgr.sys: Handle IOCTL_DISK_GET_DRIVE_GEOMETRY_EX.
Alexandre Julliard
julliard at winehq.org
Thu Apr 7 07:36:56 CDT 2011
Module: wine
Branch: stable
Commit: 2b8eadefed6547431ca0ebab969ef3a57e113c3e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=2b8eadefed6547431ca0ebab969ef3a57e113c3e
Author: André Hentschel <nerv at dawncrow.de>
Date: Wed Mar 9 20:45:18 2011 +0100
mountmgr.sys: Handle IOCTL_DISK_GET_DRIVE_GEOMETRY_EX.
(cherry picked from commit 7a90e7a4442a011db17b7f297e7c93af87269bc4)
---
dlls/mountmgr.sys/device.c | 20 ++++++++++++++++++++
include/winioctl.h | 7 +++++++
2 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c
index 8709472..ddff3ab 100644
--- a/dlls/mountmgr.sys/device.c
+++ b/dlls/mountmgr.sys/device.c
@@ -888,6 +888,26 @@ static NTSTATUS WINAPI harddisk_ioctl( DEVICE_OBJECT *device, IRP *irp )
irp->IoStatus.u.Status = STATUS_SUCCESS;
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:
{
DWORD len = min( sizeof(dev->devnum), irpsp->Parameters.DeviceIoControl.OutputBufferLength );
diff --git a/include/winioctl.h b/include/winioctl.h
index d1c3376..7f04d59 100644
--- a/include/winioctl.h
+++ b/include/winioctl.h
@@ -264,6 +264,7 @@
#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_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_GET_VOLUME_DISK_EXTENTS CTL_CODE(IOCTL_VOLUME_BASE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
@@ -325,6 +326,12 @@ typedef struct _DISK_GEOMETRY {
DWORD BytesPerSector;
} 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 {
LARGE_INTEGER StartingOffset;
LARGE_INTEGER PartitionLength;
More information about the wine-cvs
mailing list