RpcAsyncInstallPrinterDriverFromPackage installs a printer driver from a driver package.

 HRESULT RpcAsyncInstallPrinterDriverFromPackage(
   [in] handle_t hRemoteBinding,
   [in, string, unique] const wchar_t* pszServer,
   [in, string, unique] const wchar_t* pszInfPath,
   [in, string] const wchar_t* pszDriverName,
   [in, string] const wchar_t* pszEnvironment,
   [in] DWORD dwFlags
 );

hRemoteBinding: An RPC explicit binding handle.

pszServer: A pointer to a string that specifies the name of the print server on which to install the printer driver.

This string contains the server name that was used to create the hRemoteBinding parameter. For RPC bind handles, refer to [MS-RPCE]. For rules governing server names, refer to [MS-RPRN] section 2.2.4.16.

pszInfPath: A pointer to a string that specifies the path to a driver installation control file that specifies the printer driver.

This control file MAY<11> be used to install the driver on a target system. For rules governing path names, refer to [MS-RPRN] section 2.2.4.9.

pszDriverName: A pointer to a string that specifies the name of the printer driver.

pszEnvironment: A pointer to a string that specifies the environment name for which the printer driver is installed. For rules governing environment names, refer to [MS-RPRN] section 2.2.4.4.

dwFlags: A bitfield that specifies the options for installing printer driver files from a driver package.

Value

Meaning

0x00000000

Only the files that will not overwrite files with a newer version SHOULD be installed.

IPDFP_COPY_ALL_FILES

0x00000001

All files SHOULD be installed, even if doing so would overwrite some newer versions.

All other bits SHOULD be set to zero by the client and MUST be ignored by the server upon receipt.

Return Values: This method returns either an HRESULT success value ([MS-ERREF] section 2.1) or an HRESULT error value to indicate failure.

Exceptions Thrown: This method MUST NOT throw any exceptions other than those that are thrown by the underlying RPC protocol [MS-RPCE].

Parameter Validation Requirements: Upon receiving this method call, the server MUST validate parameters as follows:

The print server SHOULD<12> perform the following additional validation steps:

If the installation requested by the print client is a printer driver upgrade and the new printer driver has a driver version of 0x00000003, the print server SHOULD perform the following additional validation steps:

If this validation fails, the print server returns ERROR_PRINTER_DRIVER_BLOCKED.<14>

If the installation requested by the print client is a printer driver upgrade and the new printer driver has a driver version of 0x00000004, the print server SHOULD perform the following additional validation steps:

If this validation fails, the print server returns S_FALSE.<15>

If parameter validation fails, the server MUST fail the operation immediately and return a nonzero error response to the client.

For general information about driver installation control files, see [MSDN-INFS]. For printer-specific information about printer-driver installation control files, see [MSDN-PRNINF].

Processing and Response Requirements: If parameter validation succeeds, the server MUST process the method call by:

If the operation is successful, the server MUST install the printer driver from the driver package before returning the response.