[ros-diffs] [fireball] 39028: - Bring FatPerformDevIoCtrl to our coding standards (tabs->spaces, comments). - Change WaitReason to Executive ("A driver should set this value to Executive, ..." (c) WDK)

fireball at svn.reactos.org fireball at svn.reactos.org
Fri Jan 23 10:28:04 CET 2009


Author: fireball
Date: Fri Jan 23 03:28:03 2009
New Revision: 39028

URL: http://svn.reactos.org/svn/reactos?rev=39028&view=rev
Log:
- Bring FatPerformDevIoCtrl to our coding standards (tabs->spaces, comments).
- Change WaitReason to Executive ("A driver should set this value to Executive, ..." (c) WDK)

Modified:
    trunk/reactos/drivers/filesystems/fastfat_new/device.c
    trunk/reactos/drivers/filesystems/fastfat_new/fastfat.h

Modified: trunk/reactos/drivers/filesystems/fastfat_new/device.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfat_new/device.c?rev=39028&r1=39027&r2=39028&view=diff
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat_new/device.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat_new/device.c [iso-8859-1] Fri Jan 23 03:28:03 2009
@@ -23,12 +23,12 @@
 
 NTSTATUS
 FatPerformDevIoCtrl(PDEVICE_OBJECT DeviceObject,
-		            ULONG ControlCode,
-		            PVOID InputBuffer,
-		            ULONG InputBufferSize,
-		            PVOID OutputBuffer,
-		            ULONG OutputBufferSize,
-		            BOOLEAN Override)
+                    ULONG ControlCode,
+                    PVOID InputBuffer,
+                    ULONG InputBufferSize,
+                    PVOID OutputBuffer,
+                    ULONG OutputBufferSize,
+                    BOOLEAN Override)
 {
     PIRP Irp;
     KEVENT Event;
@@ -36,32 +36,37 @@
     PIO_STACK_LOCATION Stack;
     IO_STATUS_BLOCK IoStatus;
 
+    /* Initialize the event for waiting */
     KeInitializeEvent(&Event, NotificationEvent, FALSE);
 
+    /* Build the device I/O control request */
     Irp = IoBuildDeviceIoControlRequest(ControlCode,
-				                        DeviceObject,
-				                        InputBuffer,
-				                        InputBufferSize,
-				                        OutputBuffer,
-				                        OutputBufferSize,
-				                        FALSE,
-				                        &Event,
-				                        &IoStatus);
-    if (Irp == NULL)
-    {
-        return STATUS_INSUFFICIENT_RESOURCES;
-    }
+                                        DeviceObject,
+                                        InputBuffer,
+                                        InputBufferSize,
+                                        OutputBuffer,
+                                        OutputBufferSize,
+                                        FALSE,
+                                        &Event,
+                                        &IoStatus);
 
+    /* Fail if IRP hasn't been allocated */
+    if (!Irp) return STATUS_INSUFFICIENT_RESOURCES;
+
+    /* Set verify override flag if requested */
     if (Override)
     {
         Stack = IoGetNextIrpStackLocation(Irp);
         Stack->Flags |= SL_OVERRIDE_VERIFY_VOLUME;
     }
 
+    /* Call the driver */
     Status = IoCallDriver(DeviceObject, Irp);
+
+    /* Wait if needed */
     if (Status == STATUS_PENDING)
     {
-        KeWaitForSingleObject(&Event, Suspended, KernelMode, FALSE, NULL);
+        KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
         Status = IoStatus.Status;
     }
 

Modified: trunk/reactos/drivers/filesystems/fastfat_new/fastfat.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfat_new/fastfat.h?rev=39028&r1=39027&r2=39028&view=diff
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat_new/fastfat.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat_new/fastfat.h [iso-8859-1] Fri Jan 23 03:28:03 2009
@@ -344,12 +344,12 @@
 
 NTSTATUS
 FatPerformDevIoCtrl(PDEVICE_OBJECT DeviceObject,
-		            ULONG ControlCode,
-		            PVOID InputBuffer,
-		            ULONG InputBufferSize,
-		            PVOID OutputBuffer,
-		            ULONG OutputBufferSize,
-		            BOOLEAN Override);
+                    ULONG ControlCode,
+                    PVOID InputBuffer,
+                    ULONG InputBufferSize,
+                    PVOID OutputBuffer,
+                    ULONG OutputBufferSize,
+                    BOOLEAN Override);
 
 /*  ------------------------------------------------------  direntry.c  */
 



More information about the Ros-diffs mailing list