Thanks Doron - thats covered it.
Cheers,
Crispin
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: 09 March 2009 17:29
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] IoReportTargetDeviceChangeAsynchronous custom
notification best practices - PnP driver only?
You need a physical device object to be able to call
IoReportTargetDeviceChangeAsynchronous. This means you must be a pnp driver
which means that even though you can be root enumerated, you must still
fully implement pnp and power (unless it is a KMDF driver
). There are 2
caveats around IoReportTargetDeviceChangeAsynchronous.
- it is lossy. It requires at leat one allocation within the kernel to
deliver the message, and I think each target sink needs an alloc as well
- there are no timing guarantees. So while there are no PIRP compoletion
timing guarantees, notifications through this API have to travel through
more components across more IPC boundaries
With that said, notifications through this api have their uses, esp if you
can tolerate the occasional memory alloc failure. For instance, when I was
writing the bth stack, we would use these notifications to broadcast when a
connection was made or lost, when a remote name was retrieved, etc etc. The
in box UI used these notifications to asynchronously update itself based off
of these state changes.
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Crispin Wright
Sent: Monday, March 09, 2009 12:28 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] IoReportTargetDeviceChangeAsynchronous custom notification
best practices - PnP driver only?
I wanted to get custom notifications working from KM to UM over the weekend,
so I had a look at:
http://www.microsoft.com/whdc/Driver/tips/PnPUmNotif.mspx
Which says:
“A driver can define custom events, which don’t necessarily have to relate
to hardware”
Then I looked at the event sample src in the ddk, comments in that say:
" 4) Using PNP custom notification scheme. Walter Oney’s book describes
this.
Can be used only in PNP drivers."
And Walters book says that he couldn’t get it to work.
So I’ve started shoeing a sample, but I wanted to ask before I go any
further, in terms of best practice and “correctness”, if my driver is a
virtual device driver, and doesn’t really have anything to do with PnP,
should I be using this mechanism at all? (just because I can - does it mean
I should?)
Which then begs the question, if it is ok to use this method - what other
caveats are there? i.e. do I need to support or “manage” any standard PnP
routines/scenarios, or god forbid - any power management “bits”, because if
thats the case, then i’ll stick to some of the more generic methods from
here:
http://www.microsoft.com/msj/0799/nerd/nerd0799.aspx
cheers
Crispin
__________ Information from ESET NOD32 Antivirus, version of virus signature
database 3918 (20090309) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
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
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
__________ Information from ESET NOD32 Antivirus, version of virus signature
database 3921 (20090309) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
__________ Information from ESET NOD32 Antivirus, version of virus signature
database 3921 (20090309) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com