Re: when does a PDO become a PDO ?

From: Mark Roddy (markr_at_hollistech.com)
Date: 08/10/04


Date: Mon, 9 Aug 2004 20:54:24 -0400

Like I said, and as you are now also hearing from other quarters: you have
designed yourself into a corner. If the stack cannot be stopped then you
cannot reliably insert or remove a filter. Those are the current
constraints. Stopping or rebooting is currently the only reliable solution.

-- 
=====================
Mark Roddy
Windows 2003/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com
markr@hollistech.com
"shahar" <shahar@discussions.microsoft.com> wrote in message 
news:A8FBCF0A-43D4-4804-9946-5CC373BEC9C5@microsoft.com...
>I don't want to stop the device from the same reason I don't want to force 
>a
> reboot:
> My product installation must not disturb the user in any way.
>
> What is wrong with attaching to the top of a started device stack ?
>
> "Eliyas Yakub [MSFT]" wrote:
>
>> >Are you saying that there is no safe way to install a bus filter on a
>> running system ?
>>
>> It depends on whether the device can be stopped (query-removed) at 
>> runtime
>> and restarted. In order to insert the filter, the device stack has to be
>> torn down and rebuilt. If the device cannot be stopped at runtime then 
>> setup
>> the registry and reboot the system so that the filter gets loaded as part 
>> of
>> the bus driver function stack.
>>
>> -- 
>> --
>> -Eliyas
>> This posting is provided "AS IS" with no warranties, and confers no 
>> rights.
>> http://www.microsoft.com/whdc/driver/default.mspx
>> http://www.microsoft.com/whdc/driver/kernel/KB-drv.mspx
>>
>>
>>
>> "shahar" <shahar@discussions.microsoft.com> wrote in message
>> news:69482572-E29E-4B12-84C4-56F83052A524@microsoft.com...
>> > Even if I will find a sollution for attaching to the device stack 
>> > before
>> it
>> > starts I will still have to deal with a scenario where the device stack 
>> > is
>> > already started because this will surely be the case when my product is
>> first
>> > installed on a computer (I do not want to force a restart when my 
>> > product
>> is
>> > installed).
>> >
>> > Are you saying that there is no safe way to install a bus filter on a
>> > running system ?
>> >
>> > "Mark Roddy" wrote:
>> >
>> > > Comments inline.
>> > >
>> > > -- 
>> > >
>> > > =====================
>> > > Mark Roddy
>> > > Windows 2003/XP/2000 Consulting
>> > > Hollis Technology Solutions 603-321-1032
>> > > www.hollistech.com
>> > > markr@hollistech.com
>> > >
>> > >
>> > > "shahar" <shahar@discussions.microsoft.com> wrote in message
>> > > news:92B29FF6-842C-4A8C-A87D-05DCFF733E7D@microsoft.com...
>> > > > My product is attaching to a very specific type of bus. I only 
>> > > > attach
>> to
>> > > > the
>> > > > device stack after I am informed by a pnp notification I registered
>> > > > (IoRegisterPnpNotification) for a device interface that this 
>> > > > specific
>> bus
>> > > > registers.
>> > >
>> > > Like I said, this is the wrong approach. You have designed yourself 
>> > > into
>> a
>> > > corner here.
>> > >
>> > > > Since I will be notified only after the device completes it's
>> > > > IRP_MN_START_DEVICE, it is not possible for me to be there before
>> that,
>> > > > thus
>> > > > I am forced to do things this way.
>> > > >
>> > > > Is there another way to check if the pnp knows about the PDO ?
>> > > >
>> > >
>> > > Not that I know of. Go back and rethink how you are attaching to the 
>> > > bus
>> > > driver FDO.
>> > >
>> > > > "Mark Roddy" wrote:
>> > > >
>> > > >> Attaching to the bus FDO 'long after it started' is a design flaw 
>> > > >> you
>> > > >> ought
>> > > >> to fix. Make your inquiries when you see a start device for the 
>> > > >> PDO
>> in
>> > > >> question, as that will guarantee that the PDO is in fact a PDO.
>> > > >>
>> > > >> I have no idea why Microsoft bugchecks on an invalid PDO rather 
>> > > >> than
>> > > >> returning an error. I suppose it is a gentle warning that you are
>> doing
>> > > >> things the wrong way :-)
>> > > >>
>> > > >> -- 
>> > > >>
>> > > >> =====================
>> > > >> Mark Roddy
>> > > >> Windows 2003/XP/2000 Consulting
>> > > >> Hollis Technology Solutions 603-321-1032
>> > > >> www.hollistech.com
>> > > >> markr@hollistech.com
>> > > >>
>> > > >>
>> > > >> "shahar" <shahar@discussions.microsoft.com> wrote in message
>> > > >> news:65D27172-9DA8-4938-B31D-28E9BFEB5026@microsoft.com...
>> > > >> >I am writing a bus filter and I would like to call functions 
>> > > >> >like:
>> > > >> > IoGetDeviceProperty, IoQueryDevicePnpState and 
>> > > >> > IoRequestDeviceEject
>> > > >> > on pdo's that my filter sees in IRP_MN_QUERY_DEVICE_RELATIONS
>> queries
>> > > >> > that
>> > > >> > are sent to the bus I'm filtering.
>> > > >> > The problem is that I attach to the bus long after it is started
>> and I
>> > > >> > can't
>> > > >> > know if this is the first time that the pdo is reported or if it
>> was
>> > > >> > reported
>> > > >> > a long time ago and maybe even started already.
>> > > >> > Calling any of the functions I mentioned on a PDO that was not
>> reported
>> > > >> > to
>> > > >> > the pnp manager yet will generate a bugcheck.
>> > > >> > My questions is: How can I know if the pnp manager already knows
>> about
>> > > >> > the
>> > > >> > PDO ? when exactly is it alright to call those functions with 
>> > > >> > the
>> pdo ?
>> > > >> > I will also be very glad if someone can explain why do those
>> functions
>> > > >> > bugcheck when using an uninitialized pdo instead of just 
>> > > >> > returning
>> with
>> > > >> > a
>> > > >> > failed status.
>> > > >> >
>> > > >> > Thank you,
>> > > >> > Shahar.
>> > > >>
>> > > >>
>> > > >>
>> > >
>> > >
>> > >
>>
>>
>> 


