2 Unix SMB/Netbios implementation.
4 Copyright (C) Andrew Tridgell 1992-2000,
5 Copyright (C) Luke Kenneth Casson Leighton 1996-2000,
6 Copyright (C) Jean Francois Micouleau 1998-2000.
7 Copyright (C) Gerald Carter 2001-2006.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #include "librpc/gen_ndr/spoolss.h"
25 #ifndef _RPC_SPOOLSS_H /* _RPC_SPOOLSS_H */
26 #define _RPC_SPOOLSS_H
28 /* spoolss pipe: this are the calls which are not implemented ...
29 #define SPOOLSS_GETPRINTERDRIVER 0x0b
30 #define SPOOLSS_READPRINTER 0x16
31 #define SPOOLSS_WAITFORPRINTERCHANGE 0x1c
32 #define SPOOLSS_ADDPORT 0x25
33 #define SPOOLSS_CONFIGUREPORT 0x26
34 #define SPOOLSS_DELETEPORT 0x27
35 #define SPOOLSS_CREATEPRINTERIC 0x28
36 #define SPOOLSS_PLAYGDISCRIPTONPRINTERIC 0x29
37 #define SPOOLSS_DELETEPRINTERIC 0x2a
38 #define SPOOLSS_ADDPRINTERCONNECTION 0x2b
39 #define SPOOLSS_DELETEPRINTERCONNECTION 0x2c
40 #define SPOOLSS_PRINTERMESSAGEBOX 0x2d
41 #define SPOOLSS_ADDMONITOR 0x2e
42 #define SPOOLSS_DELETEMONITOR 0x2f
43 #define SPOOLSS_DELETEPRINTPROCESSOR 0x30
44 #define SPOOLSS_ADDPRINTPROVIDOR 0x31
45 #define SPOOLSS_DELETEPRINTPROVIDOR 0x32
46 #define SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION 0x36
47 #define SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION 0x37
48 #define SPOOLSS_ROUTERFINDFIRSTPRINTERNOTIFICATIONOLD 0x39
49 #define SPOOLSS_ADDPORTEX 0x3d
50 #define SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFICATION0x3e
51 #define SPOOLSS_SPOOLERINIT 0x3f
52 #define SPOOLSS_RESETPRINTEREX 0x40
55 /* those are implemented */
56 #define SPOOLSS_ENUMPRINTERS 0x00
57 #define SPOOLSS_OPENPRINTER 0x01
58 #define SPOOLSS_SETJOB 0x02
59 #define SPOOLSS_GETJOB 0x03
60 #define SPOOLSS_ENUMJOBS 0x04
61 #define SPOOLSS_ADDPRINTER 0x05
62 #define SPOOLSS_DELETEPRINTER 0x06
63 #define SPOOLSS_SETPRINTER 0x07
64 #define SPOOLSS_GETPRINTER 0x08
65 #define SPOOLSS_ADDPRINTERDRIVER 0x09
66 #define SPOOLSS_ENUMPRINTERDRIVERS 0x0a
67 #define SPOOLSS_GETPRINTERDRIVERDIRECTORY 0x0c
68 #define SPOOLSS_DELETEPRINTERDRIVER 0x0d
69 #define SPOOLSS_ADDPRINTPROCESSOR 0x0e
70 #define SPOOLSS_ENUMPRINTPROCESSORS 0x0f
71 #define SPOOLSS_GETPRINTPROCESSORDIRECTORY 0x10
72 #define SPOOLSS_STARTDOCPRINTER 0x11
73 #define SPOOLSS_STARTPAGEPRINTER 0x12
74 #define SPOOLSS_WRITEPRINTER 0x13
75 #define SPOOLSS_ENDPAGEPRINTER 0x14
76 #define SPOOLSS_ABORTPRINTER 0x15
77 #define SPOOLSS_ENDDOCPRINTER 0x17
78 #define SPOOLSS_ADDJOB 0x18
79 #define SPOOLSS_SCHEDULEJOB 0x19
80 #define SPOOLSS_GETPRINTERDATA 0x1a
81 #define SPOOLSS_SETPRINTERDATA 0x1b
82 #define SPOOLSS_CLOSEPRINTER 0x1d
83 #define SPOOLSS_ADDFORM 0x1e
84 #define SPOOLSS_DELETEFORM 0x1f
85 #define SPOOLSS_GETFORM 0x20
86 #define SPOOLSS_SETFORM 0x21
87 #define SPOOLSS_ENUMFORMS 0x22
88 #define SPOOLSS_ENUMPORTS 0x23
89 #define SPOOLSS_ENUMMONITORS 0x24
90 #define SPOOLSS_ENUMPRINTPROCDATATYPES 0x33
91 #define SPOOLSS_RESETPRINTER 0x34
92 #define SPOOLSS_GETPRINTERDRIVER2 0x35
93 #define SPOOLSS_FCPN 0x38 /* FindClosePrinterNotify */
94 #define SPOOLSS_REPLYOPENPRINTER 0x3a
95 #define SPOOLSS_ROUTERREPLYPRINTER 0x3b
96 #define SPOOLSS_REPLYCLOSEPRINTER 0x3c
97 #define SPOOLSS_RFFPCNEX 0x41 /* RemoteFindFirstPrinterChangeNotifyEx */
98 #define SPOOLSS_RRPCN 0x42 /* RouteRefreshPrinterChangeNotification */
99 #define SPOOLSS_RFNPCNEX 0x43 /* RemoteFindNextPrinterChangeNotifyEx */
100 #define SPOOLSS_OPENPRINTEREX 0x45
101 #define SPOOLSS_ADDPRINTEREX 0x46
102 #define SPOOLSS_ENUMPRINTERDATA 0x48
103 #define SPOOLSS_DELETEPRINTERDATA 0x49
104 #define SPOOLSS_SETPRINTERDATAEX 0x4d
105 #define SPOOLSS_GETPRINTERDATAEX 0x4e
106 #define SPOOLSS_ENUMPRINTERDATAEX 0x4f
107 #define SPOOLSS_ENUMPRINTERKEY 0x50
108 #define SPOOLSS_DELETEPRINTERDATAEX 0x51
109 #define SPOOLSS_DELETEPRINTERKEY 0x52
110 #define SPOOLSS_DELETEPRINTERDRIVEREX 0x54
111 #define SPOOLSS_XCVDATAPORT 0x58
112 #define SPOOLSS_ADDPRINTERDRIVEREX 0x59
115 * Special strings for the OpenPrinter() call. See the MSDN DDK
116 * docs on the XcvDataPort() for more details.
119 #define SPL_LOCAL_PORT "Local Port"
120 #define SPL_TCPIP_PORT "Standard TCP/IP Port"
121 #define SPL_XCV_MONITOR_LOCALMON ",XcvMonitor Local Port"
122 #define SPL_XCV_MONITOR_TCPMON ",XcvMonitor Standard TCP/IP Port"
125 #define PRINTER_STATUS_OK 0x00000000
126 #define JOB_ACCESS_READ 0x00000020
128 /* JOB status codes. */
130 #define JOB_STATUS_QUEUED 0x0000
131 #define JOB_STATUS_PAUSED 0x0001
132 #define JOB_STATUS_ERROR 0x0002
133 #define JOB_STATUS_DELETING 0x0004
134 #define JOB_STATUS_SPOOLING 0x0008
135 #define JOB_STATUS_PRINTING 0x0010
136 #define JOB_STATUS_OFFLINE 0x0020
137 #define JOB_STATUS_PAPEROUT 0x0040
138 #define JOB_STATUS_PRINTED 0x0080
139 #define JOB_STATUS_DELETED 0x0100
140 #define JOB_STATUS_BLOCKED 0x0200
141 #define JOB_STATUS_USER_INTERVENTION 0x0400
143 /* Notify field types */
145 #define NOTIFY_ONE_VALUE 1 /* Notify data is stored in value1 */
146 #define NOTIFY_TWO_VALUE 2 /* Notify data is stored in value2 */
147 #define NOTIFY_POINTER 3 /* Data is a pointer to a buffer */
148 #define NOTIFY_STRING 4 /* Data is a pointer to a buffer w/length */
149 #define NOTIFY_SECDESC 5 /* Data is a security descriptor */
151 #define PRINTER_NOTIFY_TYPE 0x00
152 #define JOB_NOTIFY_TYPE 0x01
153 #define PRINT_TABLE_END 0xFF
155 #define MAX_PRINTER_NOTIFY 26
156 #define MAX_JOB_NOTIFY 24
158 #define MAX_NOTIFY_TYPE_FOR_NOW 26
160 #define PRINTER_NOTIFY_SERVER_NAME 0x00
161 #define PRINTER_NOTIFY_PRINTER_NAME 0x01
162 #define PRINTER_NOTIFY_SHARE_NAME 0x02
163 #define PRINTER_NOTIFY_PORT_NAME 0x03
164 #define PRINTER_NOTIFY_DRIVER_NAME 0x04
165 #define PRINTER_NOTIFY_COMMENT 0x05
166 #define PRINTER_NOTIFY_LOCATION 0x06
167 #define PRINTER_NOTIFY_DEVMODE 0x07
168 #define PRINTER_NOTIFY_SEPFILE 0x08
169 #define PRINTER_NOTIFY_PRINT_PROCESSOR 0x09
170 #define PRINTER_NOTIFY_PARAMETERS 0x0A
171 #define PRINTER_NOTIFY_DATATYPE 0x0B
172 #define PRINTER_NOTIFY_SECURITY_DESCRIPTOR 0x0C
173 #define PRINTER_NOTIFY_ATTRIBUTES 0x0D
174 #define PRINTER_NOTIFY_PRIORITY 0x0E
175 #define PRINTER_NOTIFY_DEFAULT_PRIORITY 0x0F
176 #define PRINTER_NOTIFY_START_TIME 0x10
177 #define PRINTER_NOTIFY_UNTIL_TIME 0x11
178 #define PRINTER_NOTIFY_STATUS 0x12
179 #define PRINTER_NOTIFY_STATUS_STRING 0x13
180 #define PRINTER_NOTIFY_CJOBS 0x14
181 #define PRINTER_NOTIFY_AVERAGE_PPM 0x15
182 #define PRINTER_NOTIFY_TOTAL_PAGES 0x16
183 #define PRINTER_NOTIFY_PAGES_PRINTED 0x17
184 #define PRINTER_NOTIFY_TOTAL_BYTES 0x18
185 #define PRINTER_NOTIFY_BYTES_PRINTED 0x19
187 #define JOB_NOTIFY_PRINTER_NAME 0x00
188 #define JOB_NOTIFY_MACHINE_NAME 0x01
189 #define JOB_NOTIFY_PORT_NAME 0x02
190 #define JOB_NOTIFY_USER_NAME 0x03
191 #define JOB_NOTIFY_NOTIFY_NAME 0x04
192 #define JOB_NOTIFY_DATATYPE 0x05
193 #define JOB_NOTIFY_PRINT_PROCESSOR 0x06
194 #define JOB_NOTIFY_PARAMETERS 0x07
195 #define JOB_NOTIFY_DRIVER_NAME 0x08
196 #define JOB_NOTIFY_DEVMODE 0x09
197 #define JOB_NOTIFY_STATUS 0x0A
198 #define JOB_NOTIFY_STATUS_STRING 0x0B
199 #define JOB_NOTIFY_SECURITY_DESCRIPTOR 0x0C
200 #define JOB_NOTIFY_DOCUMENT 0x0D
201 #define JOB_NOTIFY_PRIORITY 0x0E
202 #define JOB_NOTIFY_POSITION 0x0F
203 #define JOB_NOTIFY_SUBMITTED 0x10
204 #define JOB_NOTIFY_START_TIME 0x11
205 #define JOB_NOTIFY_UNTIL_TIME 0x12
206 #define JOB_NOTIFY_TIME 0x13
207 #define JOB_NOTIFY_TOTAL_PAGES 0x14
208 #define JOB_NOTIFY_PAGES_PRINTED 0x15
209 #define JOB_NOTIFY_TOTAL_BYTES 0x16
210 #define JOB_NOTIFY_BYTES_PRINTED 0x17
213 * Set of macros for flagging what changed in the PRINTER_INFO_2 struct
214 * when sending messages to other smbd's
216 #define PRINTER_MESSAGE_NULL 0x00000000
217 #define PRINTER_MESSAGE_DRIVER 0x00000001
218 #define PRINTER_MESSAGE_COMMENT 0x00000002
219 #define PRINTER_MESSAGE_PRINTERNAME 0x00000004
220 #define PRINTER_MESSAGE_LOCATION 0x00000008
221 #define PRINTER_MESSAGE_DEVMODE 0x00000010 /* not curently supported */
222 #define PRINTER_MESSAGE_SEPFILE 0x00000020
223 #define PRINTER_MESSAGE_PRINTPROC 0x00000040
224 #define PRINTER_MESSAGE_PARAMS 0x00000080
225 #define PRINTER_MESSAGE_DATATYPE 0x00000100
226 #define PRINTER_MESSAGE_SECDESC 0x00000200
227 #define PRINTER_MESSAGE_CJOBS 0x00000400
228 #define PRINTER_MESSAGE_PORT 0x00000800
229 #define PRINTER_MESSAGE_SHARENAME 0x00001000
230 #define PRINTER_MESSAGE_ATTRIBUTES 0x00002000
232 typedef struct printer_message_info {
233 uint32 low; /* PRINTER_CHANGE_XXX */
234 uint32 high; /* PRINTER_CHANGE_XXX */
235 fstring printer_name;
236 uint32 flags; /* PRINTER_MESSAGE_XXX */
238 PRINTER_MESSAGE_INFO;
241 * The printer attributes.
242 * I #defined all of them (grabbed form MSDN)
244 * ( SHARED | NETWORK | RAW_ONLY )
245 * RAW_ONLY _MUST_ be present otherwise NT will send an EMF file
248 #define PRINTER_ATTRIBUTE_SAMBA (PRINTER_ATTRIBUTE_RAW_ONLY|\
249 PRINTER_ATTRIBUTE_SHARED|\
250 PRINTER_ATTRIBUTE_LOCAL)
251 #define PRINTER_ATTRIBUTE_NOT_SAMBA (PRINTER_ATTRIBUTE_NETWORK)
253 #define NO_PRIORITY 0
254 #define MAX_PRIORITY 99
255 #define MIN_PRIORITY 1
256 #define DEF_PRIORITY 1
258 /* the flags of each printers */
260 #define DRIVER_ANY_VERSION 0xffffffff
261 #define DRIVER_MAX_VERSION 4
265 * Devicemode structure
268 typedef struct devicemode
272 uint16 driverversion;
282 uint16 defaultsource;
295 uint32 displayfrequency;
303 uint32 panningheight;
308 typedef struct _devmode_cont
316 typedef struct _printer_default
320 DEVMODE_CTR devmode_cont;
321 uint32 access_required;
325 /********************************************/
327 typedef struct s_header_type
340 typedef struct spool_q_getprinterdata
346 SPOOL_Q_GETPRINTERDATA;
348 typedef struct spool_r_getprinterdata
356 SPOOL_R_GETPRINTERDATA;
358 typedef struct printer_info_0
375 uint32 global_counter;
378 uint16 major_version;
379 uint16 build_version;
384 uint32 session_counter;
386 uint32 printer_errors;
407 typedef struct printer_info_1
416 typedef struct printer_info_2
427 UNISTR printprocessor;
433 uint32 defaultpriority;
442 typedef struct printer_info_3
448 typedef struct printer_info_4
456 typedef struct printer_info_5
461 uint32 device_not_selected_timeout;
462 uint32 transmission_retry_timeout;
466 typedef struct printer_info_6
472 #define SPOOL_DS_PUBLISH 1
473 #define SPOOL_DS_UPDATE 2
474 #define SPOOL_DS_UNPUBLISH 4
475 #define SPOOL_DS_PENDING 0x80000000
477 typedef struct printer_info_7
479 UNISTR guid; /* text form of printer guid */
484 typedef struct spool_q_enumprinters
487 uint32 servername_ptr;
493 SPOOL_Q_ENUMPRINTERS;
495 typedef struct printer_info_ctr_info
497 PRINTER_INFO_0 *printers_0;
498 PRINTER_INFO_1 *printers_1;
499 PRINTER_INFO_2 *printers_2;
500 PRINTER_INFO_3 *printers_3;
501 PRINTER_INFO_4 *printers_4;
502 PRINTER_INFO_5 *printers_5;
503 PRINTER_INFO_7 *printers_7;
507 typedef struct spool_r_enumprinters
510 uint32 needed; /* bytes needed */
511 uint32 returned; /* number of printers */
514 SPOOL_R_ENUMPRINTERS;
517 typedef struct spool_q_getprinter
526 typedef struct printer_info_info
530 PRINTER_INFO_0 *info0;
531 PRINTER_INFO_1 *info1;
532 PRINTER_INFO_2 *info2;
537 typedef struct spool_r_getprinter
542 } SPOOL_R_GETPRINTER;
544 typedef struct driver_info_1
549 typedef struct driver_info_2
559 typedef struct driver_info_3
568 uint16 *dependentfiles;
570 UNISTR defaultdatatype;
574 typedef struct driver_info_6
583 uint16 *dependentfiles;
585 UNISTR defaultdatatype;
586 uint16* previousdrivernames;
589 uint32 driver_version_low;
590 uint32 driver_version_high;
598 typedef struct driver_info_info
600 DRIVER_INFO_1 *info1;
601 DRIVER_INFO_2 *info2;
602 DRIVER_INFO_3 *info3;
603 DRIVER_INFO_6 *info6;
607 typedef struct spool_q_getprinterdriver2
610 uint32 architecture_ptr;
611 UNISTR2 architecture;
615 uint32 clientmajorversion;
616 uint32 clientminorversion;
618 SPOOL_Q_GETPRINTERDRIVER2;
620 typedef struct spool_r_getprinterdriver2
624 uint32 servermajorversion;
625 uint32 serverminorversion;
628 SPOOL_R_GETPRINTERDRIVER2;
631 typedef struct add_jobinfo_1
640 * I'm really wondering how many different time formats
641 * I will have to cope with
643 * JFM, 09/13/98 In a mad mood ;-(
645 typedef struct systemtime
658 typedef struct s_job_info_1
672 SYSTEMTIME submitted;
676 typedef struct s_job_info_2
685 UNISTR printprocessor;
690 /* SEC_DESC sec_desc;*/
698 SYSTEMTIME submitted;
704 typedef struct spool_q_enumjobs
715 typedef struct job_info_ctr_info
719 JOB_INFO_1 *job_info_1;
720 JOB_INFO_2 *job_info_2;
726 typedef struct spool_r_enumjobs
735 typedef struct s_port_info_1
741 typedef struct s_port_info_2
752 #define PORT_TYPE_WRITE 0x0001
753 #define PORT_TYPE_READ 0x0002
754 #define PORT_TYPE_REDIRECTED 0x0004
755 #define PORT_TYPE_NET_ATTACHED 0x0008
757 typedef struct spool_q_enumports
767 typedef struct port_info_ctr_info
779 typedef struct spool_r_enumports
782 uint32 needed; /* bytes needed */
783 uint32 returned; /* number of printers */
788 typedef struct job_info_info
792 JOB_INFO_1 job_info_1;
793 JOB_INFO_2 job_info_2;
800 typedef struct spool_q_enumprinterdrivers
804 uint32 environment_ptr;
810 SPOOL_Q_ENUMPRINTERDRIVERS;
812 typedef struct spool_r_enumprinterdrivers
819 SPOOL_R_ENUMPRINTERDRIVERS;
822 #define FORM_BUILTIN 1
823 #define FORM_PRINTER 2
825 typedef struct spool_form_1
838 typedef struct spool_q_enumforms
847 typedef struct spool_r_enumforms
856 typedef struct spool_printer_info_level_1
859 uint32 description_ptr;
865 } SPOOL_PRINTER_INFO_LEVEL_1;
867 typedef struct spool_printer_info_level_2
869 uint32 servername_ptr;
870 uint32 printername_ptr;
871 uint32 sharename_ptr;
873 uint32 drivername_ptr;
878 uint32 printprocessor_ptr;
880 uint32 parameters_ptr;
884 uint32 default_priority;
898 UNISTR2 printprocessor;
902 SPOOL_PRINTER_INFO_LEVEL_2;
904 typedef struct spool_printer_info_level_3
908 SPOOL_PRINTER_INFO_LEVEL_3;
910 typedef struct spool_printer_info_level_7
916 SPOOL_PRINTER_INFO_LEVEL_7;
918 typedef struct spool_printer_info_level
922 SPOOL_PRINTER_INFO_LEVEL_1 *info_1;
923 SPOOL_PRINTER_INFO_LEVEL_2 *info_2;
924 SPOOL_PRINTER_INFO_LEVEL_3 *info_3;
925 SPOOL_PRINTER_INFO_LEVEL_7 *info_7;
927 SPOOL_PRINTER_INFO_LEVEL;
929 typedef struct spool_q_setprinter
933 SPOOL_PRINTER_INFO_LEVEL info;
934 SEC_DESC_BUF *secdesc_ctr;
935 DEVMODE_CTR devmode_ctr;
942 typedef struct spool_r_setprinter
948 /********************************************/
950 typedef struct spool_q_enumprintprocessors
954 uint32 environment_ptr;
960 SPOOL_Q_ENUMPRINTPROCESSORS;
962 typedef struct printprocessor_1
968 typedef struct spool_r_enumprintprocessors
975 SPOOL_R_ENUMPRINTPROCESSORS;
977 typedef struct spool_q_enumprintprocdatatypes
981 uint32 processor_ptr;
987 SPOOL_Q_ENUMPRINTPROCDATATYPES;
989 typedef struct ppdatatype_1
995 typedef struct spool_r_enumprintprocdatatypes
1002 SPOOL_R_ENUMPRINTPROCDATATYPES;
1004 typedef struct printmonitor_1
1010 typedef struct printmonitor_2
1018 typedef struct spool_q_enumprintmonitors
1026 SPOOL_Q_ENUMPRINTMONITORS;
1028 typedef struct spool_r_enumprintmonitors
1035 SPOOL_R_ENUMPRINTMONITORS;
1038 typedef struct spool_q_enumprinterdata
1045 SPOOL_Q_ENUMPRINTERDATA;
1047 typedef struct spool_r_enumprinterdata
1051 uint32 realvaluesize;
1055 uint32 realdatasize;
1058 SPOOL_R_ENUMPRINTERDATA;
1060 typedef struct spool_q_setprinterdata
1068 uint32 numeric_data;
1070 SPOOL_Q_SETPRINTERDATA;
1072 typedef struct spool_r_setprinterdata
1076 SPOOL_R_SETPRINTERDATA;
1078 typedef struct _form
1092 typedef struct spool_q_getjob
1102 typedef struct pjob_info_info
1106 JOB_INFO_1 *job_info_1;
1107 JOB_INFO_2 *job_info_2;
1115 typedef struct spool_r_getjob
1123 typedef struct spool_q_enumprinterkey
1129 SPOOL_Q_ENUMPRINTERKEY;
1131 typedef struct spool_r_enumprinterkey
1134 uint32 needed; /* in bytes */
1137 SPOOL_R_ENUMPRINTERKEY;
1139 typedef struct printer_enum_values
1148 PRINTER_ENUM_VALUES;
1150 typedef struct printer_enum_values_ctr
1153 uint32 size_of_array;
1154 PRINTER_ENUM_VALUES *values;
1156 PRINTER_ENUM_VALUES_CTR;
1158 typedef struct spool_q_enumprinterdataex
1164 SPOOL_Q_ENUMPRINTERDATAEX;
1166 typedef struct spool_r_enumprinterdataex
1168 PRINTER_ENUM_VALUES_CTR ctr;
1173 SPOOL_R_ENUMPRINTERDATAEX;
1175 #endif /* _RPC_SPOOLSS_H */