IoReleaseRemoveLockAndWait and USB filter

I’m experimenting with bus filtering using a lightly-modified version of
the DDK toaster sample. Everything works fine on SCSI and IDE, but on
USB I run into a particular problem: during IRP_MN_REMOVE_DEVICE
handling, IoReleaseRemoveLockAndWait() doesn’t return. It doesn’t
matter whether I follow the toaster sample and Wait() before forwarding
the IRP down the stack, or do the Wait() after as per Walter Oney. My
test machine is running XP-Pro SP1.

Is there something special I have to do on REMOVE_DEVICE for USB, or
does this indicate a problem somewhere else in my filter?

Thanks,

David

It is your remove lock - so you are waiting for the decrement of an
increment you performed on the lock. For debugging purposes you might want
to instrument a trace faciliity of some sort that will give you some clues
about where the missing decrement might be. Pre or post wait aren’t
relevant.

=====================
Mark Roddy DDK MVP
Windows 2003/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of David Lavo
Sent: Tuesday, November 15, 2005 5:50 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] IoReleaseRemoveLockAndWait and USB filter

I’m experimenting with bus filtering using a lightly-modified
version of the DDK toaster sample. Everything works fine on
SCSI and IDE, but on USB I run into a particular problem:
during IRP_MN_REMOVE_DEVICE handling,
IoReleaseRemoveLockAndWait() doesn’t return. It doesn’t
matter whether I follow the toaster sample and Wait() before
forwarding the IRP down the stack, or do the Wait() after as
per Walter Oney. My test machine is running XP-Pro SP1.

Is there something special I have to do on REMOVE_DEVICE for
USB, or does this indicate a problem somewhere else in my filter?

Thanks,

David


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@hollistech.com To unsubscribe send a blank email to
xxxxx@lists.osr.com

Ok,

I’ve instrumented up my acquisition and release of the remove lock in
question, and at the point of IoReleaseRemoveLockAndWait() my count
always indicates I’ve released all my locks. (The count is +1 just
before the call to IoReleaseRemoveLockAndWait().) Is there any useful
information I can get from examining the remove lock structure,
especially IO_REMOVE_LOCK_DBG_BLOCK?

I also note that I can’t reproduce this behavior if I reboot between
installing the filter and unloading it.

Thanks,

David

Mark Roddy wrote:

It is your remove lock - so you are waiting for the decrement of an
increment you performed on the lock. For debugging purposes you might want
to instrument a trace faciliity of some sort that will give you some clues
about where the missing decrement might be. Pre or post wait aren’t
relevant.

=====================
Mark Roddy DDK MVP
Windows 2003/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com

>-----Original Message-----
>From: xxxxx@lists.osr.com
>[mailto:xxxxx@lists.osr.com] On Behalf Of David Lavo
>Sent: Tuesday, November 15, 2005 5:50 AM
>To: Windows System Software Devs Interest List
>Subject: [ntdev] IoReleaseRemoveLockAndWait and USB filter
>
>I’m experimenting with bus filtering using a lightly-modified
>version of the DDK toaster sample. Everything works fine on
>SCSI and IDE, but on USB I run into a particular problem:
>during IRP_MN_REMOVE_DEVICE handling,
>IoReleaseRemoveLockAndWait() doesn’t return. It doesn’t
>matter whether I follow the toaster sample and Wait() before
>forwarding the IRP down the stack, or do the Wait() after as
>per Walter Oney. My test machine is running XP-Pro SP1.
>
>Is there something special I have to do on REMOVE_DEVICE for
>USB, or does this indicate a problem somewhere else in my filter?
>
>Thanks,
>
>David
>
>—
>Questions? First check the Kernel Driver FAQ at
>http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as:
>xxxxx@hollistech.com To unsubscribe send a blank email to
>xxxxx@lists.osr.com
>

David,

Because I had a similar need, I’ve written a debugger extension to dump this
information. I’m fairly busy right now, but I may be able to clean it up
and release it later this week.

– arlie

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of David Lavo
Sent: Monday, November 21, 2005 9:52 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] IoReleaseRemoveLockAndWait and USB filter

Ok,

I’ve instrumented up my acquisition and release of the remove lock in
question, and at the point of IoReleaseRemoveLockAndWait() my count always
indicates I’ve released all my locks. (The count is +1 just before the call
to IoReleaseRemoveLockAndWait().) Is there any useful information I can get
from examining the remove lock structure, especially
IO_REMOVE_LOCK_DBG_BLOCK?

I also note that I can’t reproduce this behavior if I reboot between
installing the filter and unloading it.

Thanks,

David

This is exactly what

!remlock 1

Is for

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Arlie Davis
Sent: Monday, November 21, 2005 7:13 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] IoReleaseRemoveLockAndWait and USB filter

David,

Because I had a similar need, I’ve written a debugger extension to dump
this
information. I’m fairly busy right now, but I may be able to clean it
up
and release it later this week.

– arlie

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of David Lavo
Sent: Monday, November 21, 2005 9:52 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] IoReleaseRemoveLockAndWait and USB filter

Ok,

I’ve instrumented up my acquisition and release of the remove lock in
question, and at the point of IoReleaseRemoveLockAndWait() my count
always
indicates I’ve released all my locks. (The count is +1 just before the
call
to IoReleaseRemoveLockAndWait().) Is there any useful information I can
get
from examining the remove lock structure, especially
IO_REMOVE_LOCK_DBG_BLOCK?

I also note that I can’t reproduce this behavior if I reboot between
installing the filter and unloading it.

Thanks,

David


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

It doesn’t work. We have already had this conversation, and you said you
would look into getting this fixed. I would love for it to work. But for
those of us without private MS symbols, it simply doesn’t work.

kd> !remlock 86040ba8 1
Dump Remove Lock: ffffffff86040ba8 1 as Checked
Could not read memLock extension

– arlie

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Monday, November 21, 2005 11:55 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] IoReleaseRemoveLockAndWait and USB filter

This is exactly what

!remlock 1

Is for

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Arlie Davis
Sent: Monday, November 21, 2005 7:13 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] IoReleaseRemoveLockAndWait and USB filter

David,

Because I had a similar need, I’ve written a debugger extension to dump this
information. I’m fairly busy right now, but I may be able to clean it up
and release it later this week.

– arlie

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of David Lavo
Sent: Monday, November 21, 2005 9:52 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] IoReleaseRemoveLockAndWait and USB filter

Ok,

I’ve instrumented up my acquisition and release of the remove lock in
question, and at the point of IoReleaseRemoveLockAndWait() my count always
indicates I’ve released all my locks. (The count is +1 just before the call
to IoReleaseRemoveLockAndWait().) Is there any useful information I can get
from examining the remove lock structure, especially
IO_REMOVE_LOCK_DBG_BLOCK?

I also note that I can’t reproduce this behavior if I reboot between
installing the filter and unloading it.

Thanks,

David


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@microsoft.com To
unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com