The branch, master has been updated
       via  98ca5b04ba1ca0649b3004fa45cab6aaa8d5ec3c (commit)
       via  54b529a44e4b3244f79f0c5ab3dab91925fae0d4 (commit)
       via  76ae2022ad239394c9122f65bd35c1523874e6f9 (commit)
       via  3e25d3bb15fd616fdf89fcb10aba27a9a7586e15 (commit)
      from  d3ac11c64a95c2041dc0002b8cc59d756736d3be (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 98ca5b04ba1ca0649b3004fa45cab6aaa8d5ec3c
Author: Günther Deschner <g...@samba.org>
Date:   Thu Feb 26 13:15:47 2009 +0100

    s3: re-run make samba3-idl.
    
    Guenther

commit 54b529a44e4b3244f79f0c5ab3dab91925fae0d4
Author: Günther Deschner <g...@samba.org>
Date:   Thu Feb 26 01:10:58 2009 +0100

    s3-spoolss: job status defines moved to IDL.
    
    Guenther

commit 76ae2022ad239394c9122f65bd35c1523874e6f9
Author: Günther Deschner <g...@samba.org>
Date:   Thu Feb 26 01:10:37 2009 +0100

    spoolss: add spoolss_JobStatus.
    
    Guenther

commit 3e25d3bb15fd616fdf89fcb10aba27a9a7586e15
Author: Günther Deschner <g...@samba.org>
Date:   Thu Feb 26 00:49:02 2009 +0100

    s3-spoolss: remove some unused defines and structs.
    
    Guenther

-----------------------------------------------------------------------

Summary of changes:
 librpc/gen_ndr/ndr_spoolss.c        |   40 ++++++++++++++++++++++++++++++++--
 librpc/gen_ndr/ndr_spoolss.h        |    1 +
 librpc/gen_ndr/spoolss.h            |   16 ++++++++++++++
 librpc/idl/spoolss.idl              |   23 +++++++++++++++++++-
 source3/include/rpc_spoolss.h       |   40 -----------------------------------
 source3/rpc_server/srv_spoolss_nt.c |    5 +--
 6 files changed, 78 insertions(+), 47 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/gen_ndr/ndr_spoolss.c b/librpc/gen_ndr/ndr_spoolss.c
index 5717da9..f9d4461 100644
--- a/librpc/gen_ndr/ndr_spoolss.c
+++ b/librpc/gen_ndr/ndr_spoolss.c
@@ -2520,6 +2520,40 @@ _PUBLIC_ void ndr_print_spoolss_DevmodeContainer(struct 
ndr_print *ndr, const ch
        ndr->depth--;
 }
 
+static enum ndr_err_code ndr_push_spoolss_JobStatus(struct ndr_push *ndr, int 
ndr_flags, uint32_t r)
+{
+       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
+       return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_spoolss_JobStatus(struct ndr_pull *ndr, int 
ndr_flags, uint32_t *r)
+{
+       uint32_t v;
+       NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
+       *r = v;
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_spoolss_JobStatus(struct ndr_print *ndr, const char 
*name, uint32_t r)
+{
+       ndr_print_uint32(ndr, name, r);
+       ndr->depth++;
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_PAUSED", 
JOB_STATUS_PAUSED, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_ERROR", 
JOB_STATUS_ERROR, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_DELETING", 
JOB_STATUS_DELETING, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_SPOOLING", 
JOB_STATUS_SPOOLING, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_PRINTING", 
JOB_STATUS_PRINTING, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_OFFLINE", 
JOB_STATUS_OFFLINE, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_PAPEROUT", 
JOB_STATUS_PAPEROUT, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_PRINTED", 
JOB_STATUS_PRINTED, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_DELETED", 
JOB_STATUS_DELETED, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_BLOCKED_DEVQ", 
JOB_STATUS_BLOCKED_DEVQ, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), 
"JOB_STATUS_USER_INTERVENTION", JOB_STATUS_USER_INTERVENTION, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_RESTART", 
JOB_STATUS_RESTART, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_COMPLETE", 
JOB_STATUS_COMPLETE, r);
+       ndr->depth--;
+}
+
 static enum ndr_err_code ndr_push_spoolss_JobInfo1(struct ndr_push *ndr, int 
ndr_flags, const struct spoolss_JobInfo1 *r)
 {
        if (ndr_flags & NDR_SCALARS) {
@@ -2561,7 +2595,7 @@ static enum ndr_err_code ndr_push_spoolss_JobInfo1(struct 
ndr_push *ndr, int ndr
                        NDR_CHECK(ndr_push_relative_ptr1(ndr, r->text_status));
                        ndr->flags = _flags_save_string;
                }
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->status));
+               NDR_CHECK(ndr_push_spoolss_JobStatus(ndr, NDR_SCALARS, 
r->status));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priority));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->position));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->total_pages));
@@ -2716,7 +2750,7 @@ static enum ndr_err_code ndr_pull_spoolss_JobInfo1(struct 
ndr_pull *ndr, int ndr
                        }
                        ndr->flags = _flags_save_string;
                }
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->status));
+               NDR_CHECK(ndr_pull_spoolss_JobStatus(ndr, NDR_SCALARS, 
&r->status));
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority));
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->position));
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->total_pages));
@@ -2859,7 +2893,7 @@ _PUBLIC_ void ndr_print_spoolss_JobInfo1(struct ndr_print 
*ndr, const char *name
                ndr_print_string(ndr, "text_status", r->text_status);
        }
        ndr->depth--;
