PVOID OutputBuffer = Irp->AssociatedIrp.SystemBuffer;
ULONG Code = Stack->Parameters.DeviceIoControl.IoControlCode;
BOOLEAN DiskChanged;
+ PMOUNTDEV_NAME Name;
TRACE_(FLOPPY, "DeviceIoctl called\n");
Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;
break;
+ case IOCTL_MOUNTDEV_QUERY_DEVICE_NAME:
+ if (OutputLength < sizeof(MOUNTDEV_NAME)) {
+ Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL;
+ Irp->IoStatus.Information = sizeof(MOUNTDEV_NAME);
+ break;
+ }
+
+ Name = Irp->AssociatedIrp.SystemBuffer;
+ Name->NameLength = wcslen(&DriveInfo->SymLinkBuffer[0]) * sizeof(WCHAR);
+
+ if (OutputLength < sizeof(USHORT) + Name->NameLength) {
+ Irp->IoStatus.Status = STATUS_BUFFER_OVERFLOW;
+ Irp->IoStatus.Information = sizeof(MOUNTDEV_NAME);
+ break;
+ }
+
+ RtlCopyMemory(Name->Name, &DriveInfo->SymLinkBuffer[0],
+ Name->NameLength);
+
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+ Irp->IoStatus.Information = sizeof(USHORT) + Name->NameLength;
+ break;
+
default:
ERR_(FLOPPY, "UNKNOWN IOCTL CODE: 0x%x\n", Code);
Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;