Search code examples
cdriverloadingwdkkmdf

WDK Driver load issue (The service cannot be started, either because it is disabled)


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.


Solution

  • 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.