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
Have you tried returning “STATUS_UNSUCCESSFUL” or something similar from
your function where you refuse the IRP? I think that’s how you’re supposed
to do it, but I’m not an expert…
–
Mats
-------- Notice --------
The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this
message by anyone else is unauthorized. If you are not the intended
recipient, any disclosure, copying or distribution of the message, or any
action taken by you in reliance on it, is prohibited and may be unlawful.
If you have received this message in error, please delete it and contact
the sender immediately. Thank you.
xxxxx@lists.osr.com wrote on 11/11/2004 04:12:39 PM:
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@3dlabs.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
ForwardSourceID:NT0000728E
Why do you not wish to easily reject the request in dispatch?
“Vladislav Goncharov” wrote in message
news:xxxxx@ntdev…
> 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
>
>
The status your dispatch routine returns must either be STATUS_PENDING
or the same status as comes back from the completion routine. You may
want to consider always returning STATUS_PENDING from your dispatch
routine (assuming that’s legal in your stack) if you’re going to
transmute the status returned by the lower driver.
Or you can detect if the dispatch call is still active (ie. The lower
driver called IoCompleteRequest in its dispatch routine) & hand the
completion of the IRP over to the dispatch routine (with an appropriate
status) in that case. I wouldn’t bother doing this unless you know
you’re in a stack that can’t handle asynch completion (and in that case
you can always hand control back to your dispatch routine.)
-p
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
Vladislav Goncharov
Sent: Thursday, November 11, 2004 8: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@windows.microsoft.com To unsubscribe send a blank
email to xxxxx@lists.osr.com