[FASTFAT]
[reactos.git] / reactos / drivers / filesystems / fastfat / misc.c
index 1435ae5..ddd547f 100644 (file)
@@ -9,9 +9,11 @@
 
 /* INCLUDES *****************************************************************/
 
-#define NDEBUG
 #include "vfat.h"
 
+#define NDEBUG
+#include <debug.h>
+
 /* GLOBALS ******************************************************************/
 
 const char* MajorFunctionNames[] =
@@ -91,6 +93,16 @@ Fail:
     return Status;
 }
 
+static
+NTSTATUS
+VfatDeviceControl(
+    IN PVFAT_IRP_CONTEXT IrpContext)
+{
+    IoSkipCurrentIrpStackLocation(IrpContext->Irp);
+
+    return IoCallDriver(IrpContext->DeviceExt->StorageDevice, IrpContext->Irp);
+}
+
 static
 NTSTATUS
 VfatDispatchRequest(
@@ -125,6 +137,8 @@ VfatDispatchRequest(
             return VfatSetVolumeInformation(IrpContext);
         case IRP_MJ_LOCK_CONTROL:
             return VfatLockControl(IrpContext);
+        case IRP_MJ_DEVICE_CONTROL:
+            return VfatDeviceControl(IrpContext);
         case IRP_MJ_CLEANUP:
             return VfatCleanup(IrpContext);
         case IRP_MJ_FLUSH_BUFFERS:
@@ -159,12 +173,12 @@ VfatBuildRequest(
     {
         Status = STATUS_INSUFFICIENT_RESOURCES;
         Irp->IoStatus.Status = Status;
-        IoCompleteRequest (Irp, IO_NO_INCREMENT);
+        IoCompleteRequest(Irp, IO_NO_INCREMENT);
     }
     else
     {
         FsRtlEnterFileSystem();
-        Status = VfatDispatchRequest (IrpContext);
+        Status = VfatDispatchRequest(IrpContext);
         FsRtlExitFileSystem();
     }
     return Status;
@@ -298,4 +312,3 @@ VfatLockUserBuffer(
 
     return STATUS_SUCCESS;
 }
-