Hi all,
I am developing a class upper filter for webcam devices. It has to
wait for a event in read stream completion routine. I used
KsWaitForSingleObject() to wait and set time out is 0.1s.

However, I found that the read stream completion routine function is
called with DISPATCH_LEVEL in UVC device, and in PASSIVE_LEVEL in non-
UVC device. This results BSOD when calling KsWaitForSingleObject()
with UVC device.

So my question is: how can I wait for a event in filter driver for UVC
driver? What results the IRP level different?

Re: Wait problem in UVC filter driver by Doron

Doron
Fri Jul 13 17:43:46 CDT 2007

the IRQL that a completion routine runs at is defined at <=dispatch_level.
you have to assume you will be running at dispatch_level. instead of a
hardcoded wait, save your state and the irp and return
STATUS_MORE_PROCESSING_REQUIRED from the completion routine. when the read
stream completes grab the saved irp and complete it.

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


<yijia2202@gmail.com> wrote in message
news:1184318149.777404.257660@g37g2000prf.googlegroups.com...
> Hi all,
> I am developing a class upper filter for webcam devices. It has to
> wait for a event in read stream completion routine. I used
> KsWaitForSingleObject() to wait and set time out is 0.1s.
>
> However, I found that the read stream completion routine function is
> called with DISPATCH_LEVEL in UVC device, and in PASSIVE_LEVEL in non-
> UVC device. This results BSOD when calling KsWaitForSingleObject()
> with UVC device.
>
> So my question is: how can I wait for a event in filter driver for UVC
> driver? What results the IRP level different?
>


Re: Wait problem in UVC filter driver by Jia

Jia
Mon Jul 16 03:18:37 CDT 2007

Thanks for replay. But I am still not very sure how to save IRP, and
grab the saved irp and complete it.
I only saved the IRP address in device extension, but it seems changed
when I use it.
For more, can I call IoCompleteRequest( ) to complete it? It seems
have been call by lower driver, is it safe to call again?


Re: Wait problem in UVC filter driver by Doron

Doron
Thu Jul 19 00:27:15 CDT 2007

yes, you can call IoCompleteRequest on an irp returned to you in the
completion routine if you return STATUS_MORE_PROCESSING_REQUIRED from the
completion routine. you may have more then one read pending in the stack
which is why you have the field in your device extension overwritten. you
also may not be using the correct synchronization around the field to
maintain correctness.

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Jia" <yijia2202@gmail.com> wrote in message
news:1184573917.813753.258990@g12g2000prg.googlegroups.com...
> Thanks for replay. But I am still not very sure how to save IRP, and
> grab the saved irp and complete it.
> I only saved the IRP address in device extension, but it seems changed
> when I use it.
> For more, can I call IoCompleteRequest( ) to complete it? It seems
> have been call by lower driver, is it safe to call again?
>