summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/printing/nt_printing.c4
-rw-r--r--source3/printing/nt_printing_ads.c4
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c23
-rw-r--r--source3/rpc_server/srv_spoolss_util.c3
-rw-r--r--source3/rpc_server/srv_spoolss_util.h1
5 files changed, 24 insertions, 11 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index ae44d5760f..3a35522e29 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -1574,7 +1574,8 @@ bool printer_driver_in_use(TALLOC_CTX *mem_ctx,
continue;
}
- result = winreg_get_printer(mem_ctx, server_info, NULL,
+ result = winreg_get_printer(mem_ctx, server_info,
+ smbd_messaging_context(), NULL,
lp_servicename(snum), &pinfo2);
if (!W_ERROR_IS_OK(result)) {
continue; /* skip */
@@ -2172,6 +2173,7 @@ bool print_time_access_check(struct auth_serversupplied_info *server_info,
uint32 mins;
result = winreg_get_printer(NULL, server_info,
+ smbd_messaging_context(),
NULL, servicename, &pinfo2);
if (!W_ERROR_IS_OK(result)) {
return False;
diff --git a/source3/printing/nt_printing_ads.c b/source3/printing/nt_printing_ads.c
index 66d66a30a1..12993a9bf9 100644
--- a/source3/printing/nt_printing_ads.c
+++ b/source3/printing/nt_printing_ads.c
@@ -354,7 +354,8 @@ WERROR check_published_printers(void)
continue;
}
- result = winreg_get_printer(tmp_ctx, server_info, NULL,
+ result = winreg_get_printer(tmp_ctx, server_info,
+ smbd_messaging_context(), NULL,
lp_servicename(snum), &pinfo2);
if (!W_ERROR_IS_OK(result)) {
continue;
@@ -388,6 +389,7 @@ bool is_printer_published(TALLOC_CTX *mem_ctx,
NTSTATUS status;
result = winreg_get_printer(mem_ctx, server_info,
+ smbd_messaging_context(),
servername, printer, &pinfo2);
if (!W_ERROR_IS_OK(result)) {
return false;
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 4d3d7565af..36b2746cb6 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -539,6 +539,7 @@ static bool set_printer_hnd_name(TALLOC_CTX *mem_ctx,
result = winreg_get_printer(mem_ctx,
server_info,
+ smbd_messaging_context(),
servername,
sname,
&info2);
@@ -1345,7 +1346,8 @@ void do_drv_upgrade_printer(struct messaging_context *msg,
continue;
}
- result = winreg_get_printer(tmp_ctx, server_info, NULL,
+ result = winreg_get_printer(tmp_ctx, server_info, msg,
+ NULL,
lp_const_servicename(snum),
&pinfo2);
@@ -3232,6 +3234,7 @@ static WERROR printserver_notify_info(struct pipes_struct *p,
/* Maybe we should use the SYSTEM server_info here... */
result = winreg_get_printer(mem_ctx, p->server_info,
+ p->msg_ctx,
Printer->servername,
lp_servicename(snum),
&pinfo2);
@@ -3315,7 +3318,7 @@ static WERROR printer_notify_info(struct pipes_struct *p,
get_printer_snum(p, hnd, &snum, NULL);
/* Maybe we should use the SYSTEM server_info here... */
- result = winreg_get_printer(mem_ctx, p->server_info,
+ result = winreg_get_printer(mem_ctx, p->server_info, p->msg_ctx,
Printer->servername,
lp_servicename(snum), &pinfo2);
if (!W_ERROR_IS_OK(result)) {
@@ -3828,6 +3831,7 @@ static WERROR enum_all_printers_info_level(TALLOC_CTX *mem_ctx,
}
result = winreg_get_printer(mem_ctx, server_info,
+ smbd_messaging_context(),
NULL, printer, &info2);
if (!W_ERROR_IS_OK(result)) {
goto out;
@@ -4206,6 +4210,7 @@ WERROR _spoolss_GetPrinter(struct pipes_struct *p,
result = winreg_get_printer(p->mem_ctx,
p->server_info,
+ p->msg_ctx,
servername,
lp_const_servicename(snum),
&info2);
@@ -4966,6 +4971,7 @@ static WERROR construct_printer_driver_info_level(TALLOC_CTX *mem_ctx,
result = winreg_get_printer(mem_ctx,
server_info,
+ smbd_messaging_context(),
servername,
lp_const_servicename(snum),
&pinfo2);
@@ -5947,6 +5953,7 @@ static WERROR update_printer(struct pipes_struct *p,
result = winreg_get_printer(tmp_ctx,
p->server_info,
+ p->msg_ctx,
servername,
lp_const_servicename(snum),
&old_printer);
@@ -6041,7 +6048,7 @@ static WERROR publish_or_unpublish_printer(struct pipes_struct *p,
if (!get_printer_snum(p, handle, &snum, NULL))
return WERR_BADFID;
- result = winreg_get_printer(p->mem_ctx, p->server_info,
+ result = winreg_get_printer(p->mem_ctx, p->server_info, p->msg_ctx,
Printer->servername,
lp_servicename(snum), &pinfo2);
if (!W_ERROR_IS_OK(result)) {
@@ -6499,8 +6506,8 @@ WERROR _spoolss_EnumJobs(struct pipes_struct *p,
return WERR_BADFID;
}
- result = winreg_get_printer(p->mem_ctx, p->server_info, NULL,
- lp_servicename(snum), &pinfo2);
+ result = winreg_get_printer(p->mem_ctx, p->server_info, p->msg_ctx,
+ NULL, lp_servicename(snum), &pinfo2);
if (!W_ERROR_IS_OK(result)) {
return result;
}
@@ -8497,8 +8504,8 @@ WERROR _spoolss_GetJob(struct pipes_struct *p,
return WERR_BADFID;
}
- result = winreg_get_printer(p->mem_ctx, p->server_info, NULL,
- lp_servicename(snum), &pinfo2);
+ result = winreg_get_printer(p->mem_ctx, p->server_info, p->msg_ctx,
+ NULL, lp_servicename(snum), &pinfo2);
if (!W_ERROR_IS_OK(result)) {
return result;
}
@@ -8709,7 +8716,7 @@ WERROR _spoolss_SetPrinterDataEx(struct pipes_struct *p,
return WERR_ACCESS_DENIED;
}
- result = winreg_get_printer(Printer, p->server_info,
+ result = winreg_get_printer(Printer, p->server_info, p->msg_ctx,
Printer->servername,
lp_servicename(snum),
&pinfo2);
diff --git a/source3/rpc_server/srv_spoolss_util.c b/source3/rpc_server/srv_spoolss_util.c
index 2f28f36118..9f8d21f62d 100644
--- a/source3/rpc_server/srv_spoolss_util.c
+++ b/source3/rpc_server/srv_spoolss_util.c
@@ -1957,6 +1957,7 @@ done:
WERROR winreg_get_printer(TALLOC_CTX *mem_ctx,
struct auth_serversupplied_info *server_info,
+ struct messaging_context *msg_ctx,
const char *servername,
const char *printer,
struct spoolss_PrinterInfo2 **pinfo2)
@@ -1989,7 +1990,7 @@ WERROR winreg_get_printer(TALLOC_CTX *mem_ctx,
result = winreg_printer_openkey(tmp_ctx,
server_info,
- smbd_messaging_context(),
+ msg_ctx,
&winreg_pipe,
path,
"",
diff --git a/source3/rpc_server/srv_spoolss_util.h b/source3/rpc_server/srv_spoolss_util.h
index 6468b8b2d0..fc0f0cff54 100644
--- a/source3/rpc_server/srv_spoolss_util.h
+++ b/source3/rpc_server/srv_spoolss_util.h
@@ -127,6 +127,7 @@ WERROR winreg_update_printer(TALLOC_CTX *mem_ctx,
*/
WERROR winreg_get_printer(TALLOC_CTX *mem_ctx,
struct auth_serversupplied_info *server_info,
+ struct messaging_context *msg_ctx,
const char *servername,
const char *printer,
struct spoolss_PrinterInfo2 **pinfo2);