/[rdesktop]/sourceforge.net/trunk/rdesktop/rdp.h
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /sourceforge.net/trunk/rdesktop/rdp.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3 - (hide annotations)
Wed May 10 07:36:34 2000 UTC (24 years, 1 month ago) by matty
Original Path: sourceforge.net/branches/RDESKTOP/rdesktop/rdp.h
File MIME type: text/plain
File size: 7211 byte(s)
Adding my experimental RDP client to repository.

1 matty 3 /*
2     rdesktop: A Remote Desktop Protocol client.
3     Protocol services - RDP layer
4     Copyright (C) Matthew Chapman 1999-2000
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
17     along with this program; if not, write to the Free Software
18     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19     */
20    
21     enum RDP_PDU_TYPE
22     {
23     RDP_PDU_DEMAND_ACTIVE = 1,
24     RDP_PDU_CONFIRM_ACTIVE = 3,
25     RDP_PDU_DATA = 7
26     };
27    
28     enum RDP_DATA_PDU_TYPE
29     {
30     RDP_DATA_PDU_UPDATE = 2,
31     RDP_DATA_PDU_CONTROL = 20,
32     RDP_DATA_PDU_POINTER = 27,
33     RDP_DATA_PDU_INPUT = 28,
34     RDP_DATA_PDU_SYNCHRONIZE = 31,
35     RDP_DATA_PDU_FONT2 = 39
36     };
37    
38     typedef struct _RDP_HEADER
39     {
40     uint16 length;
41     uint16 pdu_type;
42     uint16 userid;
43    
44     } RDP_HEADER;
45    
46     typedef struct _RDP_DATA_HEADER
47     {
48     uint32 shareid;
49     uint8 pad;
50     uint8 streamid;
51     uint16 length;
52     uint8 data_pdu_type;
53     uint8 compress_type;
54     uint16 compress_len;
55    
56     } RDP_DATA_HEADER;
57    
58     #define RDP_CAPSET_GENERAL 1
59     #define RDP_CAPLEN_GENERAL 0x18
60     #define OS_MAJOR_TYPE_UNIX 4
61     #define OS_MINOR_TYPE_XSERVER 7
62    
63     typedef struct _RDP_GENERAL_CAPS
64     {
65     uint16 os_major_type;
66     uint16 os_minor_type;
67     uint16 ver_protocol;
68     uint16 pad1;
69     uint16 compress_types;
70     uint16 pad2;
71     uint16 cap_update;
72     uint16 remote_unshare;
73     uint16 compress_level;
74     uint16 pad3;
75    
76     } RDP_GENERAL_CAPS;
77    
78     #define RDP_CAPSET_BITMAP 2
79     #define RDP_CAPLEN_BITMAP 0x1C
80    
81     typedef struct _RDP_BITMAP_CAPS
82     {
83     uint16 preferred_bpp;
84     uint16 receive1bpp;
85     uint16 receive4bpp;
86     uint16 receive8bpp;
87     uint16 width;
88     uint16 height;
89     uint16 pad1;
90     uint16 allow_resize;
91     uint16 compression;
92     uint16 unknown1;
93     uint16 unknown2;
94     uint16 pad2;
95    
96     } RDP_BITMAP_CAPS;
97    
98     #define RDP_CAPSET_ORDER 3
99     #define RDP_CAPLEN_ORDER 0x58
100     #define ORDER_CAP_NEGOTIATE 2
101     #define ORDER_CAP_NOSUPPORT 4
102    
103     typedef struct _RDP_ORDER_CAPS
104     {
105     uint8 terminal_desc[16];
106     uint32 pad1;
107     uint16 xgranularity; // 1
108     uint16 ygranularity; // 20
109     uint16 pad2;
110     uint16 max_order_level;
111     uint16 num_fonts; // 0x2C
112     uint16 cap_flags; // 0x22
113     uint8 support[32];
114     uint16 text_cap_flags; // 0x6A1
115     uint16 pad3;
116     uint32 pad4;
117     uint32 desk_save_size;
118     uint32 unknown1; // 1 from server, 0 from client
119     uint32 unknown2; // 0x4E4 from client
120    
121     } RDP_ORDER_CAPS;
122    
123     #define RDP_CAPSET_BMPCACHE 4
124     #define RDP_CAPLEN_BMPCACHE 0x28
125    
126     typedef struct _RDP_BMPCACHE_INFO
127     {
128     uint16 entries;
129     uint16 max_cell_size;
130    
131     } RDP_BMPCACHE_INFO;
132    
133     typedef struct _RDP_BMPCACHE_CAPS
134     {
135     uint32 unused[6];
136     RDP_BMPCACHE_INFO caches[3];
137    
138     } RDP_BMPCACHE_CAPS;
139    
140     #define RDP_CAPSET_CONTROL 5
141     #define RDP_CAPLEN_CONTROL 0x0C
142    
143     typedef struct _RDP_CONTROL_CAPS
144     {
145     uint16 control_caps;
146     uint16 remote_detach;
147     uint16 control_interest;
148     uint16 detach_interest;
149    
150     } RDP_CONTROL_CAPS;
151    
152     #define RDP_CAPSET_ACTIVATE 7
153     #define RDP_CAPLEN_ACTIVATE 0x0C
154    
155     typedef struct _RDP_ACTIVATE_CAPS
156     {
157     uint16 help_key;
158     uint16 help_index_key;
159     uint16 help_extended_key;
160     uint16 window_activate;
161    
162     } RDP_ACTIVATE_CAPS;
163    
164     #define RDP_CAPSET_POINTER 8
165     #define RDP_CAPLEN_POINTER 0x08
166    
167     typedef struct _RDP_POINTER_CAPS
168     {
169     uint16 colour_pointer;
170     uint16 cache_size;
171    
172     } RDP_POINTER_CAPS;
173    
174     #define RDP_CAPSET_SHARE 9
175     #define RDP_CAPLEN_SHARE 0x08
176    
177     typedef struct _RDP_SHARE_CAPS
178     {
179     uint16 userid;
180     uint16 pad;
181    
182     } RDP_SHARE_CAPS;
183    
184     #define RDP_CAPSET_COLCACHE 10
185     #define RDP_CAPLEN_COLCACHE 0x08
186    
187     typedef struct _RDP_COLCACHE_CAPS
188     {
189     uint16 cache_size;
190     uint16 pad;
191    
192     } RDP_COLCACHE_CAPS;
193    
194     #define RDP_CAPSET_UNKNOWN 13
195     #define RDP_CAPLEN_UNKNOWN 0x9C
196    
197     #define RDP_SOURCE "MSTSC"
198    
199     typedef struct _RDP_ACTIVE_PDU
200     {
201     uint32 shareid;
202     uint16 userid; // RDP_PDU_CONFIRM_ACTIVE only
203     uint16 source_len;
204     uint16 caps_len;
205     uint8 source[48];
206     uint16 num_caps;
207     uint16 pad;
208    
209     RDP_GENERAL_CAPS general_caps;
210     RDP_BITMAP_CAPS bitmap_caps;
211     RDP_ORDER_CAPS order_caps;
212     RDP_BMPCACHE_CAPS bmpcache_caps;
213     RDP_ACTIVATE_CAPS activate_caps;
214     RDP_CONTROL_CAPS control_caps;
215     RDP_POINTER_CAPS pointer_caps;
216     RDP_SHARE_CAPS share_caps;
217     RDP_COLCACHE_CAPS colcache_caps;
218    
219     } RDP_ACTIVE_PDU;
220    
221     typedef struct _RDP_SYNCHRONIZE_PDU
222     {
223     uint16 type; // 1
224     uint16 userid;
225    
226     } RDP_SYNCHRONIZE_PDU;
227    
228     #define RDP_CTL_REQUEST_CONTROL 1
229     #define RDP_CTL_GRANT_CONTROL 2
230     #define RDP_CTL_DETACH 3
231     #define RDP_CTL_COOPERATE 4
232    
233     typedef struct _RDP_CONTROL_PDU
234     {
235     uint16 action; // see above
236     uint16 userid;
237     uint32 controlid;
238    
239     } RDP_CONTROL_PDU;
240    
241     #define RDP_INPUT_SYNCHRONIZE 0
242     #define RDP_INPUT_CODEPOINT 1
243     #define RDP_INPUT_VIRTKEY 2
244     #define RDP_INPUT_UNKNOWN 4
245     #define RDP_INPUT_MOUSE 0x8001
246    
247     #define KBD_FLAG_RIGHT 0x0001
248     #define KBD_FLAG_QUIET 0x1000
249     #define KBD_FLAG_DOWN 0x4000
250     #define KBD_FLAG_RELEASE 0x8000
251    
252     #define MOUSE_FLAG_MOVE 0x0800
253     #define MOUSE_FLAG_BUTTON1 0x1000
254     #define MOUSE_FLAG_BUTTON2 0x2000
255     #define MOUSE_FLAG_BUTTON3 0x4000
256     #define MOUSE_FLAG_DOWN 0x8000
257    
258     #define RDP_MAX_EVENTS 50
259    
260     typedef struct _RDP_INPUT_EVENT
261     {
262     uint32 event_time;
263     uint16 message_type;
264     uint16 device_flags;
265    
266     uint16 kbd_keycode;
267    
268     uint16 mouse_x;
269     uint16 mouse_y;
270    
271     } RDP_INPUT_EVENT;
272    
273     typedef struct _RDP_INPUT_PDU
274     {
275     uint16 num_events;
276     uint16 pad;
277     RDP_INPUT_EVENT event[RDP_MAX_EVENTS];
278    
279     } RDP_INPUT_PDU;
280    
281     #define RDP_FONT_INFO_SIZE 0x32
282     #define RDP_MAX_FONTS 100
283    
284     typedef struct _RDP_FONT_INFO
285     {
286     uint8 name[32];
287     uint16 flags;
288     uint16 width;
289     uint16 height;
290     uint16 xaspect;
291     uint16 yaspect;
292     uint32 signature;
293     uint16 codepage;
294     uint16 ascent;
295    
296     } RDP_FONT_INFO;
297    
298     typedef struct _RDP_FONT_PDU
299     {
300     uint16 num_fonts;
301     uint16 unknown1; // 0x3e
302     uint16 unknown2; // series number?
303     uint16 entry_size;
304     RDP_FONT_INFO font[RDP_MAX_FONTS];
305    
306     } RDP_FONT_PDU;
307    
308     #define RDP_UPDATE_ORDERS 0
309     #define RDP_UPDATE_PALETTE 2
310    
311     typedef struct _OPAQUE_RECT_ORDER
312     {
313     uint16 x;
314     uint16 y;
315     uint16 cx;
316     uint16 cy;
317     uint8 colour;
318    
319     } OPAQUE_RECT_ORDER;
320    
321     typedef struct _RDP_ORDER_STATE
322     {
323     uint8 order_type;
324    
325     OPAQUE_RECT_ORDER opaque_rect;
326    
327     } RDP_ORDER_STATE;
328    
329     typedef struct _RDP_UPDATE_PDU
330     {
331     uint16 update_type;
332     uint16 pad;
333    
334     } RDP_UPDATE_PDU;
335    
336     #define RDP_ORDER_STANDARD 1
337     #define RDP_ORDER_SECONDARY 2
338     #define RDP_ORDER_BOUNDS 4
339     #define RDP_ORDER_CHANGE 8
340     #define RDP_ORDER_DELTA 16
341     #define RDP_ORDER_REPEAT 64
342    
343     enum RDP_ORDER_TYPE
344     {
345     RDP_ORDER_OPAQUE_RECT = 10
346     };
347    
348     enum RDP_SECONDARY_ORDER_TYPE
349     {
350     RDP_ORDER_BMPCACHE = 2
351     };
352    
353     typedef struct _RDP_SECONDARY_ORDER
354     {
355     uint16 length;
356     uint16 flags;
357     uint8 type;
358    
359     } RDP_SECONDARY_ORDER;
360    
361     typedef struct _RDP_BITMAP_HEADER
362     {
363     uint8 cache_id;
364     uint8 pad1;
365     uint8 width;
366     uint8 height;
367     uint8 bpp;
368     uint16 bufsize;
369     uint16 cache_idx;
370     uint16 pad2;
371     uint16 size;
372     uint16 row_size;
373     uint16 final_size;
374    
375     } RDP_BITMAP_HEADER;

  ViewVC Help
Powered by ViewVC 1.1.26