diff options
author | Günther Deschner <gd@samba.org> | 2011-01-18 18:37:52 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2011-01-21 15:20:22 +0100 |
commit | e94ffc790e7206f76d9ea43d0620511143547457 (patch) | |
tree | b582e29d4e6dda2d79e09291acc5193fca783c04 /source3/rpc_client | |
parent | 831f3eec16623e8c96aa58a4e03db5f0fcda8b5c (diff) | |
download | samba-e94ffc790e7206f76d9ea43d0620511143547457.tar.gz samba-e94ffc790e7206f76d9ea43d0620511143547457.tar.bz2 samba-e94ffc790e7206f76d9ea43d0620511143547457.zip |
s3-rpc_client: prefer dcerpc_spoolss_X functions.
Guenther
Diffstat (limited to 'source3/rpc_client')
-rw-r--r-- | source3/rpc_client/cli_spoolss.c | 186 |
1 files changed, 149 insertions, 37 deletions
diff --git a/source3/rpc_client/cli_spoolss.c b/source3/rpc_client/cli_spoolss.c index ce21a768e5..fc154a3e19 100644 --- a/source3/rpc_client/cli_spoolss.c +++ b/source3/rpc_client/cli_spoolss.c @@ -23,7 +23,7 @@ */ #include "includes.h" -#include "../librpc/gen_ndr/cli_spoolss.h" +#include "../librpc/gen_ndr/ndr_spoolss_c.h" #include "rpc_client/cli_spoolss.h" /********************************************************************** @@ -41,6 +41,7 @@ WERROR rpccli_spoolss_openprinter_ex(struct rpc_pipe_client *cli, struct spoolss_DevmodeContainer devmode_ctr; union spoolss_UserLevel userlevel; struct spoolss_UserLevel1 level1; + struct dcerpc_binding_handle *b = cli->binding_handle; ZERO_STRUCT(devmode_ctr); @@ -55,7 +56,7 @@ WERROR rpccli_spoolss_openprinter_ex(struct rpc_pipe_client *cli, userlevel.level1 = &level1; - status = rpccli_spoolss_OpenPrinterEx(cli, mem_ctx, + status = dcerpc_spoolss_OpenPrinterEx(b, mem_ctx, printername, NULL, devmode_ctr, @@ -65,14 +66,14 @@ WERROR rpccli_spoolss_openprinter_ex(struct rpc_pipe_client *cli, handle, &werror); - if (!W_ERROR_IS_OK(werror)) { - return werror; - } - if (!NT_STATUS_IS_OK(status)) { return ntstatus_to_werror(status); } + if (!W_ERROR_IS_OK(werror)) { + return werror; + } + return WERR_OK; } @@ -92,13 +93,14 @@ WERROR rpccli_spoolss_getprinterdriver(struct rpc_pipe_client *cli, WERROR werror; uint32_t needed; DATA_BLOB buffer; + struct dcerpc_binding_handle *b = cli->binding_handle; if (offered > 0) { buffer = data_blob_talloc_zero(mem_ctx, offered); W_ERROR_HAVE_NO_MEMORY(buffer.data); } - status = rpccli_spoolss_GetPrinterDriver(cli, mem_ctx, + status = dcerpc_spoolss_GetPrinterDriver(b, mem_ctx, handle, architecture, level, @@ -107,12 +109,15 @@ WERROR rpccli_spoolss_getprinterdriver(struct rpc_pipe_client *cli, info, &needed, &werror); + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } 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_GetPrinterDriver(cli, mem_ctx, + status = dcerpc_spoolss_GetPrinterDriver(b, mem_ctx, handle, architecture, level, @@ -122,6 +127,9 @@ WERROR rpccli_spoolss_getprinterdriver(struct rpc_pipe_client *cli, &needed, &werror); } + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } return werror; } @@ -146,13 +154,14 @@ WERROR rpccli_spoolss_getprinterdriver2(struct rpc_pipe_client *cli, WERROR werror; uint32_t needed; DATA_BLOB buffer; + struct dcerpc_binding_handle *b = cli->binding_handle; if (offered > 0) { buffer = data_blob_talloc_zero(mem_ctx, offered); W_ERROR_HAVE_NO_MEMORY(buffer.data); } - status = rpccli_spoolss_GetPrinterDriver2(cli, mem_ctx, + status = dcerpc_spoolss_GetPrinterDriver2(b, mem_ctx, handle, architecture, level, @@ -165,12 +174,16 @@ WERROR rpccli_spoolss_getprinterdriver2(struct rpc_pipe_client *cli, server_major_version, server_minor_version, &werror); + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } + 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_GetPrinterDriver2(cli, mem_ctx, + status = dcerpc_spoolss_GetPrinterDriver2(b, mem_ctx, handle, architecture, level, @@ -184,6 +197,9 @@ WERROR rpccli_spoolss_getprinterdriver2(struct rpc_pipe_client *cli, server_minor_version, &werror); } + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } return werror; } @@ -203,6 +219,7 @@ WERROR rpccli_spoolss_addprinterex(struct rpc_pipe_client *cli, struct spoolss_UserLevelCtr userlevel_ctr; struct spoolss_UserLevel1 level1; struct policy_handle handle; + struct dcerpc_binding_handle *b = cli->binding_handle; ZERO_STRUCT(devmode_ctr); ZERO_STRUCT(secdesc_ctr); @@ -219,7 +236,7 @@ WERROR rpccli_spoolss_addprinterex(struct rpc_pipe_client *cli, userlevel_ctr.level = 1; userlevel_ctr.user_info.level1 = &level1; - status = rpccli_spoolss_AddPrinterEx(cli, mem_ctx, + status = dcerpc_spoolss_AddPrinterEx(b, mem_ctx, cli->srv_name_slash, info_ctr, &devmode_ctr, @@ -227,6 +244,10 @@ WERROR rpccli_spoolss_addprinterex(struct rpc_pipe_client *cli, &userlevel_ctr, &handle, &result); + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } + return result; } @@ -245,13 +266,14 @@ WERROR rpccli_spoolss_getprinter(struct rpc_pipe_client *cli, WERROR werror; DATA_BLOB buffer; uint32_t needed; + struct dcerpc_binding_handle *b = cli->binding_handle; if (offered > 0) { buffer = data_blob_talloc_zero(mem_ctx, offered); W_ERROR_HAVE_NO_MEMORY(buffer.data); } - status = rpccli_spoolss_GetPrinter(cli, mem_ctx, + status = dcerpc_spoolss_GetPrinter(b, mem_ctx, handle, level, (offered > 0) ? &buffer : NULL, @@ -259,6 +281,9 @@ WERROR rpccli_spoolss_getprinter(struct rpc_pipe_client *cli, info, &needed, &werror); + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } if (W_ERROR_EQUAL(werror, WERR_INSUFFICIENT_BUFFER)) { @@ -266,7 +291,7 @@ WERROR rpccli_spoolss_getprinter(struct rpc_pipe_client *cli, buffer = data_blob_talloc_zero(mem_ctx, offered); W_ERROR_HAVE_NO_MEMORY(buffer.data); - status = rpccli_spoolss_GetPrinter(cli, mem_ctx, + status = dcerpc_spoolss_GetPrinter(b, mem_ctx, handle, level, &buffer, @@ -275,6 +300,9 @@ WERROR rpccli_spoolss_getprinter(struct rpc_pipe_client *cli, &needed, &werror); } + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } return werror; } @@ -295,13 +323,14 @@ WERROR rpccli_spoolss_getjob(struct rpc_pipe_client *cli, WERROR werror; uint32_t needed; DATA_BLOB buffer; + struct dcerpc_binding_handle *b = cli->binding_handle; if (offered > 0) { buffer = data_blob_talloc_zero(mem_ctx, offered); W_ERROR_HAVE_NO_MEMORY(buffer.data); } - status = rpccli_spoolss_GetJob(cli, mem_ctx, + status = dcerpc_spoolss_GetJob(b, mem_ctx, handle, job_id, level, @@ -310,13 +339,16 @@ WERROR rpccli_spoolss_getjob(struct rpc_pipe_client *cli, info, &needed, &werror); + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } 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_GetJob(cli, mem_ctx, + status = dcerpc_spoolss_GetJob(b, mem_ctx, handle, job_id, level, @@ -326,6 +358,9 @@ WERROR rpccli_spoolss_getjob(struct rpc_pipe_client *cli, &needed, &werror); } + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } return werror; } @@ -346,13 +381,14 @@ WERROR rpccli_spoolss_enumforms(struct rpc_pipe_client *cli, WERROR werror; uint32_t needed; DATA_BLOB buffer; + struct dcerpc_binding_handle *b = cli->binding_handle; if (offered > 0) { buffer = data_blob_talloc_zero(mem_ctx, offered); W_ERROR_HAVE_NO_MEMORY(buffer.data); } - status = rpccli_spoolss_EnumForms(cli, mem_ctx, + status = dcerpc_spoolss_EnumForms(b, mem_ctx, handle, level, (offered > 0) ? &buffer : NULL, @@ -361,13 +397,16 @@ WERROR rpccli_spoolss_enumforms(struct rpc_pipe_client *cli, info, &needed, &werror); + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } 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_EnumForms(cli, mem_ctx, + status = dcerpc_spoolss_EnumForms(b, mem_ctx, handle, level, (offered > 0) ? &buffer : NULL, @@ -377,6 +416,9 @@ WERROR rpccli_spoolss_enumforms(struct rpc_pipe_client *cli, &needed, &werror); } + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } return werror; } @@ -398,13 +440,14 @@ WERROR rpccli_spoolss_enumprintprocessors(struct rpc_pipe_client *cli, WERROR werror; uint32_t needed; DATA_BLOB buffer; + struct dcerpc_binding_handle *b = cli->binding_handle; if (offered > 0) { buffer = data_blob_talloc_zero(mem_ctx, offered); W_ERROR_HAVE_NO_MEMORY(buffer.data); } - status = rpccli_spoolss_EnumPrintProcessors(cli, mem_ctx, + status = dcerpc_spoolss_EnumPrintProcessors(b, mem_ctx, servername, environment, level, @@ -414,13 +457,16 @@ WERROR rpccli_spoolss_enumprintprocessors(struct rpc_pipe_client *cli, info, &needed, &werror); + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } 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_EnumPrintProcessors(cli, mem_ctx, + status = dcerpc_spoolss_EnumPrintProcessors(b, mem_ctx, servername, environment, level, @@ -431,6 +477,9 @@ WERROR rpccli_spoolss_enumprintprocessors(struct rpc_pipe_client *cli, &needed, &werror); } + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } return werror; } @@ -452,13 +501,14 @@ WERROR rpccli_spoolss_enumprintprocessordatatypes(struct rpc_pipe_client *cli, WERROR werror; uint32_t needed; DATA_BLOB buffer; + struct dcerpc_binding_handle *b = cli->binding_handle; 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, + status = dcerpc_spoolss_EnumPrintProcDataTypes(b, mem_ctx, servername, print_processor_name, level, @@ -468,13 +518,16 @@ WERROR rpccli_spoolss_enumprintprocessordatatypes(struct rpc_pipe_client *cli, info, &needed, &werror); + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } 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, + status = dcerpc_spoolss_EnumPrintProcDataTypes(b, mem_ctx, servername, print_processor_name, level, @@ -485,6 +538,9 @@ WERROR rpccli_spoolss_enumprintprocessordatatypes(struct rpc_pipe_client *cli, &needed, &werror); } + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } return werror; } @@ -505,13 +561,14 @@ WERROR rpccli_spoolss_enumports(struct rpc_pipe_client *cli, WERROR werror; uint32_t needed; DATA_BLOB buffer; + struct dcerpc_binding_handle *b = cli->binding_handle; if (offered > 0) { buffer = data_blob_talloc_zero(mem_ctx, offered); W_ERROR_HAVE_NO_MEMORY(buffer.data); } - status = rpccli_spoolss_EnumPorts(cli, mem_ctx, + status = dcerpc_spoolss_EnumPorts(b, mem_ctx, servername, level, (offered > 0) ? &buffer : NULL, @@ -520,13 +577,16 @@ WERROR rpccli_spoolss_enumports(struct rpc_pipe_client *cli, info, &needed, &werror); + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } 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_EnumPorts(cli, mem_ctx, + status = dcerpc_spoolss_EnumPorts(b, mem_ctx, servername, level, (offered > 0) ? &buffer : NULL, @@ -536,6 +596,9 @@ WERROR rpccli_spoolss_enumports(struct rpc_pipe_client *cli, &needed, &werror); } + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } return werror; } @@ -556,13 +619,14 @@ WERROR rpccli_spoolss_enummonitors(struct rpc_pipe_client *cli, WERROR werror; uint32_t needed; DATA_BLOB buffer; + struct dcerpc_binding_handle *b = cli->binding_handle; if (offered > 0) { buffer = data_blob_talloc_zero(mem_ctx, offered); W_ERROR_HAVE_NO_MEMORY(buffer.data); } - status = rpccli_spoolss_EnumMonitors(cli, mem_ctx, + status = dcerpc_spoolss_EnumMonitors(b, mem_ctx, servername, level, (offered > 0) ? &buffer : NULL, @@ -571,13 +635,16 @@ WERROR rpccli_spoolss_enummonitors(struct rpc_pipe_client *cli, info, &needed, &werror); + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } 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_EnumMonitors(cli, mem_ctx, + status = dcerpc_spoolss_EnumMonitors(b, mem_ctx, servername, level, (offered > 0) ? &buffer : NULL, @@ -587,6 +654,9 @@ WERROR rpccli_spoolss_enummonitors(struct rpc_pipe_client *cli, &needed, &werror); } + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } return werror; } @@ -609,13 +679,14 @@ WERROR rpccli_spoolss_enumjobs(struct rpc_pipe_client *cli, WERROR werror; uint32_t needed; DATA_BLOB buffer; + struct dcerpc_binding_handle *b = cli->binding_handle; if (offered > 0) { buffer = data_blob_talloc_zero(mem_ctx, offered); W_ERROR_HAVE_NO_MEMORY(buffer.data); } - status = rpccli_spoolss_EnumJobs(cli, mem_ctx, + status = dcerpc_spoolss_EnumJobs(b, mem_ctx, handle, firstjob, numjobs, @@ -626,13 +697,16 @@ WERROR rpccli_spoolss_enumjobs(struct rpc_pipe_client *cli, info, &needed, &werror); + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } 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_EnumJobs(cli, mem_ctx, + status = dcerpc_spoolss_EnumJobs(b, mem_ctx, handle, firstjob, numjobs, @@ -644,6 +718,9 @@ WERROR rpccli_spoolss_enumjobs(struct rpc_pipe_client *cli, &needed, &werror); } + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } return werror; } @@ -665,13 +742,14 @@ WERROR rpccli_spoolss_enumprinterdrivers(struct rpc_pipe_client *cli, WERROR werror; uint32_t needed; DATA_BLOB buffer; + struct dcerpc_binding_handle *b = cli->binding_handle; if (offered > 0) { buffer = data_blob_talloc_zero(mem_ctx, offered); W_ERROR_HAVE_NO_MEMORY(buffer.data); } - status = rpccli_spoolss_EnumPrinterDrivers(cli, mem_ctx, + status = dcerpc_spoolss_EnumPrinterDrivers(b, mem_ctx, server, environment, level, @@ -681,13 +759,16 @@ WERROR rpccli_spoolss_enumprinterdrivers(struct rpc_pipe_client *cli, info, &needed, &werror); + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } 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_EnumPrinterDrivers(cli, mem_ctx, + status = dcerpc_spoolss_EnumPrinterDrivers(b, mem_ctx, server, environment, level, @@ -698,6 +779,9 @@ WERROR rpccli_spoolss_enumprinterdrivers(struct rpc_pipe_client *cli, &needed, &werror); } + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } return werror; } @@ -719,13 +803,14 @@ WERROR rpccli_spoolss_enumprinters(struct rpc_pipe_client *cli, WERROR werror; uint32_t needed; DATA_BLOB buffer; + struct dcerpc_binding_handle *b = cli->binding_handle; if (offered > 0) { buffer = data_blob_talloc_zero(mem_ctx, offered); W_ERROR_HAVE_NO_MEMORY(buffer.data); } - status = rpccli_spoolss_EnumPrinters(cli, mem_ctx, + status = dcerpc_spoolss_EnumPrinters(b, mem_ctx, flags, server, level, @@ -735,13 +820,16 @@ WERROR rpccli_spoolss_enumprinters(struct rpc_pipe_client *cli, info, &needed, &werror); + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } 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_EnumPrinters(cli, mem_ctx, + status = dcerpc_spoolss_EnumPrinters(b, mem_ctx, flags, server, level, @@ -752,6 +840,9 @@ WERROR rpccli_spoolss_enumprinters(struct rpc_pipe_client *cli, &needed, &werror); } + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } return werror; } @@ -773,11 +864,12 @@ WERROR rpccli_spoolss_getprinterdata(struct rpc_pipe_client *cli, WERROR werror; uint32_t needed; uint8_t *data; + struct dcerpc_binding_handle *b = cli->binding_handle; data = talloc_zero_array(mem_ctx, uint8_t, offered); W_ERROR_HAVE_NO_MEMORY(data); - status = rpccli_spoolss_GetPrinterData(cli, mem_ctx, + status = dcerpc_spoolss_GetPrinterData(b, mem_ctx, handle, value_name, type, @@ -785,13 +877,16 @@ WERROR rpccli_spoolss_getprinterdata(struct rpc_pipe_client *cli, offered, &needed, &werror); + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } 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, + status = dcerpc_spoolss_GetPrinterData(b, mem_ctx, handle, value_name, type, @@ -800,6 +895,9 @@ WERROR rpccli_spoolss_getprinterdata(struct rpc_pipe_client *cli, &needed, &werror); } + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } *data_p = data; *needed_p = needed; @@ -823,8 +921,9 @@ WERROR rpccli_spoolss_enumprinterkey(struct rpc_pipe_client *cli, uint32_t needed; union spoolss_KeyNames _key_buffer; uint32_t _ndr_size; + struct dcerpc_binding_handle *b = cli->binding_handle; - status = rpccli_spoolss_EnumPrinterKey(cli, mem_ctx, + status = dcerpc_spoolss_EnumPrinterKey(b, mem_ctx, handle, key_name, &_ndr_size, @@ -832,10 +931,13 @@ WERROR rpccli_spoolss_enumprinterkey(struct rpc_pipe_client *cli, offered, &needed, &werror); + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } if (W_ERROR_EQUAL(werror, WERR_MORE_DATA)) { offered = needed; - status = rpccli_spoolss_EnumPrinterKey(cli, mem_ctx, + status = dcerpc_spoolss_EnumPrinterKey(b, mem_ctx, handle, key_name, &_ndr_size, @@ -844,6 +946,9 @@ WERROR rpccli_spoolss_enumprinterkey(struct rpc_pipe_client *cli, &needed, &werror); } + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } *key_buffer = _key_buffer.string_array; @@ -865,8 +970,9 @@ WERROR rpccli_spoolss_enumprinterdataex(struct rpc_pipe_client *cli, NTSTATUS status; WERROR werror; uint32_t needed; + struct dcerpc_binding_handle *b = cli->binding_handle; - status = rpccli_spoolss_EnumPrinterDataEx(cli, mem_ctx, + status = dcerpc_spoolss_EnumPrinterDataEx(b, mem_ctx, handle, key_name, offered, @@ -874,11 +980,14 @@ WERROR rpccli_spoolss_enumprinterdataex(struct rpc_pipe_client *cli, info, &needed, &werror); + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } if (W_ERROR_EQUAL(werror, WERR_MORE_DATA)) { offered = needed; - status = rpccli_spoolss_EnumPrinterDataEx(cli, mem_ctx, + status = dcerpc_spoolss_EnumPrinterDataEx(b, mem_ctx, handle, key_name, offered, @@ -887,6 +996,9 @@ WERROR rpccli_spoolss_enumprinterdataex(struct rpc_pipe_client *cli, &needed, &werror); } + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } return werror; } |