It’s certainly possible.
In your MainDispatch routine, you MUST return STATUS_PENDING regardless what
IoCallDriver returned, if you intend to change the IRP final completion
status.
NTSTATUS
MainDispatch(pDevObj,Irp)
{
// do whatever needed
IoCopyCurrentIrpStackLocationToNext(Irp);
IoSetCompletionRoutine(Irp,CompRoutine,Context,…);
IoMarkIrpPending(Irp);
IoCallDriver(nextLower,Irp);
return STATUS_PENDING;
}
NTSTATUS
CompRoutine(…)
{
Irp->IoStatus.Status = STATUS_Xxx
return STATUS_CONTINUE_COMPLETION;
}
NOTE: ‘…’ in this context doesn’t mean variable arguments.
HTH,
Calvin Guan Software Engineer
ATI Technologies Inc. www.ati.com
-----Original Message-----
From: Vladislav Goncharov [mailto:xxxxx@unshadow.net]
Sent: November 11, 2004 11:13 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Blocking the request in filter driver’s completion
(post-filtering) [Impossible?]
Hello!
I want to filter request in completion routine of the filter driver (for
example read request: I’ve got data to filter only in completion).
If I want to deny this request with some error status in my completion I do:
// …
Irp->IoStatus.Status = STATUS_UNSUCCESFUL; // or some specific status
Irp->IoStatus.Information = 0;
return STATUS_SUCCESS;
}
But the driver verifier tolds:
“And IRP dispatch handler has returned a status that is inconsistent with
Irp’s IoStatus.Status field.”
That’s because DeviceDispatch returned STATUS_SUCCESS (it doesn’t know about
completions and post-filtering) but Irp->IoStatus.Status = ERROR.
I can’t change return value of DeviceDispatch routine. Is it means it’s
impossible to implement such technique in filter drivers?
Vlad
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@ati.com
To unsubscribe send a blank email to xxxxx@lists.osr.com