Fixed a few typos and added the opnum for ADDPRINTERDRIVEREX to the
[ira/wip.git] / source3 / include / rpc_spoolss.h
index 94cfb45dfed17eb976b8df5a7b7ffea739bc12fc..dcb4bc04f28b0ea34d2c1bce30991e77f20cf5b9 100755 (executable)
@@ -30,8 +30,6 @@
 /* spoolss pipe: this are the calls which are not implemented ...
 #define SPOOLSS_OPENPRINTER                            0x01
 #define SPOOLSS_GETPRINTERDRIVER                       0x0b
-#define SPOOLSS_DELETEPRINTERDRIVER                    0x0d
-#define SPOOLSS_ADDPRINTPROCESSOR                      0x0e
 #define SPOOLSS_GETPRINTPROCESSORDIRECTORY             0x10
 #define SPOOLSS_READPRINTER                            0x16
 #define SPOOLSS_WAITFORPRINTERCHANGE                   0x1c
 #define SPOOLSS_SPOOLERINIT                            0x3f
 #define SPOOLSS_RESETPRINTEREX                         0x40
 #define SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFICATION 0x42
-#define SPOOLSS_GETPRINTERDATAEX                       0x4e
+*/
+
+/*
+ * Unimplement Win2k specific RPC's
+
+#define SPOOLSS_ADDPRINTERDRIVEREX                     0x59
+
 */
 
 /* those are implemented */
@@ -74,6 +78,8 @@
 #define SPOOLSS_ADDPRINTERDRIVER                       0x09
 #define SPOOLSS_ENUMPRINTERDRIVERS                     0x0a
 #define SPOOLSS_GETPRINTERDRIVERDIRECTORY              0x0c
+#define SPOOLSS_DELETEPRINTERDRIVER                    0x0d
+#define SPOOLSS_ADDPRINTPROCESSOR                      0x0e
 #define SPOOLSS_ENUMPRINTPROCESSORS                    0x0f
 #define SPOOLSS_STARTDOCPRINTER                                0x11
 #define SPOOLSS_STARTPAGEPRINTER                       0x12
 #define SPOOLSS_ADDPRINTEREX                           0x46
 #define SPOOLSS_ENUMPRINTERDATA                                0x48
 #define SPOOLSS_DELETEPRINTERDATA                      0x49
+#define SPOOLSS_GETPRINTERDATAEX                       0x4e
+#define SPOOLSS_SETPRINTERDATAEX                       0x50
 
 #define PRINTER_CONTROL_UNPAUSE                0x00000000
 #define PRINTER_CONTROL_PAUSE          0x00000001
 
 #define PRINTER_STATUS_POWER_SAVE      0x01000000
 
-/* Printer permissions ACE settings.  NT4 uses generic and standard access
-   rights whereas NT5 converts them all to object specific access rights. */
-
-#define PRINTER_ACE_FULL_CONTROL      GENERIC_ALL_ACCESS
-#define PRINTER_ACE_MANAGE_DOCUMENTS  READ_CONTROL_ACCESS
-#define PRINTER_ACE_PRINT             \
-    (GENERIC_READ_ACCESS | GENERIC_WRITE_ACCESS | GENERIC_EXECUTE_ACCESS)
-
-#define PRINTER_ACE_NT5_FULL_CONTROL     0x000f000c
-#define PRINTER_ACE_NT5_PRINT            0x00020000
-#define PRINTER_ACE_NT5_MANAGE_DOCUMENTS 0x00020008
-
 #define SERVER_ACCESS_ADMINISTER       0x00000001
 #define SERVER_ACCESS_ENUMERATE                0x00000002
 #define PRINTER_ACCESS_ADMINISTER      0x00000004
 #define PRINTER_ACCESS_USE             0x00000008
 #define JOB_ACCESS_ADMINISTER          0x00000010
 
