3.1.4.5.4 RpcSetForm (Opnum 33)

RpcSetForm replaces the form information for the specified form.

 DWORD RpcSetForm(
   [in] PRINTER_HANDLE hPrinter,
   [in, string] wchar_t* pFormName,
   [in] FORM_CONTAINER* pFormInfoContainer
 );

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

pFormName: A pointer to a string that specifies the form name on which the form information is set. For rules governing form names, see section 2.2.4.5.

pFormInfoContainer: A parameter specified in FORM_CONTAINER Parameters, section 3.1.4.1.8.4.

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.

  • Verify that the pFormName parameter points to a string that identifies an existing form. If that verification fails, return ERROR_INVALID_FORM_NAME [MS-ERREF].

  • Perform the validation steps that are specified in FORM_CONTAINER Parameters, section 3.1.4.1.8.4.

  • Additional validation MAY<355> be performed.

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:

  • Modify the object that corresponds to pFormName in order to reflect the new settings supplied in pFormInfoContainer.

  • If any clients have registered for notification of server object changes, a notification MUST be broadcast to them.

  • Return the status of the operation.