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 ntdevicemode
68 uint32 displayfrequency
;
77 uint8
*nt_dev_private
;
80 typedef struct nt_printer_info_level_2
84 uint32 default_priority
;
97 NT_DEVICEMODE
*devmode
;
99 fstring printprocessor
;
102 NT_PRINTER_DATA
*data
;
103 SEC_DESC_BUF
*secdesc_buf
;
107 } NT_PRINTER_INFO_LEVEL_2
;
109 typedef struct nt_printer_info_level
111 NT_PRINTER_INFO_LEVEL_2
*info_2
;
112 } NT_PRINTER_INFO_LEVEL
;
126 #ifndef SAMBA_PRINTER_PORT_NAME
127 #define SAMBA_PRINTER_PORT_NAME "Samba Printer Port"
130 /* DOS header format */
131 #define DOS_HEADER_SIZE 64
132 #define DOS_HEADER_MAGIC_OFFSET 0
133 #define DOS_HEADER_MAGIC 0x5A4D
134 #define DOS_HEADER_LFANEW_OFFSET 60
136 /* New Executable format (Win or OS/2 1.x segmented) */
137 #define NE_HEADER_SIZE 64
138 #define NE_HEADER_SIGNATURE_OFFSET 0
139 #define NE_HEADER_SIGNATURE 0x454E
140 #define NE_HEADER_TARGET_OS_OFFSET 54
141 #define NE_HEADER_TARGOS_WIN 0x02
142 #define NE_HEADER_MINOR_VER_OFFSET 62
143 #define NE_HEADER_MAJOR_VER_OFFSET 63
145 /* Portable Executable format */
146 #define PE_HEADER_SIZE 24
147 #define PE_HEADER_SIGNATURE_OFFSET 0
148 #define PE_HEADER_SIGNATURE 0x00004550
149 #define PE_HEADER_MACHINE_OFFSET 4
150 #define PE_HEADER_MACHINE_I386 0x14c
151 #define PE_HEADER_NUMBER_OF_SECTIONS 6
152 #define PE_HEADER_OPTIONAL_HEADER_SIZE 20
153 #define PE_HEADER_SECT_HEADER_SIZE 40
154 #define PE_HEADER_SECT_NAME_OFFSET 0
155 #define PE_HEADER_SECT_SIZE_DATA_OFFSET 16
156 #define PE_HEADER_SECT_PTR_DATA_OFFSET 20
158 /* Microsoft file version format */
159 #define VS_SIGNATURE "VS_VERSION_INFO"
160 #define VS_MAGIC_VALUE 0xfeef04bd
161 #define VS_MAJOR_OFFSET 8
162 #define VS_MINOR_OFFSET 12
163 #define VS_VERSION_INFO_UNICODE_SIZE (sizeof(VS_SIGNATURE)*2+4+VS_MINOR_OFFSET+4) /* not true size! */
164 #define VS_VERSION_INFO_SIZE (sizeof(VS_SIGNATURE)+4+VS_MINOR_OFFSET+4) /* not true size! */
165 #define VS_NE_BUF_SIZE 4096 /* Must be > 2*VS_VERSION_INFO_SIZE */
167 /* Notify spoolss clients that something has changed. The
168 notification data is either stored in two uint32 values or a
169 variable length array. */
171 #define SPOOLSS_NOTIFY_MSG_UNIX_JOBID 0x0001 /* Job id is unix */
173 typedef struct spoolss_notify_msg
{
174 fstring printer
; /* Name of printer notified */
175 uint32 type
; /* Printer or job notify */
176 uint32 field
; /* Notify field changed */
177 uint32 id
; /* Job id */
178 uint32 len
; /* Length of data, 0 for two uint32 value */
184 } SPOOLSS_NOTIFY_MSG
;
189 SPOOLSS_NOTIFY_MSG
*msgs
;
190 } SPOOLSS_NOTIFY_MSG_GROUP
;
195 SPOOLSS_NOTIFY_MSG_GROUP
*msg_groups
;
196 } SPOOLSS_NOTIFY_MSG_CTR
;
198 #define SPLHND_PRINTER 1
199 #define SPLHND_SERVER 2
200 #define SPLHND_PORTMON_TCP 3
201 #define SPLHND_PORTMON_LOCAL 4
203 /* structure to store the printer handles */
204 /* and a reference to what it's pointing to */
205 /* and the notify info asked about */
206 /* that's the central struct */
207 typedef struct _Printer
{
208 struct _Printer
*prev
, *next
;
209 bool document_started
;
211 uint32 jobid
; /* jobid in printing backend */
216 uint32 access_granted
;
220 fstring localmachine
;
222 struct spoolss_NotifyOption
*option
;
223 struct policy_handle client_hnd
;
224 bool client_connected
;
226 /* are we in a FindNextPrinterChangeNotify() call? */
234 /* devmode sent in the OpenPrinter() call */
235 NT_DEVICEMODE
*nt_devmode
;
237 /* cache the printer info */
238 NT_PRINTER_INFO_LEVEL
*printer_info
;
243 * The printer attributes.
244 * I #defined all of them (grabbed form MSDN)
246 * ( SHARED | NETWORK | RAW_ONLY )
247 * RAW_ONLY _MUST_ be present otherwise NT will send an EMF file
250 #define PRINTER_ATTRIBUTE_SAMBA (PRINTER_ATTRIBUTE_RAW_ONLY|\
251 PRINTER_ATTRIBUTE_SHARED|\
252 PRINTER_ATTRIBUTE_LOCAL)
253 #define PRINTER_ATTRIBUTE_NOT_SAMBA (PRINTER_ATTRIBUTE_NETWORK)
255 #define DRIVER_ANY_VERSION 0xffffffff
256 #define DRIVER_MAX_VERSION 4
258 struct print_architecture_table_node
{
259 const char *long_archi
;
260 const char *short_archi
;
264 #endif /* NT_PRINTING_H_ */