none
send IO_CONTROL command before shutdown RRS feed

  • Question

  • Hi all,

      I'm developing storport driver (NVMe driver) with custom functions on windows 7 64bit. I want to send a set feature command before host shutdown. I try to send set feature command when I received SRB_FUNCTION_POWER in startIO routine. However, send set feature command work, shutdown routine became BSoD. I think maybe have another signals about host start shutdown routine, but I don't know so far.

           I also try to send set feature command when I received SRB_FUNCTION_SHUTDOWN or SRB_FUNCTION_FLUSH, but send command routine not be trigger. I think host not send those SRBs when shutdown.

            my question is that what the appropriate timing  to send a set feature command before receiving shutdown signal from host in driver ?

       Thanks for your time.





    • Edited by JoeAAA Tuesday, October 17, 2017 3:21 AM
    Monday, October 16, 2017 8:04 AM

All replies

  • What is the BSOD that occurs?  You should be able to send commands to the controller on SRB_FUNCTION_SHUTDOWN, that is the whole purpose of the call, to allow commands and data to the drives before shutdown.  

    I haven't looked at the open source NVME driver in a while, but it used to have the problem of not dealing with locks properly and shutdown was one of the cases, so I would start looking there.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Monday, October 16, 2017 1:27 PM
  • Hi Don,

          After run some tests, I found that host send SRB_FUNCTION_SHUTDOWN only when device be designated a drive letter, therefore, I can send commands on SRB_FUNCTION_SHUTDOWN. But my driver still has to deal with device doesn't have drive letter situation.

         


    • Edited by JoeAAA Wednesday, October 18, 2017 2:08 AM
    Wednesday, October 18, 2017 2:07 AM
  • All I can suggest is you look into whether SRBEX_DATA_POWER or SRBEX_DATA_PNP give you the notification that you need.  I have not used these, but they may give you a notification you can use.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Wednesday, October 18, 2017 1:24 PM