So from your perspective as a disk class driver, you’ll get a call to
your Pnp AddDevice function for each disk.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Monday, April 06, 2009 1:07 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] How does Disk Class comes to know of any new
disks/partitions
Deepak Gupta wrote:
Please forgive me if my query is too simple to ask.
As I have read in Window Internals, PartMgr.sys acts as Function for
Disk Device objects created by Disk class driver.
and PartMgr informs PnP Manager which in turn informs the Volume
Managers and so forth it propagates till creation of Volume Device
Objects.
So far all clear, My doubt is how does Disk class driver come to know
of Disks below it.
I assume that Storage Miniports would inform the existence of disks to
the relevant port driver.
But still how does Disk class driver come to know of the new disk?
Does Disk class registers some callbacks with all port drivers?
The key problem is that you are thinking upside down. Driver stacks in
Windows are built from the bottom up, not from the top down.
That is, you don’t start with a disk class driver, and then tell it
about new disks. Instead, everything starts at the bottom, when some
bus realizes that a new device has come online. The bus driver simply
reports the PnP identifier for the new device. The PnP subsystem then
goes to find a driver for that device. If that driver is a disk driver,
it reports the presence of a new disk (by using a PnP identifier). The
PnP subsystem will then go find a disk class driver to handle the next
layer.
If there is a partition on the disk, the disk class driver basically
reports it, which causes the partition manager to be loaded, and the
sequence continues as you have described it.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
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