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

WERROR cli_spoolss_setprinter ( struct cli_state *  cli,
TALLOC_CTX mem_ctx,
POLICY_HND *  pol,
uint32  level,
PRINTER_INFO_CTR *  ctr,
uint32  command 
)

Set printer info

Parameters:
cli Pointer to client state structure which is open on the SPOOLSS pipe.
mem_ctx Pointer to an initialised talloc context.
pol Policy handle on printer to set info.
level Information level to set.
ctr Pointer to structure holding printer information.
command Specifies the action performed. See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/prntspol_13ua.asp for details.

Definition at line 666 of file cli_spoolss.c.

{
      prs_struct qbuf, rbuf;
      SPOOL_Q_SETPRINTER q;
      SPOOL_R_SETPRINTER r;
      WERROR result = W_ERROR(ERRgeneral);

      ZERO_STRUCT(q);
      ZERO_STRUCT(r);

      /* Initialise input parameters */
      prs_init(&qbuf, MAX_PDU_FRAG_LEN, mem_ctx, MARSHALL);
      prs_init(&rbuf, 0, mem_ctx, UNMARSHALL);
            
      make_spoolss_q_setprinter(mem_ctx, &q, pol, level, ctr, command);

      /* Marshall data and send request */

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

      /* Unmarshall response */

      if (!spoolss_io_r_setprinter("", &r, &rbuf, 0)) 
            goto done;
      
      result = r.status;
            
done:
      prs_mem_free(&qbuf);
      prs_mem_free(&rbuf);


      return result;    
}


Generated by  Doxygen 1.6.0   Back to index