RpcGetForm (Opnum 32)

RpcGetForm retrieves information about a specified form.

 DWORD RpcGetForm(
   [in] PRINTER_HANDLE hPrinter,
   [in, string] wchar_t* pFormName,
   [in] DWORD Level,
   [in, out, unique, size_is(cbBuf), disable_consistency_check] 
     BYTE* pForm,
   [in] DWORD cbBuf,
   [out] DWORD* pcbNeeded

hPrinter: A handle to a printer object or server object that was opened by RpcAddPrinter (section, RpcAddPrinterEx (section, RpcOpenPrinter (section, or RpcOpenPrinterEx (section

pFormName: A pointer to a string that specifies the form name for which data is required. For rules governing form names, see section

Level: The form information level.




Corresponds to _FORM_INFO_1 (section


Corresponds to _FORM_INFO_2 (section

pForm: A pointer to the BUFFER, as specified in INFO Structures Query Parameters (section


This parameter can be NULL if cbBuf equals zero.

cbBuf: Specified in INFO Structures Query Parameters.

pcbNeeded: Specified in INFO Structures Query Parameters.

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

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

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

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

  • Perform the validation steps specified in INFO Structures Query 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:

  • Using information about the form, perform the processing and response steps specified in INFO Structures Query Parameters.

  • Return the status of the operation.