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

Discussion in 'Windows Vista Drivers' started by Peter, Nov 3, 2009.

  1. Peter

    Peter Guest

    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,
     
    Peter, Nov 3, 2009
    #1
    1. Advertisements

  2. Peter

    Don Burn Guest

    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





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

    The message was checked by ESET NOD32 Antivirus.

    http://www.eset.com
     
    Don Burn, Nov 3, 2009
    #2
    1. Advertisements

  3. Peter

    Peter Guest

    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,



    signature database 4568 (20091103) __________
     
    Peter, Nov 4, 2009
    #3
  4. I want to create a PDO, if bus filter driver handles IRP_MJ_PNP calls
    Yes it can.
     
    Maxim S. Shatskih, Nov 4, 2009
    #4
  5. Peter

    Peter Guest

    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,

    signature database 4568 (20091103) __________
     
    Peter, Nov 9, 2009
    #5
  6. Peter

    Don Burn Guest

    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





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

    The message was checked by ESET NOD32 Antivirus.

    http://www.eset.com
     
    Don Burn, Nov 9, 2009
    #6
  7. Peter

    Peter Guest

    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" <> ???
    ???...
    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, Nov 11, 2009
    #7
  8. Peter

    Don Burn Guest

    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





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

    The message was checked by ESET NOD32 Antivirus.

    http://www.eset.com
     
    Don Burn, Nov 11, 2009
    #8
  9. Peter

    David Craig Guest

    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.
     
    David Craig, Nov 12, 2009
    #9
  10. Peter

    Peter Guest

    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, Nov 13, 2009
    #10
  11. Peter

    Don Burn Guest

    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





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

    The message was checked by ESET NOD32 Antivirus.

    http://www.eset.com
     
    Don Burn, Nov 13, 2009
    #11
  12. Peter

    Peter Guest

    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,

    signature database 4603 (20091113) __________
     
    Peter, Nov 16, 2009
    #12
  13. Peter

    Don Burn Guest

    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





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

    The message was checked by ESET NOD32 Antivirus.

    http://www.eset.com
     
    Don Burn, Nov 16, 2009
    #13
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.