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 #define MAXDEVICENAME 32
41 typedef struct ntdevicemode
70 uint32 displayfrequency
;
79 uint8
*nt_dev_private
;
82 typedef struct nt_printer_info_level_2
86 uint32 default_priority
;
99 NT_DEVICEMODE
*devmode
;
101 fstring printprocessor
;
104 NT_PRINTER_DATA
*data
;
105 SEC_DESC_BUF
*secdesc_buf
;
109 } NT_PRINTER_INFO_LEVEL_2
;
111 typedef struct nt_printer_info_level
113 NT_PRINTER_INFO_LEVEL_2
*info_2
;
114 } NT_PRINTER_INFO_LEVEL
;
128 #ifndef SAMBA_PRINTER_PORT_NAME
129 #define SAMBA_PRINTER_PORT_NAME "Samba Printer Port"
132 /* DOS header format */
133 #define DOS_HEADER_SIZE 64
134 #define DOS_HEADER_MAGIC_OFFSET 0
135 #define DOS_HEADER_MAGIC 0x5A4D
136 #define DOS_HEADER_LFANEW_OFFSET 60
138 /* New Executable format (Win or OS/2 1.x segmented) */
139 #define NE_HEADER_SIZE 64
140 #define NE_HEADER_SIGNATURE_OFFSET 0
141 #define NE_HEADER_SIGNATURE 0x454E
142 #define NE_HEADER_TARGET_OS_OFFSET 54
143 #define NE_HEADER_TARGOS_WIN 0x02
144 #define NE_HEADER_MINOR_VER_OFFSET 62
145 #define NE_HEADER_MAJOR_VER_OFFSET 63
147 /* Portable Executable format */
148 #define PE_HEADER_SIZE 24
149 #define PE_HEADER_SIGNATURE_OFFSET 0
150 #define PE_HEADER_SIGNATURE 0x00004550
151 #define PE_HEADER_MACHINE_OFFSET 4
152 #define PE_HEADER_MACHINE_I386 0x14c
153 #define PE_HEADER_NUMBER_OF_SECTIONS 6
154 #define PE_HEADER_OPTIONAL_HEADER_SIZE 20
155 #define PE_HEADER_SECT_HEADER_SIZE 40
156 #define PE_HEADER_SECT_NAME_OFFSET 0
157 #define PE_HEADER_SECT_SIZE_DATA_OFFSET 16
158 #define PE_HEADER_SECT_PTR_DATA_OFFSET 20
160 /* Microsoft file version format */
161 #define VS_SIGNATURE "VS_VERSION_INFO"
162 #define VS_MAGIC_VALUE 0xfeef04bd
163 #define VS_MAJOR_OFFSET 8
164 #define VS_MINOR_OFFSET 12
165 #define VS_VERSION_INFO_UNICODE_SIZE (sizeof(VS_SIGNATURE)*2+4+VS_MINOR_OFFSET+4) /* not true size! */
166 #define VS_VERSION_INFO_SIZE (sizeof(VS_SIGNATURE)+4+VS_MINOR_OFFSET+4) /* not true size! */
167 #define VS_NE_BUF_SIZE 4096 /* Must be > 2*VS_VERSION_INFO_SIZE */
169 /* Notify spoolss clients that something has changed. The
170 notification data is either stored in two uint32 values or a
171 variable length array. */
173 #define SPOOLSS_NOTIFY_MSG_UNIX_JOBID 0x0001 /* Job id is unix */
175 typedef struct spoolss_notify_msg
{
176 fstring printer
; /* Name of printer notified */
177 uint32 type
; /* Printer or job notify */
178 uint32 field
; /* Notify field changed */
179 uint32 id
; /* Job id */
180 uint32 len
; /* Length of data, 0 for two uint32 value */
186 } SPOOLSS_NOTIFY_MSG
;
191 SPOOLSS_NOTIFY_MSG
*msgs
;
192 } SPOOLSS_NOTIFY_MSG_GROUP
;
197 SPOOLSS_NOTIFY_MSG_GROUP
*msg_groups
;
198 } SPOOLSS_NOTIFY_MSG_CTR
;
200 #define SPLHND_PRINTER 1
201 #define SPLHND_SERVER 2
202 #define SPLHND_PORTMON_TCP 3
203 #define SPLHND_PORTMON_LOCAL 4
205 /* structure to store the printer handles */
206 /* and a reference to what it's pointing to */
207 /* and the notify info asked about */
208 /* that's the central struct */
209 typedef struct _Printer
{
210 struct _Printer
*prev
, *next
;
211 bool document_started
;
213 uint32 jobid
; /* jobid in printing backend */
218 uint32 access_granted
;
222 fstring localmachine
;
224 struct spoolss_NotifyOption
*option
;
225 struct policy_handle client_hnd
;
226 bool client_connected
;
228 /* are we in a FindNextPrinterChangeNotify() call? */
236 /* devmode sent in the OpenPrinter() call */
237 NT_DEVICEMODE
*nt_devmode
;
239 /* cache the printer info */
240 NT_PRINTER_INFO_LEVEL
*printer_info
;
245 * The printer attributes.
246 * I #defined all of them (grabbed form MSDN)
248 * ( SHARED | NETWORK | RAW_ONLY )
249 * RAW_ONLY _MUST_ be present otherwise NT will send an EMF file
252 #define PRINTER_ATTRIBUTE_SAMBA (PRINTER_ATTRIBUTE_RAW_ONLY|\
253 PRINTER_ATTRIBUTE_SHARED|\
254 PRINTER_ATTRIBUTE_LOCAL)
255 #define PRINTER_ATTRIBUTE_NOT_SAMBA (PRINTER_ATTRIBUTE_NETWORK)
257 #define DRIVER_ANY_VERSION 0xffffffff
258 #define DRIVER_MAX_VERSION 4
260 struct print_architecture_table_node
{
261 const char *long_archi
;
262 const char *short_archi
;
266 #endif /* NT_PRINTING_H_ */