microsoft / Windows-driver-samples

This repo contains driver samples prepared for use with Microsoft Visual Studio and the Windows Driver Kit (WDK). It contains both Universal Windows Driver and desktop-only driver samples.
Microsoft Public License
6.94k stars 4.93k forks source link

Multiple examples indicate "[DefaultInstall]-based INF cannot be processed as Primitive" #366

Open dovholuknf opened 5 years ago

dovholuknf commented 5 years ago

I am new to windows driver development and I have been trying to learn my way using the samples in the network folder. Yesterday I made the "mistake" of upgrading visual studio and now the drivers I am using are reporting

C:\git\external\windows-driver-samples\network\trans\inspect\sys\inspect.inf : error 1420: [DefaultInstall]-based INF cannot be processed as Primitive. and 1>C:\git\external\Windows-driver-samples\network\trans\ddproxy\sys\ddproxy.inf : error 1420: [DefaultInstall]-based INF cannot be processed as Primitive.

This page discusses the issue: https://docs.microsoft.com/en-us/windows-hardware/drivers/develop/creating-a-primitive-driver however the samples are not updated at this time.

mutterbucket commented 5 years ago

A solution that worked for me is to right click the driver project, and in the Driver Settings section change the Target Platform from Universal to Desktop.

dovholuknf commented 5 years ago

A solution that worked for me is to right click the driver project, and in the Driver Settings section change the Target Platform from Universal to Desktop.

This allows the project to build for me - but it won't actually deploy to the target machine. For me - the errors are just turned into warnings.

After you made that change - are you able to deploy the app? I get: Extracting service name from inf "C:\git\external\windows-driver-samples\network\trans\inspect\sys\x64\Debug\inspect\inspect.inf" Failed:

mutterbucket commented 5 years ago

I can run them on a VMWare test machine with a serial connection to WinDbg and driver signature enforcement disabled, that has been the most reliable setup I can establish right now.

estrandb commented 4 years ago

https://docs.microsoft.com/en-us/windows-hardware/drivers/develop/creating-a-primitive-driver#legacy-compatibility

I was getting this error as well. As described in the above documentation, I decorated the DefaultInstall and DefaultUninstall attributes with .NTx86 and added LegacyUninstall = 1 to the DefaultUninstall.NTx86 section. It builds now. I don't know if it works yet though ;)

rakendrathapa commented 2 years ago

This behavior introduced with Windows 10 version 1903 and later: Look here: https://docs.microsoft.com/en-us/windows-hardware/drivers/develop/creating-a-primitive-driver

msojocs commented 5 months ago

;;
;; Default install sections
;;

[DefaultInstall.NTamd64]
OptionDesc          = %SimRepServiceDesc%
CopyFiles           = SimRep.DriverFiles

[DefaultInstall.NTamd64.Services]
AddService          = %SimRepServiceName%,,SimRep.Service

;;
;; Default uninstall sections
;;

[DefaultUninstall.NTamd64]
LegacyUninstall=1
DelFiles   = SimRep.DriverFiles
DelReg     = SimRep.DelRegistry

[DefaultUninstall.NTamd64.Services]
DelService = SimRep,0x204

image

MrRhuezzler commented 4 months ago

A solution that worked for me is to right click the driver project, and in the Driver Settings section change the Target Platform from Universal to Desktop.

This allows the project to build for me - but it won't actually deploy to the target machine. For me - the errors are just turned into warnings.

After you made that change - are you able to deploy the app? I get: Extracting service name from inf "C:\git\external\windows-driver-samples\network\trans\inspect\sys\x64\Debug\inspect\inspect.inf" Failed:

I am trying to kernel debug a driver, I am running into the same issue. Although I can ignore the errors and I am able to kernel debug but I need to install the driver manually in the test system after attaching the kernel debugger from visual studio.

It would be nice if someone has solved this.