diff options
Diffstat (limited to 'source3/rpc_client/cli_spoolss.c')
-rw-r--r-- | source3/rpc_client/cli_spoolss.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/source3/rpc_client/cli_spoolss.c b/source3/rpc_client/cli_spoolss.c index d0781a0e65..2ca313d168 100644 --- a/source3/rpc_client/cli_spoolss.c +++ b/source3/rpc_client/cli_spoolss.c @@ -765,34 +765,44 @@ WERROR rpccli_spoolss_getprinterdata(struct rpc_pipe_client *cli, const char *value_name, uint32_t offered, enum winreg_Type *type, - union spoolss_PrinterData *data) + uint32_t *needed_p, + uint8_t **data_p) { NTSTATUS status; WERROR werror; uint32_t needed; + uint8_t *data; + + data = talloc_zero_array(mem_ctx, uint8_t, offered); + W_ERROR_HAVE_NO_MEMORY(data); status = rpccli_spoolss_GetPrinterData(cli, mem_ctx, handle, value_name, - offered, type, data, + offered, &needed, &werror); if (W_ERROR_EQUAL(werror, WERR_MORE_DATA)) { offered = needed; + data = talloc_zero_array(mem_ctx, uint8_t, offered); + W_ERROR_HAVE_NO_MEMORY(data); status = rpccli_spoolss_GetPrinterData(cli, mem_ctx, handle, value_name, - offered, type, data, + offered, &needed, &werror); } + *data_p = data; + *needed_p = needed; + return werror; } |