Commit d457a986 authored by Erich E. Hoover's avatar Erich E. Hoover Committed by Alexandre Julliard

mountmgr.sys: Have mountmgr_ioctl return the same status as the IoStatus.

parent b13f2e11
......@@ -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 )
{
IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation( irp );
NTSTATUS status;
TRACE( "ioctl %x insize %u outsize %u\n",
irpsp->Parameters.DeviceIoControl.IoControlCode,
......@@ -984,109 +985,111 @@ static NTSTATUS WINAPI mountmgr_ioctl( DEVICE_OBJECT *device, IRP *irp )
case IOCTL_MOUNTMGR_QUERY_POINTS:
if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(MOUNTMGR_MOUNT_POINT))
{
irp->IoStatus.u.Status = STATUS_INVALID_PARAMETER;
status = STATUS_INVALID_PARAMETER;
break;
}
irp->IoStatus.u.Status = query_mount_points( irp->AssociatedIrp.SystemBuffer,
irpsp->Parameters.DeviceIoControl.InputBufferLength,
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
&irp->IoStatus );
status = query_mount_points( irp->AssociatedIrp.SystemBuffer,
irpsp->Parameters.DeviceIoControl.InputBufferLength,
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
&irp->IoStatus );
break;
case IOCTL_MOUNTMGR_DEFINE_UNIX_DRIVE:
if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(struct mountmgr_unix_drive))
{
irp->IoStatus.u.Status = STATUS_INVALID_PARAMETER;
status = STATUS_INVALID_PARAMETER;
break;
}
irp->IoStatus.Information = 0;
irp->IoStatus.u.Status = define_unix_drive( irp->AssociatedIrp.SystemBuffer,
irpsp->Parameters.DeviceIoControl.InputBufferLength );
status = define_unix_drive( irp->AssociatedIrp.SystemBuffer,
irpsp->Parameters.DeviceIoControl.InputBufferLength );
break;
case IOCTL_MOUNTMGR_QUERY_UNIX_DRIVE:
if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(struct mountmgr_unix_drive))
{
irp->IoStatus.u.Status = STATUS_INVALID_PARAMETER;
status = STATUS_INVALID_PARAMETER;
break;
}
irp->IoStatus.u.Status = query_unix_drive( irp->AssociatedIrp.SystemBuffer,
irpsp->Parameters.DeviceIoControl.InputBufferLength,
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
&irp->IoStatus );
status = query_unix_drive( irp->AssociatedIrp.SystemBuffer,
irpsp->Parameters.DeviceIoControl.InputBufferLength,
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
&irp->IoStatus );
break;
case IOCTL_MOUNTMGR_QUERY_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;
}
irp->IoStatus.u.Status = query_dhcp_request_params( irp->AssociatedIrp.SystemBuffer,
irpsp->Parameters.DeviceIoControl.InputBufferLength,
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
&irp->IoStatus );
status = query_dhcp_request_params( irp->AssociatedIrp.SystemBuffer,
irpsp->Parameters.DeviceIoControl.InputBufferLength,
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
&irp->IoStatus );
break;
#ifdef __APPLE__
case IOCTL_MOUNTMGR_QUERY_SYMBOL_FILE:
if (irpsp->Parameters.DeviceIoControl.InputBufferLength != sizeof(GUID)
|| irpsp->Parameters.DeviceIoControl.OutputBufferLength < sizeof(MOUNTMGR_TARGET_NAME))
{
irp->IoStatus.u.Status = STATUS_INVALID_PARAMETER;
status = STATUS_INVALID_PARAMETER;
break;
}
if (TrySubmitThreadpoolCallback( query_symbol_file, irp, NULL )) return STATUS_PENDING;
irp->IoStatus.u.Status = STATUS_NO_MEMORY;
if (TrySubmitThreadpoolCallback( query_symbol_file, irp, NULL ))
return (irp->IoStatus.u.Status = STATUS_PENDING);
status = STATUS_NO_MEMORY;
break;
case IOCTL_MOUNTMGR_READ_CREDENTIAL:
if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(struct mountmgr_credential))
{
irp->IoStatus.u.Status = STATUS_INVALID_PARAMETER;
status = STATUS_INVALID_PARAMETER;
break;
}
irp->IoStatus.u.Status = read_credential( irp->AssociatedIrp.SystemBuffer,
irpsp->Parameters.DeviceIoControl.InputBufferLength,
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
&irp->IoStatus );
status = read_credential( irp->AssociatedIrp.SystemBuffer,
irpsp->Parameters.DeviceIoControl.InputBufferLength,
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
&irp->IoStatus );
break;
case IOCTL_MOUNTMGR_WRITE_CREDENTIAL:
if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(struct mountmgr_credential))
{
irp->IoStatus.u.Status = STATUS_INVALID_PARAMETER;
status = STATUS_INVALID_PARAMETER;
break;
}
irp->IoStatus.u.Status = write_credential( irp->AssociatedIrp.SystemBuffer,
irpsp->Parameters.DeviceIoControl.InputBufferLength,
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
&irp->IoStatus );
status = write_credential( irp->AssociatedIrp.SystemBuffer,
irpsp->Parameters.DeviceIoControl.InputBufferLength,
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
&irp->IoStatus );
break;
case IOCTL_MOUNTMGR_DELETE_CREDENTIAL:
if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(struct mountmgr_credential))
{
irp->IoStatus.u.Status = STATUS_INVALID_PARAMETER;
status = STATUS_INVALID_PARAMETER;
break;
}
irp->IoStatus.u.Status = delete_credential( irp->AssociatedIrp.SystemBuffer,
irpsp->Parameters.DeviceIoControl.InputBufferLength,
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
&irp->IoStatus );
status = delete_credential( irp->AssociatedIrp.SystemBuffer,
irpsp->Parameters.DeviceIoControl.InputBufferLength,
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
&irp->IoStatus );
break;
case IOCTL_MOUNTMGR_ENUMERATE_CREDENTIALS:
if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(struct mountmgr_credential_list))
{
irp->IoStatus.u.Status = STATUS_INVALID_PARAMETER;
status = STATUS_INVALID_PARAMETER;
break;
}
irp->IoStatus.u.Status = enumerate_credentials( irp->AssociatedIrp.SystemBuffer,
irpsp->Parameters.DeviceIoControl.InputBufferLength,
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
&irp->IoStatus );
status = enumerate_credentials( irp->AssociatedIrp.SystemBuffer,
irpsp->Parameters.DeviceIoControl.InputBufferLength,
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
&irp->IoStatus );
break;
#endif
default:
FIXME( "ioctl %x not supported\n", irpsp->Parameters.DeviceIoControl.IoControlCode );
irp->IoStatus.u.Status = STATUS_NOT_SUPPORTED;
status = STATUS_NOT_SUPPORTED;
break;
}
irp->IoStatus.u.Status = status;
IoCompleteRequest( irp, IO_NO_INCREMENT );
return STATUS_SUCCESS;
return status;
}
/* main entry point for the mount point manager driver */
......
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