Relevant Pages

  • Re: when does a PDO become a PDO ?
    ... Even if I will find a sollution for attaching to the device stack before it ... Are you saying that there is no safe way to install a bus filter on a ... >> My product is attaching to a very specific type of bus. ...
    (microsoft.public.development.device.drivers)
  • usb2: kernel panic with an USB floppy drive
    ... 8-current with the old USB stack. ... When I connect the floppy drive to the system with the new USB2 stack, ... <ACPI PCI bus> on pcib0 ... 2 ports with 2 removable, ...
    (freebsd-current)
  • Evil autorun CD - ideas ? downloadable exploits anywhere ?
    ... He would bake a stack of CD's and bring them to a conference. ... collected data to a temporary server that I will install on the network. ... This idea has one big risk - suppose someone takes the CD home. ... would be committing a criminal act if I exploited his home computer. ...
    (Pen-Test)
  • Re: SBMJOB #LIBRARY problem.
    ... You can install it on the machine that does not have a #LIBRARY. ... the library you specified omit the command. ... first entry in the call stack. ... the first entry in the call stack. ...
    (comp.sys.ibm.as400.misc)
  • Re: Cisco VPN corrupts winsock
    ... > wireless card and using Device Manager to remove your NIC adapter. ... > XP should redetect it and reinstall it giving you your IP stack back. ... >> One of our users was told to install the Cisco VPN client. ...
    (microsoft.public.windowsxp.general)