From: short <> Date: Tue, 4 Feb 2003 18:11:24 +0000 (+0000) Subject: +IOCTL_DISK_GET_PARTITION_INFO handler X-Git-Tag: captive-0_2~208 X-Git-Url: http://git.jankratochvil.net/?a=commitdiff_plain;h=6dbc8143282b9e2168056737a30c2e5128fec61c;p=captive.git +IOCTL_DISK_GET_PARTITION_INFO handler --- diff --git a/src/libcaptive/storage/media.c b/src/libcaptive/storage/media.c index c409a5f..3c95e4e 100644 --- a/src/libcaptive/storage/media.c +++ b/src/libcaptive/storage/media.c @@ -195,6 +195,28 @@ CDROM_TOC *CdromToc; Irp->IoStatus.Status=STATUS_SUCCESS; break; + case IOCTL_DISK_GET_PARTITION_INFO: { +PARTITION_INFORMATION *PartitionInformation; + + if (IrpStack->Parameters.DeviceIoControl.OutputBufferLengthIoStatus.Status=STATUS_BUFFER_TOO_SMALL; + Irp->IoStatus.Information=sizeof(PARTITION_INFORMATION); + g_assert_not_reached(); + goto done; + } + PartitionInformation=(PARTITION_INFORMATION *)Irp->AssociatedIrp.SystemBuffer; + PartitionInformation->StartingOffset.QuadPart=0; + PartitionInformation->PartitionLength.QuadPart=captive_image_size; /* unit=bytes */ + PartitionInformation->HiddenSectors=0; /* FIXME: real image disk offset */ + PartitionInformation->PartitionNumber=1; + PartitionInformation->PartitionType=0; /* FIXME: meaning? */ + PartitionInformation->BootIndicator=TRUE; + PartitionInformation->RecognizedPartition=TRUE; + PartitionInformation->RewritePartition=FALSE; /* FIXME: meaning? */ + Irp->IoStatus.Information=sizeof(PARTITION_INFORMATION); + Irp->IoStatus.Status=STATUS_SUCCESS; + } break; + case IOCTL_DISK_GET_PARTITION_INFO_EX: { PARTITION_INFORMATION_EX *PartitionInformationEx; @@ -207,7 +229,7 @@ PARTITION_INFORMATION_EX *PartitionInformationEx; PartitionInformationEx=(PARTITION_INFORMATION_EX *)Irp->AssociatedIrp.SystemBuffer; PartitionInformationEx->PartitionStyle=PARTITION_STYLE_RAW; /* not MBR or GPT */ PartitionInformationEx->StartingOffset.QuadPart=0; - PartitionInformationEx->PartitionLength.QuadPart=captive_image_size; /* FIXME: what units? */ + PartitionInformationEx->PartitionLength.QuadPart=captive_image_size; /* unit=bytes */ PartitionInformationEx->PartitionNumber=0; /* FIXME: what number? */ PartitionInformationEx->RewritePartition=FALSE; /* FIXME: meaning? */ Irp->IoStatus.Information=sizeof(PARTITION_INFORMATION_EX);