diff options
author | Günther Deschner <gd@samba.org> | 2009-12-02 14:25:31 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2009-12-02 14:56:17 +0100 |
commit | 5f60855ba2eb822dcb867378ff09278c42931b89 (patch) | |
tree | e1d8ba7df8711f464e3c61a4adc7f41a7f146abe /source3/rpc_client | |
parent | 292af4fc046ff39ebd3ec853c402dc267a863fa6 (diff) | |
download | samba-5f60855ba2eb822dcb867378ff09278c42931b89.tar.gz samba-5f60855ba2eb822dcb867378ff09278c42931b89.tar.bz2 samba-5f60855ba2eb822dcb867378ff09278c42931b89.zip |
samba-spoolss: use spoolss_StringArray2 in spoolss_EnumPrinterKey.
This should finally resolve the endian issues we were seeing on sparc and is
much cleaner for spoolss clients and servers.
Guenther
Diffstat (limited to 'source3/rpc_client')
-rw-r--r-- | source3/rpc_client/cli_spoolss.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/source3/rpc_client/cli_spoolss.c b/source3/rpc_client/cli_spoolss.c index a4622d07cf..047cb709ac 100644 --- a/source3/rpc_client/cli_spoolss.c +++ b/source3/rpc_client/cli_spoolss.c @@ -810,44 +810,28 @@ WERROR rpccli_spoolss_enumprinterkey(struct rpc_pipe_client *cli, NTSTATUS status; WERROR werror; uint32_t needed; - uint16_t *buffer = NULL; - - *key_buffer = NULL; - - if (offered) { - buffer = talloc_array(mem_ctx, uint16_t, offered/2); - W_ERROR_HAVE_NO_MEMORY(buffer); - } + struct spoolss_StringArray2 _key_buffer; status = rpccli_spoolss_EnumPrinterKey(cli, mem_ctx, handle, key_name, - buffer, + &_key_buffer, offered, &needed, &werror); if (W_ERROR_EQUAL(werror, WERR_MORE_DATA)) { offered = needed; - buffer = talloc_realloc(mem_ctx, buffer, uint16_t, needed/2); - W_ERROR_HAVE_NO_MEMORY(buffer); status = rpccli_spoolss_EnumPrinterKey(cli, mem_ctx, handle, key_name, - buffer, + &_key_buffer, offered, &needed, &werror); } - if (W_ERROR_IS_OK(werror)) { - const char **array; - DATA_BLOB blob = data_blob_const((uint8_t *)buffer, offered); - if (!pull_reg_multi_sz(mem_ctx, &blob, &array)) { - return WERR_NOMEM; - } - *key_buffer = array; - } + *key_buffer = _key_buffer.string; return werror; } |