summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2002-04-10 07:19:37 +0000
committerTim Potter <tpot@samba.org>2002-04-10 07:19:37 +0000
commite8a8b04002e89e6a2c190258f145bd7f2600bd6f (patch)
tree0159fdf07560836bf298e557b7c5c00c14218b43 /source3
parent4ad0ff29bf44e2506311f672bf912e7a2d39048a (diff)
downloadsamba-e8a8b04002e89e6a2c190258f145bd7f2600bd6f.tar.gz
samba-e8a8b04002e89e6a2c190258f145bd7f2600bd6f.tar.bz2
samba-e8a8b04002e89e6a2c190258f145bd7f2600bd6f.zip
Added cli_spoolss_enumjobs() function.
(This used to be commit 952eb866f44ac0d8ba2032cf251d3a4298a750d3)
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/cli_spoolss.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/source3/libsmb/cli_spoolss.c b/source3/libsmb/cli_spoolss.c
index cbe7da7d50..cf356ef815 100644
--- a/source3/libsmb/cli_spoolss.c
+++ b/source3/libsmb/cli_spoolss.c
@@ -1534,5 +1534,57 @@ done:
return result;
}
+/* Enumerate jobs */
+
+WERROR cli_spoolss_enumjobs(struct cli_state *cli, TALLOC_CTX *mem_ctx,
+ uint32 offered, uint32 *needed,
+ POLICY_HND *hnd, uint32 firstjob, uint32 numofjobs,
+ uint32 level)
+{
+ prs_struct qbuf, rbuf;
+ SPOOL_Q_ENUMJOBS q;
+ SPOOL_R_ENUMJOBS 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_enumjobs(&q, hnd, firstjob, numofjobs, level, &buffer,
+ offered);
+
+ /* Marshall data and send request */
+
+ if (!spoolss_io_q_enumjobs("", &q, &qbuf, 0) ||
+ !rpc_api_pipe_req(cli, SPOOLSS_ENUMJOBS, &qbuf, &rbuf))
+ goto done;
+
+ /* Unmarshall response */
+
+ if (!spoolss_io_r_enumjobs("", &r, &rbuf, 0))
+ goto done;
+
+ /* Return output parameters */
+
+ result = r.status;
+
+ if (needed)
+ *needed = r.needed;
+
+ done:
+ prs_mem_free(&qbuf);
+ prs_mem_free(&rbuf);
+
+ return result;
+}
/** @} **/