RpcAddPrinterEx installs a printer on the print server.<288>

 DWORD RpcAddPrinterEx(
   [in, string, unique] STRING_HANDLE pName,
   [in] PRINTER_CONTAINER* pPrinterContainer,
   [in] DEVMODE_CONTAINER* pDevModeContainer,
   [in] SECURITY_CONTAINER* pSecurityContainer,
   [in] SPLCLIENT_CONTAINER* pClientInfo,
   [out] PRINTER_HANDLE* pHandle
 );

pName: A parameter specified in Print Server Name Parameters (section 3.1.4.1.4).

pPrinterContainer: A parameter specified in PRINTER_CONTAINER Parameters (section 3.1.4.1.8.6). The Level member of the PRINTER_CONTAINER MUST be 0x00000001 or 0x00000002.

pDevModeContainer: A parameter specified in DEVMODE_CONTAINER Parameters (section 3.1.4.1.8.1).

pSecurityContainer: A parameter specified in SECURITY_CONTAINER Parameters (section 3.1.4.1.8.7).

pClientInfo: A parameter specified in SPLCLIENT_CONTAINER Parameters (section 3.1.4.1.8.8).

pHandle: A pointer to a variable that MUST receive the printer remote procedure call (RPC) context handle to the printer object added. RPC context handles are specified in [C706].

Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful completion or a nonzero Windows error code to indicate failure [MS-ERREF].

Upon receiving this message, the server MUST validate parameters as follows:

If parameter validation fails, the server MUST fail the operation immediately and return a nonzero error response to the client. Otherwise, the server MUST process the message and compose a response to the client as follows: