#ifndef _INCLUDE_DDK_IOFUNCS_H
#define _INCLUDE_DDK_IOFUNCS_H
-/* $Id: iofuncs.h,v 1.45 2004/10/22 20:51:44 ekohl Exp $ */
+/* $Id: iofuncs.h,v 1.46 2004/10/31 22:21:41 ion Exp $ */
#ifdef __NTOSKRNL__
extern POBJECT_TYPE EXPORTED IoAdapterObjectType;
USHORT
IoSizeOfIrp (CCHAR StackSize)
*/
-#define IoSizeOfIrp(StackSize) \
- ((USHORT)(sizeof(IRP)+(((StackSize)-1)*sizeof(IO_STACK_LOCATION))))
-
-/* original macro */
-/*
#define IoSizeOfIrp(StackSize) \
((USHORT)(sizeof(IRP)+((StackSize)*sizeof(IO_STACK_LOCATION))))
-*/
/*
* FUNCTION: Dequeues the next IRP from the device's associated queue and
InitializeListHead(&Irp->ThreadListEntry);
}
- IoStack = &Irp->Stack[(ULONG)Irp->CurrentLocation];
+ DPRINT("Tail Value %x, Irp Value %x\n", Irp->Tail.Overlay.CurrentStackLocation - (PIO_STACK_LOCATION)(Irp+1), Irp->CurrentLocation);
+ by
DeviceObject = IoStack->DeviceObject;
DPRINT("IoSecondStageCompletion(Irp %x, PriorityBoost %d)\n", Irp, PriorityBoost);
-/* $Id: irp.c,v 1.68 2004/10/22 20:25:53 ekohl Exp $
+/* $Id: irp.c,v 1.69 2004/10/31 22:21:41 ion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
{
ASSERT(Irp != NULL);
+ DPRINT("IoInitializeIrp(StackSize %x, Irp %x)\n",StackSize, Irp);
memset(Irp, 0, PacketSize);
Irp->Size = PacketSize;
Irp->StackCount = StackSize;
Irp->CurrentLocation = StackSize;
InitializeListHead(&Irp->ThreadListEntry);
- Irp->Tail.Overlay.CurrentStackLocation = &Irp->Stack[(ULONG)StackSize];
+ Irp->Tail.Overlay.CurrentStackLocation = (PIO_STACK_LOCATION)(Irp + 1) + StackSize;
+ DPRINT("Irp->Tail.Overlay.CurrentStackLocation %x\n", Irp->Tail.Overlay.CurrentStackLocation);
Irp->ApcEnvironment = KeGetCurrentThread()->ApcStateIndex;
}
PDEVICE_OBJECT DeviceObject;
KIRQL oldIrql;
PMDL Mdl;
+ PIO_STACK_LOCATION Stack = (PIO_STACK_LOCATION)(Irp + 1);
DPRINT("IoCompleteRequest(Irp %x, PriorityBoost %d) Event %x THread %x\n",
Irp,PriorityBoost, Irp->UserEvent, PsGetCurrentThread());
DeviceObject = NULL;
}
- if (Irp->Stack[i].CompletionRoutine != NULL &&
- ((NT_SUCCESS(Irp->IoStatus.Status) && (Irp->Stack[i].Control & SL_INVOKE_ON_SUCCESS)) ||
- (!NT_SUCCESS(Irp->IoStatus.Status) && (Irp->Stack[i].Control & SL_INVOKE_ON_ERROR)) ||
- (Irp->Cancel && (Irp->Stack[i].Control & SL_INVOKE_ON_CANCEL))))
+ if (Stack[i].CompletionRoutine != NULL &&
+ ((NT_SUCCESS(Irp->IoStatus.Status) && (Stack[i].Control & SL_INVOKE_ON_SUCCESS)) ||
+ (!NT_SUCCESS(Irp->IoStatus.Status) && (Stack[i].Control & SL_INVOKE_ON_ERROR)) ||
+ (Irp->Cancel && (Stack[i].Control & SL_INVOKE_ON_CANCEL))))
{
- Status = Irp->Stack[i].CompletionRoutine(DeviceObject,
+ Status = Stack[i].CompletionRoutine(DeviceObject,
Irp,
- Irp->Stack[i].Context);
+ Stack[i].Context);
if (Status == STATUS_MORE_PROCESSING_REQUIRED)
{