Doubt on UpdateDriverForPlugAndPlayDevices

Hi,
Was a bit confused on the behaviour of UpdateDriverForPlugAndPlayDevices
API. What does it actually do internally ? Does it send a remove to all the
related device objects which would then result in tearing down the whole
stack and then call IoInvalidateDeviceRelations on the related bus driver
which would then use the new driver?

And what in case of bus drivers ? Does the API use QUERY_DEVICE_RELATIONS
with remove relations to find all the related stacks,and then send Remove to
all the top most driver in the stack ?

Thanks in advance
Anees


Life on the fast track! Get hooked to it!
http://server1.msn.co.in/sp04/tataracing/ Meet the champs!

Looks good to me Anees. Of course you get all the inf processing too. Dont
forget after the COMPLETE removal of the previous driver, with the last call
to the previous driver being its Unload routine it loads the new driver
with DriverEntry getting hit on the new driver, etc as you describe. Also
any constallers, class and device get involved too with there normal
filtering in the removal and installation procedure.

In essense you are right on.

Sincerely;
William Michael Jones - P.S.

Question: Why is Bill Gates such a hard man?
Answer: Because he is MicroSoft. 10 to the -6 soft hence alot of hard.
Note:

1 / (1 microsoft) = hard

“anees mannessery” wrote in message
news:xxxxx@ntdev…
> Hi,
> Was a bit confused on the behaviour of UpdateDriverForPlugAndPlayDevices
> API. What does it actually do internally ? Does it send a remove to all
the
> related device objects which would then result in tearing down the whole
> stack and then call IoInvalidateDeviceRelations on the related bus driver
> which would then use the new driver?
>
> And what in case of bus drivers ? Does the API use QUERY_DEVICE_RELATIONS
> with remove relations to find all the related stacks,and then send Remove
to
> all the top most driver in the stack ?
>
> Thanks in advance
> Anees
>
> _________________________________________________________________
> Life on the fast track! Get hooked to it!
> http://server1.msn.co.in/sp04/tataracing/ Meet the champs!
>
>

This API will send a query remove + remove to the device node. If
successful, it will install the new service(s) and restart the device.
If the device node has enumerated children, it sends a query remove +
remove to driver and its entire child tree. If anyone fails the query
remove, you get prompted for a reboot. This is the same behavior you
see when disable a device from device manager.

The device relations are never invalidated b/c the PDO for the device
you are updating is never removed from the system. The OS will send
removal relations, but that is sent every time a device is gracefully
removed from the machine (disable, update driver, uninstall, etc).

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of anees mannessery
Sent: Tuesday, November 23, 2004 6:11 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Doubt on UpdateDriverForPlugAndPlayDevices

Hi,
Was a bit confused on the behaviour of UpdateDriverForPlugAndPlayDevices

API. What does it actually do internally ? Does it send a remove to all
the
related device objects which would then result in tearing down the whole

stack and then call IoInvalidateDeviceRelations on the related bus
driver
which would then use the new driver?

And what in case of bus drivers ? Does the API use
QUERY_DEVICE_RELATIONS
with remove relations to find all the related stacks,and then send
Remove to
all the top most driver in the stack ?

Thanks in advance
Anees


Life on the fast track! Get hooked to it!
http://server1.msn.co.in/sp04/tataracing/ Meet the champs!


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

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

Thanks Jones,
So even if i have multiple devices with same hardware id, it should remove
all the devices first and then load the new driver while enumearting back
the stack. But when i do this in my case, I have multiple devices which i
need to update the driver, when i view thru the device manager it seems that
the devices get updated one by one. At any instance I can see x number of
devices showing the new driver and the remaining still pointing to the old
driver. This was the main reason that i got confused.

Thanks
Anees

