summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-02-12 22:06:54 +0100
committerGünther Deschner <gd@samba.org>2009-02-12 22:51:29 +0100
commit30e18aadc3710116c74c47563c6476d520685cfc (patch)
tree98f6f88c94cf4896e78a0b2f62de76652485b710 /source3
parent97f15fcd68b142b5d304b9fec0a09c6361ee4ec0 (diff)
downloadsamba-30e18aadc3710116c74c47563c6476d520685cfc.tar.gz
samba-30e18aadc3710116c74c47563c6476d520685cfc.tar.bz2
samba-30e18aadc3710116c74c47563c6476d520685cfc.zip
s3-rpcclient: use rpccli_spoolss_GetPrinterDataEx.
Guenther
Diffstat (limited to 'source3')
-rw-r--r--source3/rpcclient/cmd_spoolss.c44
1 files changed, 41 insertions, 3 deletions
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index c3fd463271..b4dcad5187 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -784,11 +784,17 @@ static WERROR cmd_spoolss_getprinterdataex(struct rpc_pipe_client *cli,
{
POLICY_HND pol;
WERROR result;
+ NTSTATUS status;
bool opened_hnd = False;
fstring printername;
const char *valuename, *keyname;
REGISTRY_VALUE value;
+ uint32_t type;
+ uint8_t *buffer = NULL;
+ uint32_t offered = 0;
+ uint32_t needed;
+
if (argc != 4) {
printf("Usage: %s <printername> <keyname> <valuename>\n",
argv[0]);
@@ -819,8 +825,37 @@ static WERROR cmd_spoolss_getprinterdataex(struct rpc_pipe_client *cli,
/* Get printer info */
- result = rpccli_spoolss_getprinterdataex(cli, mem_ctx, &pol, keyname,
- valuename, &value);
+ status = rpccli_spoolss_GetPrinterDataEx(cli, mem_ctx,
+ &pol,
+ keyname,
+ valuename,
+ &type,
+ buffer,
+ offered,
+ &needed,
+ &result);
+ if (W_ERROR_EQUAL(result, WERR_MORE_DATA)) {
+ offered = needed;
+ buffer = talloc_array(mem_ctx, uint8_t, needed);
+ status = rpccli_spoolss_GetPrinterDataEx(cli, mem_ctx,
+ &pol,
+ keyname,
+ valuename,
+ &type,
+ buffer,
+ offered,
+ &needed,
+ &result);
+ }
+
+ if (!NT_STATUS_IS_OK(status)) {
+ goto done;
+ }
+
+ if (!W_ERROR_IS_OK(result)) {
+ goto done;
+ }
+
if (!W_ERROR_IS_OK(result))
goto done;
@@ -828,8 +863,11 @@ static WERROR cmd_spoolss_getprinterdataex(struct rpc_pipe_client *cli,
/* Display printer data */
fstrcpy(value.valuename, valuename);
- display_reg_value(value);
+ value.type = type;
+ value.size = needed;
+ value.data_p = buffer;
+ display_reg_value(value);
done:
if (opened_hnd)