Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Why the disk driver (disk.sys) can not receive a PDO(physical device object) that is created by a class(disk) low filter driver?

143 views
Skip to first unread message

Peter

unread,
Nov 3, 2009, 5:23:35 AM11/3/09
to
Hi,

I refer the following sources in the DDK to develop a disk low filter
driver:
\src\general\toaster\bus
\src\storage\class\disk

I would like to create a PDO in my disk low filter driver, and hope the
disk
driver can see the PDO, but the result is the PDO does not appear in disk
driver.

The following are the main procedure in my disk low filter driver:

call IoCreateDevice(), IoInvalidateDeviceRelations(), then
receive IRP_MJ_PNP.IRP_MN_QUERY_DEVICE_RELATIONS.BusRelations,
IRP_MJ_PNP.IRP_MN_START_DEVICE

Any comment for my problem, thanks.

Best Regards,
Peter,


Don Burn

unread,
Nov 3, 2009, 6:57:36 AM11/3/09
to
How did you tell the Plug and Play system that the PDO is there and part of
the disk stack. If this is not a PDO filtering an existing PDO you need to
to act like a bus filter and handle IRP_MJ_PNP calls in particular
IRP_MN_QUERY_DEVICE_RELATIONS


--
Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

"Peter" <pete...@vasstek.com.tw> wrote in message
news:eTqy%23%23GXK...@TK2MSFTNGP05.phx.gbl...

> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 4568 (20091103) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>

__________ Information from ESET NOD32 Antivirus, version of virus signature database 4568 (20091103) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


Peter

unread,
Nov 4, 2009, 5:54:23 AM11/4/09
to
Hi,
I call function IoCreateDevice() to create a DO(device object) and call
function
IoInvalidateDeviceRelations() to notify the Plug and Play system. In DDK
source
\src\general\toaster\bus, the bus-enum driver do like these to create a PDO.
And then
I receive the IRP, "IRP_MJ_PNP.IRP_MN_QUERY_DEVICE_RELATIONS.BusRelations",
after I handle the IRP, I receive the IRP "IRP_MJ_PNP.IRP_MN_START_DEVICE".

I want to create a PDO, if bus filter driver handles IRP_MJ_PNP calls
in particular
IRP_MN_QUERY_DEVICE_RELATIONS can create a new PDO?

Best Regards,
Peter,

"Don Burn" <bu...@stopspam.windrvr.com> �b�l��
news:%2362uazH...@TK2MSFTNGP06.phx.gbl �����g...

Maxim S. Shatskih

unread,
Nov 4, 2009, 7:55:43 AM11/4/09
to
> I want to create a PDO, if bus filter driver handles IRP_MJ_PNP calls
> in particular
> IRP_MN_QUERY_DEVICE_RELATIONS can create a new PDO?

Yes it can.

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

Peter

unread,
Nov 9, 2009, 5:05:19 AM11/9/09
to
Hi,
Is it impossible to create a PDO at disk class lower filter? I need a
guide
to create a PDO in my disk lower filter driver.

In my experiences, a PDO is created by a bus driver, if handling
IRP_MJ_PNP "
IRP_MN_QUERY_DEVICE_RELATIONS" in the bus filter driver, it seems only
can monitor or modify the content of the PDO. How the bus filter driver
creates
another PDO?

Best Regards,
Peter,

"Don Burn" <bu...@stopspam.windrvr.com> �b�l��
news:%2362uazH...@TK2MSFTNGP06.phx.gbl �����g...

Don Burn

unread,
Nov 9, 2009, 8:15:12 AM11/9/09
to
You create a PDO and allocates space for a new list of PDO's then copies the
list comming up from the adapter driver to add the one it wants. If free
the old list that the lower driver allocated. It then has to be careful
for all PNP calls that go to that PDO to act as a bus driver but for all
others act as a filter.


--
Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

"Peter" <pete...@vasstek.com.tw> wrote in message

news:uxA8zQS...@TK2MSFTNGP05.phx.gbl...

> signature database 4587 (20091109) __________


>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>

__________ Information from ESET NOD32 Antivirus, version of virus signature database 4587 (20091109) __________

eagersh

unread,
Nov 10, 2009, 6:16:58 PM11/10/09
to
Why do you know that AddDevice of disk.sys is not called?
You are trying emulate Port driver work, aren't you. It is not easy.
If your target is Vista SP1 and up you should better use a Virtual
Storport miniport driver.
If you may also trace all communications between disk.sys to Port
Driver to check if you doing everything correctly. You could do it
because you have a lower filter class driver.
Another option is to write your own disk class driver. In this case
you need a bus driver also.

Igor Sharovar

Peter

unread,
Nov 11, 2009, 5:26:27 AM11/11/09
to
Hi,

As your comments, I trace all communications between disk.sys and Port
driver, the PDO I created in my disk lower filter driver is not passed to
function
"AddDevice" of disk.sys .
Trying to emulate Port driver work in my disk lower filter driver is not
easy
or impossible ?. How I can accomplish the work?
What is the Virtual Storport miniport driver?

Best Regards,
Peter,