From: “Michael Jones”
>Reply-To: “Windows System Software Devs Interest List”
>
>To: “Windows System Software Devs Interest List”
>Subject: Re:[ntdev] Doubt on UpdateDriverForPlugAndPlayDevices
>Date: Tue, 23 Nov 2004 10:44:48 -0500
>
>Looks good to me Anees. Of course you get all the inf processing too.
>Dont
>forget after the COMPLETE removal of the previous driver, with the last
>call
>to the previous driver being its Unload routine it loads the new driver
>with DriverEntry getting hit on the new driver, etc as you describe. Also
>any constallers, class and device get involved too with there normal
>filtering in the removal and installation procedure.
>
>In essense you are right on.
>
>Sincerely;
>William Michael Jones - P.S.
>
>Question: Why is Bill Gates such a hard man?
>Answer: Because he is MicroSoft. 10 to the -6 soft hence alot of hard.
>Note:
>
>1 / (1 microsoft) = hard
>
>
>
>
>“anees mannessery” wrote in message
>news:xxxxx@ntdev…
> > Hi,
> > Was a bit confused on the behaviour of UpdateDriverForPlugAndPlayDevices
> > API. What does it actually do internally ? Does it send a remove to all
>the
> > related device objects which would then result in tearing down the whole
> > stack and then call IoInvalidateDeviceRelations on the related bus
>driver
> > which would then use the new driver?
> >
> > And what in case of bus drivers ? Does the API use
>QUERY_DEVICE_RELATIONS
> > with remove relations to find all the related stacks,and then send
>Remove
>to
> > all the top most driver in the stack ?
> >
> > Thanks in advance
> > Anees
> >
> >
> > Life on the fast track! Get hooked to it!
> > http://server1.msn.co.in/sp04/tataracing/ Meet the champs!
> >
> >
>
>
>
>—
>Questions? First check the Kernel Driver FAQ at
>http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com


NRIs! Easy to send, easy to receive!
http://creative.mediaturf.net/creatives/citibankrca/rca_msntagofline.htm Ask
us how!

Hi All,
Any info on this? I still am a bit confused on the behavior of this API.
From the logs as well as debug messages that i have i see all the devices
with the matching hardwareid getting removed and then rebuilt with the new
driver. After that i see all the device stacks being torn down once more and
build back in a one by one basis. Also as i pointed out in my earlier mail
device manager shows as if the driver is getting updated on a one by one
basis. Any help in this regard would be really appreciated.

Thanks
Anees

From: anees mannessery
Reply To: “Windows System Software Devs Interest List”
To: “Windows System Software Devs Interest List”
Subject: Re:[ntdev] Doubt on UpdateDriverForPlugAndPlayDevices
Sent: Wednesday, November 24, 2004 6:51:24 AM
Thanks Jones,
So even if i have multiple devices with same hardware id, it should remove
all the devices first and then load the new driver while enumearting back
the stack. But when i do this in my case, I have multiple devices which i
need to update the driver, when i view thru the device manager it seems that
the devices get updated one by one. At any instance I can see x number of
devices showing the new driver and the remaining still pointing to the old
driver. This was the main reason that i got confused.

Thanks
Anees

From: “Michael Jones”
Reply-To: “Windows System Software Devs Interest List”
To: “Windows System Software Devs Interest List”
Subject: Re:[ntdev] Doubt on UpdateDriverForPlugAndPlayDevices
Date: Tue, 23 Nov 2004 10:44:48 -0500

Looks good to me Anees. Of course you get all the inf processing too. Dont
forget after the COMPLETE removal of the previous driver, with the last call
to the previous driver being its Unload routine it loads the new driver
with DriverEntry getting hit on the new driver, etc as you describe. Also
any constallers, class and device get involved too with there normal
filtering in the removal and installation procedure.

In essense you are right on.

Sincerely;
William Michael Jones - P.S.

Question: Why is Bill Gates such a hard man?
Answer: Because he is MicroSoft. 10 to the -6 soft hence alot of hard.
Note:

1 / (1 microsoft) = hard

“anees mannessery” wrote in message
news:xxxxx@ntdev…
>Hi, Was a bit confused on the behaviour of
>UpdateDriverForPlugAndPlayDevices API. What does it actually do internally
>? Does it send a remove to all
the
>related device objects which would then result in tearing down the whole
>stack and then call IoInvalidateDeviceRelations on the related bus driver
>which would then use the new driver?
>
>And what in case of bus drivers ? Does the API use QUERY_DEVICE_RELATIONS
>with remove relations to find all the related stacks,and then send Remove
to
>all the top most driver in the stack ?
>
>Thanks in advance Anees
>
> Life on
>the fast track! Get hooked to it! http://server1.msn.co.in/sp04/tataracing/
>Meet the champs!
>
>


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

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


