none
VS2013 force reboot on kernel mode driver deploy RRS feed

  • Question

  • F5 always triggers rebuild of my kernel mode driver even though I just rebuilt it without errors.

    Deployment on rebuild fails because the driver fails to start because a reboot is required.

    SmartReboot=AS is ignored presumably because the inf is not executed via LaunchINFSection.

    Is there a simple way to pass e.g. HOW_ALWAYS_REBOOT_SILENT on the command line with the "Hardware Driver ID Update" option?

    If using the option "Custom Command Line" is the answer, what should the command line be?

    Any other suggestions?

    Thanks.

    Friday, January 3, 2014 2:53 PM

Answers

  • F5 will always trigger a rebuild of your driver. This is currently by design, because we need to make sure that the driver is signed with the right certificate (the store on the machine could have changed between your previous build and F5). We are investigating potential ways to prevent this rebuild in specific scenarios, but for now, there is no way around it that I know of.

    Using "Custom command line" could be possible in your case. You can write pretty much anything in custom command line. The Hardware Driver ID Update option runs the following command on the target machine to install a driver (replace INF_FILE.inf with your inf file name, and HARDWARE_ID with the hardware id):

    %SystemDrive%\DriverTest\devcon.exe -f install %SystemDrive%\DriverTest\Drivers\INF_FILE.inf HARDWARE_ID

    If you want to install the driver using a different command line, you can specify it in Custom Command Line. I think you can specify pretty much any command line in there, as long as the paths to whatever you are calling resolve on the test machine.

    Another option for you would be to deploy the driver without debugging, and then simply reboot your target machine and attach the kernel debugger to it from VS (you can do that from the "Debug \ Attach to Process..." menu in VS.


    Max -- This posting is provided "AS IS" with no warranties, and confers no rights.


    Friday, January 3, 2014 6:43 PM

All replies

  • F5 will always trigger a rebuild of your driver. This is currently by design, because we need to make sure that the driver is signed with the right certificate (the store on the machine could have changed between your previous build and F5). We are investigating potential ways to prevent this rebuild in specific scenarios, but for now, there is no way around it that I know of.

    Using "Custom command line" could be possible in your case. You can write pretty much anything in custom command line. The Hardware Driver ID Update option runs the following command on the target machine to install a driver (replace INF_FILE.inf with your inf file name, and HARDWARE_ID with the hardware id):

    %SystemDrive%\DriverTest\devcon.exe -f install %SystemDrive%\DriverTest\Drivers\INF_FILE.inf HARDWARE_ID

    If you want to install the driver using a different command line, you can specify it in Custom Command Line. I think you can specify pretty much any command line in there, as long as the paths to whatever you are calling resolve on the test machine.

    Another option for you would be to deploy the driver without debugging, and then simply reboot your target machine and attach the kernel debugger to it from VS (you can do that from the "Debug \ Attach to Process..." menu in VS.


    Max -- This posting is provided "AS IS" with no warranties, and confers no rights.


    Friday, January 3, 2014 6:43 PM
  • Hi Maxime,

    Thank you for your reply.

    Tried "Custom Command Line" with the -r switch. It certainly rebooted but failed to install the driver.

    What is the 'f' parameter to devcon? I couldn't find any reference in the documentation.

    I couldn't get "Debug \ Attach to Process..." to work with a kernel mode driver on my setup.

    The only reliable way to debug my 64 bit kernel mode driver on Win 8 is WinDbg over a serial connection which will have to do for the present.

    Thanks again.

    Friday, January 10, 2014 10:44 AM
  • The -f parameter stands for "force operation" and sets a flag to 0x01. I have to admit I'm not sure exactly what it's used for, as I am not very familiar with devcon. I think it is used to force uninstall the previous driver package before installation, but I could be wrong.

    If "Debug \ Attach" to process doesn't work, it's likely a VS configuration problem. In order for VS kernel debugging to work, the debugger settings set in VS (which you can set through the "Configure computer" menu used to provision a target machine) must match whatever debugger settings are set on the target machine. If you're able to debug through WinDbg, but not through VS from the "Debug \ Attach to Process" option, it is likely because the debugger settings stored by VS don't match.


    Max -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Friday, January 10, 2014 5:04 PM