summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-03-06 10:54:19 +0100
committerGünther Deschner <gd@samba.org>2009-03-06 14:30:02 +0100
commitc14a589a46ab5d9f80533cda01b6624a80611dc9 (patch)
tree918796a80adc690ef1f9a4a469434695584023d6 /source3/rpc_client
parentb4707d8df34d3c1e28270e0c054bcf6b8c3758b5 (diff)
downloadsamba-c14a589a46ab5d9f80533cda01b6624a80611dc9.tar.gz
samba-c14a589a46ab5d9f80533cda01b6624a80611dc9.tar.bz2
samba-c14a589a46ab5d9f80533cda01b6624a80611dc9.zip
s3-spoolss: add convencience wrapper around rpccli_spoolss_EnumForms.
Guenther
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_spoolss.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/source3/rpc_client/cli_spoolss.c b/source3/rpc_client/cli_spoolss.c
index d76d20c962..b4828b4d90 100644
--- a/source3/rpc_client/cli_spoolss.c
+++ b/source3/rpc_client/cli_spoolss.c
@@ -279,6 +279,57 @@ WERROR rpccli_spoolss_getjob(struct rpc_pipe_client *cli,
return werror;
}
+/**********************************************************************
+ convencience wrapper around rpccli_spoolss_EnumForms
+**********************************************************************/
+
+WERROR rpccli_spoolss_enumforms(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle,
+ uint32_t level,
+ uint32_t offered,
+ uint32_t *count,
+ union spoolss_FormInfo **info)
+{
+ NTSTATUS status;
+ WERROR werror;
+ uint32_t needed;
+ DATA_BLOB buffer;
+
+ if (offered > 0) {
+ buffer = data_blob_talloc_zero(mem_ctx, offered);
+ W_ERROR_HAVE_NO_MEMORY(buffer.data);
+ }
+
+ status = rpccli_spoolss_EnumForms(cli, mem_ctx,
+ handle,
+ level,
+ (offered > 0) ? &buffer : NULL,
+ offered,
+ count,
+ info,
+ &needed,
+ &werror);
+
+ if (W_ERROR_EQUAL(werror, WERR_INSUFFICIENT_BUFFER)) {
+ offered = needed;
+ buffer = data_blob_talloc_zero(mem_ctx, needed);
+ W_ERROR_HAVE_NO_MEMORY(buffer.data);
+
+ status = rpccli_spoolss_EnumForms(cli, mem_ctx,
+ handle,
+ level,
+ (offered > 0) ? &buffer : NULL,
+ offered,
+ count,
+ info,
+ &needed,
+ &werror);
+ }
+
+ return werror;
+}
+
/*********************************************************************
Decode various spoolss rpc's and info levels