summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-11-14 23:58:26 +0100
committerGünther Deschner <gd@samba.org>2009-02-06 18:58:34 +0100
commit0bd5698dabdf8a408e21c5261a688dd2599af3cf (patch)
treef0d4ba248e4f816fb4a8dcbd0784200399e2233c
parent46903a0f907869253899d05b3c04c93aa2e2812d (diff)
downloadsamba-0bd5698dabdf8a408e21c5261a688dd2599af3cf.tar.gz
samba-0bd5698dabdf8a408e21c5261a688dd2599af3cf.tar.bz2
samba-0bd5698dabdf8a408e21c5261a688dd2599af3cf.zip
s3-spoolss: use rpccli_spoolss_ClosePrinter.
Guenther
-rw-r--r--source3/libads/ldap_printer.c2
-rw-r--r--source3/rpcclient/cmd_spoolss.c42
-rw-r--r--source3/utils/net_rpc_printer.c50
3 files changed, 47 insertions, 47 deletions
diff --git a/source3/libads/ldap_printer.c b/source3/libads/ldap_printer.c
index 169c3bba1d..023acaa638 100644
--- a/source3/libads/ldap_printer.c
+++ b/source3/libads/ldap_printer.c
@@ -369,7 +369,7 @@ WERROR get_remote_printer_publishing_data(struct rpc_pipe_client *cli,
TALLOC_FREE( dsdriver_ctr );
TALLOC_FREE( dsspooler_ctr );
- rpccli_spoolss_close_printer(cli, mem_ctx, &pol);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &pol, NULL);
return result;
}
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index ecd0f36217..057fc25123 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -122,7 +122,7 @@ static WERROR cmd_spoolss_open_printer_ex(struct rpc_pipe_client *cli,
if (W_ERROR_IS_OK(werror)) {
printf("Printer %s opened successfully\n", printername);
- werror = rpccli_spoolss_close_printer(cli, mem_ctx, &hnd);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &hnd, &werror);
if (!W_ERROR_IS_OK(werror)) {
printf("Error closing printer handle! (%s)\n",
@@ -521,7 +521,7 @@ static WERROR cmd_spoolss_setprinter(struct rpc_pipe_client *cli,
done:
if (opened_hnd)
- rpccli_spoolss_close_printer(cli, mem_ctx, &pol);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &pol, NULL);
return result;
}
@@ -586,7 +586,7 @@ static WERROR cmd_spoolss_setprintername(struct rpc_pipe_client *cli,
done:
if (opened_hnd)
- rpccli_spoolss_close_printer(cli, mem_ctx, &pol);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &pol, NULL);
return result;
}
@@ -665,7 +665,7 @@ static WERROR cmd_spoolss_getprinter(struct rpc_pipe_client *cli,
done:
if (opened_hnd)
- rpccli_spoolss_close_printer(cli, mem_ctx, &pol);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &pol, NULL);
return result;
}
@@ -791,7 +791,7 @@ static WERROR cmd_spoolss_getprinterdata(struct rpc_pipe_client *cli,
done:
if (opened_hnd)
- rpccli_spoolss_close_printer(cli, mem_ctx, &pol);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &pol, NULL);
return result;
}
@@ -859,7 +859,7 @@ static WERROR cmd_spoolss_getprinterdataex(struct rpc_pipe_client *cli,
done:
if (opened_hnd)
- rpccli_spoolss_close_printer(cli, mem_ctx, &pol);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &pol, NULL);
return result;
}
@@ -1055,7 +1055,7 @@ static WERROR cmd_spoolss_getdriver(struct rpc_pipe_client *cli,
/* Cleanup */
if (opened_hnd)
- rpccli_spoolss_close_printer (cli, mem_ctx, &pol);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &pol, NULL);
if ( success )
werror = WERR_OK;
@@ -1490,7 +1490,7 @@ done:
/* Cleanup */
if (opened_hnd)
- rpccli_spoolss_close_printer(cli, mem_ctx, &pol);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &pol, NULL);
return result;
}
@@ -1692,7 +1692,7 @@ static WERROR cmd_spoolss_addform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
done:
if (got_handle)
- rpccli_spoolss_close_printer(cli, mem_ctx, &handle);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &handle, NULL);
SAFE_FREE(servername);
SAFE_FREE(printername);
@@ -1756,7 +1756,7 @@ static WERROR cmd_spoolss_setform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
done:
if (got_handle)
- rpccli_spoolss_close_printer(cli, mem_ctx, &handle);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &handle, NULL);
SAFE_FREE(servername);
SAFE_FREE(printername);
@@ -1852,7 +1852,7 @@ static WERROR cmd_spoolss_getform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
done:
if (got_handle)
- rpccli_spoolss_close_printer(cli, mem_ctx, &handle);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &handle, NULL);
SAFE_FREE(servername);
SAFE_FREE(printername);
@@ -1905,7 +1905,7 @@ static WERROR cmd_spoolss_deleteform(struct rpc_pipe_client *cli,
done:
if (got_handle)
- rpccli_spoolss_close_printer(cli, mem_ctx, &handle);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &handle, NULL);
SAFE_FREE(servername);
SAFE_FREE(printername);
@@ -1971,7 +1971,7 @@ static WERROR cmd_spoolss_enum_forms(struct rpc_pipe_client *cli,
done:
if (got_handle)
- rpccli_spoolss_close_printer(cli, mem_ctx, &handle);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &handle, NULL);
SAFE_FREE(servername);
SAFE_FREE(printername);
@@ -2142,7 +2142,7 @@ done:
/* cleanup */
TALLOC_FREE(tmp_ctx);
if (opened_hnd)
- rpccli_spoolss_close_printer(cli, mem_ctx, &pol);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &pol, NULL);
return result;
}
@@ -2260,7 +2260,7 @@ static WERROR cmd_spoolss_enum_jobs(struct rpc_pipe_client *cli,
done:
if (got_hnd)
- rpccli_spoolss_close_printer(cli, mem_ctx, &hnd);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &hnd, NULL);
return result;
}
@@ -2326,7 +2326,7 @@ static WERROR cmd_spoolss_enum_data( struct rpc_pipe_client *cli,
done:
if (got_hnd)
- rpccli_spoolss_close_printer(cli, mem_ctx, &hnd);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &hnd, NULL);
return result;
}
@@ -2397,7 +2397,7 @@ static WERROR cmd_spoolss_enum_data_ex( struct rpc_pipe_client *cli,
done:
if (got_hnd)
- rpccli_spoolss_close_printer(cli, mem_ctx, &hnd);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &hnd, NULL);
return result;
}
@@ -2477,7 +2477,7 @@ done:
SAFE_FREE(keylist);
if (got_hnd)
- rpccli_spoolss_close_printer(cli, mem_ctx, &hnd);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &hnd, NULL);
return result;
}
@@ -2562,7 +2562,7 @@ static WERROR cmd_spoolss_rffpcnex(struct rpc_pipe_client *cli,
done:
if (got_hnd)
- rpccli_spoolss_close_printer(cli, mem_ctx, &hnd);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &hnd, NULL);
return result;
}
@@ -2760,8 +2760,8 @@ done:
/* cleanup */
printf("Closing printers...");
- rpccli_spoolss_close_printer( cli, mem_ctx, &hPrinter1 );
- rpccli_spoolss_close_printer( cli2, mem_ctx, &hPrinter2 );
+ rpccli_spoolss_ClosePrinter( cli, mem_ctx, &hPrinter1, NULL );
+ rpccli_spoolss_ClosePrinter( cli2, mem_ctx, &hPrinter2, NULL );
printf("ok\n");
/* close the second remote connection */
diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c
index c750e46b67..60e823e5e0 100644
--- a/source3/utils/net_rpc_printer.c
+++ b/source3/utils/net_rpc_printer.c
@@ -1006,11 +1006,11 @@ static bool get_printer_info(struct rpc_pipe_client *pipe_hnd,
return false;
if (!net_spoolss_getprinter(pipe_hnd, mem_ctx, &hnd, level, ctr)) {
- rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd);
+ rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd, NULL);
return false;
}
- rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd);
+ rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd, NULL);
*num_printers = 1;
@@ -1242,7 +1242,7 @@ static NTSTATUS rpc_printer_publish_internals_args(struct rpc_pipe_client *pipe_
done:
if (got_hnd)
- rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd);
+ rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd, NULL);
return nt_status;
}
@@ -1383,7 +1383,7 @@ NTSTATUS rpc_printer_publish_list_internals(struct net_context *c,
done:
if (got_hnd)
- rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd);
+ rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd, NULL);
return nt_status;
}
@@ -1522,12 +1522,12 @@ NTSTATUS rpc_printer_migrate_security_internals(struct net_context *c,
/* close printer handles here */
if (got_hnd_src) {
- rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);
+ rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
got_hnd_src = false;
}
if (got_hnd_dst) {
- rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);
+ rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
got_hnd_dst = false;
}
@@ -1538,11 +1538,11 @@ NTSTATUS rpc_printer_migrate_security_internals(struct net_context *c,
done:
if (got_hnd_src) {
- rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);
+ rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
}
if (got_hnd_dst) {
- rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);
+ rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
}
if (cli_dst) {
@@ -1711,12 +1711,12 @@ NTSTATUS rpc_printer_migrate_forms_internals(struct net_context *c,
/* close printer handles here */
if (got_hnd_src) {
- rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);
+ rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
got_hnd_src = false;
}
if (got_hnd_dst) {
- rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);
+ rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
got_hnd_dst = false;
}
}
@@ -1726,10 +1726,10 @@ NTSTATUS rpc_printer_migrate_forms_internals(struct net_context *c,
done:
if (got_hnd_src)
- rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);
+ rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
if (got_hnd_dst)
- rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);
+ rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
if (cli_dst) {
cli_shutdown(cli_dst);
@@ -1933,13 +1933,13 @@ NTSTATUS rpc_printer_migrate_drivers_internals(struct net_context *c,
/* close dst */
if (got_hnd_dst) {
- rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);
+ rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
got_hnd_dst = false;
}
/* close src */
if (got_hnd_src) {
- rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);
+ rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
got_hnd_src = false;
}
}
@@ -1949,10 +1949,10 @@ NTSTATUS rpc_printer_migrate_drivers_internals(struct net_context *c,
done:
if (got_hnd_src)
- rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);
+ rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
if (got_hnd_dst)
- rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);
+ rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
if (cli_dst) {
cli_shutdown(cli_dst);
@@ -2067,7 +2067,7 @@ NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c,
DEBUG(1,("printer already exists: %s\n", sharename));
/* close printer handle here - dst only, not got src yet. */
if (got_hnd_dst) {
- rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);
+ rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
got_hnd_dst = false;
}
continue;
@@ -2103,12 +2103,12 @@ NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c,
/* close printer handles here */
if (got_hnd_src) {
- rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);
+ rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
got_hnd_src = false;
}
if (got_hnd_dst) {
- rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);
+ rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
got_hnd_dst = false;
}
}
@@ -2117,10 +2117,10 @@ NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c,
done:
if (got_hnd_src)
- rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);
+ rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
if (got_hnd_dst)
- rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);
+ rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
if (cli_dst) {
cli_shutdown(cli_dst);
@@ -2486,12 +2486,12 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c,
/* close printer handles here */
if (got_hnd_src) {
- rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);
+ rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
got_hnd_src = false;
}
if (got_hnd_dst) {
- rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);
+ rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
got_hnd_dst = false;
}
@@ -2505,10 +2505,10 @@ done:
SAFE_FREE(unc_name);
if (got_hnd_src)
- rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);
+ rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
if (got_hnd_dst)
- rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);
+ rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
if (cli_dst) {
cli_shutdown(cli_dst);