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-2005 |
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 |
18 |
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
19 |
*/ |
*/ |
20 |
|
|
21 |
|
#ifdef WITH_SCARD |
22 |
|
#ifdef PCSC_OSX |
23 |
|
#include <PCSC/wintypes.h> |
24 |
|
#else |
25 |
|
#include <wintypes.h> |
26 |
|
#endif /* PCSC_OSX */ |
27 |
|
#else |
28 |
typedef int BOOL; |
typedef int BOOL; |
29 |
|
#endif |
30 |
|
|
31 |
#ifndef True |
#ifndef True |
32 |
#define True (1) |
#define True (1) |
45 |
typedef void *HCOLOURMAP; |
typedef void *HCOLOURMAP; |
46 |
typedef void *HCURSOR; |
typedef void *HCURSOR; |
47 |
|
|
48 |
|
typedef struct _POINT |
49 |
|
{ |
50 |
|
sint16 x, y; |
51 |
|
} |
52 |
|
POINT; |
53 |
|
|
54 |
typedef struct _COLOURENTRY |
typedef struct _COLOURENTRY |
55 |
{ |
{ |
56 |
uint8 red; |
uint8 red; |
118 |
|
|
119 |
typedef struct _key_translation |
typedef struct _key_translation |
120 |
{ |
{ |
121 |
|
/* For normal scancode translations */ |
122 |
uint8 scancode; |
uint8 scancode; |
123 |
uint16 modifiers; |
uint16 modifiers; |
124 |
|
/* For sequences. If keysym is nonzero, the fields above are not used. */ |
125 |
|
uint32 seq_keysym; /* Really KeySym */ |
126 |
|
struct _key_translation *next; |
127 |
} |
} |
128 |
key_translation; |
key_translation; |
129 |
|
|
137 |
} |
} |
138 |
VCHANNEL; |
VCHANNEL; |
139 |
|
|
140 |
|
/* PSTCACHE */ |
141 |
|
typedef uint8 HASH_KEY[8]; |
142 |
|
|
143 |
|
/* Header for an entry in the persistent bitmap cache file */ |
144 |
|
typedef struct _PSTCACHE_CELLHEADER |
145 |
|
{ |
146 |
|
HASH_KEY key; |
147 |
|
uint8 width, height; |
148 |
|
uint16 length; |
149 |
|
uint32 stamp; |
150 |
|
} |
151 |
|
CELLHEADER; |
152 |
|
|
153 |
#define MAX_CBSIZE 256 |
#define MAX_CBSIZE 256 |
154 |
|
|
155 |
/* RDPSND */ |
/* RDPSND */ |
165 |
uint8 cb[MAX_CBSIZE]; |
uint8 cb[MAX_CBSIZE]; |
166 |
} WAVEFORMATEX; |
} WAVEFORMATEX; |
167 |
|
|
168 |
|
typedef struct _RDPCOMP |
169 |
|
{ |
170 |
|
uint32 roff; |
171 |
|
uint8 hist[RDP_MPPC_DICT_SIZE]; |
172 |
|
struct stream ns; |
173 |
|
} |
174 |
|
RDPCOMP; |
175 |
|
|
176 |
/* RDPDR */ |
/* RDPDR */ |
177 |
typedef uint32 NTSTATUS; |
typedef uint32 NTSTATUS; |
178 |
typedef uint32 HANDLE; |
typedef uint32 NTHANDLE; |
179 |
|
|
180 |
typedef struct _DEVICE_FNS |
typedef struct _DEVICE_FNS |
181 |
{ |
{ |
182 |
NTSTATUS (*create)(uint32 device, uint32 desired_access, uint32 share_mode, uint32 create_disposition, uint32 flags_and_attributes, char *filename, HANDLE *handle); |
NTSTATUS(*create) (uint32 device, uint32 desired_access, uint32 share_mode, |
183 |
NTSTATUS (*close)(HANDLE handle); |
uint32 create_disposition, uint32 flags_and_attributes, char *filename, |
184 |
NTSTATUS (*read)(HANDLE handle, uint8 *data, uint32 length, uint32 offset, uint32 *result); |
NTHANDLE * handle); |
185 |
NTSTATUS (*write)(HANDLE handle, uint8 *data, uint32 length, uint32 offset, uint32 *result); |
NTSTATUS(*close) (NTHANDLE handle); |
186 |
NTSTATUS (*device_control)(HANDLE handle, uint32 request, STREAM in, STREAM out); |
NTSTATUS(*read) (NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, |
187 |
|
uint32 * result); |
188 |
|
NTSTATUS(*write) (NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, |
189 |
|
uint32 * result); |
190 |
|
NTSTATUS(*device_control) (NTHANDLE handle, uint32 request, STREAM in, STREAM out); |
191 |
} |
} |
192 |
DEVICE_FNS; |
DEVICE_FNS; |
193 |
|
|
194 |
|
|
195 |
typedef struct rdpdr_device_info |
typedef struct rdpdr_device_info |
196 |
{ |
{ |
197 |
uint32 device_type; |
uint32 device_type; |
198 |
HANDLE handle; |
NTHANDLE handle; |
199 |
char name[8]; |
char name[8]; |
200 |
char *local_path; |
char *local_path; |
201 |
void *pdevice_data; |
void *pdevice_data; |
202 |
} |
} |
203 |
RDPDR_DEVICE; |
RDPDR_DEVICE; |
204 |
|
|
205 |
typedef struct rdpdr_serial_device_info |
typedef struct rdpdr_serial_device_info |
206 |
{ |
{ |
207 |
int dtr; |
int dtr; |
208 |
uint32 baud_rate, |
int rts; |
209 |
queue_in_size, |
uint32 control, xonoff, onlimit, offlimit; |
210 |
queue_out_size, |
uint32 baud_rate, |
211 |
wait_mask, |
queue_in_size, |
212 |
read_interval_timeout, |
queue_out_size, |
213 |
read_total_timeout_multiplier, |
wait_mask, |
214 |
read_total_timeout_constant, |
read_interval_timeout, |
215 |
write_total_timeout_multiplier, |
read_total_timeout_multiplier, |
216 |
write_total_timeout_constant, |
read_total_timeout_constant, |
217 |
posix_wait_mask; |
write_total_timeout_multiplier, write_total_timeout_constant, posix_wait_mask; |
218 |
uint8 stop_bits, |
uint8 stop_bits, parity, word_length; |
219 |
parity, |
uint8 chars[6]; |
220 |
word_length; |
struct termios *ptermios, *pold_termios; |
221 |
struct termios *ptermios, |
int event_txempty, event_cts, event_dsr, event_rlsd, event_pending; |
|
*pold_termios; |
|
222 |
} |
} |
223 |
SERIAL_DEVICE; |
SERIAL_DEVICE; |
224 |
|
|
225 |
typedef struct rdpdr_parallel_device_info |
typedef struct rdpdr_parallel_device_info |
226 |
{ |
{ |
227 |
char *driver, |
char *driver, *printer; |
228 |
*printer; |
uint32 queue_in_size, |
229 |
uint32 queue_in_size, |
queue_out_size, |
230 |
queue_out_size, |
wait_mask, |
231 |
wait_mask, |
read_interval_timeout, |
232 |
read_interval_timeout, |
read_total_timeout_multiplier, |
233 |
read_total_timeout_multiplier, |
read_total_timeout_constant, |
234 |
read_total_timeout_constant, |
write_total_timeout_multiplier, |
235 |
write_total_timeout_multiplier, |
write_total_timeout_constant, posix_wait_mask, bloblen; |
236 |
write_total_timeout_constant, |
uint8 *blob; |
|
posix_wait_mask, |
|
|
bloblen; |
|
|
uint8 *blob; |
|
237 |
} |
} |
238 |
PARALLEL_DEVICE; |
PARALLEL_DEVICE; |
239 |
|
|
240 |
typedef struct rdpdr_printer_info |
typedef struct rdpdr_printer_info |
241 |
{ |
{ |
242 |
FILE *printer_fp; |
FILE *printer_fp; |
243 |
char *driver, |
char *driver, *printer; |
244 |
*printer; |
uint32 bloblen; |
245 |
uint32 bloblen; |
uint8 *blob; |
246 |
uint8 *blob; |
BOOL default_printer; |
|
BOOL default_printer; |
|
247 |
} |
} |
248 |
PRINTER; |
PRINTER; |
249 |
|
|
250 |
|
typedef struct notify_data |
251 |
|
{ |
252 |
|
time_t modify_time; |
253 |
|
time_t status_time; |
254 |
|
time_t total_time; |
255 |
|
unsigned int num_entries; |
256 |
|
} |
257 |
|
NOTIFY; |
258 |
|
|
259 |
|
#ifndef PATH_MAX |
260 |
|
#define PATH_MAX 256 |
261 |
|
#endif |
262 |
|
|
263 |
|
typedef struct fileinfo |
264 |
|
{ |
265 |
|
uint32 device_id, flags_and_attributes, accessmask; |
266 |
|
char path[PATH_MAX]; |
267 |
|
DIR *pdir; |
268 |
|
struct dirent *pdirent; |
269 |
|
char pattern[PATH_MAX]; |
270 |
|
BOOL delete_on_close; |
271 |
|
NOTIFY notify; |
272 |
|
uint32 info_class; |
273 |
|
} |
274 |
|
FILEINFO; |
275 |
|
|
276 |
|
typedef BOOL(*str_handle_lines_t) (const char *line, void *data); |