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

WERROR cli_spoolss_enumforms ( struct cli_state *  cli,
TALLOC_CTX mem_ctx,
uint32  offered,
uint32 *  needed,
POLICY_HND *  handle,
int  level,
uint32 *  num_forms,
FORM_1 **  forms 
)

Enumerate forms

Parameters:
cli Pointer to client state structure which is open on the SPOOLSS pipe.
mem_ctx Pointer to an initialised talloc context.
offered Buffer size offered in the request.
needed Number of bytes needed to complete the request. may be NULL. or cli_spoolss_addprinterex.
level Form info level to get - should always be 1.
handle Open policy handle

Definition at line 1440 of file cli_spoolss.c.

{
      prs_struct qbuf, rbuf;
      SPOOL_Q_ENUMFORMS q;
      SPOOL_R_ENUMFORMS 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_enumforms(&q, handle, level, &buffer, offered);

      /* Marshall data and send request */

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

      /* Unmarshall response */

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

      /* Return output parameters */

      result = r.status;

      if (needed)
            *needed = r.needed;

      if (num_forms)
            *num_forms = r.numofforms;

      decode_forms_1(mem_ctx, r.buffer, *num_forms, forms);

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

      return result;
}


Generated by  Doxygen 1.6.0   Back to index