s3-printing: clean up print_job_pause/resume interface
[ddiss/samba.git] / source3 / rpc_server / spoolss / srv_spoolss_nt.c
index 2b0387dd491973e328f906ff0f36151434ec9fe2..7befe7fd8f2f7ef94d888458dc5ff0b77df970c1 100644 (file)
@@ -2202,7 +2202,7 @@ static WERROR spoolss_dpd_version(TALLOC_CTX *mem_ctx,
         * because the driver doesn not exist any more
         */
        if (delete_files) {
-               delete_driver_files(get_session_info_system(), info);
+               delete_driver_files(p->session_info, info);
        }
 
 done:
@@ -3228,7 +3228,7 @@ static void spoolss_notify_job_position(struct messaging_context *msg_ctx,
                                        struct spoolss_PrinterInfo2 *pinfo2,
                                        TALLOC_CTX *mem_ctx)
 {
-       SETUP_SPOOLSS_NOTIFY_DATA_INTEGER(data, queue->job);
+       SETUP_SPOOLSS_NOTIFY_DATA_INTEGER(data, queue->sysjob);
 }
 
 /*******************************************************************
@@ -3694,7 +3694,7 @@ static WERROR printer_notify_info(struct pipes_struct *p,
                                                           &queue[j], info,
                                                           pinfo2, snum,
                                                           &option_type,
-                                                          queue[j].job,
+                                                          queue[j].sysjob,
                                                           mem_ctx);
                        }
 
@@ -6975,7 +6975,7 @@ static WERROR fill_job_info1(TALLOC_CTX *mem_ctx,
 
        t = gmtime(&queue->time);
 
-       r->job_id               = queue->job;
+       r->job_id               = queue->sysjob;
 
        r->printer_name         = talloc_strdup(mem_ctx, lp_servicename(snum));
        W_ERROR_HAVE_NO_MEMORY(r->printer_name);
@@ -7016,7 +7016,7 @@ static WERROR fill_job_info2(TALLOC_CTX *mem_ctx,
 
        t = gmtime(&queue->time);
 
-       r->job_id               = queue->job;
+       r->job_id               = queue->sysjob;
 
        r->printer_name         = talloc_strdup(mem_ctx, lp_servicename(snum));
        W_ERROR_HAVE_NO_MEMORY(r->printer_name);
@@ -7069,10 +7069,10 @@ static WERROR fill_job_info3(TALLOC_CTX *mem_ctx,
                             int position, int snum,
                             struct spoolss_PrinterInfo2 *pinfo2)
 {
-       r->job_id               = queue->job;
+       r->job_id               = queue->sysjob;
        r->next_job_id          = 0;
        if (next_queue) {
-               r->next_job_id  = next_queue->job;
+               r->next_job_id  = next_queue->sysjob;
        }
        r->reserved             = 0;
 
@@ -7381,17 +7381,13 @@ WERROR _spoolss_SetJob(struct pipes_struct *p,
                }
                break;
        case SPOOLSS_JOB_CONTROL_PAUSE:
-               if (print_job_pause(session_info, p->msg_ctx,
-                                   snum, r->in.job_id, &errcode)) {
-                       errcode = WERR_OK;
-               }
+               errcode = print_job_pause(session_info, p->msg_ctx,
+                                         snum, r->in.job_id);
                break;
        case SPOOLSS_JOB_CONTROL_RESTART:
        case SPOOLSS_JOB_CONTROL_RESUME:
-               if (print_job_resume(session_info, p->msg_ctx,
-                                    snum, r->in.job_id, &errcode)) {
-                       errcode = WERR_OK;
-               }
+               errcode = print_job_resume(session_info, p->msg_ctx,
+                                          snum, r->in.job_id);
                break;
        case 0:
                errcode = WERR_OK;
@@ -9253,7 +9249,7 @@ static WERROR getjob_level_1(TALLOC_CTX *mem_ctx,
        bool found = false;
 
        for (i=0; i<count; i++) {
-               if (queue[i].job == (int)jobid) {
+               if (queue[i].sysjob == (int)jobid) {
                        found = true;
                        break;
                }
@@ -9288,7 +9284,7 @@ static WERROR getjob_level_2(TALLOC_CTX *mem_ctx,
        WERROR result;
 
        for (i=0; i<count; i++) {
-               if (queue[i].job == (int)jobid) {
+               if (queue[i].sysjob == (int)jobid) {
                        found = true;
                        break;
                }