s3: Lift the smbd_messaging_context from printer_driver_files_in_use
authorVolker Lendecke <vl@samba.org>
Sun, 8 Aug 2010 12:24:48 +0000 (14:24 +0200)
committerVolker Lendecke <vl@samba.org>
Sun, 8 Aug 2010 14:03:24 +0000 (16:03 +0200)
source3/include/nt_printing.h
source3/printing/nt_printing.c
source3/rpc_server/srv_spoolss_nt.c

index e8a07f8c47fef9a89d9ba1ebbe184321a528c0bf..c3d698b71a69dc28f09bce101170c0b6f19fe781 100644 (file)
@@ -261,6 +261,7 @@ bool printer_driver_in_use(TALLOC_CTX *mem_ctx,
                           const struct spoolss_DriverInfo8 *r);
 bool printer_driver_files_in_use(TALLOC_CTX *mem_ctx,
                                 struct auth_serversupplied_info *server_info,
+                                struct messaging_context *msg_ctx,
                                 struct spoolss_DriverInfo8 *r);
 bool delete_driver_files(struct auth_serversupplied_info *server_info,
                         const struct spoolss_DriverInfo8 *r);
index 4efc25b2c455ece08e35945b1f12eb5a4f7894c4..937cdfc6f530d1bc0278a8a6d0dfe0a0daac7e05 100644 (file)
@@ -1781,6 +1781,7 @@ static bool trim_overlap_drv_files(TALLOC_CTX *mem_ctx,
 
 bool printer_driver_files_in_use(TALLOC_CTX *mem_ctx,
                                 struct auth_serversupplied_info *server_info,
+                                struct messaging_context *msg_ctx,
                                 struct spoolss_DriverInfo8 *info)
 {
        int                             i;
@@ -1802,8 +1803,7 @@ bool printer_driver_files_in_use(TALLOC_CTX *mem_ctx,
 
        /* get the list of drivers */
 
-       result = winreg_get_driver_list(mem_ctx, server_info,
-                                       smbd_messaging_context(),
+       result = winreg_get_driver_list(mem_ctx, server_info, msg_ctx,
                                        info->architecture, version,
                                        &num_drivers, &drivers);
        if (!W_ERROR_IS_OK(result)) {
@@ -1820,8 +1820,7 @@ bool printer_driver_files_in_use(TALLOC_CTX *mem_ctx,
 
                driver = NULL;
 
-               result = winreg_get_driver(mem_ctx, server_info,
-                                          smbd_messaging_context(),
+               result = winreg_get_driver(mem_ctx, server_info, msg_ctx,
                                           info->architecture, drivers[i],
                                           version, &driver);
                if (!W_ERROR_IS_OK(result)) {
index 683688ad523818c7909e59bf6d9ad62bcd6a0546..1acde48d44e37917a921efedb14cd2e584186c23 100644 (file)
@@ -1993,7 +1993,8 @@ WERROR _spoolss_DeletePrinterDriverEx(struct pipes_struct *p,
 
        if (delete_files &&
            (r->in.delete_flags & DPD_DELETE_ALL_FILES) &&
-           printer_driver_files_in_use(info, p->server_info, info)) {
+           printer_driver_files_in_use(info, p->server_info, p->msg_ctx,
+                                       info)) {
                /* no idea of the correct error here */
                status = WERR_ACCESS_DENIED;
                goto done;
@@ -2011,6 +2012,7 @@ WERROR _spoolss_DeletePrinterDriverEx(struct pipes_struct *p,
                        if (delete_files &&
                            (r->in.delete_flags & DPD_DELETE_ALL_FILES) &&
                            printer_driver_files_in_use(info, p->server_info,
+                                                       p->msg_ctx,
                                                        info_win2k)) {
                                /* no idea of the correct error here */
                                talloc_free(info_win2k);