RpcClosePrinter closes a handle to a printer object, server object, job object, or port object.

 DWORD RpcClosePrinter(
   [in, out] PRINTER_HANDLE* phPrinter
 );

phPrinter: A pointer to a handle to a printer object, server object, job object, or port object that was opened by RpcAddPrinter (section 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section 3.1.4.2.2), or RpcOpenPrinterEx (section 3.1.4.2.14).

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:

Otherwise, the server MUST process the message and compose a response to the client as follows: