0

I have used windows 8.1 to write many drivers with no issues when loading what so ever. There seems to be some sort of issue when I try to load a new basic KMDF driver that I built in visual studio. I am able to edit source and compile new versions of driver projects built while on previous versions of windows and I assume WDK would be the true culprit here. I am able to load drivers that the original project was generated in Windows 8.1 even if I edit the source and recompile, but specifically If I try to create a new driver project through visual studio, namely the example base for Kernel Mode Driver, it fails to load with the error :

"The service cannot be started, either because it is disabled or because it has no enabled devices associated with it"

A couple points : The driver fails to load with the same error every time, I have my own certified trusted certificate from digicert and I have tried disabling driver signature enforcement, both with the same error. So it is safe to say that certificates is not the issue.

The only main difference I can tell between the old and new WDK sources is the old version specifically has versions of windows to build from, but the new has "universal" although through settings it looks like it will just build for Windows 10.

I am not doing any stupid errors meaning, I am compiling x64, etc...

I'm starting to think that the WDK KMDF basic template may have some sort of issue with it.

I would rather not have to gut an old project (driver) to get a successful "new" driver to load.

  • 1
    What is your question? – Box Box Box Box Mar 10 '16 at 04:12
  • @AshishAhujaツ I assume it would be a "how can I fix this" sort of thing. Max, could you please clarify? – Ashwin Gupta Mar 10 '16 at 04:16
  • Yes, sorry for that, I would like to fix the error that I am having : "The service cannot be started, either because it is disabled or because it has no enabled devices associated with it" I have tried with multiple ways of loading drivers, in which all work with my older sources. –  Mar 10 '16 at 04:23

1 Answers1

0

Can you please specify is it a legacy driver or a pnp driver.

I faced a similar issue, but the mistake I was doing was compiling a pnp driver and trying to load it as a legacy driver.

To specify the difference for completion sake pnp would be a driver that comes with a AddDevice routine. Such driver are expected to have a start type as 0 and are loaded at boot time. Need to attach the driver to a specific device object in the add device routine.

The legacy drivers are one with no AddDevice routine and we call IoCreateDevice from DriverEntry itself.

Rohit Magdum
  • 104
  • 4
  • http://hastebin.com/mawaboluvu.lua (default driver.c that comes with kmdf template) I assume you are correct with what you said. I am just a bit confused that they would change something like that in a template over WDK versions. Can I simply convert the code to run as a legacy driver or is there another base legacy template? Thank you for the response, I will accept the answer as it is the correct answer, but any more info is appreciated. –  Mar 10 '16 at 05:38
  • Yes you can convert the pnp driver into legacy driver for sure. Just that you will have to do some tedious cleaning up work. e.g. they must have defined whole lot of new structures that seem to be very irrelevant to a legacy driver. You will have to undo all the coding that they have done in AddDevice routine and make sure you undo any corresponding cleanup required for the code in AddDevice. But it should not be difficult if you know your legacy drivers well enough. – Rohit Magdum Mar 10 '16 at 05:43
  • I am just going to use WindowsDriver->Legacy->Empty WDM( i think that is the name) and just add the methods myself, it seems to be the easiest way. –  Mar 10 '16 at 06:01
  • :) oh yes. I was under the impression you want to use the sample drivers. Otherwise yes its easy to create a empty project and do whatever you want. – Rohit Magdum Mar 10 '16 at 06:33