delineation between smb and msrpc more marked. smbd now constructs
[tprouty/samba.git] / source / include / rpc_spoolss.h
1 /* 
2    Unix SMB/Netbios implementation.
3    Version 1.9.
4    SMB parameters and setup
5    Copyright (C) Andrew Tridgell 1992-1998
6    Copyright (C) Luke Kenneth Casson Leighton 1996-1998
7    Copyright (C) Jean Francois Micouleau 1998-1999
8    
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 2 of the License, or
12    (at your option) any later version.
13    
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.
18    
19    You should have received a copy of the GNU General Public License
20    along with this program; if not, write to the Free Software
21    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23
24 #ifndef _RPC_SPOOLSS_H /* _RPC_SPOOLSS_H */
25 #define _RPC_SPOOLSS_H 
26
27 #define INTEGER 1
28 #define STRING 2
29
30 /* spoolss pipe: this are the calls which are not implemented ...
31 #define SPOOLSS_OPENPRINTER                             0x01
32 #define SPOOLSS_DELETEPRINTER                           0x06
33 #define SPOOLSS_GETPRINTERDRIVER                        0x0b
34 #define SPOOLSS_DELETEPRINTERDRIVER                     0x0d
35 #define SPOOLSS_ADDPRINTPROCESSOR                       0x0e
36 #define SPOOLSS_GETPRINTPROCESSORDIRECTORY              0x10
37 #define SPOOLSS_ABORTPRINTER                            0x15
38 #define SPOOLSS_READPRINTER                             0x16
39 #define SPOOLSS_WAITFORPRINTERCHANGE                    0x1c
40 #define SPOOLSS_DELETEFORM                              0x1f
41 #define SPOOLSS_GETFORM                                 0x20
42 #define SPOOLSS_ADDPORT                                 0x25
43 #define SPOOLSS_CONFIGUREPORT                           0x26
44 #define SPOOLSS_DELETEPORT                              0x27
45 #define SPOOLSS_CREATEPRINTERIC                         0x28
46 #define SPOOLSS_PLAYGDISCRIPTONPRINTERIC                0x29
47 #define SPOOLSS_DELETEPRINTERIC                         0x2a
48 #define SPOOLSS_ADDPRINTERCONNECTION                    0x2b
49 #define SPOOLSS_DELETEPRINTERCONNECTION                 0x2c
50 #define SPOOLSS_PRINTERMESSAGEBOX                       0x2d
51 #define SPOOLSS_ADDMONITOR                              0x2e
52 #define SPOOLSS_DELETEMONITOR                           0x2f
53 #define SPOOLSS_DELETEPRINTPROCESSOR                    0x30
54 #define SPOOLSS_ADDPRINTPROVIDOR                        0x31
55 #define SPOOLSS_DELETEPRINTPROVIDOR                     0x32
56 #define SPOOLSS_RESETPRINTER                            0x34
57 #define SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION      0x36
58 #define SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION       0x37
59 #define SPOOLSS_ROUTERFINDFIRSTPRINTERNOTIFICATIONOLD   0x39
60 #define SPOOLSS_REPLYOPENPRINTER                        0x3a
61 #define SPOOLSS_ROUTERREPLYPRINTER                      0x3b
62 #define SPOOLSS_REPLYCLOSEPRINTER                       0x3c
63 #define SPOOLSS_ADDPORTEX                               0x3d
64 #define SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFICATION0x3e
65 #define SPOOLSS_SPOOLERINIT                             0x3f
66 #define SPOOLSS_RESETPRINTEREX                          0x40
67 #define SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFICATION  0x42
68 */
69
70 /* those are implemented */
71
72 #define SPOOLSS_ENUMPRINTERS                            0x00
73 #define SPOOLSS_SETJOB                                  0x02
74 #define SPOOLSS_GETJOB                                  0x03
75 #define SPOOLSS_ENUMJOBS                                0x04
76 #define SPOOLSS_ADDPRINTER                              0x05
77 #define SPOOLSS_SETPRINTER                              0x07
78 #define SPOOLSS_GETPRINTER                              0x08
79 #define SPOOLSS_ADDPRINTERDRIVER                        0x09
80 #define SPOOLSS_ENUMPRINTERDRIVERS                      0x0a
81 #define SPOOLSS_GETPRINTERDRIVERDIRECTORY               0x0c
82 #define SPOOLSS_ENUMPRINTPROCESSORS                     0x0f
83 #define SPOOLSS_STARTDOCPRINTER                         0x11
84 #define SPOOLSS_STARTPAGEPRINTER                        0x12
85 #define SPOOLSS_WRITEPRINTER                            0x13
86 #define SPOOLSS_ENDPAGEPRINTER                          0x14
87 #define SPOOLSS_ENDDOCPRINTER                           0x17
88 #define SPOOLSS_ADDJOB                                  0x18
89 #define SPOOLSS_SCHEDULEJOB                             0x19
90 #define SPOOLSS_GETPRINTERDATA                          0x1a
91 #define SPOOLSS_SETPRINTERDATA                          0x1b
92 #define SPOOLSS_CLOSEPRINTER                            0x1d
93 #define SPOOLSS_ADDFORM                                 0x1e
94 #define SPOOLSS_SETFORM                                 0x21
95 #define SPOOLSS_ENUMFORMS                               0x22
96 #define SPOOLSS_ENUMPORTS                               0x23
97 #define SPOOLSS_ENUMMONITORS                            0x24
98 #define SPOOLSS_ENUMPRINTPROCESSORDATATYPES             0x33
99 #define SPOOLSS_GETPRINTERDRIVER2                       0x35
100 /* find close printer notification */
101 #define SPOOLSS_FCPN                                    0x38
102 /* remote find first printer change notifyEx */
103 #define SPOOLSS_RFFPCNEX                                0x41
104 /* remote find next printer change notifyEx */
105 #define SPOOLSS_RFNPCNEX                                0x43
106 #define SPOOLSS_OPENPRINTEREX                           0x45
107 #define SPOOLSS_ADDPRINTEREX                            0x46
108 #define SPOOLSS_ENUMPRINTERDATA                         0x48
109
110
111 #define SERVER_ACCESS_ADMINISTER        0x00000001
112 #define SERVER_ACCESS_ENUMERATE         0x00000002
113
114 #define PRINTER_ACCESS_ADMINISTER       0x00000004
115 #define PRINTER_ACCESS_USE              0x00000008
116
117 #define PRINTER_CONTROL_UNPAUSE         0x00000000
118 #define PRINTER_CONTROL_PAUSE           0x00000001
119 #define PRINTER_CONTROL_RESUME          0x00000002
120 #define PRINTER_CONTROL_PURGE           0x00000003
121 #define PRINTER_CONTROL_SET_STATUS      0x00000004
122
123 #define PRINTER_STATUS_PAUSED           0x00000001
124 #define PRINTER_STATUS_ERROR            0x00000002
125 #define PRINTER_STATUS_PENDING_DELETION 0x00000004
126 #define PRINTER_STATUS_PAPER_JAM        0x00000008
127
128 #define PRINTER_STATUS_PAPER_OUT        0x00000010
129 #define PRINTER_STATUS_MANUAL_FEED      0x00000020
130 #define PRINTER_STATUS_PAPER_PROBLEM    0x00000040
131 #define PRINTER_STATUS_OFFLINE          0x00000080
132
133 #define PRINTER_STATUS_IO_ACTIVE        0x00000100
134 #define PRINTER_STATUS_BUSY             0x00000200
135 #define PRINTER_STATUS_PRINTING         0x00000400
136 #define PRINTER_STATUS_OUTPUT_BIN_FULL  0x00000800
137
138 #define PRINTER_STATUS_NOT_AVAILABLE    0x00001000
139 #define PRINTER_STATUS_WAITING          0x00002000
140 #define PRINTER_STATUS_PROCESSING       0x00004000
141 #define PRINTER_STATUS_INITIALIZING     0x00008000
142
143 #define PRINTER_STATUS_WARMING_UP       0x00010000
144 #define PRINTER_STATUS_TONER_LOW        0x00020000
145 #define PRINTER_STATUS_NO_TONER         0x00040000
146 #define PRINTER_STATUS_PAGE_PUNT        0x00080000
147
148 #define PRINTER_STATUS_USER_INTERVENTION        0x00100000
149 #define PRINTER_STATUS_OUT_OF_MEMORY    0x00200000
150 #define PRINTER_STATUS_DOOR_OPEN        0x00400000
151 #define PRINTER_STATUS_SERVER_UNKNOWN   0x00800000
152
153 #define PRINTER_STATUS_POWER_SAVE       0x01000000
154
155 #define JOB_ACCESS_ADMINISTER           0x00000010
156
157 #define STANDARD_RIGHTS_READ            0x00020000
158 #define STANDARD_RIGHTS_WRITE           STANDARD_RIGHTS_READ
159 #define STANDARD_RIGHTS_EXECUTE         STANDARD_RIGHTS_READ
160 #define STANDARD_RIGHTS_REQUIRED        0x000F0000
161
162 /* Access rights for print servers */
163 #define SERVER_ALL_ACCESS       STANDARD_RIGHTS_REQUIRED|SERVER_ACCESS_ADMINISTER|SERVER_ACCESS_ENUMERATE
164 #define SERVER_READ             STANDARD_RIGHTS_READ|SERVER_ACCESS_ENUMERATE
165 #define SERVER_WRITE            STANDARD_RIGHTS_WRITE|SERVER_ACCESS_ADMINISTER|SERVER_ACCESS_ENUMERATE
166 #define SERVER_EXECUTE          STANDARD_RIGHTS_EXECUTE|SERVER_ACCESS_ENUMERATE
167
168 /* Access rights for printers */
169 #define PRINTER_ALL_ACCESS      STANDARD_RIGHTS_REQUIRED|PRINTER_ACCESS_ADMINISTER|PRINTER_ACCESS_USE
170 #define PRINTER_READ          STANDARD_RIGHTS_READ|PRINTER_ACCESS_USE
171 #define PRINTER_WRITE         STANDARD_RIGHTS_WRITE|PRINTER_ACCESS_USE
172 #define PRINTER_EXECUTE       STANDARD_RIGHTS_EXECUTE|PRINTER_ACCESS_USE
173
174 /* Access rights for jobs */
175 #define JOB_ALL_ACCESS  STANDARD_RIGHTS_REQUIRED|JOB_ACCESS_ADMINISTER
176 #define JOB_READ        STANDARD_RIGHTS_READ|JOB_ACCESS_ADMINISTER
177 #define JOB_WRITE       STANDARD_RIGHTS_WRITE|JOB_ACCESS_ADMINISTER
178 #define JOB_EXECUTE     STANDARD_RIGHTS_EXECUTE|JOB_ACCESS_ADMINISTER
179
180 #define POLICY_HND_SIZE 20
181
182 #define ONE_VALUE 01
183 #define TWO_VALUE 02
184 #define POINTER   03
185
186 #define PRINTER_NOTIFY_TYPE 0x00
187 #define JOB_NOTIFY_TYPE     0x01
188
189 #define MAX_PRINTER_NOTIFY 26
190
191 #define PRINTER_NOTIFY_SERVER_NAME              0x00
192 #define PRINTER_NOTIFY_PRINTER_NAME             0x01
193 #define PRINTER_NOTIFY_SHARE_NAME               0x02
194 #define PRINTER_NOTIFY_PORT_NAME                0x03
195 #define PRINTER_NOTIFY_DRIVER_NAME              0x04
196 #define PRINTER_NOTIFY_COMMENT                  0x05
197 #define PRINTER_NOTIFY_LOCATION                 0x06
198 #define PRINTER_NOTIFY_DEVMODE                  0x07
199 #define PRINTER_NOTIFY_SEPFILE                  0x08
200 #define PRINTER_NOTIFY_PRINT_PROCESSOR          0x09
201 #define PRINTER_NOTIFY_PARAMETERS               0x0A
202 #define PRINTER_NOTIFY_DATATYPE                 0x0B
203 #define PRINTER_NOTIFY_SECURITY_DESCRIPTOR      0x0C
204 #define PRINTER_NOTIFY_ATTRIBUTES               0x0D
205 #define PRINTER_NOTIFY_PRIORITY                 0x0E
206 #define PRINTER_NOTIFY_DEFAULT_PRIORITY         0x0F
207 #define PRINTER_NOTIFY_START_TIME               0x10
208 #define PRINTER_NOTIFY_UNTIL_TIME               0x11
209 #define PRINTER_NOTIFY_STATUS                   0x12
210 #define PRINTER_NOTIFY_STATUS_STRING            0x13
211 #define PRINTER_NOTIFY_CJOBS                    0x14
212 #define PRINTER_NOTIFY_AVERAGE_PPM              0x15
213 #define PRINTER_NOTIFY_TOTAL_PAGES              0x16
214 #define PRINTER_NOTIFY_PAGES_PRINTED            0x17
215 #define PRINTER_NOTIFY_TOTAL_BYTES              0x18
216 #define PRINTER_NOTIFY_BYTES_PRINTED            0x19
217
218 #define MAX_JOB_NOTIFY 24
219
220 #define JOB_NOTIFY_PRINTER_NAME                 0x00
221 #define JOB_NOTIFY_MACHINE_NAME                 0x01
222 #define JOB_NOTIFY_PORT_NAME                    0x02
223 #define JOB_NOTIFY_USER_NAME                    0x03
224 #define JOB_NOTIFY_NOTIFY_NAME                  0x04
225 #define JOB_NOTIFY_DATATYPE                     0x05
226 #define JOB_NOTIFY_PRINT_PROCESSOR              0x06
227 #define JOB_NOTIFY_PARAMETERS                   0x07
228 #define JOB_NOTIFY_DRIVER_NAME                  0x08
229 #define JOB_NOTIFY_DEVMODE                      0x09
230 #define JOB_NOTIFY_STATUS                       0x0A
231 #define JOB_NOTIFY_STATUS_STRING                0x0B
232 #define JOB_NOTIFY_SECURITY_DESCRIPTOR          0x0C
233 #define JOB_NOTIFY_DOCUMENT                     0x0D
234 #define JOB_NOTIFY_PRIORITY                     0x0E
235 #define JOB_NOTIFY_POSITION                     0x0F
236 #define JOB_NOTIFY_SUBMITTED                    0x10
237 #define JOB_NOTIFY_START_TIME                   0x11
238 #define JOB_NOTIFY_UNTIL_TIME                   0x12
239 #define JOB_NOTIFY_TIME                         0x13
240 #define JOB_NOTIFY_TOTAL_PAGES                  0x14
241 #define JOB_NOTIFY_PAGES_PRINTED                0x15
242 #define JOB_NOTIFY_TOTAL_BYTES                  0x16
243 #define JOB_NOTIFY_BYTES_PRINTED                0x17
244
245 /*
246  * The printer attributes.
247  * I #defined all of them (grabbed form MSDN)
248  * I'm only using:
249  * ( SHARED | NETWORK | RAW_ONLY )
250  * RAW_ONLY _MUST_ be present otherwise NT will send an EMF file
251  */
252  
253 #define PRINTER_ATTRIBUTE_QUEUED                0x00000001
254 #define PRINTER_ATTRIBUTE_DIRECT                0x00000002
255 #define PRINTER_ATTRIBUTE_DEFAULT               0x00000004
256 #define PRINTER_ATTRIBUTE_SHARED                0x00000008
257
258 #define PRINTER_ATTRIBUTE_NETWORK               0x00000010
259 #define PRINTER_ATTRIBUTE_HIDDEN                0x00000020
260 #define PRINTER_ATTRIBUTE_LOCAL                 0x00000040
261 #define PRINTER_ATTRIBUTE_ENABLE_DEVQ           0x00000080
262
263 #define PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS       0x00000100
264 #define PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST     0x00000200
265 #define PRINTER_ATTRIBUTE_WORK_OFFLINE          0x00000400
266 #define PRINTER_ATTRIBUTE_ENABLE_BIDI           0x00000800
267
268 #define PRINTER_ATTRIBUTE_RAW_ONLY              0x00001000
269
270 #define NO_PRIORITY      0
271 #define MAX_PRIORITY    99
272 #define MIN_PRIORITY     1
273 #define DEF_PRIORITY     1
274
275 #define PRINTER_ENUM_DEFAULT            0x00000001
276 #define PRINTER_ENUM_LOCAL              0x00000002
277 #define PRINTER_ENUM_CONNECTIONS        0x00000004
278 #define PRINTER_ENUM_FAVORITE           0x00000004
279 #define PRINTER_ENUM_NAME               0x00000008
280 #define PRINTER_ENUM_REMOTE             0x00000010
281 #define PRINTER_ENUM_SHARED             0x00000020
282 #define PRINTER_ENUM_NETWORK            0x00000040
283
284 #define PRINTER_ENUM_EXPAND             0x00004000
285 #define PRINTER_ENUM_CONTAINER          0x00008000
286
287 #define PRINTER_ENUM_ICONMASK           0x00ff0000
288 #define PRINTER_ENUM_ICON1              0x00010000
289 #define PRINTER_ENUM_ICON2              0x00020000
290 #define PRINTER_ENUM_ICON3              0x00040000
291 #define PRINTER_ENUM_ICON4              0x00080000
292 #define PRINTER_ENUM_ICON5              0x00100000
293 #define PRINTER_ENUM_ICON6              0x00200000
294 #define PRINTER_ENUM_ICON7              0x00400000
295 #define PRINTER_ENUM_ICON8              0x00800000
296
297 typedef struct
298 {
299         char name[100];
300         uint32 flag;
301         uint32 width;
302         uint32 length;
303         uint32 left;
304         uint32 top;
305         uint32 right;
306         uint32 bottom;
307 } nt_forms_struct;
308
309 typedef struct 
310 {
311         char name[100];
312         char architecture[100];
313         uint32 version;
314         char default_form[30];
315         uint32 color_flag;
316         char driver[100];
317         char datafile[100];
318         char configfile[100];
319         char helpfile[100];
320         char monitor[100];
321         char monitor_name[100];
322         char **dependant;
323 } nt_drivers_struct;
324
325 typedef struct devicemode
326 {
327         UNISTR  devicename;
328         uint16  specversion;
329         uint16  driverversion;
330         uint16  size;
331         uint16  driverextra;
332         uint32  fields;
333         uint16  orientation;
334         uint16  papersize;
335         uint16  paperlength;
336         uint16  paperwidth;
337         uint16  scale;
338         uint16  copies;
339         uint16  defaultsource;
340         uint16  printquality;
341         uint16  color;
342         uint16  duplex;
343         uint16  yresolution;
344         uint16  ttoption;
345         uint16  collate;
346         UNISTR  formname;
347         uint16  logpixels;
348         uint32  bitsperpel;
349         uint32  pelswidth;
350         uint32  pelsheight;
351         uint32  displayflags;
352         uint32  displayfrequency;
353         uint32  icmmethod;
354         uint32  icmintent;
355         uint32  mediatype;
356         uint32  dithertype;
357         uint32  reserved1;
358         uint32  reserved2;
359         uint32  panningwidth;
360         uint32  panningheight;
361         uint8   *private;
362 } DEVICEMODE; 
363
364 typedef struct devicemode_container
365 {
366         DEVICEMODE *dm;
367         uint8 *buffer;
368         uint32 size_of_buffer;
369 } DEVICEMODE_CONTAINER;
370
371 #define ORIENTATION      0x00000001L
372 #define PAPERSIZE        0x00000002L
373 #define PAPERLENGTH      0x00000004L
374 #define PAPERWIDTH       0x00000008L
375 #define SCALE            0x00000010L
376 #define COPIES           0x00000100L
377 #define DEFAULTSOURCE    0x00000200L
378 #define PRINTQUALITY     0x00000400L
379 #define COLOR            0x00000800L
380 #define DUPLEX           0x00001000L
381 #define YRESOLUTION      0x00002000L
382 #define TTOPTION         0x00004000L
383 #define COLLATE          0x00008000L
384 #define FORMNAME         0x00010000L
385 #define LOGPIXELS        0x00020000L
386 #define BITSPERPEL       0x00040000L
387 #define PELSWIDTH        0x00080000L
388 #define PELSHEIGHT       0x00100000L
389 #define DISPLAYFLAGS     0x00200000L
390 #define DISPLAYFREQUENCY 0x00400000L
391 #define PANNINGWIDTH     0x00800000L
392 #define PANNINGHEIGHT    0x01000000L
393
394 #define ORIENT_PORTRAIT   1
395 #define ORIENT_LANDSCAPE  2
396
397 #define PAPER_FIRST                PAPER_LETTER
398 #define PAPER_LETTER               1  /* Letter 8 1/2 x 11 in               */
399 #define PAPER_LETTERSMALL          2  /* Letter Small 8 1/2 x 11 in         */
400 #define PAPER_TABLOID              3  /* Tabloid 11 x 17 in                 */
401 #define PAPER_LEDGER               4  /* Ledger 17 x 11 in                  */
402 #define PAPER_LEGAL                5  /* Legal 8 1/2 x 14 in                */
403 #define PAPER_STATEMENT            6  /* Statement 5 1/2 x 8 1/2 in         */
404 #define PAPER_EXECUTIVE            7  /* Executive 7 1/4 x 10 1/2 in        */
405 #define PAPER_A3                   8  /* A3 297 x 420 mm                    */
406 #define PAPER_A4                   9  /* A4 210 x 297 mm                    */
407 #define PAPER_A4SMALL             10  /* A4 Small 210 x 297 mm              */
408 #define PAPER_A5                  11  /* A5 148 x 210 mm                    */
409 #define PAPER_B4                  12  /* B4 (JIS) 250 x 354                 */
410 #define PAPER_B5                  13  /* B5 (JIS) 182 x 257 mm              */
411 #define PAPER_FOLIO               14  /* Folio 8 1/2 x 13 in                */
412 #define PAPER_QUARTO              15  /* Quarto 215 x 275 mm                */
413 #define PAPER_10X14               16  /* 10x14 in                           */
414 #define PAPER_11X17               17  /* 11x17 in                           */
415 #define PAPER_NOTE                18  /* Note 8 1/2 x 11 in                 */
416 #define PAPER_ENV_9               19  /* Envelope #9 3 7/8 x 8 7/8          */
417 #define PAPER_ENV_10              20  /* Envelope #10 4 1/8 x 9 1/2         */
418 #define PAPER_ENV_11              21  /* Envelope #11 4 1/2 x 10 3/8        */
419 #define PAPER_ENV_12              22  /* Envelope #12 4 \276 x 11           */
420 #define PAPER_ENV_14              23  /* Envelope #14 5 x 11 1/2            */
421 #define PAPER_CSHEET              24  /* C size sheet                       */
422 #define PAPER_DSHEET              25  /* D size sheet                       */
423 #define PAPER_ESHEET              26  /* E size sheet                       */
424 #define PAPER_ENV_DL              27  /* Envelope DL 110 x 220mm            */
425 #define PAPER_ENV_C5              28  /* Envelope C5 162 x 229 mm           */
426 #define PAPER_ENV_C3              29  /* Envelope C3  324 x 458 mm          */
427 #define PAPER_ENV_C4              30  /* Envelope C4  229 x 324 mm          */
428 #define PAPER_ENV_C6              31  /* Envelope C6  114 x 162 mm          */
429 #define PAPER_ENV_C65             32  /* Envelope C65 114 x 229 mm          */
430 #define PAPER_ENV_B4              33  /* Envelope B4  250 x 353 mm          */
431 #define PAPER_ENV_B5              34  /* Envelope B5  176 x 250 mm          */
432 #define PAPER_ENV_B6              35  /* Envelope B6  176 x 125 mm          */
433 #define PAPER_ENV_ITALY           36  /* Envelope 110 x 230 mm              */
434 #define PAPER_ENV_MONARCH         37  /* Envelope Monarch 3.875 x 7.5 in    */
435 #define PAPER_ENV_PERSONAL        38  /* 6 3/4 Envelope 3 5/8 x 6 1/2 in    */
436 #define PAPER_FANFOLD_US          39  /* US Std Fanfold 14 7/8 x 11 in      */
437 #define PAPER_FANFOLD_STD_GERMAN  40  /* German Std Fanfold 8 1/2 x 12 in   */
438 #define PAPER_FANFOLD_LGL_GERMAN  41  /* German Legal Fanfold 8 1/2 x 13 in */
439
440 #define PAPER_LAST                PAPER_FANFOLD_LGL_GERMAN
441 #define PAPER_USER                256
442
443 #define BIN_FIRST         BIN_UPPER
444 #define BIN_UPPER         1
445 #define BIN_ONLYONE       1
446 #define BIN_LOWER         2
447 #define BIN_MIDDLE        3
448 #define BIN_MANUAL        4
449 #define BIN_ENVELOPE      5
450 #define BIN_ENVMANUAL     6
451 #define BIN_AUTO          7
452 #define BIN_TRACTOR       8
453 #define BIN_SMALLFMT      9
454 #define BIN_LARGEFMT      10
455 #define BIN_LARGECAPACITY 11
456 #define BIN_CASSETTE      14
457 #define BIN_FORMSOURCE    15
458 #define BIN_LAST          BIN_FORMSOURCE
459
460 #define BIN_USER          256     /* device specific bins start here */
461
462 #define RES_DRAFT         (-1)
463 #define RES_LOW           (-2)
464 #define RES_MEDIUM        (-3)
465 #define RES_HIGH          (-4)
466
467 #define COLOR_MONOCHROME  1
468 #define COLOR_COLOR       2
469
470 #define DUP_SIMPLEX    1
471 #define DUP_VERTICAL   2
472 #define DUP_HORIZONTAL 3
473
474 #define TT_BITMAP     1       /* print TT fonts as graphics */
475 #define TT_DOWNLOAD   2       /* download TT fonts as soft fonts */
476 #define TT_SUBDEV     3       /* substitute device fonts for TT fonts */
477
478 #define COLLATE_FALSE  0
479 #define COLLATE_TRUE   1
480
481 typedef struct s_header_type
482 {
483         uint32 type;
484         union
485         {
486                 uint32 value;
487                 UNISTR string;
488         } data;
489 } HEADER_TYPE;
490
491 typedef struct s_buffer
492 {
493         uint32 ptr;
494         uint32 size;
495         uint32 count;
496         uint8 *data;
497         HEADER_TYPE *header;
498 } BUFFER;
499
500
501 /* SPOOL_Q_OPEN_PRINTER_EX request to open a printer */
502 typedef struct spool_q_open_printer_ex
503 {
504         uint32  ptr;
505         UNISTR2 printername;
506         uint32  unknown0;
507         uint32  cbbuf;
508         uint32  devmod;
509         uint32  access_required;
510         uint32  unknown1;       /* 0x0000 0001 */
511         uint32  unknown2;       /* 0x0000 0001 */
512         uint32  unknown3;       /* ??? pointer? */
513         uint32  unknown4;       /* 0x0000 001c */
514         uint32  unknown5;       /* ??? e.g 0xb94dd0 */
515         uint32  unknown6;       /* ??? pointer? */
516         uint32  unknown7;       /* 0x0000 0565 */
517         uint32  unknown8;       /* 0x0000 0002 */
518         uint32  unknown9;       /* 0x0000 0000 */
519         uint32  unknown10;      /* 0x0000 0000 */
520         UNISTR2 station;
521         UNISTR2 username;
522
523 } SPOOL_Q_OPEN_PRINTER_EX;
524
525 /* SPOOL_Q_OPEN_PRINTER_EX reply to an open printer */ 
526 typedef struct spool_r_open_printer_ex
527 {       
528         POLICY_HND handle; /* handle used along all transactions (20*uint8) */
529         uint32 status;
530
531 } SPOOL_R_OPEN_PRINTER_EX;
532
533 typedef struct spool_q_getprinterdata
534 {
535         POLICY_HND handle;
536         UNISTR2     valuename;
537         uint32      size;
538 } SPOOL_Q_GETPRINTERDATA;
539
540 typedef struct spool_r_getprinterdata
541 {
542         uint32 type;
543         uint32 size;
544         uint8 *data;
545         uint32 numeric_data;
546         uint32 needed;
547         uint32 status;
548 } SPOOL_R_GETPRINTERDATA;
549
550 typedef struct spool_q_closeprinter
551 {
552         POLICY_HND handle;
553 } SPOOL_Q_CLOSEPRINTER;
554
555 typedef struct spool_r_closeprinter
556 {
557         POLICY_HND handle;
558         uint32 status;
559 } SPOOL_R_CLOSEPRINTER;
560
561 typedef struct spool_q_startpageprinter
562 {
563         POLICY_HND handle;
564 } SPOOL_Q_STARTPAGEPRINTER;
565
566 typedef struct spool_r_startpageprinter
567 {
568         uint32 status;
569 } SPOOL_R_STARTPAGEPRINTER;
570
571 typedef struct spool_q_endpageprinter
572 {
573         POLICY_HND handle;
574 } SPOOL_Q_ENDPAGEPRINTER;
575
576 typedef struct spool_r_endpageprinter
577 {
578         uint32 status;
579 } SPOOL_R_ENDPAGEPRINTER;
580
581 typedef struct spool_doc_info_1
582 {
583         uint32 p_docname;
584         uint32 p_outputfile;
585         uint32 p_datatype;
586         UNISTR2 docname;
587         UNISTR2 outputfile;
588         UNISTR2 datatype;
589 } DOC_INFO_1;
590
591 typedef struct spool_doc_info
592 {
593         uint32 switch_value;
594         DOC_INFO_1 doc_info_1;
595 } DOC_INFO;
596
597 typedef struct spool_doc_info_container
598 {
599         uint32 level;
600         DOC_INFO docinfo;
601 } DOC_INFO_CONTAINER;
602
603 typedef struct spool_q_startdocprinter
604 {
605         POLICY_HND handle;
606         DOC_INFO_CONTAINER doc_info_container;
607 } SPOOL_Q_STARTDOCPRINTER;
608
609 typedef struct spool_r_startdocprinter
610 {
611         uint32 jobid;
612         uint32 status;
613 } SPOOL_R_STARTDOCPRINTER;
614
615 typedef struct spool_q_enddocprinter
616 {
617         POLICY_HND handle;
618 } SPOOL_Q_ENDDOCPRINTER;
619
620 typedef struct spool_r_enddocprinter
621 {
622         uint32 status;
623 } SPOOL_R_ENDDOCPRINTER;
624
625 typedef struct spool_q_writeprinter
626 {
627         POLICY_HND handle;
628         uint32 buffer_size;
629         uint8 *buffer;
630         uint32 buffer_size2;
631 } SPOOL_Q_WRITEPRINTER;
632
633 typedef struct spool_r_writeprinter
634 {
635         uint32 buffer_written;
636         uint32 status;
637 } SPOOL_R_WRITEPRINTER;
638
639 typedef struct spool_notify_option_type
640 {
641         uint16 type;
642         uint16 reserved0;
643         uint32 reserved1;
644         uint32 reserved2;
645         uint32 count;
646         uint16 fields[16];
647 } SPOOL_NOTIFY_OPTION_TYPE;
648
649 typedef struct spool_notify_option
650 {
651         uint32 version;
652         uint32 reserved;
653         uint32 count;
654         SPOOL_NOTIFY_OPTION_TYPE type[16]; /* totally arbitrary !!! */
655 } SPOOL_NOTIFY_OPTION;
656
657 typedef struct spool_notify_info_data
658 {
659         uint16 type;
660         uint16 field;
661         uint32 reserved;
662         uint32 id;
663         union 
664         {
665                 uint32 value[2];
666                 struct
667                 {
668                         uint32 length;
669                         uint16 string[1024];
670                 } data;
671         } notify_data;
672         uint32 size;
673         BOOL   enc_type;
674 } SPOOL_NOTIFY_INFO_DATA;
675
676 typedef struct spool_notify_info
677 {
678         uint32 version;
679         uint32 flags;
680         uint32 count;
681         SPOOL_NOTIFY_INFO_DATA data[26*16];
682         /* 26 differents data types */
683         /* so size it for 16 printers at max */
684         /* jfmxxxx: Have to make it dynamic !!!*/
685 } SPOOL_NOTIFY_INFO;
686
687 /* If the struct name looks obscure, yes it is ! */
688 /* RemoteFindFirstPrinterChangeNotificationEx query struct */
689 typedef struct spoolss_q_rffpcnex
690 {
691         POLICY_HND handle;
692         uint32 flags;
693         uint32 options;
694         UNISTR2 localmachine;
695         uint32  printerlocal;
696         SPOOL_NOTIFY_OPTION option;
697 } SPOOL_Q_RFFPCNEX;
698
699 typedef struct spool_r_rffpcnex
700 {
701         uint32 status;
702 } SPOOL_R_RFFPCNEX;
703
704 /* Remote Find Next Printer Change Notify Ex */
705 typedef struct spool_q_rfnpcnex
706 {
707         POLICY_HND handle;
708         uint32 change;
709         SPOOL_NOTIFY_OPTION option;
710 } SPOOL_Q_RFNPCNEX;
711
712 typedef struct spool_r_rfnpcnex
713 {
714         uint32 count;
715         SPOOL_NOTIFY_INFO info;
716 } SPOOL_R_RFNPCNEX;
717
718 /* Find Close Printer Notify */
719 typedef struct spool_q_fcpn
720 {
721         POLICY_HND handle;
722 } SPOOL_Q_FCPN;
723
724 typedef struct spool_r_fcpn
725 {
726         uint32 status;
727 } SPOOL_R_FCPN;
728
729
730 typedef struct printer_info_0
731 {
732         UNISTR printername;
733         UNISTR servername;
734         uint32 cjobs;
735         uint32 attributes;
736         uint32 unknown0;
737         uint32 unknown1;
738         uint32 unknown2;
739         uint32 unknown3;
740         uint32 unknown4;
741         uint32 unknown5;
742         uint32 unknown6;
743         uint16 majorversion;
744         uint16 buildversion;
745         uint32 unknown7;
746         uint32 unknown8;
747         uint32 unknown9;
748         uint32 unknown10;
749         uint32 unknown11;
750         uint32 unknown12;
751         uint32 unknown13;
752         uint32 unknown14;
753         uint32 unknown15;
754         uint32 unknown16;
755         uint32 unknown17;
756         uint32 unknown18;
757         uint32 status;
758         uint32 unknown20;
759         uint32 unknown21;
760         uint16 unknown22;
761         uint32 unknown23;       
762 } PRINTER_INFO_0;
763
764 typedef struct printer_info_1
765 {
766     uint32 flags;
767     UNISTR description;
768     UNISTR name;
769     UNISTR comment;
770 } PRINTER_INFO_1;
771
772 typedef struct printer_info_2
773 {
774     UNISTR     servername;
775     UNISTR     printername;
776     UNISTR     sharename;
777     UNISTR     portname;
778     UNISTR     drivername;
779     UNISTR     comment;
780     UNISTR     location;
781     DEVICEMODE *devmode;
782     UNISTR     sepfile;
783     UNISTR     printprocessor;
784     UNISTR     datatype;
785     UNISTR     parameters;
786     /*SECURITY_DESCRIPTOR securitydescriptor;*/
787     uint32   attributes;
788     uint32   priority;
789     uint32   defaultpriority;
790     uint32   starttime;
791     uint32   untiltime;
792     uint32   status;
793     uint32   cjobs;
794     uint32   averageppm;
795 } PRINTER_INFO_2;
796
797 typedef struct spool_q_enumprinters
798 {
799         uint32 flags;
800         UNISTR2 servername;
801         uint32 level;
802         BUFFER buffer;
803         uint32 buf_size;
804 } SPOOL_Q_ENUMPRINTERS;
805
806 typedef struct spool_r_enumprinters
807 {
808         uint32 offered;  /* number of bytes offered */
809         uint32 needed;   /* bytes needed */
810         uint32 returned; /* number of printers */
811         uint32 status;
812         uint32 level;
813         UNISTR servername;
814         union {
815                 PRINTER_INFO_1 **printers_1;
816                 PRINTER_INFO_2 **printers_2;
817                 void *info;
818         } printer;
819 } SPOOL_R_ENUMPRINTERS;
820
821
822 typedef struct spool_q_getprinter
823 {
824         POLICY_HND handle;
825         uint32 level;
826         uint8* buffer;
827         uint32 offered;
828
829 } SPOOL_Q_GETPRINTER;
830
831 typedef struct spool_r_getprinter
832 {
833         POLICY_HND handle;
834         uint32 level;
835         
836         uint32 offered;
837         uint32 needed;
838         uint32 status;
839         union {
840                 PRINTER_INFO_0 *info0;
841                 PRINTER_INFO_1 *info1;
842                 PRINTER_INFO_2 *info2;
843                 void *info;
844         } printer;
845 } SPOOL_R_GETPRINTER;
846
847 struct s_notify_info_data_table
848 {
849         uint16 type;
850         uint16 field;
851         char   *name;
852         uint32 size;
853         void   (*fn) (int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer);
854 };
855
856 typedef struct spool_q_getprinterdriver2
857 {
858         POLICY_HND handle;
859         UNISTR2 architecture;
860         uint32 level;
861         BUFFER buffer;
862         uint32 buf_size;
863         uint32 status;
864 } SPOOL_Q_GETPRINTERDRIVER2;
865
866 typedef struct driver_info_1
867 {
868         UNISTR name;
869 } DRIVER_INFO_1;
870
871 typedef struct driver_info_2
872 {
873         uint32 version;
874         UNISTR name;
875         UNISTR architecture;
876         UNISTR driverpath;
877         UNISTR datafile;
878         UNISTR configfile;
879 } DRIVER_INFO_2;
880
881 typedef struct driver_info_3
882 {
883         uint32 version;
884         UNISTR name;
885         UNISTR architecture;
886         UNISTR driverpath;
887         UNISTR datafile;
888         UNISTR configfile;
889         UNISTR helpfile;
890         UNISTR **dependentfiles;
891         UNISTR monitorname;
892         UNISTR defaultdatatype;
893 } DRIVER_INFO_3;
894
895 typedef struct spool_r_getprinterdriver2
896 {
897         uint32 needed;
898         uint32 offered;
899         uint32 returned;
900         uint32 status;
901         uint32 level;
902         union {
903                 DRIVER_INFO_1 *info1;
904                 DRIVER_INFO_2 *info2;
905                 DRIVER_INFO_3 *info3;
906         } printer;
907 } SPOOL_R_GETPRINTERDRIVER2;
908
909 typedef struct add_jobinfo_1
910 {
911         UNISTR path;
912         uint32 job_number;
913 } ADD_JOBINFO_1;
914
915
916 typedef struct spool_q_addjob
917 {
918         POLICY_HND handle;
919         uint32 level;
920         BUFFER buffer;
921         uint32 buf_size;
922 } SPOOL_Q_ADDJOB;
923
924 typedef struct spool_r_addjob
925 {
926         uint32 status;
927 } SPOOL_R_ADDJOB;
928
929 /*
930  * I'm really wondering how many different time formats
931  * I will have to cope with
932  *
933  * JFM, 09/13/98 In a mad mood ;-(
934 */
935 typedef struct systemtime
936 {
937     uint16 year;
938     uint16 month;
939     uint16 dayofweek;
940     uint16 day;
941     uint16 hour;
942     uint16 minute;
943     uint16 second;
944     uint16 milliseconds;
945 } SYSTEMTIME;
946
947 typedef struct s_job_info_1
948 {
949         uint32 jobid;
950         UNISTR printername;
951         UNISTR machinename;
952         UNISTR username;
953         UNISTR document;
954         UNISTR datatype;
955         UNISTR text_status;
956         uint32 status;
957         uint32 priority;
958         uint32 position;
959         uint32 totalpages;
960         uint32 pagesprinted;
961         SYSTEMTIME submitted;
962 } JOB_INFO_1;
963
964 typedef struct s_job_info_2
965 {
966         uint32 jobid;
967         UNISTR printername;
968         UNISTR machinename;
969         UNISTR username;
970         UNISTR document;
971         UNISTR notifyname;
972         UNISTR datatype;
973         UNISTR printprocessor;
974         UNISTR parameters;
975         UNISTR drivername;
976         DEVICEMODE *devmode;
977         UNISTR text_status;
978 /*      SEC_DESC sec_desc;*/
979         uint32 status;
980         uint32 priority;
981         uint32 position;
982         uint32 starttime;
983         uint32 untiltime;
984         uint32 totalpages;
985         uint32 size;
986         SYSTEMTIME submitted;
987         uint32 timeelapsed;
988         uint32 pagesprinted;
989 } JOB_INFO_2;
990
991 typedef struct spool_q_enumjobs
992 {
993         POLICY_HND handle;
994         uint32 firstjob;
995         uint32 numofjobs;
996         uint32 level;
997         BUFFER buffer;
998         uint32 buf_size;
999 } SPOOL_Q_ENUMJOBS;
1000
1001 typedef struct spool_r_enumjobs
1002 {
1003         uint32 level;
1004         union {
1005                 JOB_INFO_1 **job_info_1;
1006                 JOB_INFO_2 **job_info_2;
1007                 void *info;
1008         } job;
1009         uint32 offered;
1010         uint32 numofjobs;
1011         uint32 status;
1012 } SPOOL_R_ENUMJOBS;
1013
1014 typedef struct spool_q_schedulejob
1015 {
1016         POLICY_HND handle;
1017         uint32 jobid;
1018 } SPOOL_Q_SCHEDULEJOB;
1019
1020 typedef struct spool_r_schedulejob
1021 {
1022         uint32 status;
1023 } SPOOL_R_SCHEDULEJOB;
1024
1025 typedef struct s_port_info_1
1026 {
1027         UNISTR port_name;
1028 } PORT_INFO_1;
1029
1030 typedef struct s_port_info_2
1031 {
1032         UNISTR port_name;
1033         UNISTR monitor_name;
1034         UNISTR description;
1035         uint32 port_type;
1036         uint32 reserved;
1037 } PORT_INFO_2;
1038
1039 typedef struct spool_q_enumports
1040 {
1041         UNISTR2 name;
1042         uint32 level;
1043         BUFFER buffer;
1044         uint32 buf_size;
1045 } SPOOL_Q_ENUMPORTS;
1046
1047 typedef struct spool_r_enumports
1048 {
1049         uint32 level;
1050         union {
1051                 PORT_INFO_1 *port_info_1;
1052                 PORT_INFO_2 *port_info_2;
1053         } port;
1054         uint32 offered;
1055         uint32 numofports;
1056         uint32 status;
1057 } SPOOL_R_ENUMPORTS;
1058
1059 #define JOB_CONTROL_PAUSE              1
1060 #define JOB_CONTROL_RESUME             2
1061 #define JOB_CONTROL_CANCEL             3
1062 #define JOB_CONTROL_RESTART            4
1063 #define JOB_CONTROL_DELETE             5
1064
1065 typedef struct spool_q_setjob
1066 {
1067         POLICY_HND handle;
1068         uint32 jobid;
1069         uint32 level;
1070         union {
1071                 JOB_INFO_1 job_info_1;
1072                 JOB_INFO_2 job_info_2;
1073         } job;
1074         uint32 command;
1075 } SPOOL_Q_SETJOB;
1076
1077 typedef struct spool_r_setjob
1078 {
1079         uint32 status;
1080 } SPOOL_R_SETJOB;
1081
1082 typedef struct spool_q_enumprinterdrivers
1083 {
1084         UNISTR2 name;
1085         UNISTR2 environment;
1086         uint32 level;
1087         BUFFER buffer;
1088         uint32 buf_size;
1089 } SPOOL_Q_ENUMPRINTERDRIVERS;
1090
1091 typedef struct spool_r_enumprinterdrivers
1092 {
1093         uint32 level;
1094         union {
1095                 DRIVER_INFO_1 *driver_info_1;
1096                 DRIVER_INFO_2 *driver_info_2;
1097                 DRIVER_INFO_3 *driver_info_3;
1098         } driver;
1099         uint32 offered;
1100         uint32 numofdrivers;
1101         uint32 status;
1102 } SPOOL_R_ENUMPRINTERDRIVERS;
1103
1104 typedef struct spool_form_1
1105 {
1106         uint32 flag;
1107         UNISTR name;
1108         uint32 width;
1109         uint32 length;
1110         uint32 left;
1111         uint32 top;
1112         uint32 right;
1113         uint32 bottom;
1114 } FORM_1;
1115
1116 typedef struct spool_q_enumforms
1117 {
1118         POLICY_HND handle;
1119         uint32 level;
1120         BUFFER buffer;
1121         uint32 buf_size;
1122 } SPOOL_Q_ENUMFORMS;
1123
1124 typedef struct spool_r_enumforms
1125 {
1126         uint32 level;
1127         FORM_1 *forms_1;
1128         uint32 offered;
1129         uint32 numofforms;
1130         uint32 status;
1131 } SPOOL_R_ENUMFORMS;
1132
1133
1134 typedef struct spool_printer_info_level_2
1135 {
1136         uint32 servername_ptr;
1137         uint32 printername_ptr;
1138         uint32 sharename_ptr;
1139         uint32 portname_ptr;
1140         uint32 drivername_ptr;
1141         uint32 comment_ptr;
1142         uint32 location_ptr;
1143         uint32 devmode_ptr;
1144         uint32 sepfile_ptr;
1145         uint32 printprocessor_ptr;
1146         uint32 datatype_ptr;
1147         uint32 parameters_ptr;
1148         uint32 secdesc_ptr;
1149         uint32 attributes;
1150         uint32 priority;
1151         uint32 default_priority;
1152         uint32 starttime;
1153         uint32 untiltime;
1154         uint32 status;
1155         uint32 cjobs;
1156         uint32 averageppm;
1157         UNISTR2 servername;
1158         UNISTR2 printername;
1159         UNISTR2 sharename;
1160         UNISTR2 portname;
1161         UNISTR2 drivername;
1162         UNISTR2 comment;
1163         UNISTR2 location;
1164         UNISTR2 sepfile;
1165         UNISTR2 printprocessor;
1166         UNISTR2 datatype;
1167         UNISTR2 parameters;
1168         SEC_DESC_BUF *secdesc;
1169 } SPOOL_PRINTER_INFO_LEVEL_2;
1170
1171 typedef struct spool_printer_info_level
1172 {
1173         SPOOL_PRINTER_INFO_LEVEL_2 *info_2;
1174 } SPOOL_PRINTER_INFO_LEVEL;
1175
1176 typedef struct spool_printer_driver_info_level_3
1177 {
1178         uint32 cversion;
1179         uint32 name_ptr;
1180         uint32 environment_ptr;
1181         uint32 driverpath_ptr;
1182         uint32 datafile_ptr;
1183         uint32 configfile_ptr;
1184         uint32 helpfile_ptr;
1185         uint32 monitorname_ptr;
1186         uint32 defaultdatatype_ptr;
1187         uint32 dependentfilessize;
1188         uint32 dependentfiles_ptr;
1189
1190         UNISTR2 name;
1191         UNISTR2 environment;
1192         UNISTR2 driverpath;
1193         UNISTR2 datafile;
1194         UNISTR2 configfile;
1195         UNISTR2 helpfile;
1196         UNISTR2 monitorname;
1197         UNISTR2 defaultdatatype;
1198         BUFFER5 dependentfiles;
1199
1200 } SPOOL_PRINTER_DRIVER_INFO_LEVEL_3;
1201
1202 typedef struct spool_printer_driver_info_level
1203 {
1204         SPOOL_PRINTER_DRIVER_INFO_LEVEL_3 *info_3;
1205 } SPOOL_PRINTER_DRIVER_INFO_LEVEL;
1206
1207
1208 /* this struct is undocumented */
1209 /* thanks to the ddk ... */
1210 typedef struct spool_user_level_1
1211 {
1212         uint32 size;
1213         uint32 client_name_ptr;
1214         uint32 user_name_ptr;
1215         uint32 build;
1216         uint32 major;
1217         uint32 minor;
1218         uint32 processor;
1219         UNISTR2 client_name;
1220         UNISTR2 user_name;
1221 } SPOOL_USER_LEVEL_1;
1222
1223 typedef struct spool_user_level
1224 {
1225         SPOOL_USER_LEVEL_1 *user_level_1;
1226 } SPOOL_USER_LEVEL;
1227
1228 typedef struct spool_q_setprinter
1229 {
1230         POLICY_HND handle;
1231         uint32 level;
1232         SPOOL_PRINTER_INFO_LEVEL info;
1233
1234         DEVICEMODE *devmode;
1235         struct
1236         {
1237                 uint32 size_of_buffer;
1238                 uint32 data;
1239         } security;
1240
1241         uint32 command;
1242 } SPOOL_Q_SETPRINTER;
1243
1244 typedef struct spool_r_setprinter
1245 {
1246         uint32 status;
1247 } SPOOL_R_SETPRINTER;
1248
1249 typedef struct spool_q_addprinter
1250 {
1251         UNISTR2 server_name;
1252         uint32 level;
1253         SPOOL_PRINTER_INFO_LEVEL info;
1254         uint32 unk0;
1255         uint32 unk1;
1256         uint32 unk2;
1257         uint32 unk3;
1258         uint32 user_level;
1259         SPOOL_USER_LEVEL user;
1260 } SPOOL_Q_ADDPRINTER;
1261
1262 typedef struct spool_r_addprinter
1263 {
1264         uint32 status;
1265 } SPOOL_R_ADDPRINTER;
1266
1267 typedef struct spool_q_addprinterex
1268 {
1269         UNISTR2 server_name;
1270         uint32 level;
1271         SPOOL_PRINTER_INFO_LEVEL info;
1272         uint32 unk0;
1273         uint32 unk1;
1274         uint32 unk2;
1275         uint32 unk3;
1276         uint32 user_level;
1277         SPOOL_USER_LEVEL user;
1278 } SPOOL_Q_ADDPRINTEREX;
1279
1280
1281 typedef struct spool_r_addprinterex
1282 {
1283         POLICY_HND handle;
1284         uint32 status;
1285 } SPOOL_R_ADDPRINTEREX;
1286
1287 typedef struct spool_q_addprinterdriver
1288 {
1289         UNISTR2 server_name;
1290         uint32 level;
1291         SPOOL_PRINTER_DRIVER_INFO_LEVEL info;
1292 } SPOOL_Q_ADDPRINTERDRIVER;
1293
1294 typedef struct spool_r_addprinterdriver
1295 {
1296         uint32 status;
1297 } SPOOL_R_ADDPRINTERDRIVER;
1298
1299 typedef struct spool_q_getprinterdriverdirectory
1300 {
1301         UNISTR2 name;
1302         UNISTR2 environment;
1303         uint32 level;
1304         BUFFER buffer;
1305         uint32 buf_size;
1306 } SPOOL_Q_GETPRINTERDRIVERDIR;
1307
1308 typedef struct driver_directory_1
1309 {
1310         UNISTR name;
1311 } DRIVER_DIRECTORY_1 ;
1312
1313 typedef struct spool_r_getprinterdriverdirectory
1314 {
1315         uint32 level;
1316         union {
1317                 DRIVER_DIRECTORY_1 driver_info_1;
1318         } driver;
1319         uint32 offered;
1320         uint32 status;
1321 } SPOOL_R_GETPRINTERDRIVERDIR;
1322
1323 typedef struct spool_q_enumprintprocessors
1324 {
1325         UNISTR2 name;
1326         UNISTR2 environment;
1327         uint32 level;
1328         BUFFER buffer;
1329         uint32 buf_size;
1330 } SPOOL_Q_ENUMPRINTPROCESSORS;
1331
1332 typedef struct printprocessor_1
1333 {
1334         UNISTR name;
1335 } PRINTPROCESSOR_1;
1336
1337 typedef struct spool_r_enumprintprocessors
1338 {
1339         uint32 level;
1340         PRINTPROCESSOR_1 *info_1;
1341         uint32 offered;
1342         uint32 numofprintprocessors;
1343         uint32 status;
1344 } SPOOL_R_ENUMPRINTPROCESSORS;
1345
1346 typedef struct spool_q_enumprintprocessordatatypes
1347 {
1348         UNISTR2 name;
1349         UNISTR2 printprocessor;
1350         uint32 level;
1351         BUFFER buffer;
1352         uint32 buf_size;
1353 } SPOOL_Q_ENUMPRINTPROCESSORDATATYPES;
1354
1355 typedef struct ppdatatype_1
1356 {
1357         UNISTR name;
1358 } PPDATATYPE_1;
1359
1360 typedef struct spool_r_enumprintprocessordatatypes
1361 {
1362         uint32 level;
1363         PPDATATYPE_1 *info_1;
1364         uint32 offered;
1365         uint32 numofppdatatypes;
1366         uint32 status;
1367 } SPOOL_R_ENUMPRINTPROCESSORDATATYPES;
1368
1369 typedef struct spool_q_enumprintmonitors
1370 {
1371         UNISTR2 name;
1372         uint32 level;
1373         BUFFER buffer;
1374         uint32 buf_size;
1375 } SPOOL_Q_ENUMPRINTMONITORS;
1376
1377 typedef struct printmonitor_1
1378 {
1379         UNISTR name;
1380 } PRINTMONITOR_1;
1381
1382 typedef struct spool_r_enumprintmonitors
1383 {
1384         uint32 level;
1385         PRINTMONITOR_1 *info_1;
1386         uint32 offered;
1387         uint32 numofprintmonitors;
1388         uint32 status;
1389 } SPOOL_R_ENUMPRINTMONITORS;
1390
1391 typedef struct spool_q_enumprinterdata
1392 {
1393         POLICY_HND handle;
1394         uint32 index;
1395         uint32 valuesize;
1396         uint32 datasize;
1397 } SPOOL_Q_ENUMPRINTERDATA;
1398
1399 typedef struct spool_r_enumprinterdata
1400 {
1401         uint32 valuesize;
1402         UNISTR value;
1403         uint32 realvaluesize;
1404         uint32 type;
1405         uint32 datasize;
1406         uint8  *data;
1407         uint32 realdatasize;
1408         uint32 status;
1409 } SPOOL_R_ENUMPRINTERDATA;
1410
1411 typedef struct spool_q_setprinterdata
1412 {
1413         POLICY_HND handle;
1414         UNISTR2 value;
1415         uint32 type;
1416         uint32 max_len;
1417         uint8 *data;
1418         uint32 real_len;
1419         uint32 numeric_data;
1420 } SPOOL_Q_SETPRINTERDATA;
1421
1422 typedef struct spool_r_setprinterdata
1423 {
1424         uint32 status;
1425 } SPOOL_R_SETPRINTERDATA;
1426
1427 typedef struct _form
1428 {
1429        uint32 flags;
1430        uint32 name_ptr;
1431        uint32 size_x;
1432        uint32 size_y;
1433        uint32 left;
1434        uint32 top;
1435        uint32 right;
1436        uint32 bottom;
1437        UNISTR2 name;
1438 } FORM;
1439
1440 typedef struct spool_q_addform
1441 {
1442         POLICY_HND handle;
1443         uint32 level;
1444         uint32 level2;
1445         FORM form;
1446 } SPOOL_Q_ADDFORM;
1447
1448 typedef struct spool_r_addform
1449 {
1450         uint32 status;
1451 } SPOOL_R_ADDFORM;
1452
1453 typedef struct spool_q_setform
1454 {
1455         POLICY_HND handle;
1456         UNISTR2 name;
1457         uint32 level;
1458         uint32 level2;
1459         FORM form;
1460 } SPOOL_Q_SETFORM;
1461
1462 typedef struct spool_r_setform
1463 {
1464         uint32 status;
1465 } SPOOL_R_SETFORM;
1466
1467 typedef struct spool_q_getjob
1468 {
1469         POLICY_HND handle;
1470         uint32 jobid;
1471         uint32 level;
1472         BUFFER buffer;
1473         uint32 buf_size;
1474 } SPOOL_Q_GETJOB;
1475
1476 typedef struct spool_r_getjob
1477 {
1478         uint32 level;
1479         union {
1480                 JOB_INFO_1 *job_info_1;
1481                 JOB_INFO_2 *job_info_2;
1482         } job;
1483         uint32 offered;
1484         uint32 status;
1485 } SPOOL_R_GETJOB;
1486
1487 #define PRINTER_DRIVER_VERSION 2
1488 #define PRINTER_DRIVER_ARCHITECTURE "Windows NT x86"
1489
1490
1491 #endif /* _RPC_SPOOLSS_H */
1492