xbox-kernel/private/ntos/udfx/devctrl.c
2020-09-30 17:17:25 +02:00

70 lines
1.3 KiB
C

/*++
Copyright (c) 2000-2001 Microsoft Corporation
Module Name:
devctrl.c
Abstract:
This module implements routines related to handling IRP_MJ_DEVICE_CONTROL.
--*/
#include "udfx.h"
NTSTATUS
UdfxFsdDeviceControl(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
)
/*++
Routine Description:
This routine is called by the I/O manager to handle IRP_MJ_DEVICE_CONTROL
requests.
Arguments:
DeviceObject - Specifies the device object that the I/O request is for.
Irp - Specifies the packet that describes the I/O request.
Return Value:
Status of operation.
--*/
{
NTSTATUS status;
PUDF_VOLUME_EXTENSION VolumeExtension;
VolumeExtension = (PUDF_VOLUME_EXTENSION)DeviceObject->DeviceExtension;
//
// Check if the volume has been dismounted.
//
if (VolumeExtension->Dismounted) {
status = STATUS_VOLUME_DISMOUNTED;
goto CleanupAndExit;
}
//
// Pass the IRP down to the target device. We don't need to touch any of
// the arguments.
//
IoSkipCurrentIrpStackLocation(Irp);
return IoCallDriver(VolumeExtension->TargetDeviceObject, Irp);
CleanupAndExit:
Irp->IoStatus.Status = status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return status;
}