220.127.116.11.9 RpcGetCorePrinterDrivers (Opnum 102)
HRESULT RpcGetCorePrinterDrivers( [in, string, unique] STRING_HANDLE pszServer, [in, string] const wchar_t* pszEnvironment, [in] DWORD cchCoreDrivers, [in, size_is(cchCoreDrivers)] const wchar_t* pszzCoreDriverDependencies, [in] DWORD cCorePrinterDrivers, [out, size_is(cCorePrinterDrivers)] CORE_PRINTER_DRIVER* pCorePrinterDrivers );
pszEnvironment: A pointer to a string that specifies the environment name for which the core printer driver information is returned. For rules governing environment names and product behaviors, see 18.104.22.168.
cchCoreDrivers: The size, in bytes, of the buffer that is referenced by the pszzCoreDriverDependencies parameter.
A print client SHOULD obtain this list of IDs as follows:
Call RpcGetPrinterDriver (section 22.214.171.124.3) with a Level parameter value of 0x00000008.
A _DRIVER_INFO_8 custom-marshaled structure is returned in the pDriver parameter.
In the _DRIVER_INFO_8 structure, the szzCoreDependenciesOffset member contains an offset to a multisz that contains the list of IDs.
cCorePrinterDrivers: The count of CORE_PRINTER_DRIVER (section 126.96.36.199) structures that are contained in the buffer that is pointed to by the pCorePrinterDrivers parameter. It MUST equal the number of IDs that are specified in the multisz that is pointed to by the pszzCoreDriverDependencies parameter.
pCorePrinterDrivers: A pointer to a buffer that receives an array of CORE_PRINTER_DRIVER structures.
Return Values: This method MUST return zero or an HRESULT success value ([MS-ERREF] section 2.1) to indicate successful completion 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 pszEnvironment parameter MUST specify one of the supported environment names on the server for that type of driver; otherwise the server MUST return ERROR_INVALID_ENVIRONMENT.
cCorePrinterDrivers MUST be equal to or greater than 1; otherwise the server MUST return ERROR_INVALID_PARAMETER.
cCorePrinterDrivers MUST be equal to the number of GUIDs present in pszzCoreDriverDependencies; otherwise the server MUST return ERROR_INVALID_PARAMETER.
The pCorePrinterDrivers parameter MUST NOT be NULL.
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 process the method call by
Enumerating the CORE_PRINTER_DRIVER structures in the system.
Populating each CORE_PRINTER_DRIVER structure in the supplied buffer with information about the core printer driver.
Returning a response that MUST contain the output parameters mentioned above and the status of the operation.
The server MUST NOT change the List of Core Printer Drivers as part of processing this method call.