s3-spoolss: use DSPRINT flags instead of SPOOLS_DS flags.
authorGünther Deschner <gd@samba.org>
Thu, 26 Feb 2009 22:40:58 +0000 (23:40 +0100)
committerGünther Deschner <gd@samba.org>
Fri, 27 Feb 2009 12:33:15 +0000 (13:33 +0100)
Guenther

source3/include/rpc_spoolss.h
source3/printing/nt_printing.c
source3/rpc_server/srv_spoolss_nt.c
source3/smbd/server.c
source3/utils/net_rpc_printer.c

index a26a31522429b3f3dd23558be62fc560f61c3be1..798bbf922c1e535ee312ade010673cd6d5013232 100644 (file)
@@ -428,11 +428,6 @@ typedef struct printer_info_6
 }
 PRINTER_INFO_6;
 
-#define SPOOL_DS_PUBLISH       1
-#define SPOOL_DS_UPDATE                2
-#define SPOOL_DS_UNPUBLISH     4
-#define SPOOL_DS_PENDING        0x80000000
-
 typedef struct printer_info_7
 {
        UNISTR guid; /* text form of printer guid */
index b254ce0b95d948b90c152c3c84f01bf136d6a3e1..d8658e9280f569c290121107e384fa9ee9820666 100644 (file)
@@ -3425,8 +3425,8 @@ WERROR nt_printer_publish(Printer_entry *print_hnd, int snum, int action)
                goto done;
 
        switch (action) {
-       case SPOOL_DS_PUBLISH:
-       case SPOOL_DS_UPDATE:
+       case DSPRINT_PUBLISH:
+       case DSPRINT_UPDATE:
                /* set the DsSpooler info and attributes */
                if (!(map_nt_printer_info2_to_dsspooler(printer->info_2))) {
                        win_rc = WERR_NOMEM;
@@ -3435,7 +3435,7 @@ WERROR nt_printer_publish(Printer_entry *print_hnd, int snum, int action)
 
                printer->info_2->attributes |= PRINTER_ATTRIBUTE_PUBLISHED;
                break;
-       case SPOOL_DS_UNPUBLISH:
+       case DSPRINT_UNPUBLISH:
                printer->info_2->attributes ^= PRINTER_ATTRIBUTE_PUBLISHED;
                break;
        default:
@@ -3469,11 +3469,11 @@ WERROR nt_printer_publish(Printer_entry *print_hnd, int snum, int action)
        }
 
        switch (action) {
-       case SPOOL_DS_PUBLISH:
-       case SPOOL_DS_UPDATE:
+       case DSPRINT_PUBLISH:
+       case DSPRINT_UPDATE:
                win_rc = nt_printer_publish_ads(ads, printer);
                break;
-       case SPOOL_DS_UNPUBLISH:
+       case DSPRINT_UNPUBLISH:
                win_rc = nt_printer_unpublish_ads(ads, printer);
                break;
        }
index 7a580517d347e8e332a496aaeaaf3b66ab2888a7..814f406e8702948eb6302bb48aeae24806278a33 100644 (file)
@@ -4353,10 +4353,10 @@ static bool construct_printer_info_7(Printer_entry *print_hnd, PRINTER_INFO_7 *p
                strupper_m(guid_str);
                init_unistr(&printer->guid, guid_str);
                SAFE_FREE(guid_str);
-               printer->action = SPOOL_DS_PUBLISH;
+               printer->action = DSPRINT_PUBLISH;
        } else {
                init_unistr(&printer->guid, "");
-               printer->action = SPOOL_DS_UNPUBLISH;
+               printer->action = DSPRINT_UNPUBLISH;
        }
 
        return True;
index 346e8973de3948aecddaa59d66eab2badf222c96..538e04938e917c6e7434783ba35a67acf643917f 100644 (file)
@@ -730,7 +730,7 @@ void reload_printers(void)
                        DEBUG(3, ("removing stale printer %s\n", pname));
 
                        if (is_printer_published(NULL, snum, NULL))
-                               nt_printer_publish(NULL, snum, SPOOL_DS_UNPUBLISH);
+                               nt_printer_publish(NULL, snum, DSPRINT_UNPUBLISH);
                        del_a_printer(pname);
                        lp_killservice(snum);
                }
index 99012ddf2dac55b273ad3f808b3d39a3a5d5adc1..8116764d9b34f8d4c7accca3d040213b41ae952a 100644 (file)
@@ -1313,13 +1313,13 @@ static NTSTATUS rpc_printer_publish_internals_args(struct rpc_pipe_client *pipe_
 
                /* check action and set string */
                switch (action) {
-               case SPOOL_DS_PUBLISH:
+               case DSPRINT_PUBLISH:
                        action_str = "published";
                        break;
-               case SPOOL_DS_UPDATE:
+               case DSPRINT_UPDATE:
                        action_str = "updated";
                        break;
-               case SPOOL_DS_UNPUBLISH:
+               case DSPRINT_UNPUBLISH:
                        action_str = "unpublished";
                        break;
                default:
@@ -1369,7 +1369,7 @@ NTSTATUS rpc_printer_publish_publish_internals(struct net_context *c,
                                                int argc,
                                                const char **argv)
 {
-       return rpc_printer_publish_internals_args(pipe_hnd, mem_ctx, argc, argv, SPOOL_DS_PUBLISH);
+       return rpc_printer_publish_internals_args(pipe_hnd, mem_ctx, argc, argv, DSPRINT_PUBLISH);
 }
 
 NTSTATUS rpc_printer_publish_unpublish_internals(struct net_context *c,
@@ -1381,7 +1381,7 @@ NTSTATUS rpc_printer_publish_unpublish_internals(struct net_context *c,
                                                int argc,
                                                const char **argv)
 {
-       return rpc_printer_publish_internals_args(pipe_hnd, mem_ctx, argc, argv, SPOOL_DS_UNPUBLISH);
+       return rpc_printer_publish_internals_args(pipe_hnd, mem_ctx, argc, argv, DSPRINT_UNPUBLISH);
 }
 
 NTSTATUS rpc_printer_publish_update_internals(struct net_context *c,
@@ -1393,7 +1393,7 @@ NTSTATUS rpc_printer_publish_update_internals(struct net_context *c,
                                                int argc,
                                                const char **argv)
 {
-       return rpc_printer_publish_internals_args(pipe_hnd, mem_ctx, argc, argv, SPOOL_DS_UPDATE);
+       return rpc_printer_publish_internals_args(pipe_hnd, mem_ctx, argc, argv, DSPRINT_UPDATE);
 }
 
 /**
@@ -1466,16 +1466,16 @@ NTSTATUS rpc_printer_publish_list_internals(struct net_context *c,
                }
                state = info.info7.action;
                switch (state) {
-                       case SPOOL_DS_PUBLISH:
+                       case DSPRINT_PUBLISH:
                                printf("printer [%s] is published", sharename);
                                if (c->opt_verbose)
                                        printf(", guid: %s", info.info7.guid);
                                printf("\n");
                                break;
-                       case SPOOL_DS_UNPUBLISH:
+                       case DSPRINT_UNPUBLISH:
                                printf("printer [%s] is unpublished\n", sharename);
                                break;
-                       case SPOOL_DS_UPDATE:
+                       case DSPRINT_UPDATE:
                                printf("printer [%s] is currently updating\n", sharename);
                                break;
                        default:
@@ -2348,7 +2348,7 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c,
                        if (!net_spoolss_getprinter(pipe_hnd_dst, mem_ctx, &hnd_dst, 7, &info_dst_publish))
                                goto done;
 
-                       info_dst_publish.info7.action = SPOOL_DS_PUBLISH;
+                       info_dst_publish.info7.action = DSPRINT_PUBLISH;
 
                        /* ignore false from setprinter due to WERR_IO_PENDING */
                        net_spoolss_setprinter(pipe_hnd_dst, mem_ctx, &hnd_dst, 7, &info_dst_publish);