I am trying to create virtual print driver with WDK and print driver v4. I want to have virtual printer installed in system, display my own UI when printing - in ideal case a .NET win or wpf form. In the end, virtual printer will contact web service and will send there XPS file + XML containing metadata entered in UI.
I tryed to use v4 driver. So far, I tryed to modify printer project in Visual Studio 2013, here is my inf file:
[Version]
Signature="$Windows NT$"
Class=Printer
ClassGuid={4D36E979-E325-11CE-BFC1-08002BE10318}
Provider=%ManufacturerName%
CatalogFile=MyV4PrintDriver.cat
ClassVer=4.0
DriverVer=08/01/2012,1.0.0.0
[DestinationDirs]
DefaultDestDir = 66000
[SourceDisksNames]
1 = %DiskName%,,,""
[SourceDisksFiles]
MyV4PrintDriver.gpd=1
MyV4PrintDriver-manifest.ini=1
[Manufacturer]
%ManufacturerName%=Standard,NT$ARCH$
[Standard.NT$ARCH$]
%PrinterName%=DriverInstall,,test_virtual_printer
[Strings]
ManufacturerName="My company"
PrinterName="Test print driver"
DiskName="MyV4PrintDriver Installation Disk"
[DriverInstall]
CopyFiles=DriverFiles
[DriverFiles]
MyV4PrintDriver.gpd
MyV4PrintDriver-manifest.ini
I have test PC to deploy driver to (Win 8.1 in HyperV). Visual studio returns error on deployment. Unfortunatelly, log information in C:\DriverTest\Logs is not very usefull - says "Error HRESULT E_FAIL has been returned from call to a COM component"
I also tryed to install driver manually by running command:
rundll32 printui.dll,PrintUIEntry /ia /f "D:\Driver\MyV4PrintDriver.inf" /m "Test print driver"
But I am receiving 0x80004005 - Unspecified error.
Log files %windir%\inf\setupapi.* does not contain any error message too. - zip with logs from running deploy by Visual Studio and by running command are here
My question is: - Does anybody have any idea what could possibly be wrong? - Is my syntax of INF file correct, especially part with hardware ID? - I have no HWID since i am installing virtual printer:
[Standard.NT$ARCH$]
%PrinterName%=DriverInstall,,test_virtual_printer
Driver package is signed with test certificate, but running
signtool verify /v /c myv4printdriver.cab myv4printdriver.inf
gives an error - "A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider". My test certificate is installed on test machine in trusted root certificates..
The SetupApi logs will provide more information, whether or not it'll give you enough to solve the issue, I'm not sure. I've had a similar issue and although the logs are comprehensive, they didn't help on this occasion.
Either way though, you need to enable a few registries. See here for more details: - Sorry, just re-read the post. Looks like you've looked at the logs. I can't tell the verbosity settings from your post, so you could review to see if your SetupAPI logs are set to their most verbose to see if you can get additional information out. You can see the settings here:
https://msdn.microsoft.com/en-us/library/windows/hardware/ff550808%28v=vs.85%29.aspx
Essentially, you need to change the value at this registry:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Setup\LogLevel
Also, from the last error you report, since it's a v4 driver, it sounds more than likely that it's due to Windows 8 signed driver enforcement rules. It requires a certificate to be installed and trusted. If it's not, it'll fail to install the driver.
Assuming you just want to get things working for testing purposes, there are two options here, you can either:
Bcdedit.exe -set TESTSIGNING ON