skipping lower device

hey, is it possible ? I want in certain cases to call the device under the lower device I have stored in my DeviceExtension, obtaining the said device object is possible using IoGetLowerDeviceObject , but what are the things I need to ensure for this to work ? will the fact the I/O manager allocates stack locations based on the actual number of devices be a problem ? maybe copying params to the target stack location? the device I intend to skip is not critical to the os, it’s some 3rd party filter

why not just uninstall it?

No one cares if some of the stack locations go unused. They aren’t assigned individually – they’re just there if needed.

However, you risk invalidating whatever state information that driver might be maintaining. Also, how will you know you need to do this? You can’t assume that every system is like the one you happen to be using. What if there are other filters, or another order?

> @Tim_Roberts said: > No one cares if some of the stack locations go unused. They aren’t assigned individually – they’re just there if needed. > > However, you risk invalidating whatever state information that driver might be maintaining. Also, how will you know you need to do this? You can’t assume that every system is like the one you happen to be using. What if there are other filters, or another order? aren’t stack locations unwinded and freed one by one? so, if I skip a device in this manner by simply calling the one below it wont the last stack location leak? and I validate the said device by name

aren’t stack locations unwinded and freed one by one?

Yes, but “freed” isn’t quite right…

so, if I skip a device in this manner by simply calling the one below it wont the last stack location leak?

No. The flex portion of the IRP and the I/O stack are all allocated contiguously. So… no leak.

1 Like

There is something odd about this request. While you certainly can do this, why bother? If you know that you need to do this, and have the authority to do it in a legitimate way, then you can simply uninstall the filter you want to bypass. Even if you don’t remove it completely, you can adjust the bindings - a few registry changes and you are done. Why bother writing any code?

If you want to sometimes bypass the filter, then you better understand how it works very well. Probably you will need the source code for it to understand it well enough. And if you have that, you can probably fix whatever problem you are trying to work around.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.