1 |
/* |
/* |
2 |
rdesktop: A Remote Desktop Protocol client. |
rdesktop: A Remote Desktop Protocol client. |
3 |
Common data types |
Common data types |
4 |
Copyright (C) Matthew Chapman 1999-2002 |
Copyright (C) Matthew Chapman 1999-2008 |
5 |
|
|
6 |
This program is free software; you can redistribute it and/or modify |
This program is free software; you can redistribute it and/or modify |
7 |
it under the terms of the GNU General Public License as published by |
it under the terms of the GNU General Public License as published by |
8 |
the Free Software Foundation; either version 2 of the License, or |
the Free Software Foundation; either version 2 of the License, or |
9 |
(at your option) any later version. |
(at your option) any later version. |
10 |
|
|
11 |
This program is distributed in the hope that it will be useful, |
This program is distributed in the hope that it will be useful, |
12 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
GNU General Public License for more details. |
GNU General Public License for more details. |
15 |
|
|
16 |
You should have received a copy of the GNU General Public License |
You should have received a copy of the GNU General Public License |
17 |
along with this program; if not, write to the Free Software |
along with this program; if not, write to the Free Software |
18 |
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
19 |
*/ |
*/ |
20 |
|
|
21 |
typedef int BOOL; |
typedef int RD_BOOL; |
22 |
|
|
23 |
#ifndef True |
#ifndef True |
24 |
#define True (1) |
#define True (1) |
32 |
typedef unsigned int uint32; |
typedef unsigned int uint32; |
33 |
typedef signed int sint32; |
typedef signed int sint32; |
34 |
|
|
35 |
typedef void *HBITMAP; |
typedef void *RD_HBITMAP; |
36 |
typedef void *HGLYPH; |
typedef void *RD_HGLYPH; |
37 |
typedef void *HCOLOURMAP; |
typedef void *RD_HCOLOURMAP; |
38 |
typedef void *HCURSOR; |
typedef void *RD_HCURSOR; |
39 |
|
|
40 |
|
typedef struct _RD_POINT |
41 |
|
{ |
42 |
|
sint16 x, y; |
43 |
|
} |
44 |
|
RD_POINT; |
45 |
|
|
46 |
typedef struct _COLOURENTRY |
typedef struct _COLOURENTRY |
47 |
{ |
{ |
62 |
|
|
63 |
typedef struct _BOUNDS |
typedef struct _BOUNDS |
64 |
{ |
{ |
65 |
uint16 left; |
sint16 left; |
66 |
uint16 top; |
sint16 top; |
67 |
uint16 right; |
sint16 right; |
68 |
uint16 bottom; |
sint16 bottom; |
69 |
|
|
70 |
} |
} |
71 |
BOUNDS; |
BOUNDS; |
79 |
} |
} |
80 |
PEN; |
PEN; |
81 |
|
|
82 |
|
/* this is whats in the brush cache */ |
83 |
|
typedef struct _BRUSHDATA |
84 |
|
{ |
85 |
|
uint32 colour_code; |
86 |
|
uint32 data_size; |
87 |
|
uint8 *data; |
88 |
|
} |
89 |
|
BRUSHDATA; |
90 |
|
|
91 |
typedef struct _BRUSH |
typedef struct _BRUSH |
92 |
{ |
{ |
93 |
uint8 xorigin; |
uint8 xorigin; |
94 |
uint8 yorigin; |
uint8 yorigin; |
95 |
uint8 style; |
uint8 style; |
96 |
uint8 pattern[8]; |
uint8 pattern[8]; |
97 |
|
BRUSHDATA *bd; |
98 |
} |
} |
99 |
BRUSH; |
BRUSH; |
100 |
|
|
104 |
sint16 baseline; |
sint16 baseline; |
105 |
uint16 width; |
uint16 width; |
106 |
uint16 height; |
uint16 height; |
107 |
HBITMAP pixmap; |
RD_HBITMAP pixmap; |
108 |
|
|
109 |
} |
} |
110 |
FONTGLYPH; |
FONTGLYPH; |
119 |
|
|
120 |
typedef struct _key_translation |
typedef struct _key_translation |
121 |
{ |
{ |
122 |
|
/* For normal scancode translations */ |
123 |
uint8 scancode; |
uint8 scancode; |
124 |
uint16 modifiers; |
uint16 modifiers; |
125 |
|
/* For sequences. If keysym is nonzero, the fields above are not used. */ |
126 |
|
uint32 seq_keysym; /* Really KeySym */ |
127 |
|
struct _key_translation *next; |
128 |
} |
} |
129 |
key_translation; |
key_translation; |
130 |
|
|
131 |
|
typedef struct _VCHANNEL |
132 |
|
{ |
133 |
|
uint16 mcs_id; |
134 |
|
char name[8]; |
135 |
|
uint32 flags; |
136 |
|
struct stream in; |
137 |
|
void (*process) (STREAM); |
138 |
|
} |
139 |
|
VCHANNEL; |
140 |
|
|
141 |
|
/* PSTCACHE */ |
142 |
|
typedef uint8 HASH_KEY[8]; |
143 |
|
|
144 |
|
/* Header for an entry in the persistent bitmap cache file */ |
145 |
|
typedef struct _PSTCACHE_CELLHEADER |
146 |
|
{ |
147 |
|
HASH_KEY key; |
148 |
|
uint8 width, height; |
149 |
|
uint16 length; |
150 |
|
uint32 stamp; |
151 |
|
} |
152 |
|
CELLHEADER; |
153 |
|
|
154 |
|
#define MAX_CBSIZE 256 |
155 |
|
|
156 |
|
/* RDPSND */ |
157 |
|
typedef struct _RD_WAVEFORMATEX |
158 |
|
{ |
159 |
|
uint16 wFormatTag; |
160 |
|
uint16 nChannels; |
161 |
|
uint32 nSamplesPerSec; |
162 |
|
uint32 nAvgBytesPerSec; |
163 |
|
uint16 nBlockAlign; |
164 |
|
uint16 wBitsPerSample; |
165 |
|
uint16 cbSize; |
166 |
|
uint8 cb[MAX_CBSIZE]; |
167 |
|
} RD_WAVEFORMATEX; |
168 |
|
|
169 |
|
typedef struct _RDPCOMP |
170 |
|
{ |
171 |
|
uint32 roff; |
172 |
|
uint8 hist[RDP_MPPC_DICT_SIZE]; |
173 |
|
struct stream ns; |
174 |
|
} |
175 |
|
RDPCOMP; |
176 |
|
|
177 |
|
/* RDPDR */ |
178 |
|
typedef uint32 RD_NTSTATUS; |
179 |
|
typedef uint32 RD_NTHANDLE; |
180 |
|
|
181 |
|
typedef struct _DEVICE_FNS |
182 |
|
{ |
183 |
|
RD_NTSTATUS(*create) (uint32 device, uint32 desired_access, uint32 share_mode, |
184 |
|
uint32 create_disposition, uint32 flags_and_attributes, |
185 |
|
char *filename, RD_NTHANDLE * handle); |
186 |
|
RD_NTSTATUS(*close) (RD_NTHANDLE handle); |
187 |
|
RD_NTSTATUS(*read) (RD_NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, |
188 |
|
uint32 * result); |
189 |
|
RD_NTSTATUS(*write) (RD_NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, |
190 |
|
uint32 * result); |
191 |
|
RD_NTSTATUS(*device_control) (RD_NTHANDLE handle, uint32 request, STREAM in, STREAM out); |
192 |
|
} |
193 |
|
DEVICE_FNS; |
194 |
|
|
195 |
|
|
196 |
|
typedef struct rdpdr_device_info |
197 |
|
{ |
198 |
|
uint32 device_type; |
199 |
|
RD_NTHANDLE handle; |
200 |
|
char name[8]; |
201 |
|
char *local_path; |
202 |
|
void *pdevice_data; |
203 |
|
} |
204 |
|
RDPDR_DEVICE; |
205 |
|
|
206 |
|
typedef struct rdpdr_serial_device_info |
207 |
|
{ |
208 |
|
int dtr; |
209 |
|
int rts; |
210 |
|
uint32 control, xonoff, onlimit, offlimit; |
211 |
|
uint32 baud_rate, |
212 |
|
queue_in_size, |
213 |
|
queue_out_size, |
214 |
|
wait_mask, |
215 |
|
read_interval_timeout, |
216 |
|
read_total_timeout_multiplier, |
217 |
|
read_total_timeout_constant, |
218 |
|
write_total_timeout_multiplier, write_total_timeout_constant, posix_wait_mask; |
219 |
|
uint8 stop_bits, parity, word_length; |
220 |
|
uint8 chars[6]; |
221 |
|
struct termios *ptermios, *pold_termios; |
222 |
|
int event_txempty, event_cts, event_dsr, event_rlsd, event_pending; |
223 |
|
} |
224 |
|
SERIAL_DEVICE; |
225 |
|
|
226 |
|
typedef struct rdpdr_parallel_device_info |
227 |
|
{ |
228 |
|
char *driver, *printer; |
229 |
|
uint32 queue_in_size, |
230 |
|
queue_out_size, |
231 |
|
wait_mask, |
232 |
|
read_interval_timeout, |
233 |
|
read_total_timeout_multiplier, |
234 |
|
read_total_timeout_constant, |
235 |
|
write_total_timeout_multiplier, |
236 |
|
write_total_timeout_constant, posix_wait_mask, bloblen; |
237 |
|
uint8 *blob; |
238 |
|
} |
239 |
|
PARALLEL_DEVICE; |
240 |
|
|
241 |
|
typedef struct rdpdr_printer_info |
242 |
|
{ |
243 |
|
FILE *printer_fp; |
244 |
|
char *driver, *printer; |
245 |
|
uint32 bloblen; |
246 |
|
uint8 *blob; |
247 |
|
RD_BOOL default_printer; |
248 |
|
} |
249 |
|
PRINTER; |
250 |
|
|
251 |
|
typedef struct notify_data |
252 |
|
{ |
253 |
|
time_t modify_time; |
254 |
|
time_t status_time; |
255 |
|
time_t total_time; |
256 |
|
unsigned int num_entries; |
257 |
|
} |
258 |
|
NOTIFY; |
259 |
|
|
260 |
|
#ifndef PATH_MAX |
261 |
|
#define PATH_MAX 256 |
262 |
|
#endif |
263 |
|
|
264 |
|
typedef struct fileinfo |
265 |
|
{ |
266 |
|
uint32 device_id, flags_and_attributes, accessmask; |
267 |
|
char path[PATH_MAX]; |
268 |
|
DIR *pdir; |
269 |
|
struct dirent *pdirent; |
270 |
|
char pattern[PATH_MAX]; |
271 |
|
RD_BOOL delete_on_close; |
272 |
|
NOTIFY notify; |
273 |
|
uint32 info_class; |
274 |
|
} |
275 |
|
FILEINFO; |
276 |
|
|
277 |
|
typedef RD_BOOL(*str_handle_lines_t) (const char *line, void *data); |