summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/nt_printing.h3
-rw-r--r--source3/printing/nt_printing.c16
-rw-r--r--source3/rpc_server/spoolss/srv_spoolss_nt.c6
3 files changed, 5 insertions, 20 deletions
diff --git a/source3/include/nt_printing.h b/source3/include/nt_printing.h
index 69e9f7f80f..0ac1995f53 100644
--- a/source3/include/nt_printing.h
+++ b/source3/include/nt_printing.h
@@ -147,8 +147,7 @@ bool is_printer_published(TALLOC_CTX *mem_ctx,
WERROR check_published_printers(struct messaging_context *msg_ctx);
bool printer_driver_in_use(TALLOC_CTX *mem_ctx,
- const struct auth_session_info *server_info,
- struct messaging_context *msg_ctx,
+ struct dcerpc_binding_handle *b,
const struct spoolss_DriverInfo8 *r);
bool printer_driver_files_in_use(TALLOC_CTX *mem_ctx,
const struct auth_session_info *server_info,
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 7d1dd9e4d0..4eb375dddd 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -1174,16 +1174,14 @@ WERROR move_driver_to_download_area(struct auth_session_info *session_info,
****************************************************************************/
bool printer_driver_in_use(TALLOC_CTX *mem_ctx,
- const struct auth_session_info *session_info,
- struct messaging_context *msg_ctx,
- const struct spoolss_DriverInfo8 *r)
+ struct dcerpc_binding_handle *b,
+ const struct spoolss_DriverInfo8 *r)
{
int snum;
int n_services = lp_numservices();
bool in_use = False;
struct spoolss_PrinterInfo2 *pinfo2 = NULL;
WERROR result;
- struct dcerpc_binding_handle *b = NULL;
if (!r) {
return false;
@@ -1198,16 +1196,6 @@ bool printer_driver_in_use(TALLOC_CTX *mem_ctx,
continue;
}
- if (b == NULL) {
- result = winreg_printer_binding_handle(mem_ctx,
- session_info,
- msg_ctx,
- &b);
- if (!W_ERROR_IS_OK(result)) {
- return false;
- }
- }
-
result = winreg_get_printer(mem_ctx, b,
lp_servicename(snum),
&pinfo2);
diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c
index afd78f1f59..79e62c4fd3 100644
--- a/source3/rpc_server/spoolss/srv_spoolss_nt.c
+++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c
@@ -2142,8 +2142,7 @@ WERROR _spoolss_DeletePrinterDriver(struct pipes_struct *p,
}
if (printer_driver_in_use(tmp_ctx,
- get_session_info_system(),
- p->msg_ctx,
+ b,
info)) {
status = WERR_PRINTER_DRIVER_IN_USE;
goto done;
@@ -2260,8 +2259,7 @@ WERROR _spoolss_DeletePrinterDriverEx(struct pipes_struct *p,
}
if (printer_driver_in_use(tmp_ctx,
- get_session_info_system(),
- p->msg_ctx,
+ b,
info)) {
status = WERR_PRINTER_DRIVER_IN_USE;
goto done;