+/* JOB status codes. */
+
+#define JOB_STATUS_PAUSED              0x001
+#define JOB_STATUS_ERROR               0x002
+#define JOB_STATUS_DELETING            0x004
+#define JOB_STATUS_SPOOLING            0x008
+#define JOB_STATUS_PRINTING            0x010
+#define JOB_STATUS_OFFLINE             0x020
+#define JOB_STATUS_PAPEROUT            0x040
+#define JOB_STATUS_PRINTED             0x080
+#define JOB_STATUS_DELETED             0x100
+#define JOB_STATUS_BLOCKED             0x200
+#define JOB_STATUS_USER_INTERVENTION   0x400
+
+/* ACE masks for the various print permissions */
+
+#define PRINTER_ACE_FULL_CONTROL      GENERIC_ALL_ACCESS
+#define PRINTER_ACE_MANAGE_DOCUMENTS  READ_CONTROL_ACCESS
+#define PRINTER_ACE_PRINT             \
+    (GENERIC_READ_ACCESS | GENERIC_WRITE_ACCESS | GENERIC_EXECUTE_ACCESS)
+
 /* Access rights for print servers */
 #define SERVER_ALL_ACCESS      STANDARD_RIGHTS_REQUIRED_ACCESS|SERVER_ACCESS_ADMINISTER|SERVER_ACCESS_ENUMERATE
 #define SERVER_READ            STANDARD_RIGHTS_READ_ACCESS|SERVER_ACCESS_ENUMERATE
 #define JOB_WRITE      STANDARD_RIGHTS_WRITE_ACCESS|JOB_ACCESS_ADMINISTER
 #define JOB_EXECUTE    STANDARD_RIGHTS_EXECUTE_ACCESS|JOB_ACCESS_ADMINISTER
 
-#define POLICY_HND_SIZE 20
-
 #define ONE_VALUE 01
 #define TWO_VALUE 02
 #define POINTER   03
@@ -453,8 +468,7 @@ SPOOL_Q_OPEN_PRINTER_EX;
 typedef struct spool_r_open_printer_ex
 {
        POLICY_HND handle;      /* handle used along all transactions (20*uint8) */
-       uint32 status;
-
+       WERROR status;
 }
 SPOOL_R_OPEN_PRINTER_EX;
 
@@ -516,7 +530,7 @@ typedef struct spool_r_getprinterdata
        uint32 size;
        uint8 *data;
        uint32 needed;
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_GETPRINTERDATA;
 
