Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Completion Routine called several times !!!!

23 views
Skip to first unread message

E. Kuntzel

unread,
Jul 10, 2001, 7:46:22 AM7/10/01
to

Hi All,

I wrote a USB driver that does the following to send/receive packets on
the USB :

(1) I allocate an IRP using IoAllocateIrp
(2) I set the completion routine using IoSetCompletionRoutine
(3) Call IoCallDriver to transmit the IRP to the USBD.sys driver
(Microsoft USB host controller driver)
(4) Then I do a WaitForSingleObject on an Event that will be set by the
completion routine when the IRP will have been processed by the
USBD.sys.
(5) When the event is signalled, WaitForSingleObject returns and I clean
the IRP by doing a IoFreeIrp.

Then here is what happens once in a while : The Completion Routines gets
called several times in a raw by Windows for the very *same* IRP !!!!

Is this a normal behavior ? What should I do to tell Windows that the
IRP is complete and it's no use calling the Completion Routine anymore ?

Any help is welcome !!!
ThanX !

Etienne

Mark Roddy

unread,
Jul 10, 2001, 8:10:49 AM7/10/01
to
Your completion routine will get called only as a result of some
kernel entity calling IoCompleteRequest specifying an IRP that has
your completion handler set. Once your completion handler runs it is
'erased' from the IRP. If your IRP is really getting completed many
times, and if you are not in fact re-using the same IRP, that is if
the IRP in question is being multiply completed, the system generally
bugchecks. I think you have misinterpreted the data you are looking
at, but I really have no theory of what you have misinterpreted.

I don't suppose you are assuming that each call to IoAllocateIrp
produces a new and different IRP value? For example if you call
IoAllocateIrp, IoFreeIrp, and IoAllocateIrp again, it is very likely,
especially on an otherwise idle system, that you will get the same
value for PIRP from each call to IoAllocateIrp.

On Tue, 10 Jul 2001 11:46:22 GMT, "E. Kuntzel" <ekun...@free.fr>
wrote:

=
Mark Roddy
WindowsNT Windows2000 Consultant
Hollis Technology Solutions
http://www.hollistech.com
ma...@hollistech.com
603-321 1032


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----

0 new messages