Ensure that the provided inf defines Class=Printer for driver installation
to succeed.
Some driver packages(HP Universal Print Driver) include inf files with
other device types such as Class=USB. Attempting to install these will fail
when tested against Windows Server 2016 Print server using
iremotewinspool RPC calls.
Signed-off-by: Justin Stephenson <jstephen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Bjoern Jacke <bjacke@samba.org>
Autobuild-User(master): Björn Jacke <bjacke@samba.org>
Autobuild-Date(master): Mon Jan 28 19:34:41 CET 2019 on sn-devel-144
drv_info->core_driver_inf, &drv_info->info);
torture_assert_goto(tctx, ok, ok, done, "Failed to parse inf driver");
+ /* Ensure that we are trying to install the correct device class:
+ * https://docs.microsoft.com/en-us/windows-hardware/drivers/install/system-defined-device-setup-classes-available-to-vendors
+ */
+ if (!(drv_info->info->printer_driver_attributes & PRINTER_DRIVER_CLASS)) {
+ ok = false;
+ torture_fail_goto(tctx, done, "Inf file Class value must be Printer");
+ }
done:
return ok;