eagersh" <eage...@gmail.com> ???
news:03a4d15d-3376-40fd...@m33g2000pri.googlegroups.com
???...

eagersh

unread,
Nov 11, 2009, 2:19:43 PM11/11/09
to
On Nov 11, 3:26 am, "Peter" <peter_...@vasstek.com.tw> wrote:
> Hi,
>
>     As your comments, I trace all communications between disk.sys and Port
> driver, the PDO I created in my disk lower filter driver is not passed to
> function
> "AddDevice" of disk.sys .
>     Trying to emulate Port driver work in my disk lower filter driver is not
> easy
> or impossible ?. How I can accomplish the work?
>     What is the Virtual Storport miniport driver?
>
> Best Regards,
> Peter,
>
> eagersh" <eagers...@gmail.com> ???news:03a4d15d-3376-40fd...@m33g2000pri.googlegroups.com

Try to use Virtual Storport miniport driver. The upper edge interface
of this driver is a standard StorPort miniport driver but the low edge
could be your own, for example network interface.
This is pretty much a new type of driver and available only since
Vista SP1 or Windows 2008. You could find some information( not much)
in WDK documentation under

WDK->Device and Driver Technologies-> Storage Device->Design Guide-
>Storage Virtual Miniport Drivers

Also OSR starts to publish articles on such topic.
http://www.osronline.com/article.cfm?id=538

Igor Sharovar

Don Burn

unread,
Nov 11, 2009, 2:28:03 PM11/11/09
to
It is not impossible, but does require careful work to handle all the PNP
calls.


--
Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

"Peter" <pete...@vasstek.com.tw> wrote in message

news:%23l2z9lr...@TK2MSFTNGP06.phx.gbl...

> __________ Information from ESET NOD32 Antivirus, version of virus

> signature database 4595 (20091111) __________


>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>

__________ Information from ESET NOD32 Antivirus, version of virus signature database 4597 (20091111) __________

David Craig

unread,
Nov 11, 2009, 7:44:24 PM11/11/09
to
If you use a bus driver to handle the real hardware and use KMDF then most
of your PnP and Power issues are resolved. You don't need to handle them in
StorPort as the port driver will just load and unload you when it wants.

"Don Burn" <bu...@stopspam.windrvr.com> wrote in message
news:ewVJcUwY...@TK2MSFTNGP06.phx.gbl...

Peter

unread,
Nov 13, 2009, 5:16:45 AM11/13/09
to
Hi,
It seems that the PNP knows what driver creates the PDO.
The PNP seems initiate a PDO in the different way by different drivers :
In my disk low filter driver, it receives only:
IRP_MJ_PNP[IRP_MN_START_DEVICE]
In the bus enum driver which is compiled from DDK sources
"\src\general\toaster\bus", it receives:
IRP_MJ_PNP[IRP_MN_QUERY_ID]
IRP_MJ_PNP[IRP_MN_QUERY_CAPABILITIES]
IRP_MJ_PNP[IRP_MN_QUERY_DEVICE_TEXT]
IRP_MJ_PNP[IRP_MN_QUERY_RESOURCE_REQUIREMENTS]
IRP_MJ_PNP[IRP_MN_QUERY_BUS_INFORMATION]
...

What the PNP will do after it knows a new PDO is created?
Any other info. about device stack and driver stack?

Best Regards,
Peter,

"Peter" <pete...@vasstek.com.tw> �b�l��
news:eTqy%23%23GXK...@TK2MSFTNGP05.phx.gbl �����g...

Don Burn

unread,
Nov 13, 2009, 8:41:17 AM11/13/09
to
Look at http://msdn.microsoft.com/en-us/library/ms806534.aspx


--
Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

"Peter" <pete...@vasstek.com.tw> wrote in message

news:%23bMh7pE...@TK2MSFTNGP05.phx.gbl...

> __________ Information from ESET NOD32 Antivirus, version of virus

> signature database 4603 (20091113) __________


>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>

__________ Information from ESET NOD32 Antivirus, version of virus signature database 4603 (20091113) __________

Peter

unread,
Nov 16, 2009, 4:47:19 AM11/16/09
to
Hi,
I create a PDO in my disk low filter driver, what is the meaning of
this PDO in
device stack? Is any driver will see it and create a FDO for it? And any
device will
be shown in system Device Manager?

Best Regards,
Peter,

"Don Burn" <bu...@stopspam.windrvr.com> �b�l��

news:%23Xv1AcG...@TK2MSFTNGP04.phx.gbl �����g...

Don Burn

unread,
Nov 16, 2009, 8:19:44 AM11/16/09
to
Drivers will only see the PDO if you issue an IoInvalidateDeviceRelations
and then handle the IRP_MJ_PNP calls to notify the system of the device. Go
read the toaster sample in detail.


--
Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

"Peter" <pete...@vasstek.com.tw> wrote in message

news:uGPVMHqZ...@TK2MSFTNGP06.phx.gbl...

> signature database 4611 (20091116) __________


>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>

__________ Information from ESET NOD32 Antivirus, version of virus signature database 4611 (20091116) __________

0 new messages