I am trying to compile the XPSDrv Driver and Filter Sample from Microsoft Windows driver samples.
https://github.com/microsoft/Windows-driver-samples/tree/master/print/XPSDrvSmpl
I followed the instructions step by step.
Solution Build Fails:
Warning The driver package project C:\Users\ihebb\source\repos\Windows-driver-samples-master\print\XPSDrvSmpl\Driver Package\Driver Package.vcxproj doesn't have any references to other projects and no projects were packaged.
Driver Package C:\Program Files (x86)\Windows Kits\10\build\WindowsDriver.common.targets 1710
Warning 1324 [Version] section should specify PnpLockdown=1. package (Package\package) C:\Users\ihebb\source\repos\Windows-driver-samples-master\print\XPSDrvSmpl\install\xdsmpl.inf 19
Warning 2083 Section [printerpackageinstallation.x86] not referenced or used. package (Package\package) C:\Users\ihebb\source\repos\Windows-driver-samples-master\print\XPSDrvSmpl\install\xdsmpl.inf 70
Warning 2083 Section [printerpackageinstallation.ia64] not referenced or used. package (Package\package) C:\Users\ihebb\source\repos\Windows-driver-samples-master\print\XPSDrvSmpl\install\xdsmpl.inf 78
Warning 2083 Section [printerpackageinstallation.arm64] not referenced or used. package (Package\package) C:\Users\ihebb\source\repos\Windows-driver-samples-master\print\XPSDrvSmpl\install\xdsmpl.inf 82
Warning 2083 Section [printerpackageinstallation.amd64] not referenced or used. package (Package\package) C:\Users\ihebb\source\repos\Windows-driver-samples-master\print\XPSDrvSmpl\install\xdsmpl.inf 74
Error 1297 (NTarm64.6.0) Device driver does not install on any devices, use primitive driver if this is intended. package (Package\package) C:\Users\ihebb\source\repos\Windows-driver-samples-master\print\XPSDrvSmpl\install\xdsmpl.inf 1
I referred to these two questions. But the answers don't work in my case.
Device driver does not install on any devices, use primitive driver if this is intended in Visual studio 2019 for hello world driver?
An error occurred while creating the driver. The device driver is not installed on any device, use a primitive driver if provided
The solutions propose to either remove the INF file or Manufacturer section.
I am trying to set up a driver for a virtual printer (can't be a primitive driver) so a Security Certificate has to be generated (INF must exist) and the Certificate must have a Manufacturer.
xdsmpl.inf:
;
; Copyright (c) 2005 Microsoft Corporation
;
; All rights reserved.
;
; THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
; ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
; THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
; PARTICULAR PURPOSE.
;
; File Name:
;
; xdsmpl.inf
;
; Abstract:
;
; XPSDrv sample driver install file
;
[Version]
Signature="$Windows NT$"
Provider=%ProviderString%
ClassGUID={4D36E979-E325-11CE-BFC1-08002BE10318}
Class=Printer
DriverVer=10/17/2008,6.1.6930.0
CatalogFile=XpsDrvSmpl.cat
[Manufacturer]
%ManufacturerName%=Standard,NTx86,NTia64,NTamd64,NTx86.6.0,NTia64.6.0,NTamd64.6.0,NTarm64.6.0
[Standard.NTx86]
"XPSDrv Sample Driver" = INSTALL_XDSMPL_FILTERS_PRE_VISTA
[Standard.NTia64]
"XPSDrv Sample Driver" = INSTALL_XDSMPL_FILTERS_PRE_VISTA
[Standard.NTamd64]
"XPSDrv Sample Driver" = INSTALL_XDSMPL_FILTERS_PRE_VISTA
[Standard.NTx86.6.0]
"XPSDrv Sample Driver" = INSTALL_XDSMPL_FILTERS_VISTA
[Standard.NTia64.6.0]
"XPSDrv Sample Driver" = INSTALL_XDSMPL_FILTERS_VISTA
[Standard.NTamd64.6.0]
"XPSDrv Sample Driver" = INSTALL_XDSMPL_FILTERS_VISTA
[Standard.NTarm64.6.0]
"XPSDrv Sample Driver" = INSTALL_XDSMPL_FILTERS_VISTA
[INSTALL_XDSMPL_FILTERS_PRE_VISTA]
CopyFiles=XPSDrvSample,ConfigPlugin,COLORPROFILES
DriverFile=mxdwdrv.dll
PrintProcessor="MS_XPS,filterpipelineprintproc.dll"
ConfigFile=UniDrvUI.dll
HelpFile=UniDrv.HLP
DataFile=XDSmpl.GPD
Include=NTPRINT.INF, MSXPSDRV.INF
Needs=UNIDRV.OEM, XPSGPD.OEM, XPSDRV.OEM
[INSTALL_XDSMPL_FILTERS_VISTA]
CopyFiles=XPSDrvSample,ConfigPlugin,COLORPROFILES
DriverFile=mxdwdrv.dll
ConfigFile=UniDrvUI.dll
HelpFile=UniDrv.HLP
DataFile=XDSmpl.GPD
ICMProfiles=xdwscRGB.icc
CoreDriverSections="{D20EA372-DD35-4950-9ED8-A6335AFE79F0},UNIDRV.OEM", "{D20EA372-DD35-4950-9ED8-A6335AFE79F5},XPSDRV.OEM,XPSGPD.OEM"
[PrinterPackageInstallation.x86]
PackageAware=TRUE
CoreDriverDependencies={D20EA372-DD35-4950-9ED8-A6335AFE79F0}, {D20EA372-DD35-4950-9ED8-A6335AFE79F5}
[PrinterPackageInstallation.amd64]
PackageAware=TRUE
CoreDriverDependencies={D20EA372-DD35-4950-9ED8-A6335AFE79F0}, {D20EA372-DD35-4950-9ED8-A6335AFE79F5}
[PrinterPackageInstallation.ia64]
PackageAware=TRUE
CoreDriverDependencies={D20EA372-DD35-4950-9ED8-A6335AFE79F0}, {D20EA372-DD35-4950-9ED8-A6335AFE79F5}
[PrinterPackageInstallation.arm64]
PackageAware=TRUE
CoreDriverDependencies={D20EA372-DD35-4950-9ED8-A6335AFE79F0}, {D20EA372-DD35-4950-9ED8-A6335AFE79F5}
[DestinationDirs]
DefaultDestDir=66000
COLORPROFILES=66003
[COLORPROFILES]
xdwscRGB.icc
xdCMYKPrinter.icc
[ConfigPlugin]
XDSmpl.ini
XDSmplUI.dll
[XPSDrvSample]
xdsmpl.gpd
xdnames.gpd
xdwmark.gpd
xdbook.gpd
xdcolman.gpd
xdnup.gpd
xdpgscl.gpd
xdwmark.dll
xdcolman.dll
xdbook.dll
xdnup.dll
xdscale.dll
xdsmpl-pipelineconfig.xml
[SourceDisksNames.x86]
1 = %Location%,,
2 = %Location%,,,x86
[SourceDisksNames.ia64]
1 = %Location%,,
2 = %Location%,,,ia64
[SourceDisksNames.amd64]
1 = %Location%,,
2 = %Location%,,,amd64
[SourceDisksNames.arm64]
1 = %Location%,,
2 = %Location%,,,arm64
[SourceDisksFiles]
xdsmpl.gpd = 1
xdnames.gpd = 1
xdwmark.gpd = 1
xdbook.gpd = 1
xdcolman.gpd = 1
xdnup.gpd = 1
xdpgscl.gpd = 1
xdsmpl-pipelineconfig.xml = 1
xdsmpl.ini = 1
xdwscRGB.icc = 1
xdCMYKPrinter.icc = 1
xdwmark.dll = 1
xdcolman.dll = 1
xdbook.dll = 1
xdnup.dll = 1
xdsmplui.dll = 1
xdscale.dll = 1
[Strings]
Location="XPSDrv Sample Driver Location"
ManufacturerName="VirtualPrinterABC"
ProviderString = "VirtualPrinterABC"
Output:
Build started...
1>------ Build started: Project: Driver Package, Configuration: Debug Win32 ------
1>Building 'Driver Package' with toolset 'WindowsKernelModeDriver10.0' and the 'Desktop' target platform.
1>C:\Program Files (x86)\Windows Kits\10\build\WindowsDriver.common.targets(1710,5): warning : The driver package project C:\Users\ihebb\source\repos\Windows-driver-samples-master\print\XPSDrvSmpl\Driver Package\Driver Package.vcxproj doesn't have any references to other projects and no projects were packaged.
1>C:\Program Files (x86)\Windows Kits\10\build\WindowsDriver.common.targets(1710,5): warning :
1>Inf2Cat task was skipped as there were no inf files to process
1>Done building project "Driver Package.vcxproj".
2>------ Build started: Project: package (Package\package), Configuration: Debug Win32 ------
2>Building 'package' with toolset 'WindowsKernelModeDriver10.0' and the 'Desktop' target platform.
2>Stamping Debug\xdsmpl.inf
2>Stamping [Version] section with DriverVer=11/06/2021,2.57.51.890
2>C:\Users\ihebb\source\repos\Windows-driver-samples-master\print\XPSDrvSmpl\install\xdsmpl.inf : error 1297: (NTarm64.6.0) Device driver does not install on any devices, use primitive driver if this is intended.
2>C:\Users\ihebb\source\repos\Windows-driver-samples-master\print\XPSDrvSmpl\install\xdsmpl.inf(19-19): warning 1324: [Version] section should specify PnpLockdown=1.
2>C:\Users\ihebb\source\repos\Windows-driver-samples-master\print\XPSDrvSmpl\install\xdsmpl.inf(70-70): warning 2083: Section [printerpackageinstallation.x86] not referenced or used.
2>C:\Users\ihebb\source\repos\Windows-driver-samples-master\print\XPSDrvSmpl\install\xdsmpl.inf(74-74): warning 2083: Section [printerpackageinstallation.amd64] not referenced or used.
2>C:\Users\ihebb\source\repos\Windows-driver-samples-master\print\XPSDrvSmpl\install\xdsmpl.inf(78-78): warning 2083: Section [printerpackageinstallation.ia64] not referenced or used.
2>C:\Users\ihebb\source\repos\Windows-driver-samples-master\print\XPSDrvSmpl\install\xdsmpl.inf(82-82): warning 2083: Section [printerpackageinstallation.arm64] not referenced or used.
2>Done building project "package.VcxProj" -- FAILED.
========== Build: 1 succeeded, 1 failed, 10 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========