Reverted latest changes.
[reactos.git] / reactos / ntoskrnl / io / irp.c
index 95f3dd7..a67ffd1 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: irp.c,v 1.42 2002/09/07 15:12:53 chorns Exp $
+/* $Id: irp.c,v 1.43 2002/09/08 10:23:25 chorns Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
 
 /* INCLUDES ****************************************************************/
 
-#include <ntoskrnl.h>
+#include <ddk/ntddk.h>
+#include <internal/io.h>
+#include <internal/ps.h>
+#include <internal/pool.h>
 
 #define NDEBUG
 #include <internal/debug.h>
 
-
 /* GLOBALS *******************************************************************/
 
 #define TAG_IRP     TAG('I', 'R', 'P', ' ')
@@ -91,7 +93,7 @@ IoInitializeIrp(PIRP Irp,
   Irp->Size = PacketSize;
   Irp->StackCount = StackSize;
   Irp->CurrentLocation = StackSize;
-  Irp->Tail.Overlay.CurrentStackLocation = IoGetSpecificIrpStackLocation(Irp, StackSize);
+  Irp->Tail.Overlay.CurrentStackLocation = &Irp->Stack[(ULONG)StackSize];
 }
 
 
@@ -125,13 +127,12 @@ IofCallDriver(PDEVICE_OBJECT DeviceObject,
   DPRINT("MajorFunction %d\n", Param->MajorFunction);
   DPRINT("DriverObject->MajorFunction[Param->MajorFunction] %x\n",
         DriverObject->MajorFunction[Param->MajorFunction]);
-  Status = ((PDRIVER_DISPATCH)DriverObject->MajorFunction[Param->MajorFunction])(DeviceObject,
+  Status = DriverObject->MajorFunction[Param->MajorFunction](DeviceObject,
                                                             Irp);
 
   return(Status);
 }
 
-#undef IoCallDriver
 
 NTSTATUS
 STDCALL
@@ -227,18 +228,18 @@ IofCompleteRequest(PIRP Irp,
 
    for (i=Irp->CurrentLocation;i<Irp->StackCount;i++)
    {
-      PIO_STACK_LOCATION IrpSp = IoGetSpecificIrpStackLocation(Irp, i);
-      if (IrpSp->CompletionRoutine != NULL)
+      if (Irp->Stack[i].CompletionRoutine != NULL)
       {
-        Status = IrpSp->CompletionRoutine(IrpSp->DeviceObject,
-                                          Irp,
-                                          IrpSp->Context);
+        Status = Irp->Stack[i].CompletionRoutine(
+                                            Irp->Stack[i].DeviceObject,
+                                            Irp,
+                                            Irp->Stack[i].CompletionContext);
         if (Status == STATUS_MORE_PROCESSING_REQUIRED)
         {
            return;
         }
       }
-      if (IrpSp->Control & SL_PENDING_RETURNED)
+      if (Irp->Stack[i].Control & SL_PENDING_RETURNED)
       {
         Irp->PendingReturned = TRUE;
       }
@@ -273,7 +274,6 @@ IofCompleteRequest(PIRP Irp,
      }
 }
 
-#undef IoCompleteRequest
 
 VOID STDCALL
 IoCompleteRequest(PIRP Irp,