Logo Search packages:      
Sourcecode: samba-doc-ja version File versions

WERROR cli_spoolss_setform ( struct cli_state *  cli,
TALLOC_CTX mem_ctx,
POLICY_HND *  handle,
uint32  level,
char *  form_name,
FORM *  form 
)

Set a form on a printer.

Parameters:
cli Pointer to client state structure which is open on the SPOOLSS pipe.
mem_ctx Pointer to an initialised talloc context.
handle Policy handle opened with cli_spoolss_open_printer_ex or cli_spoolss_addprinterex.
level Form info level to set - should always be 1.
form A pointer to the form to be set.

Definition at line 1245 of file cli_spoolss.c.

{
      prs_struct qbuf, rbuf;
      SPOOL_Q_SETFORM q;
      SPOOL_R_SETFORM r;
      WERROR result = W_ERROR(ERRgeneral);

      ZERO_STRUCT(q);
      ZERO_STRUCT(r);

      /* Initialise parse structures */

      prs_init(&qbuf, MAX_PDU_FRAG_LEN, mem_ctx, MARSHALL);
      prs_init(&rbuf, 0, mem_ctx, UNMARSHALL);

      /* Initialise input parameters */

        make_spoolss_q_setform(&q, handle, level, form_name, form);
      
      /* Marshall data and send request */

      if (!spoolss_io_q_setform("", &q, &qbuf, 0) ||
          !rpc_api_pipe_req(cli, SPOOLSS_SETFORM, &qbuf, &rbuf))
            goto done;

            /* Unmarshall response */
            
      if (!spoolss_io_r_setform("", &r, &rbuf, 0))
                  goto done;

      /* Return output parameters */

      result = r.status;

      if (!W_ERROR_IS_OK(result))
            goto done;



 done:
      prs_mem_free(&qbuf);
      prs_mem_free(&rbuf);

      return result;
}


Generated by  Doxygen 1.6.0   Back to index