-       ndr_print_uint32(ndr, "status", r->status);
+       ndr_print_spoolss_JobStatus(ndr, "status", r->status);
        ndr_print_uint32(ndr, "priority", r->priority);
        ndr_print_uint32(ndr, "position", r->position);
        ndr_print_uint32(ndr, "total_pages", r->total_pages);
diff --git a/librpc/gen_ndr/ndr_spoolss.h b/librpc/gen_ndr/ndr_spoolss.h
index 2e87754..bf14422 100644
--- a/librpc/gen_ndr/ndr_spoolss.h
+++ b/librpc/gen_ndr/ndr_spoolss.h
@@ -235,6 +235,7 @@ enum ndr_err_code ndr_push_spoolss_PrinterInfo(struct 
ndr_push *ndr, int ndr_fla
 enum ndr_err_code ndr_pull_spoolss_PrinterInfo(struct ndr_pull *ndr, int 
ndr_flags, union spoolss_PrinterInfo *r);
 void ndr_print_spoolss_PrinterInfo(struct ndr_print *ndr, const char *name, 
const union spoolss_PrinterInfo *r);
 void ndr_print_spoolss_DevmodeContainer(struct ndr_print *ndr, const char 
*name, const struct spoolss_DevmodeContainer *r);
+void ndr_print_spoolss_JobStatus(struct ndr_print *ndr, const char *name, 
uint32_t r);
 void ndr_print_spoolss_JobInfo1(struct ndr_print *ndr, const char *name, const 
struct spoolss_JobInfo1 *r);
 enum ndr_err_code ndr_push_spoolss_JobInfo(struct ndr_push *ndr, int 
ndr_flags, const union spoolss_JobInfo *r);
 enum ndr_err_code ndr_pull_spoolss_JobInfo(struct ndr_pull *ndr, int 
ndr_flags, union spoolss_JobInfo *r);
diff --git a/librpc/gen_ndr/spoolss.h b/librpc/gen_ndr/spoolss.h
index e758153..25162a0 100644
--- a/librpc/gen_ndr/spoolss.h
+++ b/librpc/gen_ndr/spoolss.h
@@ -11,6 +11,7 @@
 #define _HEADER_spoolss
 
 #define PRINTER_ENUM_ICONMASK  ( 
(PRINTER_ENUM_ICON1|PRINTER_ENUM_ICON2|PRINTER_ENUM_ICON3|PRINTER_ENUM_ICON4|PRINTER_ENUM_ICON5|PRINTER_ENUM_ICON6|PRINTER_ENUM_ICON7|PRINTER_ENUM_ICON8)
 )
