2010-08-30 11:51:17 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS kernel
|
|
|
|
* FILE: drivers/filesystems/cdfs/devctrl.c
|
|
|
|
* PURPOSE: CDROM (ISO 9660) filesystem driver
|
|
|
|
* PROGRAMMER: Pierre Schweitzer
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* INCLUDES *****************************************************************/
|
|
|
|
|
|
|
|
#include "cdfs.h"
|
|
|
|
|
|
|
|
#define NDEBUG
|
|
|
|
#include <debug.h>
|
|
|
|
|
|
|
|
/* FUNCTIONS ****************************************************************/
|
|
|
|
|
|
|
|
NTSTATUS NTAPI
|
2015-06-01 13:13:18 +00:00
|
|
|
CdfsDeviceControl(
|
|
|
|
PCDFS_IRP_CONTEXT IrpContext)
|
2010-08-30 11:51:17 +00:00
|
|
|
{
|
2015-06-01 13:13:18 +00:00
|
|
|
PIRP Irp;
|
2010-08-30 11:51:17 +00:00
|
|
|
NTSTATUS Status;
|
|
|
|
PVCB Vcb = NULL;
|
|
|
|
PFILE_OBJECT FileObject;
|
2015-06-01 13:13:18 +00:00
|
|
|
PIO_STACK_LOCATION Stack;
|
2010-08-30 11:51:17 +00:00
|
|
|
|
2015-06-01 14:26:58 +00:00
|
|
|
DPRINT("CdfsDeviceControl()\n");
|
|
|
|
|
2015-06-01 13:13:18 +00:00
|
|
|
ASSERT(IrpContext);
|
2013-05-11 09:24:31 +00:00
|
|
|
|
2015-06-01 13:13:18 +00:00
|
|
|
Irp = IrpContext->Irp;
|
|
|
|
Stack = IrpContext->Stack;
|
2010-08-30 11:51:17 +00:00
|
|
|
FileObject = Stack->FileObject;
|
|
|
|
Irp->IoStatus.Information = 0;
|
|
|
|
|
|
|
|
/* FIXME: HACK, it means that CD has changed */
|
|
|
|
if (!FileObject)
|
|
|
|
{
|
|
|
|
DPRINT1("FIXME: CdfsDeviceControl called without FileObject!\n");
|
|
|
|
return STATUS_INVALID_DEVICE_REQUEST;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Only support such operations on volume */
|
|
|
|
if (!(FileObject->RelatedFileObject == NULL || FileObject->RelatedFileObject->FsContext2 != NULL))
|
|
|
|
{
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (Stack->Parameters.DeviceIoControl.IoControlCode == IOCTL_CDROM_DISK_TYPE)
|
|
|
|
{
|
|
|
|
/* We should handle this one, but we don't! */
|
|
|
|
Status = STATUS_NOT_IMPLEMENTED;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Pass it to storage driver */
|
|
|
|
IoSkipCurrentIrpStackLocation(Irp);
|
|
|
|
Vcb = (PVCB)Stack->DeviceObject->DeviceExtension;
|
2015-06-01 14:26:58 +00:00
|
|
|
|
|
|
|
/* Lower driver will complete - we don't have to */
|
|
|
|
IrpContext->Flags &= ~IRPCONTEXT_COMPLETE;
|
|
|
|
|
2010-08-30 11:51:17 +00:00
|
|
|
Status = IoCallDriver(Vcb->StorageDevice, Irp);
|
|
|
|
}
|
|
|
|
|
|
|
|
return Status;
|
|
|
|
}
|