The Samba-Bugzilla – Attachment 5333 Details for
Bug 7130
enumjobs level 3 is required by win7
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for 3.5
enumjobs-level3.patch (text/plain), 3.42 KB, created by
Guenther Deschner
on 2010-02-12 03:25:25 UTC
(
hide
)
Description:
patch for 3.5
Filename:
MIME Type:
Creator:
Guenther Deschner
Created:
2010-02-12 03:25:25 UTC
Size:
3.42 KB
patch
obsolete
>From eacb3b7be16884bb6bfcc3b4db97708566d66c40 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd@samba.org> >Date: Thu, 11 Feb 2010 00:44:06 +0100 >Subject: [PATCH] s3-spoolss: implement spoolss_EnumJobs level 3. > >Level 3 has been added with NT 4.0 and Windows 7 (at least 64bit version) makes >use of it in order to display queued jobs. Windows 7 will *not* fall back to >level 2 if we just return WERR_UNKNOWN_LEVEL, instead there will be no printjobs >displayed at all. > >Guenther >(cherry picked from commit 25001bbd1b0b32073073dab7cf5b78a2b902163f) >--- > source3/rpc_server/srv_spoolss_nt.c | 76 +++++++++++++++++++++++++++++++++++ > 1 files changed, 76 insertions(+), 0 deletions(-) > >diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c >index 30d3d87..74f7f93 100644 >--- a/source3/rpc_server/srv_spoolss_nt.c >+++ b/source3/rpc_server/srv_spoolss_nt.c >@@ -6105,6 +6105,27 @@ static WERROR fill_job_info2(TALLOC_CTX *mem_ctx, > } > > /**************************************************************************** >+fill_job_info3 >+****************************************************************************/ >+ >+static WERROR fill_job_info3(TALLOC_CTX *mem_ctx, >+ struct spoolss_JobInfo3 *r, >+ const print_queue_struct *queue, >+ const print_queue_struct *next_queue, >+ int position, int snum, >+ const NT_PRINTER_INFO_LEVEL *ntprinter) >+{ >+ r->job_id = queue->job; >+ r->next_job_id = 0; >+ if (next_queue) { >+ r->next_job_id = next_queue->job; >+ } >+ r->reserved = 0; >+ >+ return WERR_OK; >+} >+ >+/**************************************************************************** > Enumjobs at level 1. > ****************************************************************************/ > >@@ -6202,6 +6223,57 @@ static WERROR enumjobs_level2(TALLOC_CTX *mem_ctx, > return WERR_OK; > } > >+/**************************************************************************** >+ Enumjobs at level 3. >+****************************************************************************/ >+ >+static WERROR enumjobs_level3(TALLOC_CTX *mem_ctx, >+ const print_queue_struct *queue, >+ uint32_t num_queues, int snum, >+ const NT_PRINTER_INFO_LEVEL *ntprinter, >+ union spoolss_JobInfo **info_p, >+ uint32_t *count) >+{ >+ union spoolss_JobInfo *info; >+ int i; >+ WERROR result = WERR_OK; >+ >+ info = TALLOC_ARRAY(mem_ctx, union spoolss_JobInfo, num_queues); >+ W_ERROR_HAVE_NO_MEMORY(info); >+ >+ *count = num_queues; >+ >+ for (i=0; i<*count; i++) { >+ const print_queue_struct *next_queue = NULL; >+ >+ if (i+1 < *count) { >+ next_queue = &queue[i+1]; >+ } >+ >+ result = fill_job_info3(info, >+ &info[i].info3, >+ &queue[i], >+ next_queue, >+ i, >+ snum, >+ ntprinter); >+ if (!W_ERROR_IS_OK(result)) { >+ goto out; >+ } >+ } >+ >+ out: >+ if (!W_ERROR_IS_OK(result)) { >+ TALLOC_FREE(info); >+ *count = 0; >+ return result; >+ } >+ >+ *info_p = info; >+ >+ return WERR_OK; >+} >+ > /**************************************************************** > _spoolss_EnumJobs > ****************************************************************/ >@@ -6258,6 +6330,10 @@ WERROR _spoolss_EnumJobs(pipes_struct *p, > result = enumjobs_level2(p->mem_ctx, queue, count, snum, > ntprinter, r->out.info, r->out.count); > break; >+ case 3: >+ result = enumjobs_level3(p->mem_ctx, queue, count, snum, >+ ntprinter, r->out.info, r->out.count); >+ break; > default: > result = WERR_UNKNOWN_LEVEL; > break; >-- >1.6.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
metze
:
review+
Actions:
View
Attachments on
bug 7130
: 5333 |
5334