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 |
8 |
the Free Software Foundation; either version 2 of the License, or |
the Free Software Foundation; either version 2 of the License, or |
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 |
|
#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) |
40 |
typedef unsigned int uint32; |
typedef unsigned int uint32; |
41 |
typedef signed int sint32; |
typedef signed int sint32; |
42 |
|
|
43 |
typedef void *HBITMAP; |
typedef void *RD_HBITMAP; |
44 |
typedef void *HGLYPH; |
typedef void *RD_HGLYPH; |
45 |
typedef void *HCOLOURMAP; |
typedef void *RD_HCOLOURMAP; |
46 |
typedef void *HCURSOR; |
typedef void *RD_HCURSOR; |
47 |
|
|
48 |
|
typedef struct _RD_POINT |
49 |
|
{ |
50 |
|
sint16 x, y; |
51 |
|
} |
52 |
|
RD_POINT; |
53 |
|
|
54 |
typedef struct _COLOURENTRY |
typedef struct _COLOURENTRY |
55 |
{ |
{ |
103 |
sint16 baseline; |
sint16 baseline; |
104 |
uint16 width; |
uint16 width; |
105 |
uint16 height; |
uint16 height; |
106 |
HBITMAP pixmap; |
RD_HBITMAP pixmap; |
107 |
|
|
108 |
} |
} |
109 |
FONTGLYPH; |
FONTGLYPH; |
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 |
|
|
|
typedef struct _BMPCACHEENTRY |
|
|
{ |
|
|
HBITMAP bitmap; |
|
|
uint32 usage; |
|
|
|
|
|
} |
|
|
BMPCACHEENTRY; |
|
|
|
|
140 |
/* PSTCACHE */ |
/* PSTCACHE */ |
141 |
|
typedef uint8 HASH_KEY[8]; |
|
typedef uint8 BITMAP_ID[8]; |
|
142 |
|
|
143 |
/* Header for an entry in the persistent bitmap cache file */ |
/* Header for an entry in the persistent bitmap cache file */ |
144 |
typedef struct _PSTCACHE_CELLHEADER |
typedef struct _PSTCACHE_CELLHEADER |
145 |
{ |
{ |
146 |
BITMAP_ID bitmap_id; |
HASH_KEY key; |
147 |
uint8 width, height; |
uint8 width, height; |
148 |
uint16 length; |
uint16 length; |
149 |
uint32 stamp; |
uint32 stamp; |
153 |
#define MAX_CBSIZE 256 |
#define MAX_CBSIZE 256 |
154 |
|
|
155 |
/* RDPSND */ |
/* RDPSND */ |
156 |
typedef struct |
typedef struct _RD_WAVEFORMATEX |
157 |
{ |
{ |
158 |
uint16 wFormatTag; |
uint16 wFormatTag; |
159 |
uint16 nChannels; |
uint16 nChannels; |
163 |
uint16 wBitsPerSample; |
uint16 wBitsPerSample; |
164 |
uint16 cbSize; |
uint16 cbSize; |
165 |
uint8 cb[MAX_CBSIZE]; |
uint8 cb[MAX_CBSIZE]; |
166 |
} WAVEFORMATEX; |
} RD_WAVEFORMATEX; |
167 |
|
|
168 |
typedef struct _RDPCOMP |
typedef struct _RDPCOMP |
169 |
{ |
{ |
174 |
RDPCOMP; |
RDPCOMP; |
175 |
|
|
176 |
/* RDPDR */ |
/* RDPDR */ |
177 |
typedef uint32 NTSTATUS; |
typedef uint32 RD_NTSTATUS; |
178 |
typedef uint32 NTHANDLE; |
typedef uint32 RD_NTHANDLE; |
179 |
|
|
180 |
typedef struct _DEVICE_FNS |
typedef struct _DEVICE_FNS |
181 |
{ |
{ |
182 |
NTSTATUS(*create) (uint32 device, uint32 desired_access, uint32 share_mode, |
RD_NTSTATUS(*create) (uint32 device, uint32 desired_access, uint32 share_mode, |
183 |
uint32 create_disposition, uint32 flags_and_attributes, char *filename, |
uint32 create_disposition, uint32 flags_and_attributes, |
184 |
NTHANDLE * handle); |
char *filename, RD_NTHANDLE * handle); |
185 |
NTSTATUS(*close) (NTHANDLE handle); |
RD_NTSTATUS(*close) (RD_NTHANDLE handle); |
186 |
NTSTATUS(*read) (NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, |
RD_NTSTATUS(*read) (RD_NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, |
187 |
uint32 * result); |
uint32 * result); |
188 |
NTSTATUS(*write) (NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, |
RD_NTSTATUS(*write) (RD_NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, |
189 |
uint32 * result); |
uint32 * result); |
190 |
NTSTATUS(*device_control) (NTHANDLE handle, uint32 request, STREAM in, STREAM out); |
RD_NTSTATUS(*device_control) (RD_NTHANDLE handle, uint32 request, STREAM in, STREAM out); |
191 |
} |
} |
192 |
DEVICE_FNS; |
DEVICE_FNS; |
193 |
|
|
195 |
typedef struct rdpdr_device_info |
typedef struct rdpdr_device_info |
196 |
{ |
{ |
197 |
uint32 device_type; |
uint32 device_type; |
198 |
NTHANDLE handle; |
RD_NTHANDLE handle; |
199 |
char name[8]; |
char name[8]; |
200 |
char *local_path; |
char *local_path; |
201 |
void *pdevice_data; |
void *pdevice_data; |
206 |
{ |
{ |
207 |
int dtr; |
int dtr; |
208 |
int rts; |
int rts; |
209 |
|
uint32 control, xonoff, onlimit, offlimit; |
210 |
uint32 baud_rate, |
uint32 baud_rate, |
211 |
queue_in_size, |
queue_in_size, |
212 |
queue_out_size, |
queue_out_size, |
216 |
read_total_timeout_constant, |
read_total_timeout_constant, |
217 |
write_total_timeout_multiplier, write_total_timeout_constant, posix_wait_mask; |
write_total_timeout_multiplier, write_total_timeout_constant, posix_wait_mask; |
218 |
uint8 stop_bits, parity, word_length; |
uint8 stop_bits, parity, word_length; |
219 |
|
uint8 chars[6]; |
220 |
struct termios *ptermios, *pold_termios; |
struct termios *ptermios, *pold_termios; |
221 |
|
int event_txempty, event_cts, event_dsr, event_rlsd, event_pending; |
222 |
} |
} |
223 |
SERIAL_DEVICE; |
SERIAL_DEVICE; |
224 |
|
|
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 |
typedef struct fileinfo |
264 |
{ |
{ |
265 |
uint32 device_id, flags_and_attributes; |
uint32 device_id, flags_and_attributes, accessmask; |
266 |
char path[256]; |
char path[PATH_MAX]; |
267 |
DIR *pdir; |
DIR *pdir; |
268 |
struct dirent *pdirent; |
struct dirent *pdirent; |
269 |
char pattern[64]; |
char pattern[PATH_MAX]; |
270 |
BOOL delete_on_close; |
BOOL delete_on_close; |
271 |
|
NOTIFY notify; |
272 |
|
uint32 info_class; |
273 |
} |
} |
274 |
FILEINFO; |
FILEINFO; |
275 |
|
|
276 |
|
typedef BOOL(*str_handle_lines_t) (const char *line, void *data); |