FastIoQueryOpen: which is right approach

snippet from Filemon:

currIrpStack = IoGetCurrentIrpStackLocation(Irp);
nextIrpStack = IoGetNextIrpStackLocation(Irp);
*nextIrpStack = *currIrpStack;
nextIrpStack->DeviceObject = DevExt->NextDeviceObject;
IoSetNextIrpStackLocation( Irp );
FastIoDispatch->FastIoQueryOpen(…);
Irp->CurrentLocation++;
Irp->Tail.Overlay.CurrentStackLocation++;

snippet from sfilter:

currIrpStack = IoGetCurrentIrpStackLocation( Irp )
currIrpStack->DeviceObject = nextDeviceObject;
FastIoDispatch->FastIoQueryOpen(…);
irpSp->DeviceObject = DeviceObject;

which strategy to follow?

> *nextIrpStack = *currIrpStack;

This is a potential crash, more so, the crash any time you will not set the
completion routine or use this IRP for some non-trivial things like the Filemon
does.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com