s3: Lift the smbd_messaging_context from nt_printer_publish
[amitay/samba.git] / source3 / printing / nt_printing_ads.c
index 42570389c422d7167d8063bc93de1b4b303f12c0..e981aca5e8a4ce8cdef3ea7a2bf1fc0f5d5cd950 100644 (file)
@@ -237,6 +237,7 @@ static WERROR nt_printer_unpublish_ads(ADS_STRUCT *ads,
 
 WERROR nt_printer_publish(TALLOC_CTX *mem_ctx,
                          struct auth_serversupplied_info *server_info,
+                         struct messaging_context *msg_ctx,
                          struct spoolss_PrinterInfo2 *pinfo2,
                          int action)
 {
@@ -266,8 +267,7 @@ WERROR nt_printer_publish(TALLOC_CTX *mem_ctx,
 
        sinfo2->attributes = pinfo2->attributes;
 
-       win_rc = winreg_update_printer(mem_ctx, server_info,
-                                       smbd_messaging_context(),
+       win_rc = winreg_update_printer(mem_ctx, server_info, msg_ctx,
                                        pinfo2->sharename, info2_mask,
                                        sinfo2, NULL, NULL);
        if (!W_ERROR_IS_OK(win_rc)) {
@@ -299,8 +299,7 @@ WERROR nt_printer_publish(TALLOC_CTX *mem_ctx,
        switch (action) {
        case DSPRINT_PUBLISH:
        case DSPRINT_UPDATE:
-               win_rc = nt_printer_publish_ads(smbd_messaging_context(),
-                                               ads, pinfo2);
+               win_rc = nt_printer_publish_ads(msg_ctx, ads, pinfo2);
                break;
        case DSPRINT_UNPUBLISH:
                win_rc = nt_printer_unpublish_ads(ads, pinfo2->sharename);