mountmgr.sys: Have mountmgr_ioctl return the same status as the IoStatus.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b13f2e11da
commit
d457a986de
|
@ -973,6 +973,7 @@ static NTSTATUS enumerate_credentials( void *buff, SIZE_T insize, SIZE_T outsize
|
||||||
static NTSTATUS WINAPI mountmgr_ioctl( DEVICE_OBJECT *device, IRP *irp )
|
static NTSTATUS WINAPI mountmgr_ioctl( DEVICE_OBJECT *device, IRP *irp )
|
||||||
{
|
{
|
||||||
IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation( irp );
|
IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation( irp );
|
||||||
|
NTSTATUS status;
|
||||||
|
|
||||||
TRACE( "ioctl %x insize %u outsize %u\n",
|
TRACE( "ioctl %x insize %u outsize %u\n",
|
||||||
irpsp->Parameters.DeviceIoControl.IoControlCode,
|
irpsp->Parameters.DeviceIoControl.IoControlCode,
|
||||||
|
@ -984,109 +985,111 @@ static NTSTATUS WINAPI mountmgr_ioctl( DEVICE_OBJECT *device, IRP *irp )
|
||||||
case IOCTL_MOUNTMGR_QUERY_POINTS:
|
case IOCTL_MOUNTMGR_QUERY_POINTS:
|
||||||
if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(MOUNTMGR_MOUNT_POINT))
|
if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(MOUNTMGR_MOUNT_POINT))
|
||||||
{
|
{
|
||||||
irp->IoStatus.u.Status = STATUS_INVALID_PARAMETER;
|
status = STATUS_INVALID_PARAMETER;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
irp->IoStatus.u.Status = query_mount_points( irp->AssociatedIrp.SystemBuffer,
|
status = query_mount_points( irp->AssociatedIrp.SystemBuffer,
|
||||||
irpsp->Parameters.DeviceIoControl.InputBufferLength,
|
irpsp->Parameters.DeviceIoControl.InputBufferLength,
|
||||||
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
|
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
|
||||||
&irp->IoStatus );
|
&irp->IoStatus );
|
||||||
break;
|
break;
|
||||||
case IOCTL_MOUNTMGR_DEFINE_UNIX_DRIVE:
|
case IOCTL_MOUNTMGR_DEFINE_UNIX_DRIVE:
|
||||||
if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(struct mountmgr_unix_drive))
|
if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(struct mountmgr_unix_drive))
|
||||||
{
|
{
|
||||||
irp->IoStatus.u.Status = STATUS_INVALID_PARAMETER;
|
status = STATUS_INVALID_PARAMETER;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
irp->IoStatus.Information = 0;
|
irp->IoStatus.Information = 0;
|
||||||
irp->IoStatus.u.Status = define_unix_drive( irp->AssociatedIrp.SystemBuffer,
|
status = define_unix_drive( irp->AssociatedIrp.SystemBuffer,
|
||||||
irpsp->Parameters.DeviceIoControl.InputBufferLength );
|
irpsp->Parameters.DeviceIoControl.InputBufferLength );
|
||||||
break;
|
break;
|
||||||
case IOCTL_MOUNTMGR_QUERY_UNIX_DRIVE:
|
case IOCTL_MOUNTMGR_QUERY_UNIX_DRIVE:
|
||||||
if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(struct mountmgr_unix_drive))
|
if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(struct mountmgr_unix_drive))
|
||||||
{
|
{
|
||||||
irp->IoStatus.u.Status = STATUS_INVALID_PARAMETER;
|
status = STATUS_INVALID_PARAMETER;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
irp->IoStatus.u.Status = query_unix_drive( irp->AssociatedIrp.SystemBuffer,
|
status = query_unix_drive( irp->AssociatedIrp.SystemBuffer,
|
||||||
irpsp->Parameters.DeviceIoControl.InputBufferLength,
|
irpsp->Parameters.DeviceIoControl.InputBufferLength,
|
||||||
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
|
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
|
||||||
&irp->IoStatus );
|
&irp->IoStatus );
|
||||||
break;
|
break;
|
||||||
case IOCTL_MOUNTMGR_QUERY_DHCP_REQUEST_PARAMS:
|
case IOCTL_MOUNTMGR_QUERY_DHCP_REQUEST_PARAMS:
|
||||||
if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(struct mountmgr_dhcp_request_params))
|
if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(struct mountmgr_dhcp_request_params))
|
||||||
{
|
{
|
||||||
irp->IoStatus.u.Status = STATUS_INVALID_PARAMETER;
|
status = STATUS_INVALID_PARAMETER;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
irp->IoStatus.u.Status = query_dhcp_request_params( irp->AssociatedIrp.SystemBuffer,
|
status = query_dhcp_request_params( irp->AssociatedIrp.SystemBuffer,
|
||||||
irpsp->Parameters.DeviceIoControl.InputBufferLength,
|
irpsp->Parameters.DeviceIoControl.InputBufferLength,
|
||||||
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
|
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
|
||||||
&irp->IoStatus );
|
&irp->IoStatus );
|
||||||
break;
|
break;
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
case IOCTL_MOUNTMGR_QUERY_SYMBOL_FILE:
|
case IOCTL_MOUNTMGR_QUERY_SYMBOL_FILE:
|
||||||
if (irpsp->Parameters.DeviceIoControl.InputBufferLength != sizeof(GUID)
|
if (irpsp->Parameters.DeviceIoControl.InputBufferLength != sizeof(GUID)
|
||||||
|| irpsp->Parameters.DeviceIoControl.OutputBufferLength < sizeof(MOUNTMGR_TARGET_NAME))
|
|| irpsp->Parameters.DeviceIoControl.OutputBufferLength < sizeof(MOUNTMGR_TARGET_NAME))
|
||||||
{
|
{
|
||||||
irp->IoStatus.u.Status = STATUS_INVALID_PARAMETER;
|
status = STATUS_INVALID_PARAMETER;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (TrySubmitThreadpoolCallback( query_symbol_file, irp, NULL )) return STATUS_PENDING;
|
if (TrySubmitThreadpoolCallback( query_symbol_file, irp, NULL ))
|
||||||
irp->IoStatus.u.Status = STATUS_NO_MEMORY;
|
return (irp->IoStatus.u.Status = STATUS_PENDING);
|
||||||
|
status = STATUS_NO_MEMORY;
|
||||||
break;
|
break;
|
||||||
case IOCTL_MOUNTMGR_READ_CREDENTIAL:
|
case IOCTL_MOUNTMGR_READ_CREDENTIAL:
|
||||||
if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(struct mountmgr_credential))
|
if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(struct mountmgr_credential))
|
||||||
{
|
{
|
||||||
irp->IoStatus.u.Status = STATUS_INVALID_PARAMETER;
|
status = STATUS_INVALID_PARAMETER;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
irp->IoStatus.u.Status = read_credential( irp->AssociatedIrp.SystemBuffer,
|
status = read_credential( irp->AssociatedIrp.SystemBuffer,
|
||||||
irpsp->Parameters.DeviceIoControl.InputBufferLength,
|
irpsp->Parameters.DeviceIoControl.InputBufferLength,
|
||||||
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
|
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
|
||||||
&irp->IoStatus );
|
&irp->IoStatus );
|
||||||
break;
|
break;
|
||||||
case IOCTL_MOUNTMGR_WRITE_CREDENTIAL:
|
case IOCTL_MOUNTMGR_WRITE_CREDENTIAL:
|
||||||
if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(struct mountmgr_credential))
|
if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(struct mountmgr_credential))
|
||||||
{
|
{
|
||||||
irp->IoStatus.u.Status = STATUS_INVALID_PARAMETER;
|
status = STATUS_INVALID_PARAMETER;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
irp->IoStatus.u.Status = write_credential( irp->AssociatedIrp.SystemBuffer,
|
status = write_credential( irp->AssociatedIrp.SystemBuffer,
|
||||||
irpsp->Parameters.DeviceIoControl.InputBufferLength,
|
irpsp->Parameters.DeviceIoControl.InputBufferLength,
|
||||||
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
|
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
|
||||||
&irp->IoStatus );
|
&irp->IoStatus );
|
||||||
break;
|
break;
|
||||||
case IOCTL_MOUNTMGR_DELETE_CREDENTIAL:
|
case IOCTL_MOUNTMGR_DELETE_CREDENTIAL:
|
||||||
if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(struct mountmgr_credential))
|
if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(struct mountmgr_credential))
|
||||||
{
|
{
|
||||||
irp->IoStatus.u.Status = STATUS_INVALID_PARAMETER;
|
status = STATUS_INVALID_PARAMETER;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
irp->IoStatus.u.Status = delete_credential( irp->AssociatedIrp.SystemBuffer,
|
status = delete_credential( irp->AssociatedIrp.SystemBuffer,
|
||||||
irpsp->Parameters.DeviceIoControl.InputBufferLength,
|
irpsp->Parameters.DeviceIoControl.InputBufferLength,
|
||||||
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
|
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
|
||||||
&irp->IoStatus );
|
&irp->IoStatus );
|
||||||
break;
|
break;
|
||||||
case IOCTL_MOUNTMGR_ENUMERATE_CREDENTIALS:
|
case IOCTL_MOUNTMGR_ENUMERATE_CREDENTIALS:
|
||||||
if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(struct mountmgr_credential_list))
|
if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(struct mountmgr_credential_list))
|
||||||
{
|
{
|
||||||
irp->IoStatus.u.Status = STATUS_INVALID_PARAMETER;
|
status = STATUS_INVALID_PARAMETER;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
irp->IoStatus.u.Status = enumerate_credentials( irp->AssociatedIrp.SystemBuffer,
|
status = enumerate_credentials( irp->AssociatedIrp.SystemBuffer,
|
||||||
irpsp->Parameters.DeviceIoControl.InputBufferLength,
|
irpsp->Parameters.DeviceIoControl.InputBufferLength,
|
||||||
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
|
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
|
||||||
&irp->IoStatus );
|
&irp->IoStatus );
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
FIXME( "ioctl %x not supported\n", irpsp->Parameters.DeviceIoControl.IoControlCode );
|
FIXME( "ioctl %x not supported\n", irpsp->Parameters.DeviceIoControl.IoControlCode );
|
||||||
irp->IoStatus.u.Status = STATUS_NOT_SUPPORTED;
|
status = STATUS_NOT_SUPPORTED;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
irp->IoStatus.u.Status = status;
|
||||||
IoCompleteRequest( irp, IO_NO_INCREMENT );
|
IoCompleteRequest( irp, IO_NO_INCREMENT );
|
||||||
return STATUS_SUCCESS;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* main entry point for the mount point manager driver */
|
/* main entry point for the mount point manager driver */
|
||||||
|
|
Loading…
Reference in New Issue