What is the DeviceObject in MyCompletionRoutine?
Is DeviceObject the DeviceObject in MyDispatchRead?
Or devExt->LowerDriver?
MyDispatchRead(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
PIO_STACK_LOCATION ioStack;
PYOUR_DEV_EXT devExt;
devExt = DeviceObject->DeviceExtension;
IoCopyCurrentIrpStackLocationToNext(Irp);
IoSetCompletionRoutine(Irp, MyCompletionRoutine, NULL, TRUE, TRUE,
TRUE);
return(IoCallDriver(devExt->LowerDriver, Irp));
}
MyCompletionRoutine(PDEVICE_OBJECT DeviceObject, PIRP Irp,PVOID Context)
{
…
}
It is your DEVICE_OBJECT (which you receive in dispatch routine). But I
heard that there was a bug when you could get invalid DEVICE_OBJECT. See
chapter 12 in R.Nagars’s book for details. Never had problem with it anyway.
-htfv
----- Original Message -----
From: “Eric Chan”
To: “File Systems Developers”
Sent: Saturday, August 10, 2002 12:05 PM
Subject: [ntfsd] DeviceObject in a completion routine
> What is the DeviceObject in MyCompletionRoutine?
>
> Is DeviceObject the DeviceObject in MyDispatchRead?
> Or devExt->LowerDriver?
>
> MyDispatchRead(PDEVICE_OBJECT DeviceObject, PIRP Irp)
> {
> PIO_STACK_LOCATION ioStack;
> PYOUR_DEV_EXT devExt;
>
> devExt = DeviceObject->DeviceExtension;
>
> IoCopyCurrentIrpStackLocationToNext(Irp);
> IoSetCompletionRoutine(Irp, MyCompletionRoutine, NULL, TRUE, TRUE,
> TRUE);
> return(IoCallDriver(devExt->LowerDriver, Irp));
> }
>
> MyCompletionRoutine(PDEVICE_OBJECT DeviceObject, PIRP Irp,PVOID Context)
> {
> …
> }
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@vba.com.by
> To unsubscribe send a blank email to %%email.unsub%%
>