Is there an API to refresh the hardware changes in the device manager?

Hello experts,

I am making a console app trying to refresh the device manager.
What i want is that, I have an external device that will change occasionally and my application
don’t know if it has changed. Refreshing the Device Manager manually will detect my external changes, how can i do this?

I have also a filter driver for my external device,
Is there a way I can call some OS defined interface function to inform the PnP manager to check for a new hardware changes?
If there are any changes on my extrnal device, my device arrival routine will not notice it.
Is there a way of refreshing the device manager list in driver side?

-tongyong
forever newbie
always trying the new one

How is your device conecting to the pc?

d

Sent from my phone with no t9, all spilling mistakes are not intentional.

-----Original Message-----
From: xxxxx@gmail.com
Sent: Tuesday, September 22, 2009 9:07 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Is there an API to refresh the hardware changes in the device manager?

Hello experts,

I am making a console app trying to refresh the device manager.
What i want is that, I have an external device that will change occasionally and my application
don’t know if it has changed. Refreshing the Device Manager manually will detect my external changes, how can i do this?

I have also a filter driver for my external device,
Is there a way I can call some OS defined interface function to inform the PnP manager to check for a new hardware changes?
If there are any changes on my extrnal device, my device arrival routine will not notice it.
Is there a way of refreshing the device manager list in driver side?

-tongyong
forever newbie
always trying the new one


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

my device is connected via Fibre channel.

Can you expand little more? Are you connecting SCSI Disk Array via FC? Is
your requirement, OS has to see new SCSI LUNs as & when added?

Regards,
T.V.Gokul.

On Wed, Sep 23, 2009 at 11:01 AM, wrote:

> my device is connected via Fibre channel.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Yes, that’s what i meant to be, my bad of not telling the actual scenario…

I am working of a utility for a scsi disk array connected via fc

Is your SCSI target sending “REPORTED LUNS DATA HAS CHANGED” UA to your
machine(initiator) on adding new LUNS? This will make the port driver to
initiate REPORT-LUNS, and if it finds new LUNS, it will update/notify the
PnP manager.

But this requires, atleast one LUN to be presented to your machine, so that
the target shall send UA to that LUN.

Regards,
T.V.Gokul.

On Wed, Sep 23, 2009 at 11:29 AM, wrote:

> Yes, that’s what i meant to be, my bad of not telling the actual
> scenario…
>
> I am working of a utility for a scsi disk array connected via fc
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

the scsi target for my app is any scsi disk array connected to a certain Host via FC .

If i am assuming of all scsi disk array supports SPC-2 which has Report Luns supported. it could be Okay. almost all of the scsi disk array devices already uses at least spc-2 i think.

assuming of one LUN already presented, I am not sure of sending a Report Lun spti commands will do.
I’ll have to try this…

thanks anyway…

No… You got it wrong… I’m *not* asking you to send REPORT-LUNS SCSI
command from app…

Instead, check whether your target is sending *UNIT ATTENTION* with ASC/ASCQ
set to 3F/0E (which is nothing but “REPORTED LUNS DATA HAS CHANGED” unit
attention), on adding/deleting new-LUNS. You can verify this, but sniffing
thru FC Analyzer. I hope your SCSI target is not sending this!

Regards,
T.V.Gokul.

On Wed, Sep 23, 2009 at 12:36 PM, wrote:

> the scsi target for my app is any scsi disk array connected to a certain
> Host via FC .
>
> If i am assuming of all scsi disk array supports SPC-2 which has Report
> Luns supported. it could be Okay. almost all of the scsi disk array devices
> already uses at least spc-2 i think.
>
> assuming of one LUN already presented, I am not sure of sending a Report
> Lun spti commands will do.
> I’ll have to try this…
>
> thanks anyway…
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Sorry if i misunderstood it,

we are not yet sure if our scsi target is sending such UA w/ ASC/ASCQ,
we are targeting multiple scsi disk arrays…old or new
currently, one of our scsi target is kinda older version, if we have added some LUN on a scsi disk array, Host Pc has no response until manually refresh the device manager, that is why we are working on it, for all type of scsi targets.

Ok,… then you have 2 options,

  1. If you have control of SCSI Target, make it send the UA on addition or
    deletion of LUNs.

  2. You have to write an app/service, that issues SCSI Report-Luns command to
    all SCSI controller device (LUN 0) periodically or on admin’s request! (not

  • preferable)

Regards,
T.V.Gokul.

On Wed, Sep 23, 2009 at 1:30 PM, wrote:

> Sorry if i misunderstood it,
>
> we are not yet sure if our scsi target is sending such UA w/ ASC/ASCQ,
> we are targeting multiple scsi disk arrays…old or new
> currently, one of our scsi target is kinda older version, if we have added
> some LUN on a scsi disk array, Host Pc has no response until manually
> refresh the device manager, that is why we are working on it, for all type
> of scsi targets.
>
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

thnks a lot… these would be a great help…

God bless and more power…

Have a look at the devcon example in the WDK. CM_Reenumerate_DevNode_Ex
and friends may be what you want.

xxxxx@gmail.com wrote:

Hello experts,

I am making a console app trying to refresh the device manager.
What i want is that, I have an external device that will change occasionally and my application
don’t know if it has changed. Refreshing the Device Manager manually will detect my external changes, how can i do this?

I have also a filter driver for my external device,
Is there a way I can call some OS defined interface function to inform the PnP manager to check for a new hardware changes?
If there are any changes on my extrnal device, my device arrival routine will not notice it.
Is there a way of refreshing the device manager list in driver side?

-tongyong
forever newbie
always trying the new one

Thnks for the info Mr. Farell