summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-03-06 22:22:49 +0100
committerGünther Deschner <gd@samba.org>2009-03-07 00:55:00 +0100
commit2d24d3a3800fda96d266aead26286fbb3008339c (patch)
treeda2816466a10715d087085c27a01f94a952878c9 /source3
parentf9019c18375d3b63d21aa6ed346620c487d379fb (diff)
downloadsamba-2d24d3a3800fda96d266aead26286fbb3008339c.tar.gz
samba-2d24d3a3800fda96d266aead26286fbb3008339c.tar.bz2
samba-2d24d3a3800fda96d266aead26286fbb3008339c.zip
s3-spoolss: add rpccli_spoolss_enumprintprocessordatatypes convenience wrapper.
Guenther
Diffstat (limited to 'source3')
-rw-r--r--source3/include/proto.h8
-rw-r--r--source3/rpc_client/cli_spoolss.c54
2 files changed, 62 insertions, 0 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 4b0d79cc61..b5f310012c 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -5489,6 +5489,14 @@ WERROR rpccli_spoolss_enumprintprocessors(struct rpc_pipe_client *cli,
uint32_t offered,
uint32_t *count,
union spoolss_PrintProcessorInfo **info);
+WERROR rpccli_spoolss_enumprintprocessordatatypes(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ const char *servername,
+ const char *print_processor_name,
+ uint32_t level,
+ uint32_t offered,
+ uint32_t *count,
+ union spoolss_PrintProcDataTypesInfo **info);
WERROR rpccli_spoolss_enum_printers(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
char *name, uint32 flags, uint32 level,
uint32 *num_printers, PRINTER_INFO_CTR *ctr);
diff --git a/source3/rpc_client/cli_spoolss.c b/source3/rpc_client/cli_spoolss.c
index 664220ac19..11537fc689 100644
--- a/source3/rpc_client/cli_spoolss.c
+++ b/source3/rpc_client/cli_spoolss.c
@@ -384,6 +384,60 @@ WERROR rpccli_spoolss_enumprintprocessors(struct rpc_pipe_client *cli,
return werror;
}
+/**********************************************************************
+ convencience wrapper around rpccli_spoolss_EnumPrintProcDataTypes
+**********************************************************************/
+
+WERROR rpccli_spoolss_enumprintprocessordatatypes(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ const char *servername,
+ const char *print_processor_name,
+ uint32_t level,
+ uint32_t offered,
+ uint32_t *count,
+ union spoolss_PrintProcDataTypesInfo **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_EnumPrintProcDataTypes(cli, mem_ctx,
+ servername,
+ print_processor_name,
+ 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_EnumPrintProcDataTypes(cli, mem_ctx,
+ servername,
+ print_processor_name,
+ level,
+ (offered > 0) ? &buffer : NULL,
+ offered,
+ count,
+ info,
+ &needed,
+ &werror);
+ }
+
+ return werror;
+}
+
/*********************************************************************
Decode various spoolss rpc's and info levels
********************************************************************/