2009-01-12 17:04:13 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS FAT file system driver
|
2009-10-20 10:12:49 +00:00
|
|
|
* LICENSE: GNU GPLv3 as published by the Free Software Foundation
|
2009-01-12 17:04:13 +00:00
|
|
|
* FILE: drivers/filesystems/fastfat/device.c
|
|
|
|
* PURPOSE: Device control
|
|
|
|
* PROGRAMMERS: Aleksey Bragin (aleksey@reactos.org)
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* INCLUDES *****************************************************************/
|
|
|
|
|
|
|
|
#define NDEBUG
|
|
|
|
#include "fastfat.h"
|
|
|
|
|
|
|
|
/* FUNCTIONS ****************************************************************/
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
FatDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
|
|
|
{
|
2009-01-14 10:42:56 +00:00
|
|
|
DPRINT1("FatDeviceControl()\n");
|
2009-01-12 17:04:13 +00:00
|
|
|
return STATUS_NOT_IMPLEMENTED;
|
|
|
|
}
|
|
|
|
|
2009-01-22 17:25:28 +00:00
|
|
|
NTSTATUS
|
|
|
|
FatPerformDevIoCtrl(PDEVICE_OBJECT DeviceObject,
|
2009-01-23 09:28:03 +00:00
|
|
|
ULONG ControlCode,
|
|
|
|
PVOID InputBuffer,
|
|
|
|
ULONG InputBufferSize,
|
|
|
|
PVOID OutputBuffer,
|
|
|
|
ULONG OutputBufferSize,
|
|
|
|
BOOLEAN Override)
|
2009-01-22 17:25:28 +00:00
|
|
|
{
|
|
|
|
PIRP Irp;
|
|
|
|
KEVENT Event;
|
|
|
|
NTSTATUS Status;
|
|
|
|
PIO_STACK_LOCATION Stack;
|
|
|
|
IO_STATUS_BLOCK IoStatus;
|
|
|
|
|
2009-01-23 09:28:03 +00:00
|
|
|
/* Initialize the event for waiting */
|
2009-01-22 17:25:28 +00:00
|
|
|
KeInitializeEvent(&Event, NotificationEvent, FALSE);
|
|
|
|
|
2009-01-23 09:28:03 +00:00
|
|
|
/* Build the device I/O control request */
|
2009-01-22 17:25:28 +00:00
|
|
|
Irp = IoBuildDeviceIoControlRequest(ControlCode,
|
2009-01-23 09:28:03 +00:00
|
|
|
DeviceObject,
|
|
|
|
InputBuffer,
|
|
|
|
InputBufferSize,
|
|
|
|
OutputBuffer,
|
|
|
|
OutputBufferSize,
|
|
|
|
FALSE,
|
|
|
|
&Event,
|
|
|
|
&IoStatus);
|
2009-01-22 17:25:28 +00:00
|
|
|
|
2009-01-23 09:28:03 +00:00
|
|
|
/* Fail if IRP hasn't been allocated */
|
|
|
|
if (!Irp) return STATUS_INSUFFICIENT_RESOURCES;
|
|
|
|
|
|
|
|
/* Set verify override flag if requested */
|
2009-01-22 17:25:28 +00:00
|
|
|
if (Override)
|
|
|
|
{
|
|
|
|
Stack = IoGetNextIrpStackLocation(Irp);
|
|
|
|
Stack->Flags |= SL_OVERRIDE_VERIFY_VOLUME;
|
|
|
|
}
|
|
|
|
|
2009-01-23 09:28:03 +00:00
|
|
|
/* Call the driver */
|
2009-01-22 17:25:28 +00:00
|
|
|
Status = IoCallDriver(DeviceObject, Irp);
|
2009-01-23 09:28:03 +00:00
|
|
|
|
|
|
|
/* Wait if needed */
|
2009-01-22 17:25:28 +00:00
|
|
|
if (Status == STATUS_PENDING)
|
|
|
|
{
|
2009-01-23 09:28:03 +00:00
|
|
|
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
|
2009-01-22 17:25:28 +00:00
|
|
|
Status = IoStatus.Status;
|
|
|
|
}
|
|
|
|
|
|
|
|
return Status;
|
|
|
|
}
|
|
|
|
|
2009-01-12 17:04:13 +00:00
|
|
|
/* EOF */
|