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