+#define JOB_STATUS_QUEUED      ( 0x0000 )
 #define SPOOLSS_ARCHITECTURE_NT_X86    ( "Windows NT x86" )
 #define SPOOLSS_DEFAULT_SERVER_PATH    ( "C:\\WINDOWS\\system32\\spool" )
 #define PRINTER_CHANGE_PRINTER ( 0x000000FF )
@@ -372,6 +373,21 @@ struct spoolss_DevmodeContainer {
        struct spoolss_DeviceMode *devmode;/* 
[unique,subcontext_size(_ndr_size),subcontext(4)] */
 };
 
+/* bitmap spoolss_JobStatus */
+#define JOB_STATUS_PAUSED ( 0x00000001 )
+#define JOB_STATUS_ERROR ( 0x00000002 )
+#define JOB_STATUS_DELETING ( 0x00000004 )
+#define JOB_STATUS_SPOOLING ( 0x00000008 )
+#define JOB_STATUS_PRINTING ( 0x00000010 )
+#define JOB_STATUS_OFFLINE ( 0x00000020 )
+#define JOB_STATUS_PAPEROUT ( 0x00000040 )
+#define JOB_STATUS_PRINTED ( 0x00000080 )
+#define JOB_STATUS_DELETED ( 0x00000100 )
+#define JOB_STATUS_BLOCKED_DEVQ ( 0x00000200 )
+#define JOB_STATUS_USER_INTERVENTION ( 0x00000400 )
+#define JOB_STATUS_RESTART ( 0x00000800 )
+#define JOB_STATUS_COMPLETE ( 0x00001000 )
+
 struct spoolss_JobInfo1 {
        uint32_t job_id;
        const char * printer_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] 
*/
diff --git a/librpc/idl/spoolss.idl b/librpc/idl/spoolss.idl
index 2aebed5..f356294 100644
--- a/librpc/idl/spoolss.idl
+++ b/librpc/idl/spoolss.idl
@@ -378,6 +378,27 @@ import "misc.idl", "security.idl", "winreg.idl";
 
        /******************/
        /* Function: 0x02 */
