#include "includes.h"
#include "utils/net.h"
#include "librpc/gen_ndr/ndr_ntprinting.h"
-#include "librpc/gen_ndr/cli_spoolss.h"
+#include "librpc/gen_ndr/ndr_spoolss_c.h"
#include "rpc_client/cli_spoolss.h"
#include "../libcli/security/security.h"
#include "../librpc/gen_ndr/ndr_security.h"
unsigned char *data,
size_t length)
{
+ struct dcerpc_binding_handle *b = pipe_hnd->binding_handle;
struct policy_handle hnd;
enum ndr_err_code ndr_err;
struct ntprinting_form r;
f.info1 = &f1;
- status = rpccli_spoolss_AddForm(pipe_hnd,
+ status = dcerpc_spoolss_AddForm(b,
mem_ctx,
&hnd,
1,
if (!NT_STATUS_IS_OK(status)) {
d_printf(_("\tAddForm(%s) refused -- %s.\n"),
f.info1->form_name, nt_errstr(status));
+ } else if (!W_ERROR_IS_OK(result)) {
+ d_printf(_("\tAddForm(%s) refused -- %s.\n"),
+ f.info1->form_name, win_errstr(result));
+ status = werror_to_ntstatus(result);
}
- rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd, NULL);
+ dcerpc_spoolss_ClosePrinter(b, mem_ctx, &hnd, &result);
return status;
}
unsigned char *data,
size_t length)
{
+ struct dcerpc_binding_handle *b = pipe_hnd->binding_handle;
enum ndr_err_code ndr_err;
struct ntprinting_driver r;
struct spoolss_AddDriverInfoCtr d;
d.info.info3 = &d3;
d.level = 3;
- status = rpccli_spoolss_AddPrinterDriver(pipe_hnd,
+ status = dcerpc_spoolss_AddPrinterDriver(b,
mem_ctx,
NULL,
&d,
if (!NT_STATUS_IS_OK(status)) {
d_printf(_("\tAddDriver driver: [%s] refused -- %s.\n"),
d3.driver_name, nt_errstr(status));
+ } else if (!W_ERROR_IS_OK(result)) {
+ d_printf(_("\tAddDriver driver: [%s] refused -- %s.\n"),
+ d3.driver_name, win_errstr(result));
+ status = werror_to_ntstatus(result);
}
return status;
unsigned char *data,
size_t length)
{
+ struct dcerpc_binding_handle *b = pipe_hnd->binding_handle;
struct policy_handle hnd;
enum ndr_err_code ndr_err;
struct ntprinting_printer r;
info_ctr.info.info2 = &info2;
info_ctr.level = 2;
- status = rpccli_spoolss_SetPrinter(pipe_hnd,
+ status = dcerpc_spoolss_SetPrinter(b,
mem_ctx,
&hnd,
&info_ctr,
d_printf(_("\tSetPrinter(%s) level 2 refused -- %s.\n"),
key_name, nt_errstr(status));
goto done;
+ } else if (!W_ERROR_IS_OK(result)) {
+ d_printf(_("\tSetPrinter(%s) level 2 refused -- %s.\n"),
+ key_name, win_errstr(result));
+ status = werror_to_ntstatus(result);
+ goto done;
}
/* migrate printerdata */
printf(" data: %s\\%s\n", keyname, valuename);
- status = rpccli_spoolss_SetPrinterDataEx(pipe_hnd,
+ status = dcerpc_spoolss_SetPrinterDataEx(b,
mem_ctx,
&hnd,
keyname,
d_printf(_("\tSetPrinterDataEx: printer [%s], keyname [%s], valuename [%s] refused -- %s.\n"),
key_name, keyname, valuename, nt_errstr(status));
break;
+ } else if (!W_ERROR_IS_OK(result)) {
+ d_printf(_("\tSetPrinterDataEx: printer [%s], keyname [%s], valuename [%s] refused -- %s.\n"),
+ key_name, keyname, valuename, win_errstr(result));
+ status = werror_to_ntstatus(result);
+ break;
}
}
done:
- rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd, NULL);
+ dcerpc_spoolss_ClosePrinter(b, mem_ctx, &hnd, &result);
return status;
}
unsigned char *data,
size_t length)
{
+ struct dcerpc_binding_handle *b = pipe_hnd->binding_handle;
struct policy_handle hnd;
enum ndr_err_code ndr_err;
struct sec_desc_buf secdesc_ctr;
info_ctr.info.info3 = &info3;
info_ctr.level = 3;
- status = rpccli_spoolss_SetPrinter(pipe_hnd,
+ status = dcerpc_spoolss_SetPrinter(b,
mem_ctx,
&hnd,
&info_ctr,
if (!NT_STATUS_IS_OK(status)) {
d_printf(_("\tSetPrinter(%s) level 3 refused -- %s.\n"),
key_name, nt_errstr(status));
+ } else if (!W_ERROR_IS_OK(result)) {
+ d_printf(_("\tSetPrinter(%s) level 3 refused -- %s.\n"),
+ key_name, win_errstr(result));
+ status = werror_to_ntstatus(result);
}
- rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd, NULL);
+ dcerpc_spoolss_ClosePrinter(b, mem_ctx, &hnd, &result);
return status;
}
*/
#include "includes.h"
#include "utils/net.h"
-#include "../librpc/gen_ndr/cli_spoolss.h"
+#include "../librpc/gen_ndr/ndr_spoolss_c.h"
#include "rpc_client/cli_spoolss.h"
#include "rpc_client/init_spoolss.h"
#include "nt_printing.h"
uint32_t level,
union spoolss_PrinterInfo *info)
{
+ struct dcerpc_binding_handle *b = pipe_hnd->binding_handle;
WERROR result;
NTSTATUS status;
struct spoolss_SetPrinterInfoCtr info_ctr;
break; /* FIXME */
}
- status = rpccli_spoolss_SetPrinter(pipe_hnd, mem_ctx,
+ status = dcerpc_spoolss_SetPrinter(b, mem_ctx,
hnd,
&info_ctr,
&devmode_ctr,
&secdesc_ctr,
0, /* command */
&result);
-
+ if (!NT_STATUS_IS_OK(status)) {
+ printf(_("cannot set printer-info: %s\n"), nt_errstr(status));
+ return false;
+ }
if (!W_ERROR_IS_OK(result)) {
printf(_("cannot set printer-info: %s\n"), win_errstr(result));
return false;
uint8_t *data,
uint32_t offered)
{
+ struct dcerpc_binding_handle *b = pipe_hnd->binding_handle;
WERROR result;
NTSTATUS status;
/* setprinterdata call */
- status = rpccli_spoolss_SetPrinterData(pipe_hnd, mem_ctx,
+ status = dcerpc_spoolss_SetPrinterData(b, mem_ctx,
hnd,
value_name,
type,
data,
offered,
&result);
-
+ if (!NT_STATUS_IS_OK(status)) {
+ printf (_("unable to set printerdata: %s\n"),
+ nt_errstr(status));
+ return false;
+ }
if (!W_ERROR_IS_OK(result)) {
printf (_("unable to set printerdata: %s\n"),
win_errstr(result));
const char *keyname,
struct regval_blob *value)
{
+ struct dcerpc_binding_handle *b = pipe_hnd->binding_handle;
WERROR result;
NTSTATUS status;
/* setprinterdataex call */
- status = rpccli_spoolss_SetPrinterDataEx(pipe_hnd, mem_ctx,
+ status = dcerpc_spoolss_SetPrinterDataEx(b, mem_ctx,
hnd,
keyname,
regval_name(value),
regval_data_p(value),
regval_size(value),
&result);
-
+ if (!NT_STATUS_IS_OK(status)) {
+ printf(_("could not set printerdataex: %s\n"),
+ nt_errstr(status));
+ return false;
+ }
if (!W_ERROR_IS_OK(result)) {
printf(_("could not set printerdataex: %s\n"),
win_errstr(result));
TALLOC_CTX *mem_ctx, uint32_t level,
union spoolss_DriverInfo *info)
{
+ struct dcerpc_binding_handle *b = pipe_hnd->binding_handle;
WERROR result;
NTSTATUS status;
struct spoolss_AddDriverInfoCtr info_ctr;
}
/* addprinterdriver call */
- status = rpccli_spoolss_AddPrinterDriver(pipe_hnd, mem_ctx,
+ status = dcerpc_spoolss_AddPrinterDriver(b, mem_ctx,
pipe_hnd->srv_name_slash,
&info_ctr,
&result);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf(_("cannot add driver: %s\n"), nt_errstr(status));
+ return false;
+ }
/* be more verbose */
if (W_ERROR_V(result) == W_ERROR_V(WERR_ACCESS_DENIED)) {
printf(_("You are not allowed to add drivers\n"));
uint32_t *num_printers,
union spoolss_PrinterInfo **info_p)
{
+ struct dcerpc_binding_handle *b = pipe_hnd->binding_handle;
struct policy_handle hnd;
+ WERROR werr;
/* no arguments given, enumerate all printers */
if (argc == 0) {
}
if (!net_spoolss_getprinter(pipe_hnd, mem_ctx, &hnd, level, *info_p)) {
- rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd, NULL);
+ dcerpc_spoolss_ClosePrinter(b, mem_ctx, &hnd, &werr);
return false;
}
- rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd, NULL);
+ dcerpc_spoolss_ClosePrinter(b, mem_ctx, &hnd, &werr);
*num_printers = 1;
const char **argv,
uint32_t action)
{
+ struct dcerpc_binding_handle *b = pipe_hnd->binding_handle;
NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
uint32_t i, num_printers;
uint32_t level = 7;
ZERO_STRUCT(devmode_ctr);
ZERO_STRUCT(secdesc_ctr);
- nt_status = rpccli_spoolss_SetPrinter(pipe_hnd, mem_ctx,
+ nt_status = dcerpc_spoolss_SetPrinter(b, mem_ctx,
&hnd,
&info_ctr,
&devmode_ctr,
&secdesc_ctr,
0, /* command */
&result);
-
+ if (!NT_STATUS_IS_OK(nt_status)) {
+ printf(_("cannot set printer-info: %s\n"),
+ nt_errstr(nt_status));
+ goto done;
+ }
if (!W_ERROR_IS_OK(result) && !W_ERROR_EQUAL(result, WERR_IO_PENDING)) {
if ((action == DSPRINT_UPDATE) && W_ERROR_EQUAL(result, W_ERROR(0x80070002))) {
printf(_("printer not published yet\n"));
printf(_("cannot set printer-info: %s\n"),
win_errstr(result));
}
+ nt_status = werror_to_ntstatus(result);
goto done;
}
nt_status = NT_STATUS_OK;
done:
- if (is_valid_policy_hnd(&hnd))
- rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd, NULL);
+ if (is_valid_policy_hnd(&hnd)) {
+ dcerpc_spoolss_ClosePrinter(b, mem_ctx, &hnd, &result);
+ }
return nt_status;
}
int argc,
const char **argv)
{
+ struct dcerpc_binding_handle *b = pipe_hnd->binding_handle;
NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
uint32_t i, num_printers;
uint32_t level = 7;
union spoolss_PrinterInfo info;
struct policy_handle hnd;
int state;
+ WERROR werr;
if (!get_printer_info(pipe_hnd, mem_ctx, 2, argc, argv, &num_printers, &info_enum))
return nt_status;
nt_status = NT_STATUS_OK;
done:
- if (is_valid_policy_hnd(&hnd))
- rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd, NULL);
+ if (is_valid_policy_hnd(&hnd)) {
+ dcerpc_spoolss_ClosePrinter(b, mem_ctx, &hnd, &werr);
+ }
return nt_status;
}
int argc,
const char **argv)
{
+ struct dcerpc_binding_handle *b_src = pipe_hnd->binding_handle;
/* TODO: what now, info2 or info3 ?
convince jerry that we should add clientside setacls level 3 at least
*/
uint32_t level = 2;
const char *printername, *sharename;
struct rpc_pipe_client *pipe_hnd_dst = NULL;
+ struct dcerpc_binding_handle *b_dst = NULL;
struct policy_handle hnd_src, hnd_dst;
union spoolss_PrinterInfo *info_enum;
struct cli_state *cli_dst = NULL;
union spoolss_PrinterInfo info_src, info_dst;
+ WERROR werr;
DEBUG(3,("copying printer ACLs\n"));
/* connect destination PI_SPOOLSS */
nt_status = connect_dst_pipe(c, &cli_dst, &pipe_hnd_dst,
&ndr_table_spoolss.syntax_id);
- if (!NT_STATUS_IS_OK(nt_status))
+ if (!NT_STATUS_IS_OK(nt_status)) {
return nt_status;
-
+ }
+ b_dst = pipe_hnd_dst->binding_handle;
/* enum source printers */
if (!get_printer_info(pipe_hnd, mem_ctx, level, argc, argv, &num_printers, &info_enum)) {
/* close printer handles here */
if (is_valid_policy_hnd(&hnd_src)) {
- rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
+ dcerpc_spoolss_ClosePrinter(b_src, mem_ctx, &hnd_src, &werr);
}
if (is_valid_policy_hnd(&hnd_dst)) {
- rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
+ dcerpc_spoolss_ClosePrinter(b_dst, mem_ctx, &hnd_dst, &werr);
}
}
done:
if (is_valid_policy_hnd(&hnd_src)) {
- rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
+ dcerpc_spoolss_ClosePrinter(b_src, mem_ctx, &hnd_src, &werr);
}
if (is_valid_policy_hnd(&hnd_dst)) {
- rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
+ dcerpc_spoolss_ClosePrinter(b_dst, mem_ctx, &hnd_dst, &werr);
}
if (cli_dst) {
int argc,
const char **argv)
{
+ struct dcerpc_binding_handle *b_src = pipe_hnd->binding_handle;
NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
WERROR result;
uint32_t i, f;
uint32_t level = 1;
const char *printername, *sharename;
struct rpc_pipe_client *pipe_hnd_dst = NULL;
+ struct dcerpc_binding_handle *b_dst = NULL;
struct policy_handle hnd_src, hnd_dst;
union spoolss_PrinterInfo *info_enum;
union spoolss_PrinterInfo info_dst;
/* connect destination PI_SPOOLSS */
nt_status = connect_dst_pipe(c, &cli_dst, &pipe_hnd_dst,
&ndr_table_spoolss.syntax_id);
- if (!NT_STATUS_IS_OK(nt_status))
+ if (!NT_STATUS_IS_OK(nt_status)) {
return nt_status;
+ }
+ b_dst = pipe_hnd_dst->binding_handle;
/* enum src printers */
if (!get_printer_info(pipe_hnd, mem_ctx, 2, argc, argv, &num_printers, &info_enum)) {
/* FIXME: there might be something wrong with samba's
builtin-forms */
- status = rpccli_spoolss_AddForm(pipe_hnd_dst, mem_ctx,
+ status = dcerpc_spoolss_AddForm(b_dst, mem_ctx,
&hnd_dst,
1,
info,
&result);
+ if (!NT_STATUS_IS_OK(status)) {
+ d_printf(_("\tdcerpc_spoolss_AddForm form %d: [%s] - %s\n"),
+ f, forms[f].info1.form_name, nt_errstr(status));
+ continue;
+ }
if (!W_ERROR_IS_OK(result)) {
d_printf(_("\tAddForm form %d: [%s] refused.\n"),
f, forms[f].info1.form_name);
/* close printer handles here */
if (is_valid_policy_hnd(&hnd_src)) {
- rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
+ dcerpc_spoolss_ClosePrinter(b_src, mem_ctx, &hnd_src, &result);
}
if (is_valid_policy_hnd(&hnd_dst)) {
- rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
+ dcerpc_spoolss_ClosePrinter(b_dst, mem_ctx, &hnd_dst, &result);
}
}
done:
- if (is_valid_policy_hnd(&hnd_src))
- rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
+ if (is_valid_policy_hnd(&hnd_src)) {
+ dcerpc_spoolss_ClosePrinter(b_src, mem_ctx, &hnd_src, &result);
+ }
- if (is_valid_policy_hnd(&hnd_dst))
- rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
+ if (is_valid_policy_hnd(&hnd_dst)) {
+ dcerpc_spoolss_ClosePrinter(b_dst, mem_ctx, &hnd_dst, &result);
+ }
if (cli_dst) {
cli_shutdown(cli_dst);
int argc,
const char **argv)
{
+ struct dcerpc_binding_handle *b_src = pipe_hnd->binding_handle;
NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
uint32_t i, p;
uint32_t num_printers;
bool got_src_driver_share = false;
bool got_dst_driver_share = false;
struct rpc_pipe_client *pipe_hnd_dst = NULL;
+ struct dcerpc_binding_handle *b_dst = NULL;
struct policy_handle hnd_src, hnd_dst;
union spoolss_DriverInfo drv_info_src;
union spoolss_PrinterInfo *info_enum;
struct cli_state *cli_share_src = NULL;
struct cli_state *cli_share_dst = NULL;
const char *drivername = NULL;
+ WERROR werr;
DEBUG(3,("copying printer-drivers\n"));
nt_status = connect_dst_pipe(c, &cli_dst, &pipe_hnd_dst,
&ndr_table_spoolss.syntax_id);
- if (!NT_STATUS_IS_OK(nt_status))
+ if (!NT_STATUS_IS_OK(nt_status)) {
return nt_status;
+ }
+ b_dst = pipe_hnd_dst->binding_handle;
/* open print$-share on the src server */
nt_status = connect_to_service(c, &cli_share_src, &cli->dest_ss,
/* close dst */
if (is_valid_policy_hnd(&hnd_dst)) {
- rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
+ dcerpc_spoolss_ClosePrinter(b_dst, mem_ctx, &hnd_dst, &werr);
}
/* close src */
if (is_valid_policy_hnd(&hnd_src)) {
- rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
+ dcerpc_spoolss_ClosePrinter(b_src, mem_ctx, &hnd_src, &werr);
}
}
done:
- if (is_valid_policy_hnd(&hnd_src))
- rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
+ if (is_valid_policy_hnd(&hnd_dst)) {
+ dcerpc_spoolss_ClosePrinter(b_dst, mem_ctx, &hnd_dst, &werr);
+ }
- if (is_valid_policy_hnd(&hnd_dst))
- rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
+ /* close src */
+ if (is_valid_policy_hnd(&hnd_src)) {
+ dcerpc_spoolss_ClosePrinter(b_src, mem_ctx, &hnd_src, &werr);
+ }
if (cli_dst) {
cli_shutdown(cli_dst);
int argc,
const char **argv)
{
+ struct dcerpc_binding_handle *b_src = pipe_hnd->binding_handle;
WERROR result;
NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
uint32_t i = 0, num_printers;
struct policy_handle hnd_dst, hnd_src;
const char *printername, *sharename;
struct rpc_pipe_client *pipe_hnd_dst = NULL;
+ struct dcerpc_binding_handle *b_dst = NULL;
struct spoolss_SetPrinterInfoCtr info_ctr;
DEBUG(3,("copying printers\n"));
/* connect destination PI_SPOOLSS */
nt_status = connect_dst_pipe(c, &cli_dst, &pipe_hnd_dst,
&ndr_table_spoolss.syntax_id);
- if (!NT_STATUS_IS_OK(nt_status))
+ if (!NT_STATUS_IS_OK(nt_status)) {
return nt_status;
+ }
+ b_dst = pipe_hnd_dst->binding_handle;
/* enum printers */
if (!get_printer_info(pipe_hnd, mem_ctx, level, argc, argv, &num_printers, &info_enum)) {
DEBUG(1,("printer already exists: %s\n", sharename));
/* close printer handle here - dst only, not got src yet. */
if (is_valid_policy_hnd(&hnd_dst)) {
- rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
+ dcerpc_spoolss_ClosePrinter(b_dst, mem_ctx, &hnd_dst, &result);
}
continue;
}
/* close printer handles here */
if (is_valid_policy_hnd(&hnd_src)) {
- rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
+ dcerpc_spoolss_ClosePrinter(b_src, mem_ctx, &hnd_src, &result);
}
if (is_valid_policy_hnd(&hnd_dst)) {
- rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
+ dcerpc_spoolss_ClosePrinter(b_dst, mem_ctx, &hnd_dst, &result);
}
}
nt_status = NT_STATUS_OK;
done:
- if (is_valid_policy_hnd(&hnd_src))
- rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
+ if (is_valid_policy_hnd(&hnd_src)) {
+ dcerpc_spoolss_ClosePrinter(b_src, mem_ctx, &hnd_src, &result);
+ }
- if (is_valid_policy_hnd(&hnd_dst))
- rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
+ if (is_valid_policy_hnd(&hnd_dst)) {
+ dcerpc_spoolss_ClosePrinter(b_dst, mem_ctx, &hnd_dst, &result);
+ }
if (cli_dst) {
cli_shutdown(cli_dst);
int argc,
const char **argv)
{
+ struct dcerpc_binding_handle *b_src = pipe_hnd->binding_handle;
/* FIXME: Here the nightmare begins */
uint32_t level = 2;
const char *printername, *sharename;
struct rpc_pipe_client *pipe_hnd_dst = NULL;
+ struct dcerpc_binding_handle *b_dst = NULL;
struct policy_handle hnd_src, hnd_dst;
union spoolss_PrinterInfo *info_enum;
union spoolss_PrinterInfo info_dst_publish;
/* connect destination PI_SPOOLSS */
nt_status = connect_dst_pipe(c, &cli_dst, &pipe_hnd_dst,
&ndr_table_spoolss.syntax_id);
- if (!NT_STATUS_IS_OK(nt_status))
+ if (!NT_STATUS_IS_OK(nt_status)) {
return nt_status;
+ }
+ b_dst = pipe_hnd_dst->binding_handle;
/* enum src printers */
if (!get_printer_info(pipe_hnd, mem_ctx, level, argc, argv, &num_printers, &info_enum)) {
*/
/* enumerate data on src handle */
- nt_status = rpccli_spoolss_EnumPrinterData(pipe_hnd, mem_ctx,
+ nt_status = dcerpc_spoolss_EnumPrinterData(b_src, mem_ctx,
&hnd_src,
p,
value_name,
/* loop for all printerdata of "PrinterDriverData" */
while (NT_STATUS_IS_OK(nt_status) && W_ERROR_IS_OK(result)) {
- nt_status = rpccli_spoolss_EnumPrinterData(pipe_hnd, mem_ctx,
+ nt_status = dcerpc_spoolss_EnumPrinterData(b_src, mem_ctx,
&hnd_src,
p++,
value_name,
/* close printer handles here */
if (is_valid_policy_hnd(&hnd_src)) {
- rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
+ dcerpc_spoolss_ClosePrinter(b_src, mem_ctx, &hnd_src, &result);
}
if (is_valid_policy_hnd(&hnd_dst)) {
- rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
+ dcerpc_spoolss_ClosePrinter(b_dst, mem_ctx, &hnd_dst, &result);
}
-
}
nt_status = NT_STATUS_OK;
SAFE_FREE(url);
SAFE_FREE(unc_name);
- if (is_valid_policy_hnd(&hnd_src))
- rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
+ if (is_valid_policy_hnd(&hnd_src)) {
+ dcerpc_spoolss_ClosePrinter(b_src, mem_ctx, &hnd_src, &result);
+ }
- if (is_valid_policy_hnd(&hnd_dst))
- rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
+ if (is_valid_policy_hnd(&hnd_dst)) {
+ dcerpc_spoolss_ClosePrinter(b_dst, mem_ctx, &hnd_dst, &result);
+ }
if (cli_dst) {
cli_shutdown(cli_dst);