3.1.4.2.13 RpcResetPrinter (Opnum 52)

RpcResetPrinter resets the data type and device mode (For more information, see [DEVMODE]) values to use for printing documents submitted by the RpcStartDocPrinter (section 3.1.4.9.1) method.

 DWORD RpcResetPrinter(
   [in] PRINTER_HANDLE hPrinter,
   [in, string, unique] wchar_t* pDatatype,
   [in] DEVMODE_CONTAINER* pDevModeContainer
 );

hPrinter: A handle to a printer 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).

pDatatype: A parameter specified in Datatype Name Parameters (section 3.1.4.1.1).

pDevModeContainer: A parameter specified in DEVMODE_CONTAINER Parameters.

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:

  • Perform the validation steps specified in PRINTER_HANDLE Parameters (section 3.1.4.1.11). This method SHOULD assume that the handle to the printer object can be used without further access checks.

  • Perform the validation steps specified in Datatype Name Parameters.

  • Perform the validation steps specified in DEVMODE_CONTAINER Parameters.

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:

  • Update the default data type that is associated with the context for hPrinter.

  • Update the default DEVMODE structure that is associated with the context for hPrinter.

  • Return the status of the operation.