summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/nt_printing.h1
-rw-r--r--source3/printing/nt_printing.c16
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c5
3 files changed, 11 insertions, 11 deletions
diff --git a/source3/include/nt_printing.h b/source3/include/nt_printing.h
index 3ac58ca339..e8a07f8c47 100644
--- a/source3/include/nt_printing.h
+++ b/source3/include/nt_printing.h
@@ -257,6 +257,7 @@ bool driver_info_ctr_to_info8(struct spoolss_AddDriverInfoCtr *r,
bool printer_driver_in_use(TALLOC_CTX *mem_ctx,
struct auth_serversupplied_info *server_info,
+ struct messaging_context *msg_ctx,
const struct spoolss_DriverInfo8 *r);
bool printer_driver_files_in_use(TALLOC_CTX *mem_ctx,
struct auth_serversupplied_info *server_info,
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index a5d36dab57..4efc25b2c4 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -1553,6 +1553,7 @@ bool driver_info_ctr_to_info8(struct spoolss_AddDriverInfoCtr *r,
bool printer_driver_in_use(TALLOC_CTX *mem_ctx,
struct auth_serversupplied_info *server_info,
+ struct messaging_context *msg_ctx,
const struct spoolss_DriverInfo8 *r)
{
int snum;
@@ -1574,9 +1575,9 @@ bool printer_driver_in_use(TALLOC_CTX *mem_ctx,
continue;
}
- result = winreg_get_printer(mem_ctx, server_info,
- smbd_messaging_context(), NULL,
- lp_servicename(snum), &pinfo2);
+ result = winreg_get_printer(mem_ctx, server_info, msg_ctx,
+ NULL, lp_servicename(snum),
+ &pinfo2);
if (!W_ERROR_IS_OK(result)) {
continue; /* skip */
}
@@ -1600,21 +1601,18 @@ bool printer_driver_in_use(TALLOC_CTX *mem_ctx,
"Windows NT x86" version 2 or 3 left */
if (!strequal("Windows NT x86", r->architecture)) {
- werr = winreg_get_driver(mem_ctx, server_info,
- smbd_messaging_context(),
+ werr = winreg_get_driver(mem_ctx, server_info, msg_ctx,
"Windows NT x86",
r->driver_name,
DRIVER_ANY_VERSION,
&driver);
} else if (r->version == 2) {
- werr = winreg_get_driver(mem_ctx, server_info,
- smbd_messaging_context(),
+ werr = winreg_get_driver(mem_ctx, server_info, msg_ctx,
"Windows NT x86",
r->driver_name,
3, &driver);
} else if (r->version == 3) {
- werr = winreg_get_driver(mem_ctx, server_info,
- smbd_messaging_context(),
+ werr = winreg_get_driver(mem_ctx, server_info, msg_ctx,
"Windows NT x86",
r->driver_name,
2, &driver);
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index d6830dace6..683688ad52 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -1868,7 +1868,8 @@ WERROR _spoolss_DeletePrinterDriver(struct pipes_struct *p,
}
- if (printer_driver_in_use(p->mem_ctx, p->server_info, info)) {
+ if (printer_driver_in_use(p->mem_ctx, p->server_info, p->msg_ctx,
+ info)) {
status = WERR_PRINTER_DRIVER_IN_USE;
goto done;
}
@@ -1969,7 +1970,7 @@ WERROR _spoolss_DeletePrinterDriverEx(struct pipes_struct *p,
}
}
- if (printer_driver_in_use(info, p->server_info, info)) {
+ if (printer_driver_in_use(info, p->server_info, p->msg_ctx, info)) {
status = WERR_PRINTER_DRIVER_IN_USE;
goto done;
}