Instant personal loans. Celebrate this season with your family.
http://acm.bridgeovertw.com/hdfc/pl/landingpage/sep04/index.htm?sitecode=611|395
Apply.

What is it that you are confused about? These device stacks are being
rebuilt one by one. Did you expect them to be all torn down at once?

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of anees mannessery
Sent: Wednesday, November 24, 2004 9:47 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Doubt on UpdateDriverForPlugAndPlayDevices

Hi All,
Any info on this? I still am a bit confused on the behavior of this API.

From the logs as well as debug messages that i have i see all the
devices
with the matching hardwareid getting removed and then rebuilt with the
new
driver. After that i see all the device stacks being torn down once more
and
build back in a one by one basis. Also as i pointed out in my earlier
mail
device manager shows as if the driver is getting updated on a one by one

basis. Any help in this regard would be really appreciated.

Thanks
Anees

From: anees mannessery
Reply To: “Windows System Software Devs Interest List”

To: “Windows System Software Devs Interest List”
Subject: Re:[ntdev] Doubt on UpdateDriverForPlugAndPlayDevices
Sent: Wednesday, November 24, 2004 6:51:24 AM
Thanks Jones,
So even if i have multiple devices with same hardware id, it should
remove
all the devices first and then load the new driver while enumearting
back
the stack. But when i do this in my case, I have multiple devices which
i
need to update the driver, when i view thru the device manager it seems
that
the devices get updated one by one. At any instance I can see x number
of
devices showing the new driver and the remaining still pointing to the
old
driver. This was the main reason that i got confused.

Thanks
Anees

From: “Michael Jones”
Reply-To: “Windows System Software Devs Interest List”

To: “Windows System Software Devs Interest List”
Subject: Re:[ntdev] Doubt on UpdateDriverForPlugAndPlayDevices
Date: Tue, 23 Nov 2004 10:44:48 -0500

Looks good to me Anees. Of course you get all the inf processing too.
Dont
forget after the COMPLETE removal of the previous driver, with the last
call
to the previous driver being its Unload routine it loads the new driver
with DriverEntry getting hit on the new driver, etc as you describe.
Also
any constallers, class and device get involved too with there normal
filtering in the removal and installation procedure.

In essense you are right on.

Sincerely;
William Michael Jones - P.S.

Question: Why is Bill Gates such a hard man?
Answer: Because he is MicroSoft. 10 to the -6 soft hence alot of hard.
Note:

1 / (1 microsoft) = hard

“anees mannessery” wrote in message
news:xxxxx@ntdev…
>Hi, Was a bit confused on the behaviour of
>UpdateDriverForPlugAndPlayDevices API. What does it actually do
internally
>? Does it send a remove to all
the
>related device objects which would then result in tearing down the
whole
>stack and then call IoInvalidateDeviceRelations on the related bus
driver
>which would then use the new driver?
>
>And what in case of bus drivers ? Does the API use
QUERY_DEVICE_RELATIONS
>with remove relations to find all the related stacks,and then send
Remove
to
>all the top most driver in the stack ?
>
>Thanks in advance Anees
>
> Life
on
>the fast track! Get hooked to it!
http://server1.msn.co.in/sp04/tataracing/
>Meet the champs!
>
>


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

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


Instant personal loans. Celebrate this season with your family.
http://acm.bridgeovertw.com/hdfc/pl/landingpage/sep04/index.htm?sitecode
=611|395
Apply.


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

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

Doron,

But in case when iam trying to update my driver with a latest version of the
same driver, i see all the related device stacks being torn down all at one
and then getting installed. After all the stacks are rebuilt, i see i see
the device getting rebuilt one by one again. What could the reason for that
be then ?

Are you sure that the normal behaviour of UpdateDriver is to rebuilt the
related device stacks one by one, rather than uninstalling the driver first
and then re building all the stacks with the new driver ? In case its being
rebuilt one by one, wont the image names lead to a confusion where the names
for both the driver are the same ?

Thanks
Anees

