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

WERROR cli_spoolss_getform ( struct cli_state *  cli,
TALLOC_CTX mem_ctx,
uint32  offered,
uint32 *  needed,
POLICY_HND *  handle,
char *  formname,
uint32  level,
FORM_1 *  form 
)

Get 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.
formname Name of the form to get
level Form info level to get - should always be 1.

Definition at line 1306 of file cli_spoolss.c.

{
      prs_struct qbuf, rbuf;
      SPOOL_Q_GETFORM q;
      SPOOL_R_GETFORM r;
      WERROR result = W_ERROR(ERRgeneral);
      NEW_BUFFER buffer;

      ZERO_STRUCT(q);
      ZERO_STRUCT(r);

      /* Initialise parse structures */

      init_buffer(&buffer, offered, mem_ctx);

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

      /* Initialise input parameters */

        make_spoolss_q_getform(&q, handle, formname, level, &buffer, offered);
      
      /* Marshall data and send request */

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

      /* Unmarshall response */

      if (!spoolss_io_r_getform("", &r, &rbuf, 0))
            goto done;

            /* Return output parameters */
            
      result = r.status;

      if (needed)
            *needed = r.needed;

      if (W_ERROR_IS_OK(result)) 
            smb_io_form_1("", r.buffer, form, 0);

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

      return result;
}


Generated by  Doxygen 1.6.0   Back to index