3.1.4.2.12 RpcAsyncDeletePrinterDriverPackage (Opnum 67)

RpcAsyncDeletePrinterDriverPackage deletes a specified printer driver package.

 HRESULT RpcAsyncDeletePrinterDriverPackage(
   [in] handle_t hRemoteBinding,
   [in, string, unique] const wchar_t* pszServer,
   [in, string] const wchar_t* pszInfPath,
   [in, string] const wchar_t* pszEnvironment
 );

hRemoteBinding: An RPC explicit binding handle.

pszServer: A non-NULL pointer to a string that specifies the name of the print server from which to delete the printer driver package. This string contains a server name that is identical to the server name that was used to create the hRemoteBinding parameter. For details on RPC bind handles, see [MS-RPCE]. For rules governing print server names, see [MS-RPRN] section 2.2.4.16.

pszInfPath: A non-NULL pointer to a string that specifies the path name of a driver installation control file that specifies the printer driver and MAY<28> be used to delete the driver from the print server. For rules governing path names, see [MS-RPRN] section 2.2.4.9.

pszEnvironment: A non-NULL pointer to a string that specifies the environment name for which the driver will be deleted. For rules governing environment names, see [MS-RPRN] section 2.2.4.4.

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 string pointed to by the pszInfPath parameter contains an existing path name; otherwise the server MUST return ERROR_INVALID_PARAMETER.

  • The string pointed to by the pszEnvironment parameter specifies one of the supported environment names on the server for that type of driver; otherwise the server MUST return ERROR_INVALID_ENVIRONMENT.

Additional validation SHOULD<29> be performed.

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

Processing and Response Requirements: If parameter validation succeeds, the server MUST search for the driver package based on pszInfPath and determine if the driver package is in use on the print server. A driver package is in use on a server if at least one printer driver on the server has been installed from the driver package as specified in section 3.1.4.2.7, or if the driver package contains a core printer driver on which other printer drivers on the server depend. If the driver package is in use on the server, the server MUST return ERROR_PRINTER_DRIVER_PACKAGE_IN_USE. If the driver package is not in use, the server MUST delete it from the driver store of the print server.

If the operation is successful, the server MUST delete the driver package from the driver store of the print server, before returning a response that contains the status of the operation.