Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygendevice.c
Go to the documentation of this file.
00001 /* 00002 * PROJECT: ReactOS FAT file system driver 00003 * LICENSE: GNU GPLv3 as published by the Free Software Foundation 00004 * FILE: drivers/filesystems/fastfat/device.c 00005 * PURPOSE: Device control 00006 * PROGRAMMERS: Aleksey Bragin (aleksey@reactos.org) 00007 */ 00008 00009 /* INCLUDES *****************************************************************/ 00010 00011 #define NDEBUG 00012 #include "fastfat.h" 00013 00014 /* FUNCTIONS ****************************************************************/ 00015 00016 NTSTATUS 00017 NTAPI 00018 FatDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) 00019 { 00020 DPRINT1("FatDeviceControl()\n"); 00021 return STATUS_NOT_IMPLEMENTED; 00022 } 00023 00024 NTSTATUS 00025 FatPerformDevIoCtrl(PDEVICE_OBJECT DeviceObject, 00026 ULONG ControlCode, 00027 PVOID InputBuffer, 00028 ULONG InputBufferSize, 00029 PVOID OutputBuffer, 00030 ULONG OutputBufferSize, 00031 BOOLEAN Override) 00032 { 00033 PIRP Irp; 00034 KEVENT Event; 00035 NTSTATUS Status; 00036 PIO_STACK_LOCATION Stack; 00037 IO_STATUS_BLOCK IoStatus; 00038 00039 /* Initialize the event for waiting */ 00040 KeInitializeEvent(&Event, NotificationEvent, FALSE); 00041 00042 /* Build the device I/O control request */ 00043 Irp = IoBuildDeviceIoControlRequest(ControlCode, 00044 DeviceObject, 00045 InputBuffer, 00046 InputBufferSize, 00047 OutputBuffer, 00048 OutputBufferSize, 00049 FALSE, 00050 &Event, 00051 &IoStatus); 00052 00053 /* Fail if IRP hasn't been allocated */ 00054 if (!Irp) return STATUS_INSUFFICIENT_RESOURCES; 00055 00056 /* Set verify override flag if requested */ 00057 if (Override) 00058 { 00059 Stack = IoGetNextIrpStackLocation(Irp); 00060 Stack->Flags |= SL_OVERRIDE_VERIFY_VOLUME; 00061 } 00062 00063 /* Call the driver */ 00064 Status = IoCallDriver(DeviceObject, Irp); 00065 00066 /* Wait if needed */ 00067 if (Status == STATUS_PENDING) 00068 { 00069 KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); 00070 Status = IoStatus.Status; 00071 } 00072 00073 return Status; 00074 } 00075 00076 /* EOF */ Generated on Sun May 27 2012 04:21:21 for ReactOS by
1.7.6.1
|