@@ -529,7 +543,7 @@ SPOOL_Q_DELETEPRINTERDATA;
 
 typedef struct spool_r_deleteprinterdata
 {
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_DELETEPRINTERDATA;
 
@@ -542,7 +556,7 @@ SPOOL_Q_CLOSEPRINTER;
 typedef struct spool_r_closeprinter
 {
        POLICY_HND handle;
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_CLOSEPRINTER;
 
@@ -554,7 +568,7 @@ SPOOL_Q_STARTPAGEPRINTER;
 
 typedef struct spool_r_startpageprinter
 {
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_STARTPAGEPRINTER;
 
@@ -566,10 +580,27 @@ SPOOL_Q_ENDPAGEPRINTER;
 
 typedef struct spool_r_endpageprinter
 {
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_ENDPAGEPRINTER;
 
+
+typedef struct spool_q_deleteprinterdriver
+{
+       uint32 server_ptr;
+       UNISTR2 server;
+       UNISTR2 arch;
+       UNISTR2 driver;
+}
+SPOOL_Q_DELETEPRINTERDRIVER;
+
+typedef struct spool_r_deleteprinterdriver
+{
+       WERROR status;
+}
+SPOOL_R_DELETEPRINTERDRIVER;
+
+
 typedef struct spool_doc_info_1
 {
        uint32 p_docname;
@@ -605,7 +636,7 @@ SPOOL_Q_STARTDOCPRINTER;
 typedef struct spool_r_startdocprinter
 {
        uint32 jobid;
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_STARTDOCPRINTER;
 
@@ -617,7 +648,7 @@ SPOOL_Q_ENDDOCPRINTER;
 
 typedef struct spool_r_enddocprinter
 {
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_ENDDOCPRINTER;
 
@@ -633,7 +664,7 @@ SPOOL_Q_WRITEPRINTER;
 typedef struct spool_r_writeprinter
 {
        uint32 buffer_written;
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_WRITEPRINTER;
 
@@ -659,7 +690,7 @@ typedef struct spool_notify_info_data
                struct
                {
                        uint32 length;
-                       uint16 string[1024];
+                       uint16 *string;
                }
                data;
        }
@@ -694,7 +725,7 @@ SPOOL_Q_RFFPCNEX;
 
 typedef struct spool_r_rffpcnex
 {
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_RFFPCNEX;
 
@@ -712,7 +743,7 @@ typedef struct spool_r_rfnpcnex
 {
        uint32 info_ptr;
        SPOOL_NOTIFY_INFO info;
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_RFNPCNEX;
 
@@ -725,7 +756,7 @@ SPOOL_Q_FCPN;
 
 typedef struct spool_r_fcpn
 {
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_FCPN;
 
@@ -846,7 +877,7 @@ typedef struct spool_r_enumprinters
        NEW_BUFFER *buffer;
        uint32 needed;          /* bytes needed */
        uint32 returned;        /* number of printers */
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_ENUMPRINTERS;
 
@@ -875,7 +906,7 @@ typedef struct spool_r_getprinter
 {
        NEW_BUFFER *buffer;
        uint32 needed;
-       uint32 status;
+       WERROR status;
 } SPOOL_R_GETPRINTER;
 
 typedef struct driver_info_1
@@ -960,7 +991,7 @@ typedef struct spool_r_getprinterdriver2
        uint32 needed;
        uint32 servermajorversion;
        uint32 serverminorversion;
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_GETPRINTERDRIVER2;
 
@@ -986,7 +1017,7 @@ typedef struct spool_r_addjob
 {
        NEW_BUFFER *buffer;
        uint32 needed;
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_ADDJOB;
 
@@ -1082,7 +1113,7 @@ typedef struct spool_r_enumjobs
        NEW_BUFFER *buffer;
        uint32 needed;
        uint32 returned;
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_ENUMJOBS;
 
@@ -1095,7 +1126,7 @@ SPOOL_Q_SCHEDULEJOB;
 
 typedef struct spool_r_schedulejob
 {
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_SCHEDULEJOB;
 
@@ -1142,7 +1173,7 @@ typedef struct spool_r_enumports
        NEW_BUFFER *buffer;
        uint32 needed;          /* bytes needed */
        uint32 returned;        /* number of printers */
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_ENUMPORTS;
 
@@ -1177,7 +1208,7 @@ SPOOL_Q_SETJOB;
 
 typedef struct spool_r_setjob
 {
-       uint32 status;
+       WERROR status;
 
 }
 SPOOL_R_SETJOB;
@@ -1199,7 +1230,7 @@ typedef struct spool_r_enumprinterdrivers
        NEW_BUFFER *buffer;
        uint32 needed;
        uint32 returned;
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_ENUMPRINTERDRIVERS;
 
@@ -1230,7 +1261,7 @@ typedef struct spool_r_enumforms
        NEW_BUFFER *buffer;
        uint32 needed;
        uint32 numofforms;
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_ENUMFORMS;
 
@@ -1248,7 +1279,7 @@ typedef struct spool_r_getform
 {
        NEW_BUFFER *buffer;
        uint32 needed;
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_GETFORM;
 
@@ -1283,7 +1314,7 @@ typedef struct spool_printer_info_level_2
        uint32 default_priority;
        uint32 starttime;
        uint32 untiltime;
-       uint32 status;
+       WERROR status;
        uint32 cjobs;
        uint32 averageppm;
        UNISTR2 servername;
@@ -1430,7 +1461,7 @@ SPOOL_Q_SETPRINTER;
 
 typedef struct spool_r_setprinter
 {
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_SETPRINTER;
 
@@ -1450,7 +1481,7 @@ SPOOL_Q_ADDPRINTER;
 
 typedef struct spool_r_addprinter
 {
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_ADDPRINTER;
 
@@ -1463,7 +1494,7 @@ SPOOL_Q_DELETEPRINTER;
 typedef struct spool_r_deleteprinter
 {
        POLICY_HND handle;
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_DELETEPRINTER;
 
@@ -1475,7 +1506,7 @@ SPOOL_Q_ABORTPRINTER;
 
 typedef struct spool_r_abortprinter
 {
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_ABORTPRINTER;
 
@@ -1498,7 +1529,7 @@ SPOOL_Q_ADDPRINTEREX;
 typedef struct spool_r_addprinterex
 {
        POLICY_HND handle;
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_ADDPRINTEREX;
 
@@ -1514,7 +1545,7 @@ SPOOL_Q_ADDPRINTERDRIVER;
 
 typedef struct spool_r_addprinterdriver
 {
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_ADDPRINTERDRIVER;
 
@@ -1527,11 +1558,7 @@ DRIVER_DIRECTORY_1;
 
 typedef struct driver_info_ctr_info
 {
-       union
-       {
-               DRIVER_DIRECTORY_1 info_1;
-       }
-       driver;
+       DRIVER_DIRECTORY_1 *info1;
 }
 DRIVER_DIRECTORY_CTR;
 
@@ -1551,10 +1578,27 @@ typedef struct spool_r_getprinterdriverdirectory
 {
        NEW_BUFFER *buffer;
        uint32 needed;
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_GETPRINTERDRIVERDIR;
 
+typedef struct spool_q_addprintprocessor
+{
+       uint32 server_ptr;
+       UNISTR2 server;
+       UNISTR2 environment;
+       UNISTR2 path;
+       UNISTR2 name;
+}
+SPOOL_Q_ADDPRINTPROCESSOR;
+
+typedef struct spool_r_addprintprocessor
+{
+       WERROR status;
+}
+SPOOL_R_ADDPRINTPROCESSOR;
+
+
 typedef struct spool_q_enumprintprocessors
 {
        uint32 name_ptr;
@@ -1578,7 +1622,7 @@ typedef struct spool_r_enumprintprocessors
        NEW_BUFFER *buffer;
        uint32 needed;
        uint32 returned;
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_ENUMPRINTPROCESSORS;
 
@@ -1605,7 +1649,7 @@ typedef struct spool_r_enumprintprocdatatypes
        NEW_BUFFER *buffer;
        uint32 needed;
        uint32 returned;
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_ENUMPRINTPROCDATATYPES;
 
@@ -1638,7 +1682,7 @@ typedef struct spool_r_enumprintmonitors
        NEW_BUFFER *buffer;
        uint32 needed;
        uint32 returned;
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_ENUMPRINTMONITORS;
 
@@ -1661,7 +1705,7 @@ typedef struct spool_r_enumprinterdata
        uint32 datasize;
        uint8 *data;
        uint32 realdatasize;
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_ENUMPRINTERDATA;
 
@@ -1679,7 +1723,7 @@ SPOOL_Q_SETPRINTERDATA;
 
 typedef struct spool_r_setprinterdata
 {
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_SETPRINTERDATA;
 
@@ -1708,7 +1752,7 @@ SPOOL_Q_ADDFORM;
 
 typedef struct spool_r_addform
 {
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_ADDFORM;
 
@@ -1724,7 +1768,7 @@ SPOOL_Q_SETFORM;
 
 typedef struct spool_r_setform
 {
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_SETFORM;
 
@@ -1737,7 +1781,7 @@ SPOOL_Q_DELETEFORM;
 
 typedef struct spool_r_deleteform
 {
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_DELETEFORM;
 
@@ -1768,7 +1812,7 @@ typedef struct spool_r_getjob
 {
        NEW_BUFFER *buffer;
        uint32 needed;
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_GETJOB;
 
@@ -1785,7 +1829,7 @@ SPOOL_Q_REPLYOPENPRINTER;
 typedef struct spool_r_replyopenprinter
 {
        POLICY_HND handle;
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_REPLYOPENPRINTER;
 
@@ -1798,7 +1842,7 @@ SPOOL_Q_REPLYCLOSEPRINTER;
 typedef struct spool_r_replycloseprinter
 {
        POLICY_HND handle;
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_REPLYCLOSEPRINTER;
 
@@ -1817,12 +1861,49 @@ SPOOL_Q_REPLY_RRPCN;
 typedef struct spool_r_rrpcn
 {
        uint32 unknown0;
-       uint32 status;
+       WERROR status;
 }
 SPOOL_R_REPLY_RRPCN;
 
+typedef struct spool_q_getprinterdataex
+{
+       POLICY_HND handle;
+       UNISTR2 keyname;
+        UNISTR2 valuename;
+       uint32 size;
+}
+SPOOL_Q_GETPRINTERDATAEX;
+
+typedef struct spool_r_getprinterdataex
+{
+       uint32 type;
+       uint32 size;
+       uint8 *data;
+       uint32 needed;
+       WERROR status;
+}
+SPOOL_R_GETPRINTERDATAEX;
+
+typedef struct spool_q_setprinterdataex
+{
+       POLICY_HND handle;
+       UNISTR2 key;
+       UNISTR2 value;
+       uint32 type;
+       uint32 max_len;
+       uint8 *data;
+       uint32 real_len;
+       uint32 numeric_data;
+}
+SPOOL_Q_SETPRINTERDATAEX;
+
+typedef struct spool_r_setprinterdataex
+{
+       WERROR status;
+}
+SPOOL_R_SETPRINTERDATAEX;
+
 #define PRINTER_DRIVER_VERSION 2
 #define PRINTER_DRIVER_ARCHITECTURE "Windows NT x86"
 
-
 #endif /* _RPC_SPOOLSS_H */