UMDF device names

Awesome this works, and makes sense. Thanks to both of you.

That would mean every time I wanted to update my device map, I’d have to cycle through every detected device in my specific class, open them all, make a request to each, and then close them all again. Otherwise how can we tell if they have been removed and another added since our last check. If we do this every second, then it gets quite inefficient.

Also what if another part of my application, or another application is using a particular device and in the middle of a request when the device map update occurs. Assuming I limit each device to not being shared (as was the idea) this would cause the device to then disappear from my device map.

I’m willing to take suggestions as to how to improve this design, as I too think it’s not the best approach, but since I’m still unfamiliar with driver development, no obvious solutions come to mind yet.

Thanks again to everyone for your help, it is much appreciated.

Andrew Parlane

What id the pnp instance with the control device device name is removed? And the remaining pnp instances without the fixed name remain? Why do you poll? Why not just pens an up and complete it when something changes. Better yet, make the app pnp aware and have it register for pnp changes on the device interface (which you need to do on the handle to the device anyways)

d

dent from a phpne with no keynoard

-----Original Message-----
From: xxxxx@carallon.com
Sent: August 11, 2010 2:07 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] UMDF device names





Awesome this works, and makes sense. Thanks to both of you.



That would mean every time I wanted to update my device map, I’d have to cycle through every detected device in my specific class, open them all, make a request to each, and then close them all again. Otherwise how can we tell if they have been removed and another added since our last check. If we do this every second, then it gets quite inefficient.

Also what if another part of my application, or another application is using a particular device and in the middle of a request when the device map update occurs. Assuming I limit each device to not being shared (as was the idea) this would cause the device to then disappear from my device map.

I’m willing to take suggestions as to how to improve this design, as I too think it’s not the best approach, but since I’m still unfamiliar with driver development, no obvious solutions come to mind yet.

Thanks again to everyone for your help, it is much appreciated.

Andrew Parlane


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

I intended to have the device map be separate from any specific device, it should be created when the first device is added, and deleted when the last device is removed. This is certainly how it works in the old WDM driver, I’m not sure if that’s possible with UMDF.

How would one make the app PNP aware, that sounds like a decent option, any chance of a pointer in the right direction, just the name of some functions to look up / a sample app + driver that do this?

Thanks, while my progress is slow, I feel I am starting to get the hang of this. Sorry for all the newby questions.

Andrew

Each instance gets its own process by default. That explains your trace. Look at RegisterDeviceNotifcation, you will want to call it once for the device interface guid (to know when something arrives) and the once per handle you open (to know when to close it).

d

dent from a phpne with no keynoard

-----Original Message-----
From: xxxxx@carallon.com
Sent: August 11, 2010 7:32 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] UMDF device names

I intended to have the device map be separate from any specific device, it should be created when the first device is added, and deleted when the last device is removed. This is certainly how it works in the old WDM driver, I’m not sure if that’s possible with UMDF.

How would one make the app PNP aware, that sounds like a decent option, any chance of a pointer in the right direction, just the name of some functions to look up / a sample app + driver that do this?

Thanks, while my progress is slow, I feel I am starting to get the hang of this. Sorry for all the newby questions.

Andrew


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

Thanks, will look at it, and get back to you when I’ve got somewheer.

> That would mean every time I wanted to update my device map,

Do you really need one? are your devices inter-dependent? or the app can work with several at once?

added since our last check. If we do this every second, then it gets quite inefficient.

Device interface arrival notifications are useful. Can be delivered as both WM_xxx and the service control message.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com