-/*\r
- rdesktop: A Remote Desktop Protocol client.\r
- Common data types\r
- Copyright (C) Matthew Chapman 1999-2005\r
-\r
- This program is free software; you can redistribute it and/or modify\r
- it under the terms of the GNU General Public License as published by\r
- the Free Software Foundation; either version 2 of the License, or\r
- (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
-*/\r
-\r
-#if 0\r
-typedef int BOOL;\r
-#endif\r
-\r
-#ifndef True\r
-#define True (1)\r
-#define False (0)\r
-#endif\r
-\r
-typedef unsigned char uint8;\r
-typedef signed char sint8;\r
-typedef unsigned short uint16;\r
-typedef signed short sint16;\r
-typedef unsigned int uint32;\r
-typedef signed int sint32;\r
-\r
-// TODO: detect Win32, avoid this mess\r
-#if 0\r
-typedef void *HBITMAP;\r
-typedef void *HCURSOR;\r
-#endif\r
-typedef void *HGLYPH;\r
-\r
-// TODO: nuke, use HPALETTE\r
-typedef void *HCOLOURMAP;\r
-\r
-#if 0\r
-typedef struct _POINT\r
-{\r
- sint16 x, y;\r
-}\r
-POINT;\r
-#endif\r
-\r
-// TODO: nuke, use COLORREF\r
-typedef struct _COLOURENTRY\r
-{\r
- uint8 red;\r
- uint8 green;\r
- uint8 blue;\r
-\r
-}\r
-COLOURENTRY;\r
-\r
-// TODO: nuke, use LOGPALETTE\r
-typedef struct _COLOURMAP\r
-{\r
- uint16 ncolours;\r
- COLOURENTRY *colours;\r
-\r
-}\r
-COLOURMAP;\r
-\r
-// TODO: nuke, use RECT\r
-typedef struct _BOUNDS\r
-{\r
- sint16 left;\r
- sint16 top;\r
- sint16 right;\r
- sint16 bottom;\r
-\r
-}\r
-BOUNDS;\r
-\r
-// TODO: nuke, use LOGPEN\r
-typedef struct _PEN \r
-{\r
- uint8 style;\r
- uint8 width;\r
- uint32 colour;\r
-\r
-}\r
-PEN;\r
-\r
-typedef struct _BRUSH\r
-{\r
- uint8 xorigin;\r
- uint8 yorigin;\r
- uint8 style;\r
- uint8 pattern[8];\r
-\r
-}\r
-BRUSH;\r
-\r
-typedef struct _FONTGLYPH\r
-{\r
- sint16 offset;\r
- sint16 baseline;\r
- uint16 width;\r
- uint16 height;\r
- HBITMAP pixmap;\r
-\r
-}\r
-FONTGLYPH;\r
-\r
-typedef struct _DATABLOB\r
-{\r
- void *data;\r
- int size;\r
-\r
-}\r
-DATABLOB;\r
-\r
-typedef struct _key_translation\r
-{\r
- /* For normal scancode translations */\r
- uint8 scancode;\r
- uint16 modifiers;\r
- /* For sequences. If keysym is nonzero, the fields above are not used. */\r
- uint32 seq_keysym; /* Really KeySym */\r
- struct _key_translation *next;\r
-}\r
-key_translation;\r
-\r
-typedef struct _VCHANNEL\r
-{\r
- CHANNEL_DEF def;\r
- uint16 mcs_id;\r
- struct stream in;\r
- void (*process) (RDPCLIENT *, STREAM);\r
-}\r
-VCHANNEL;\r
-\r
-/* PSTCACHE */\r
-typedef uint8 HASH_KEY[8];\r
-\r
-/* Header for an entry in the persistent bitmap cache file */\r
-typedef struct _PSTCACHE_CELLHEADER\r
-{\r
- HASH_KEY key;\r
- uint8 width, height;\r
- uint16 length;\r
- uint32 stamp;\r
-}\r
-CELLHEADER;\r
-\r
-#define MAX_CBSIZE 256\r
-\r
-/* RDPSND */\r
-#if 0\r
-typedef struct\r
-{\r
- uint16 wFormatTag;\r
- uint16 nChannels;\r
- uint32 nSamplesPerSec;\r
- uint32 nAvgBytesPerSec;\r
- uint16 nBlockAlign;\r
- uint16 wBitsPerSample;\r
- uint16 cbSize;\r
- uint8 cb[MAX_CBSIZE];\r
-} WAVEFORMATEX;\r
-#endif\r
-typedef struct _RDPCOMP\r
-{\r
- uint32 roff;\r
- uint8 hist[RDP_MPPC_DICT_SIZE];\r
- struct stream ns;\r
-}\r
-RDPCOMP;\r
-\r
-#if 0\r
-/* RDPDR */\r
-typedef uint32 NTSTATUS;\r
-typedef uint32 NTHANDLE;\r
-\r
-typedef struct _DEVICE_FNS\r
-{\r
- NTSTATUS(*create) (RDPCLIENT * This, uint32 device, uint32 desired_access, uint32 share_mode,\r
- uint32 create_disposition, uint32 flags_and_attributes, char *filename,\r
- NTHANDLE * handle);\r
- NTSTATUS(*close) (RDPCLIENT * This, NTHANDLE handle);\r
- NTSTATUS(*read) (RDPCLIENT * This, NTHANDLE handle, uint8 * data, uint32 length, uint32 offset,\r
- uint32 * result);\r
- NTSTATUS(*write) (RDPCLIENT * This, NTHANDLE handle, uint8 * data, uint32 length, uint32 offset,\r
- uint32 * result);\r
- NTSTATUS(*device_control) (RDPCLIENT * This, NTHANDLE handle, uint32 request, STREAM in, STREAM out);\r
-}\r
-DEVICE_FNS;\r
-\r
-\r
-typedef struct rdpdr_device_info\r
-{\r
- uint32 device_type;\r
- NTHANDLE handle;\r
- char name[8];\r
- char *local_path;\r
- void *pdevice_data;\r
-}\r
-RDPDR_DEVICE;\r
-\r
-typedef struct rdpdr_serial_device_info\r
-{\r
- int dtr;\r
- int rts;\r
- uint32 control, xonoff, onlimit, offlimit;\r
- uint32 baud_rate,\r
- queue_in_size,\r
- queue_out_size,\r
- wait_mask,\r
- read_interval_timeout,\r
- read_total_timeout_multiplier,\r
- read_total_timeout_constant,\r
- write_total_timeout_multiplier, write_total_timeout_constant, posix_wait_mask;\r
- uint8 stop_bits, parity, word_length;\r
- uint8 chars[6];\r
- struct termios *ptermios, *pold_termios;\r
- int event_txempty, event_cts, event_dsr, event_rlsd, event_pending;\r
-}\r
-SERIAL_DEVICE;\r
-\r
-typedef struct rdpdr_parallel_device_info\r
-{\r
- char *driver, *printer;\r
- uint32 queue_in_size,\r
- queue_out_size,\r
- wait_mask,\r
- read_interval_timeout,\r
- read_total_timeout_multiplier,\r
- read_total_timeout_constant,\r
- write_total_timeout_multiplier,\r
- write_total_timeout_constant, posix_wait_mask, bloblen;\r
- uint8 *blob;\r
-}\r
-PARALLEL_DEVICE;\r
-\r
-typedef struct rdpdr_printer_info\r
-{\r
- FILE *printer_fp;\r
- char *driver, *printer;\r
- uint32 bloblen;\r
- uint8 *blob;\r
- BOOL default_printer;\r
-}\r
-PRINTER;\r
-\r
-typedef struct notify_data\r
-{\r
- time_t modify_time;\r
- time_t status_time;\r
- time_t total_time;\r
- unsigned int num_entries;\r
-}\r
-NOTIFY;\r
-\r
-#ifndef PATH_MAX\r
-#define PATH_MAX 256\r
-#endif\r
-\r
-typedef struct fileinfo\r
-{\r
- uint32 device_id, flags_and_attributes, accessmask;\r
- char path[PATH_MAX];\r
- DIR *pdir;\r
- struct dirent *pdirent;\r
- char pattern[PATH_MAX];\r
- BOOL delete_on_close;\r
- NOTIFY notify;\r
- uint32 info_class;\r
-}\r
-FILEINFO;\r
-#endif\r
-\r
-typedef BOOL(*str_handle_lines_t) (RDPCLIENT * This, const char *line, void *data);\r
+/*
+ rdesktop: A Remote Desktop Protocol client.
+ Common data types
+ Copyright (C) Matthew Chapman 1999-2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#if 0
+typedef int BOOL;
+#endif
+
+#ifndef True
+#define True (1)
+#define False (0)
+#endif
+
+typedef unsigned char uint8;
+typedef signed char sint8;
+typedef unsigned short uint16;
+typedef signed short sint16;
+typedef unsigned int uint32;
+typedef signed int sint32;
+
+// TODO: detect Win32, avoid this mess
+#if 0
+typedef void *HBITMAP;
+typedef void *HCURSOR;
+#endif
+typedef void *HGLYPH;
+
+// TODO: nuke, use HPALETTE
+typedef void *HCOLOURMAP;
+
+#if 0
+typedef struct _POINT
+{
+ sint16 x, y;
+}
+POINT;
+#endif
+
+// TODO: nuke, use COLORREF
+typedef struct _COLOURENTRY
+{
+ uint8 red;
+ uint8 green;
+ uint8 blue;
+
+}
+COLOURENTRY;
+
+// TODO: nuke, use LOGPALETTE
+typedef struct _COLOURMAP
+{
+ uint16 ncolours;
+ COLOURENTRY *colours;
+
+}
+COLOURMAP;
+
+// TODO: nuke, use RECT
+typedef struct _BOUNDS
+{
+ sint16 left;
+ sint16 top;
+ sint16 right;
+ sint16 bottom;
+
+}
+BOUNDS;
+
+// TODO: nuke, use LOGPEN
+typedef struct _PEN
+{
+ uint8 style;
+ uint8 width;
+ uint32 colour;
+
+}
+PEN;
+
+typedef struct _BRUSH
+{
+ uint8 xorigin;
+ uint8 yorigin;
+ uint8 style;
+ uint8 pattern[8];
+
+}
+BRUSH;
+
+typedef struct _FONTGLYPH
+{
+ sint16 offset;
+ sint16 baseline;
+ uint16 width;
+ uint16 height;
+ HBITMAP pixmap;
+
+}
+FONTGLYPH;
+
+typedef struct _DATABLOB
+{
+ void *data;
+ int size;
+
+}
+DATABLOB;
+
+typedef struct _key_translation
+{
+ /* For normal scancode translations */
+ uint8 scancode;
+ uint16 modifiers;
+ /* For sequences. If keysym is nonzero, the fields above are not used. */
+ uint32 seq_keysym; /* Really KeySym */
+ struct _key_translation *next;
+}
+key_translation;
+
+typedef struct _VCHANNEL
+{
+ CHANNEL_DEF def;
+ uint16 mcs_id;
+ struct stream in;
+ void (*process) (RDPCLIENT *, STREAM);
+}
+VCHANNEL;
+
+/* PSTCACHE */
+typedef uint8 HASH_KEY[8];
+
+/* Header for an entry in the persistent bitmap cache file */
+typedef struct _PSTCACHE_CELLHEADER
+{
+ HASH_KEY key;
+ uint8 width, height;
+ uint16 length;
+ uint32 stamp;
+}
+CELLHEADER;
+
+#define MAX_CBSIZE 256
+
+/* RDPSND */
+#if 0
+typedef struct
+{
+ uint16 wFormatTag;
+ uint16 nChannels;
+ uint32 nSamplesPerSec;
+ uint32 nAvgBytesPerSec;
+ uint16 nBlockAlign;
+ uint16 wBitsPerSample;
+ uint16 cbSize;
+ uint8 cb[MAX_CBSIZE];
+} WAVEFORMATEX;
+#endif
+typedef struct _RDPCOMP
+{
+ uint32 roff;
+ uint8 hist[RDP_MPPC_DICT_SIZE];
+ struct stream ns;
+}
+RDPCOMP;
+
+#if 0
+/* RDPDR */
+typedef uint32 NTSTATUS;
+typedef uint32 NTHANDLE;
+
+typedef struct _DEVICE_FNS
+{
+ NTSTATUS(*create) (RDPCLIENT * This, uint32 device, uint32 desired_access, uint32 share_mode,
+ uint32 create_disposition, uint32 flags_and_attributes, char *filename,
+ NTHANDLE * handle);
+ NTSTATUS(*close) (RDPCLIENT * This, NTHANDLE handle);
+ NTSTATUS(*read) (RDPCLIENT * This, NTHANDLE handle, uint8 * data, uint32 length, uint32 offset,
+ uint32 * result);
+ NTSTATUS(*write) (RDPCLIENT * This, NTHANDLE handle, uint8 * data, uint32 length, uint32 offset,
+ uint32 * result);
+ NTSTATUS(*device_control) (RDPCLIENT * This, NTHANDLE handle, uint32 request, STREAM in, STREAM out);
+}
+DEVICE_FNS;
+
+
+typedef struct rdpdr_device_info
+{
+ uint32 device_type;
+ NTHANDLE handle;
+ char name[8];
+ char *local_path;
+ void *pdevice_data;
+}
+RDPDR_DEVICE;
+
+typedef struct rdpdr_serial_device_info
+{
+ int dtr;
+ int rts;
+ uint32 control, xonoff, onlimit, offlimit;
+ uint32 baud_rate,
+ queue_in_size,
+ queue_out_size,
+ wait_mask,
+ read_interval_timeout,
+ read_total_timeout_multiplier,
+ read_total_timeout_constant,
+ write_total_timeout_multiplier, write_total_timeout_constant, posix_wait_mask;
+ uint8 stop_bits, parity, word_length;
+ uint8 chars[6];
+ struct termios *ptermios, *pold_termios;
+ int event_txempty, event_cts, event_dsr, event_rlsd, event_pending;
+}
+SERIAL_DEVICE;
+
+typedef struct rdpdr_parallel_device_info
+{
+ char *driver, *printer;
+ uint32 queue_in_size,
+ queue_out_size,
+ wait_mask,
+ read_interval_timeout,
+ read_total_timeout_multiplier,
+ read_total_timeout_constant,
+ write_total_timeout_multiplier,
+ write_total_timeout_constant, posix_wait_mask, bloblen;
+ uint8 *blob;
+}
+PARALLEL_DEVICE;
+
+typedef struct rdpdr_printer_info
+{
+ FILE *printer_fp;
+ char *driver, *printer;
+ uint32 bloblen;
+ uint8 *blob;
+ BOOL default_printer;
+}
+PRINTER;
+
+typedef struct notify_data
+{
+ time_t modify_time;
+ time_t status_time;
+ time_t total_time;
+ unsigned int num_entries;
+}
+NOTIFY;
+
+#ifndef PATH_MAX
+#define PATH_MAX 256
+#endif
+
+typedef struct fileinfo
+{
+ uint32 device_id, flags_and_attributes, accessmask;
+ char path[PATH_MAX];
+ DIR *pdir;
+ struct dirent *pdirent;
+ char pattern[PATH_MAX];
+ BOOL delete_on_close;
+ NOTIFY notify;
+ uint32 info_class;
+}
+FILEINFO;
+#endif
+
+typedef BOOL(*str_handle_lines_t) (RDPCLIENT * This, const char *line, void *data);