From: kobi n on
Hi.

i have a question regarding the PnP mechanism.

my driver (WDF based) controls a pci board. my system can have between one
to ten boards on its backplane.
my question is - is there a way for me to know (to be sure) that PnP have
finished dealing with all of my boards (that are related to my driver) in a
given moment. my user mode side of the system needs to know weather there are
still boards that were not handled by the PnP.
a possible soulution might be using some kind of configuration, meaning that
the user mode will have to know how many boards exist on a given system and
will be able to query the driver of how many boards were found in a given
moment.
but since i try to avoid this kind of solution i would to know if the OS/pnp
mechanism can help me with that.

thanks a ot,
kobi.
From: Doron Holan [MSFT] on
no, there is no way to know. you have to deal with the boards coming and
going dynamically (yes they can go as well, the user can disable them in
device manager or the driver could expereince an error that causes the stack
to be torn down) even if you had this information.

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"kobi n" <kobin(a)discussions.microsoft.com> wrote in message
news:CC911860-8AF2-4F12-9B3A-F5E1AF81CBE5(a)microsoft.com...
> Hi.
>
> i have a question regarding the PnP mechanism.
>
> my driver (WDF based) controls a pci board. my system can have between
> one
> to ten boards on its backplane.
> my question is - is there a way for me to know (to be sure) that PnP have
> finished dealing with all of my boards (that are related to my driver) in
> a
> given moment. my user mode side of the system needs to know weather there
> are
> still boards that were not handled by the PnP.
> a possible soulution might be using some kind of configuration, meaning
> that
> the user mode will have to know how many boards exist on a given system
> and
> will be able to query the driver of how many boards were found in a given
> moment.
> but since i try to avoid this kind of solution i would to know if the
> OS/pnp
> mechanism can help me with that.
>
> thanks a ot,
> kobi.

From: Pavel A. on
"kobi n" <kobin(a)discussions.microsoft.com> wrote in message
news:CC911860-8AF2-4F12-9B3A-F5E1AF81CBE5(a)microsoft.com...
> Hi.
>
> i have a question regarding the PnP mechanism.
>
> my driver (WDF based) controls a pci board. my system can have between
> one
> to ten boards on its backplane.
> my question is - is there a way for me to know (to be sure) that PnP have
> finished dealing with all of my boards (that are related to my driver) in
> a
> given moment. my user mode side of the system needs to know weather there
> are
> still boards that were not handled by the PnP.
> a possible soulution might be using some kind of configuration, meaning
> that
> the user mode will have to know how many boards exist on a given system
> and
> will be able to query the driver of how many boards were found in a given
> moment.
> but since i try to avoid this kind of solution i would to know if the
> OS/pnp
> mechanism can help me with that.
>
> thanks a ot,
> kobi.

Why do you need this? Maybe you want to detect failed driver instances
or debug a stuck coinstaller?
Normally, setup of a PCI device should complete in few seconds,
so all your 10 boards should install pretty quick.

Regards,
--PA


From: kobi n on

thanks for the answer.

our system is complicated and composed of various modules. the user mode
application would like to know when all the driver related boards were found
and ready to work in order to start some other proccesses that depend on the
boards readiness.

"Pavel A." wrote:

> "kobi n" <kobin(a)discussions.microsoft.com> wrote in message
> news:CC911860-8AF2-4F12-9B3A-F5E1AF81CBE5(a)microsoft.com...
> > Hi.
> >
> > i have a question regarding the PnP mechanism.
> >
> > my driver (WDF based) controls a pci board. my system can have between
> > one
> > to ten boards on its backplane.
> > my question is - is there a way for me to know (to be sure) that PnP have
> > finished dealing with all of my boards (that are related to my driver) in
> > a
> > given moment. my user mode side of the system needs to know weather there
> > are
> > still boards that were not handled by the PnP.
> > a possible soulution might be using some kind of configuration, meaning
> > that
> > the user mode will have to know how many boards exist on a given system
> > and
> > will be able to query the driver of how many boards were found in a given
> > moment.
> > but since i try to avoid this kind of solution i would to know if the
> > OS/pnp
> > mechanism can help me with that.
> >
> > thanks a ot,
> > kobi.
>
> Why do you need this? Maybe you want to detect failed driver instances
> or debug a stuck coinstaller?
> Normally, setup of a PCI device should complete in few seconds,
> so all your 10 boards should install pretty quick.
>
> Regards,
> --PA
>
>
>
From: Farhan Ahmed [MSFT] on
You could use the device and interface enumeration functions in SetupAPI
(http://msdn.microsoft.com/en-us/library/ms791137.aspx) to enumerate your
devices and check when you have the required number of them ready and in
the correct state.

If you'd like to know when PnP has finished installing a "batch" of
devices (note, this is for installation, and hence only the first time
your device is discovered), you could use the
CMP_WaitNoPendingInstallEvents API
(http://msdn.microsoft.com/en-us/library/ms789525.aspx). While it will not
help you determine if your particular device is being installed, it will
tell you if the PnP manager is actively installing *some* device.

Farhan

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no
rights.

-----Original Message-----
From: kobi n [mailto:kobin(a)discussions.microsoft.com]
Posted At: Tuesday, April 29, 2008 11:06 PM
Posted To: microsoft.public.development.device.drivers
Conversation: PnP device recognition
Subject: Re: PnP device recognition


thanks for the answer.

our system is complicated and composed of various modules. the user mode
application would like to know when all the driver related boards were
found
and ready to work in order to start some other proccesses that depend on
the
boards readiness.

"Pavel A." wrote:

> "kobi n" <kobin(a)discussions.microsoft.com> wrote in message
> news:CC911860-8AF2-4F12-9B3A-F5E1AF81CBE5(a)microsoft.com...
> > Hi.
> >
> > i have a question regarding the PnP mechanism.
> >
> > my driver (WDF based) controls a pci board. my system can have
> > between
> > one
> > to ten boards on its backplane.
> > my question is - is there a way for me to know (to be sure) that PnP
> > have
> > finished dealing with all of my boards (that are related to my driver)
> > in
> > a
> > given moment. my user mode side of the system needs to know weather
> > there
> > are
> > still boards that were not handled by the PnP.
> > a possible soulution might be using some kind of configuration,
> > meaning
> > that
> > the user mode will have to know how many boards exist on a given
> > system
> > and
> > will be able to query the driver of how many boards were found in a
> > given
> > moment.
> > but since i try to avoid this kind of solution i would to know if the
> > OS/pnp
> > mechanism can help me with that.
> >
> > thanks a ot,
> > kobi.
>
> Why do you need this? Maybe you want to detect failed driver instances
> or debug a stuck coinstaller?
> Normally, setup of a PCI device should complete in few seconds,
> so all your 10 boards should install pretty quick.
>
> Regards,
> --PA
>
>
>