2 Unix SMB/Netbios implementation.
4 SMB parameters and setup
5 Copyright (C) Andrew Tridgell 1992-2000,
6 Copyright (C) Jean Francois Micouleau 1998-2000.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #ifndef NT_PRINTING_H_
23 #define NT_PRINTING_H_
25 /* container for a single registry key */
29 struct regval_ctr *values;
32 /* container for all printer data */
39 typedef struct nt_printer_info_level_2
43 uint32 default_priority;
56 struct spoolss_DeviceMode *devmode;
58 fstring printprocessor;
61 NT_PRINTER_DATA *data;
62 struct sec_desc_buf *secdesc_buf;
66 } NT_PRINTER_INFO_LEVEL_2;
68 typedef struct nt_printer_info_level
70 NT_PRINTER_INFO_LEVEL_2 *info_2;
71 } NT_PRINTER_INFO_LEVEL;
85 #ifndef SAMBA_PRINTER_PORT_NAME
86 #define SAMBA_PRINTER_PORT_NAME "Samba Printer Port"
89 /* DOS header format */
90 #define DOS_HEADER_SIZE 64
91 #define DOS_HEADER_MAGIC_OFFSET 0
92 #define DOS_HEADER_MAGIC 0x5A4D
93 #define DOS_HEADER_LFANEW_OFFSET 60
95 /* New Executable format (Win or OS/2 1.x segmented) */
96 #define NE_HEADER_SIZE 64
97 #define NE_HEADER_SIGNATURE_OFFSET 0
98 #define NE_HEADER_SIGNATURE 0x454E
99 #define NE_HEADER_TARGET_OS_OFFSET 54
100 #define NE_HEADER_TARGOS_WIN 0x02
101 #define NE_HEADER_MINOR_VER_OFFSET 62
102 #define NE_HEADER_MAJOR_VER_OFFSET 63
104 /* Portable Executable format */
105 #define PE_HEADER_SIZE 24
106 #define PE_HEADER_SIGNATURE_OFFSET 0
107 #define PE_HEADER_SIGNATURE 0x00004550
108 #define PE_HEADER_MACHINE_OFFSET 4
109 #define PE_HEADER_MACHINE_I386 0x14c
110 #define PE_HEADER_NUMBER_OF_SECTIONS 6
111 #define PE_HEADER_OPTIONAL_HEADER_SIZE 20
112 #define PE_HEADER_SECT_HEADER_SIZE 40
113 #define PE_HEADER_SECT_NAME_OFFSET 0
114 #define PE_HEADER_SECT_SIZE_DATA_OFFSET 16
115 #define PE_HEADER_SECT_PTR_DATA_OFFSET 20
117 /* Microsoft file version format */
118 #define VS_SIGNATURE "VS_VERSION_INFO"
119 #define VS_MAGIC_VALUE 0xfeef04bd
120 #define VS_MAJOR_OFFSET 8
121 #define VS_MINOR_OFFSET 12
122 #define VS_VERSION_INFO_UNICODE_SIZE (sizeof(VS_SIGNATURE)*2+4+VS_MINOR_OFFSET+4) /* not true size! */
123 #define VS_VERSION_INFO_SIZE (sizeof(VS_SIGNATURE)+4+VS_MINOR_OFFSET+4) /* not true size! */
124 #define VS_NE_BUF_SIZE 4096 /* Must be > 2*VS_VERSION_INFO_SIZE */
126 /* Notify spoolss clients that something has changed. The
127 notification data is either stored in two uint32 values or a
128 variable length array. */
130 #define SPOOLSS_NOTIFY_MSG_UNIX_JOBID 0x0001 /* Job id is unix */
132 typedef struct spoolss_notify_msg {
133 fstring printer; /* Name of printer notified */
134 uint32 type; /* Printer or job notify */
135 uint32 field; /* Notify field changed */
136 uint32 id; /* Job id */
137 uint32 len; /* Length of data, 0 for two uint32 value */
143 } SPOOLSS_NOTIFY_MSG;
148 SPOOLSS_NOTIFY_MSG *msgs;
149 } SPOOLSS_NOTIFY_MSG_GROUP;
154 SPOOLSS_NOTIFY_MSG_GROUP *msg_groups;
155 } SPOOLSS_NOTIFY_MSG_CTR;
157 #define SPLHND_PRINTER 1
158 #define SPLHND_SERVER 2
159 #define SPLHND_PORTMON_TCP 3
160 #define SPLHND_PORTMON_LOCAL 4
162 /* structure to store the printer handles */
163 /* and a reference to what it's pointing to */
164 /* and the notify info asked about */
165 /* that's the central struct */
166 typedef struct _Printer{
167 struct _Printer *prev, *next;
168 bool document_started;
170 uint32 jobid; /* jobid in printing backend */
175 uint32 access_granted;
179 fstring localmachine;
181 struct spoolss_NotifyOption *option;
182 struct policy_handle client_hnd;
183 bool client_connected;
185 /* are we in a FindNextPrinterChangeNotify() call? */
193 /* devmode sent in the OpenPrinter() call */
194 struct spoolss_DeviceMode *devmode;
196 /* TODO cache the printer info2 structure */
197 struct spoolss_PrinterInfo2 *info2;
202 * The printer attributes.
203 * I #defined all of them (grabbed form MSDN)
205 * ( SHARED | NETWORK | RAW_ONLY )
206 * RAW_ONLY _MUST_ be present otherwise NT will send an EMF file
209 #define PRINTER_ATTRIBUTE_SAMBA (PRINTER_ATTRIBUTE_RAW_ONLY|\
210 PRINTER_ATTRIBUTE_SHARED|\
211 PRINTER_ATTRIBUTE_LOCAL)
212 #define PRINTER_ATTRIBUTE_NOT_SAMBA (PRINTER_ATTRIBUTE_NETWORK)
214 #define DRIVER_ANY_VERSION 0xffffffff
215 #define DRIVER_MAX_VERSION 4
217 struct print_architecture_table_node {
218 const char *long_archi;
219 const char *short_archi;
223 #endif /* NT_PRINTING_H_ */