+
+       /* JOB status codes. */
+
+       const int JOB_STATUS_QUEUED = 0x0000;
+
+       typedef [bitmap32bit] bitmap {
+               JOB_STATUS_PAUSED               = 0x00000001,
+               JOB_STATUS_ERROR                = 0x00000002,
+               JOB_STATUS_DELETING             = 0x00000004,
+               JOB_STATUS_SPOOLING             = 0x00000008,
+               JOB_STATUS_PRINTING             = 0x00000010,
+               JOB_STATUS_OFFLINE              = 0x00000020,
+               JOB_STATUS_PAPEROUT             = 0x00000040,
+               JOB_STATUS_PRINTED              = 0x00000080,
+               JOB_STATUS_DELETED              = 0x00000100,
+               JOB_STATUS_BLOCKED_DEVQ         = 0x00000200,
+               JOB_STATUS_USER_INTERVENTION    = 0x00000400,
+               JOB_STATUS_RESTART              = 0x00000800,
+               JOB_STATUS_COMPLETE             = 0x00001000
+       } spoolss_JobStatus;
+
        typedef struct {
                uint32 job_id;
                [relative] nstring *printer_name;
@@ -386,7 +407,7 @@ import "misc.idl", "security.idl", "winreg.idl";
                [relative] nstring *document_name;
                [relative] nstring *data_type;
                [relative] nstring *text_status;
-               uint32 status;
+               spoolss_JobStatus status;
                uint32 priority;
                uint32 position;
                uint32 total_pages;
diff --git a/source3/include/rpc_spoolss.h b/source3/include/rpc_spoolss.h
index 1880331..a26a315 100644
--- a/source3/include/rpc_spoolss.h
+++ b/source3/include/rpc_spoolss.h
@@ -124,37 +124,10 @@
 
 #define PRINTER_STATUS_OK               0x00000000
 
-/* JOB status codes. */
-
-#define JOB_STATUS_QUEUED               0x0000
-#define JOB_STATUS_PAUSED              0x0001
-#define JOB_STATUS_ERROR               0x0002
-#define JOB_STATUS_DELETING            0x0004
-#define JOB_STATUS_SPOOLING            0x0008
-#define JOB_STATUS_PRINTING            0x0010
-#define JOB_STATUS_OFFLINE             0x0020
-#define JOB_STATUS_PAPEROUT            0x0040
-#define JOB_STATUS_PRINTED             0x0080
-#define JOB_STATUS_DELETED             0x0100
-#define JOB_STATUS_BLOCKED             0x0200
-#define JOB_STATUS_USER_INTERVENTION   0x0400
-
 /* Notify field types */
 
-#define NOTIFY_ONE_VALUE 1             /* Notify data is stored in value1 */
-#define NOTIFY_TWO_VALUE 2             /* Notify data is stored in value2 */
-#define NOTIFY_POINTER   3             /* Data is a pointer to a buffer */
-#define NOTIFY_STRING    4             /* Data is a pointer to a buffer 
w/length */
-#define NOTIFY_SECDESC   5             /* Data is a security descriptor */
-
 #define PRINTER_NOTIFY_TYPE 0x00
 #define JOB_NOTIFY_TYPE     0x01
-#define PRINT_TABLE_END     0xFF
-
-#define MAX_PRINTER_NOTIFY 26
-#define MAX_JOB_NOTIFY 24
-
-#define MAX_NOTIFY_TYPE_FOR_NOW 26
 
 #define PRINTER_NOTIFY_SERVER_NAME             0x00
 #define PRINTER_NOTIFY_PRINTER_NAME            0x01
@@ -323,19 +296,6 @@ PRINTER_DEFAULT;
 
 /********************************************/
 
-typedef struct s_header_type
-{
-       uint32 type;
-       union
-       {
-               uint32 value;
-               UNISTR string;
-       }
-       data;
-}
-HEADER_TYPE;
-
-
 typedef struct spool_q_getprinterdata
 {
        POLICY_HND handle;
diff --git a/source3/rpc_server/srv_spoolss_nt.c 
b/source3/rpc_server/srv_spoolss_nt.c
index 5a79dca..7485a42 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -110,7 +110,7 @@ static int nt_printj_status(int v)
        case LPQ_DELETED:
                return JOB_STATUS_DELETED;
        case LPQ_BLOCKED:
-               return JOB_STATUS_BLOCKED;
+               return JOB_STATUS_BLOCKED_DEVQ;
        case LPQ_USER_INTERVENTION:
                return JOB_STATUS_USER_INTERVENTION;
        }
@@ -3486,7 +3486,6 @@ static const struct s_notify_info_data_table 
notify_info_data_table[] =
 { JOB_NOTIFY_TYPE,     JOB_NOTIFY_TOTAL_PAGES,             
"JOB_NOTIFY_TOTAL_PAGES",             NOTIFY_TABLE_DWORD,    
spoolss_notify_total_pages },
 { JOB_NOTIFY_TYPE,     JOB_NOTIFY_PAGES_PRINTED,           
"JOB_NOTIFY_PAGES_PRINTED",           NOTIFY_TABLE_DWORD,    
spoolss_notify_pages_printed },
 { JOB_NOTIFY_TYPE,     JOB_NOTIFY_TOTAL_BYTES,             
"JOB_NOTIFY_TOTAL_BYTES",             NOTIFY_TABLE_DWORD,    
spoolss_notify_job_size },
-{ PRINT_TABLE_END, 0x0, NULL, 0x0, NULL },
 };
 
 /*******************************************************************
@@ -3519,7 +3518,7 @@ static bool search_notify(enum spoolss_NotifyType type,
 {
        int i;
 
-       for (i = 0; notify_info_data_table[i].type != PRINT_TABLE_END; i++) {
+       for (i = 0; ARRAY_SIZE(notify_info_data_table); i++) {
                if (notify_info_data_table[i].type == type &&
                    notify_info_data_table[i].field == field &&
                    notify_info_data_table[i].fn != NULL) {


-- 
Samba Shared Repository

Reply via email to