diff options
author | Günther Deschner <gd@samba.org> | 2009-03-17 23:39:00 +0100 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2009-04-15 09:07:05 +0200 |
commit | 09f73e7d1e3910adfcb403bb4a2cdbab8ce914de (patch) | |
tree | e61841a6bf7c661451cab1b5e389c555c8954e46 /source3 | |
parent | a4fbe5e67c9a96030027fe1351d5bcb2d91fba30 (diff) | |
download | samba-09f73e7d1e3910adfcb403bb4a2cdbab8ce914de.tar.gz samba-09f73e7d1e3910adfcb403bb4a2cdbab8ce914de.tar.xz samba-09f73e7d1e3910adfcb403bb4a2cdbab8ce914de.zip |
s3-spoolss: add rpccli_spoolss_enumprinterdataex convenience wrapper.
Guenther
(cherry picked from commit ab85fc78bd932aca14103352f784a4b5f2909f3a)
(cherry picked from commit 2ecc69851773d3a2cfa0e0e2dc1e90eff26e3fb0)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/proto.h | 7 | ||||
-rw-r--r-- | source3/rpc_client/cli_spoolss.c | 41 |
2 files changed, 48 insertions, 0 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index d3db1e8784e..f0929755fe2 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5543,6 +5543,13 @@ WERROR rpccli_spoolss_enumprinterkey(struct rpc_pipe_client *cli, const char *key_name, const char ***key_buffer, uint32_t offered); +WERROR rpccli_spoolss_enumprinterdataex(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle, + const char *key_name, + uint32_t offered, + uint32_t *count, + struct spoolss_PrinterEnumValues **info); WERROR rpccli_spoolss_enumprinterdataex(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, POLICY_HND *hnd, const char *keyname, REGVAL_CTR *ctr); diff --git a/source3/rpc_client/cli_spoolss.c b/source3/rpc_client/cli_spoolss.c index 9ca3ab6daec..0c9bddff287 100644 --- a/source3/rpc_client/cli_spoolss.c +++ b/source3/rpc_client/cli_spoolss.c @@ -784,6 +784,47 @@ WERROR rpccli_spoolss_enumprinterkey(struct rpc_pipe_client *cli, return werror; } +/********************************************************************** + convencience wrapper around rpccli_spoolss_EnumPrinterDataEx +**********************************************************************/ + +WERROR rpccli_spoolss_enumprinterdataex(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle, + const char *key_name, + uint32_t offered, + uint32_t *count, + struct spoolss_PrinterEnumValues **info) +{ + NTSTATUS status; + WERROR werror; + uint32_t needed; + + status = rpccli_spoolss_EnumPrinterDataEx(cli, mem_ctx, + handle, + key_name, + offered, + count, + info, + &needed, + &werror); + + if (W_ERROR_EQUAL(werror, WERR_MORE_DATA)) { + offered = needed; + + status = rpccli_spoolss_EnumPrinterDataEx(cli, mem_ctx, + handle, + key_name, + offered, + count, + info, + &needed, + &werror); + } + + return werror; +} + /********************************************************************* Decode various spoolss rpc's and info levels |