From: “Doron Holan”
>Reply-To: “Windows System Software Devs Interest List”
>
>To: “Windows System Software Devs Interest List”
>Subject: RE: [ntdev] Doubt on UpdateDriverForPlugAndPlayDevices
>Date: Wed, 24 Nov 2004 23:13:17 -0800
>
>What is it that you are confused about? These device stacks are being
>rebuilt one by one. Did you expect them to be all torn down at once?
>
>d
>
>-----Original Message-----
>From: xxxxx@lists.osr.com
>[mailto:xxxxx@lists.osr.com] On Behalf Of anees mannessery
>Sent: Wednesday, November 24, 2004 9:47 PM
>To: Windows System Software Devs Interest List
>Subject: Re:[ntdev] Doubt on UpdateDriverForPlugAndPlayDevices
>
>Hi All,
>Any info on this? I still am a bit confused on the behavior of this API.
>
>From the logs as well as debug messages that i have i see all the
>devices
>with the matching hardwareid getting removed and then rebuilt with the
>new
>driver. After that i see all the device stacks being torn down once more
>and
>build back in a one by one basis. Also as i pointed out in my earlier
>mail
>device manager shows as if the driver is getting updated on a one by one
>
>basis. Any help in this regard would be really appreciated.
>
>Thanks
>Anees
>
>
>
>
>
>
>From: anees mannessery
>Reply To: “Windows System Software Devs Interest List”
>
>To: “Windows System Software Devs Interest List”
>Subject: Re:[ntdev] Doubt on UpdateDriverForPlugAndPlayDevices
>Sent: Wednesday, November 24, 2004 6:51:24 AM
>Thanks Jones,
>So even if i have multiple devices with same hardware id, it should
>remove
>all the devices first and then load the new driver while enumearting
>back
>the stack. But when i do this in my case, I have multiple devices which
>i
>need to update the driver, when i view thru the device manager it seems
>that
>the devices get updated one by one. At any instance I can see x number
>of
>devices showing the new driver and the remaining still pointing to the
>old
>driver. This was the main reason that i got confused.
>
>Thanks
>Anees
>
> From: “Michael Jones”
>Reply-To: “Windows System Software Devs Interest List”
>
>To: “Windows System Software Devs Interest List”
>Subject: Re:[ntdev] Doubt on UpdateDriverForPlugAndPlayDevices
>Date: Tue, 23 Nov 2004 10:44:48 -0500
>
>Looks good to me Anees. Of course you get all the inf processing too.
>Dont
>forget after the COMPLETE removal of the previous driver, with the last
>call
>to the previous driver being its Unload routine it loads the new driver
>with DriverEntry getting hit on the new driver, etc as you describe.
>Also
>any constallers, class and device get involved too with there normal
>filtering in the removal and installation procedure.
>
>In essense you are right on.
>
>Sincerely;
>William Michael Jones - P.S.
>
>Question: Why is Bill Gates such a hard man?
>Answer: Because he is MicroSoft. 10 to the -6 soft hence alot of hard.
>Note:
>
>1 / (1 microsoft) = hard
>
>
>
>
>“anees mannessery” wrote in message
>news:xxxxx@ntdev…
> >Hi, Was a bit confused on the behaviour of
> >UpdateDriverForPlugAndPlayDevices API. What does it actually do
>internally
> >? Does it send a remove to all
>the
> >related device objects which would then result in tearing down the
>whole
> >stack and then call IoInvalidateDeviceRelations on the related bus
>driver
> >which would then use the new driver?
> >
> >And what in case of bus drivers ? Does the API use
>QUERY_DEVICE_RELATIONS
> >with remove relations to find all the related stacks,and then send
>Remove
>to
> >all the top most driver in the stack ?
> >
> >Thanks in advance Anees
> >
> > Life
>on
> >the fast track! Get hooked to it!
>http://server1.msn.co.in/sp04/tataracing/
> >Meet the champs!
> >
> >
>
>
>
>—
>Questions? First check the Kernel Driver FAQ at
>http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>

>Instant personal loans. Celebrate this season with your family.
>http://acm.bridgeovertw.com/hdfc/pl/landingpage/sep04/index.htm?sitecode
>=611|395
>Apply.
>
>
>—
>Questions? First check the Kernel Driver FAQ at
>http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@windows.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

_________________________________________________________________
Chat with thousands of singles.
http://www.bharatmatrimony.com/cgi-bin/bmclicks1.cgi?74 Only on
BharatMatrimony.com’s Instant Messenger.