2000-07-07 11:49:45 +02:00
|
|
|
/*
|
|
|
|
rdesktop: A Remote Desktop Protocol client.
|
2000-08-15 12:23:24 +02:00
|
|
|
Common data types
|
2008-07-11 05:51:23 +02:00
|
|
|
Copyright (C) Matthew Chapman 1999-2008
|
2014-05-20 12:43:03 +02:00
|
|
|
Copyright 2014 Henrik Andersson <hean01@cendio.se> for Cendio AB
|
2017-01-23 12:50:42 +01:00
|
|
|
Copyright 2017 Karl Mikaelsson <derfian@cendio.se> for Cendio AB
|
2007-01-04 05:55:56 +01:00
|
|
|
|
2010-01-12 09:31:06 +01:00
|
|
|
This program is free software: you can redistribute it and/or modify
|
2000-07-07 11:49:45 +02:00
|
|
|
it under the terms of the GNU General Public License as published by
|
2010-01-12 09:31:06 +01:00
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
2000-07-07 11:49:45 +02:00
|
|
|
(at your option) any later version.
|
2004-01-21 15:40:40 +01:00
|
|
|
|
2000-07-07 11:49:45 +02:00
|
|
|
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.
|
2007-01-04 05:55:56 +01:00
|
|
|
|
2000-07-07 11:49:45 +02:00
|
|
|
You should have received a copy of the GNU General Public License
|
2010-01-12 09:31:06 +01:00
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2000-07-07 11:49:45 +02:00
|
|
|
*/
|
|
|
|
|
2017-11-08 09:29:41 +01:00
|
|
|
#ifndef _TYPES_H
|
|
|
|
#define _TYPES_H
|
|
|
|
|
|
|
|
#include "constants.h"
|
|
|
|
#include "stream.h"
|
|
|
|
|
2007-01-08 05:47:06 +01:00
|
|
|
typedef int RD_BOOL;
|
2000-07-07 11:49:45 +02:00
|
|
|
|
2000-08-15 12:23:24 +02:00
|
|
|
#ifndef True
|
|
|
|
#define True (1)
|
|
|
|
#define False (0)
|
|
|
|
#endif
|
2000-07-07 11:49:45 +02:00
|
|
|
|
2017-01-23 12:50:42 +01:00
|
|
|
#ifndef PATH_MAX
|
|
|
|
#define PATH_MAX 256
|
|
|
|
#endif
|
|
|
|
|
2000-08-15 12:23:24 +02:00
|
|
|
typedef unsigned char uint8;
|
2003-01-30 12:15:00 +01:00
|
|
|
typedef signed char sint8;
|
2000-08-15 12:23:24 +02:00
|
|
|
typedef unsigned short uint16;
|
2003-01-30 12:15:00 +01:00
|
|
|
typedef signed short sint16;
|
2000-08-15 12:23:24 +02:00
|
|
|
typedef unsigned int uint32;
|
2003-01-30 12:15:00 +01:00
|
|
|
typedef signed int sint32;
|
2000-07-25 14:34:29 +02:00
|
|
|
|
2007-01-04 05:55:56 +01:00
|
|
|
typedef void *RD_HBITMAP;
|
|
|
|
typedef void *RD_HGLYPH;
|
|
|
|
typedef void *RD_HCOLOURMAP;
|
|
|
|
typedef void *RD_HCURSOR;
|
2000-07-25 14:34:29 +02:00
|
|
|
|
2012-06-15 07:16:20 +02:00
|
|
|
|
|
|
|
typedef enum _RDP_VERSION
|
|
|
|
{
|
|
|
|
RDP_V4 = 4,
|
|
|
|
RDP_V5 = 5,
|
|
|
|
RDP_V6 = 6
|
|
|
|
} RDP_VERSION;
|
|
|
|
|
|
|
|
|
2007-01-04 05:55:56 +01:00
|
|
|
typedef struct _RD_POINT
|
2005-03-08 01:43:10 +01:00
|
|
|
{
|
|
|
|
sint16 x, y;
|
|
|
|
}
|
2007-01-04 05:55:56 +01:00
|
|
|
RD_POINT;
|
2005-03-08 01:43:10 +01:00
|
|
|
|
2000-08-15 12:23:24 +02:00
|
|
|
typedef struct _COLOURENTRY
|
2000-07-07 11:49:45 +02:00
|
|
|
{
|
2000-07-25 14:34:29 +02:00
|
|
|
uint8 red;
|
2000-08-15 12:23:24 +02:00
|
|
|
uint8 green;
|
|
|
|
uint8 blue;
|
2000-07-25 14:34:29 +02:00
|
|
|
|
2002-07-18 18:38:31 +02:00
|
|
|
}
|
|
|
|
COLOURENTRY;
|
2000-07-25 14:34:29 +02:00
|
|
|
|
2000-08-15 12:23:24 +02:00
|
|
|
typedef struct _COLOURMAP
|
2000-07-25 14:34:29 +02:00
|
|
|
{
|
|
|
|
uint16 ncolours;
|
2000-08-15 12:23:24 +02:00
|
|
|
COLOURENTRY *colours;
|
2000-07-25 14:34:29 +02:00
|
|
|
|
2002-07-18 18:38:31 +02:00
|
|
|
}
|
|
|
|
COLOURMAP;
|
2000-07-25 14:34:29 +02:00
|
|
|
|
2000-08-15 12:23:24 +02:00
|
|
|
typedef struct _BOUNDS
|
2000-07-25 14:34:29 +02:00
|
|
|
{
|
2003-05-16 23:55:14 +02:00
|
|
|
sint16 left;
|
|
|
|
sint16 top;
|
|
|
|
sint16 right;
|
|
|
|
sint16 bottom;
|
2000-07-25 14:34:29 +02:00
|
|
|
|
2002-07-18 18:38:31 +02:00
|
|
|
}
|
|
|
|
BOUNDS;
|
2000-07-25 14:34:29 +02:00
|
|
|
|
2000-08-15 12:23:24 +02:00
|
|
|
typedef struct _PEN
|
2000-07-25 14:34:29 +02:00
|
|
|
{
|
|
|
|
uint8 style;
|
|
|
|
uint8 width;
|
2003-02-04 06:32:13 +01:00
|
|
|
uint32 colour;
|
2000-07-25 14:34:29 +02:00
|
|
|
|
2002-07-18 18:38:31 +02:00
|
|
|
}
|
|
|
|
PEN;
|
2000-07-25 14:34:29 +02:00
|
|
|
|
2008-07-11 05:35:24 +02:00
|
|
|
/* this is whats in the brush cache */
|
|
|
|
typedef struct _BRUSHDATA
|
|
|
|
{
|
2008-11-01 03:37:10 +01:00
|
|
|
uint32 colour_code;
|
|
|
|
uint32 data_size;
|
2008-11-25 09:05:25 +01:00
|
|
|
uint8 *data;
|
2008-07-11 05:35:24 +02:00
|
|
|
}
|
|
|
|
BRUSHDATA;
|
|
|
|
|
2000-08-15 12:23:24 +02:00
|
|
|
typedef struct _BRUSH
|
2000-07-25 14:34:29 +02:00
|
|
|
{
|
|
|
|
uint8 xorigin;
|
|
|
|
uint8 yorigin;
|
|
|
|
uint8 style;
|
|
|
|
uint8 pattern[8];
|
2008-11-25 09:05:25 +01:00
|
|
|
BRUSHDATA *bd;
|
2002-07-18 18:38:31 +02:00
|
|
|
}
|
|
|
|
BRUSH;
|
2000-07-25 14:34:29 +02:00
|
|
|
|
2000-08-15 12:23:24 +02:00
|
|
|
typedef struct _FONTGLYPH
|
2000-07-25 14:34:29 +02:00
|
|
|
{
|
2003-01-30 12:15:00 +01:00
|
|
|
sint16 offset;
|
|
|
|
sint16 baseline;
|
2000-07-25 14:34:29 +02:00
|
|
|
uint16 width;
|
|
|
|
uint16 height;
|
2007-01-04 05:55:56 +01:00
|
|
|
RD_HBITMAP pixmap;
|
2000-07-07 11:49:45 +02:00
|
|
|
|
2002-07-18 18:38:31 +02:00
|
|
|
}
|
|
|
|
FONTGLYPH;
|
2000-07-07 11:49:45 +02:00
|
|
|
|
2000-08-15 12:23:24 +02:00
|
|
|
typedef struct _DATABLOB
|
2000-07-07 11:49:45 +02:00
|
|
|
{
|
2000-07-25 14:34:29 +02:00
|
|
|
void *data;
|
|
|
|
int size;
|
2000-07-07 11:49:45 +02:00
|
|
|
|
2002-07-18 18:38:31 +02:00
|
|
|
}
|
|
|
|
DATABLOB;
|
2002-07-18 20:28:12 +02:00
|
|
|
|
|
|
|
typedef struct _key_translation
|
|
|
|
{
|
2005-08-02 17:07:35 +02:00
|
|
|
/* For normal scancode translations */
|
2002-07-18 20:28:12 +02:00
|
|
|
uint8 scancode;
|
|
|
|
uint16 modifiers;
|
2005-08-02 17:07:35 +02:00
|
|
|
/* For sequences. If keysym is nonzero, the fields above are not used. */
|
|
|
|
uint32 seq_keysym; /* Really KeySym */
|
|
|
|
struct _key_translation *next;
|
2002-07-18 20:28:12 +02:00
|
|
|
}
|
|
|
|
key_translation;
|
2003-06-06 13:08:15 +02:00
|
|
|
|
2014-05-20 12:43:03 +02:00
|
|
|
typedef struct _key_translation_entry
|
|
|
|
{
|
|
|
|
key_translation *tr;
|
|
|
|
/* The full KeySym for this entry, not KEYMAP_MASKed */
|
|
|
|
uint32 keysym;
|
|
|
|
/* This will be non-NULL if there has been a hash collision */
|
|
|
|
struct _key_translation_entry *next;
|
|
|
|
}
|
|
|
|
key_translation_entry;
|
|
|
|
|
2003-07-01 11:31:25 +02:00
|
|
|
typedef struct _VCHANNEL
|
|
|
|
{
|
|
|
|
uint16 mcs_id;
|
|
|
|
char name[8];
|
|
|
|
uint32 flags;
|
|
|
|
struct stream in;
|
|
|
|
void (*process) (STREAM);
|
|
|
|
}
|
|
|
|
VCHANNEL;
|
2003-06-06 13:08:15 +02:00
|
|
|
|
2004-06-27 19:51:54 +02:00
|
|
|
/* PSTCACHE */
|
2005-03-08 01:23:02 +01:00
|
|
|
typedef uint8 HASH_KEY[8];
|
2004-06-27 19:51:54 +02:00
|
|
|
|
|
|
|
/* Header for an entry in the persistent bitmap cache file */
|
|
|
|
typedef struct _PSTCACHE_CELLHEADER
|
|
|
|
{
|
2005-03-08 01:23:02 +01:00
|
|
|
HASH_KEY key;
|
2004-06-27 19:51:54 +02:00
|
|
|
uint8 width, height;
|
|
|
|
uint16 length;
|
|
|
|
uint32 stamp;
|
|
|
|
}
|
|
|
|
CELLHEADER;
|
|
|
|
|
2003-10-14 09:46:49 +02:00
|
|
|
#define MAX_CBSIZE 256
|
|
|
|
|
2003-09-30 11:11:08 +02:00
|
|
|
/* RDPSND */
|
2007-01-04 05:55:56 +01:00
|
|
|
typedef struct _RD_WAVEFORMATEX
|
2003-10-15 16:01:32 +02:00
|
|
|
{
|
|
|
|
uint16 wFormatTag;
|
|
|
|
uint16 nChannels;
|
|
|
|
uint32 nSamplesPerSec;
|
|
|
|
uint32 nAvgBytesPerSec;
|
|
|
|
uint16 nBlockAlign;
|
|
|
|
uint16 wBitsPerSample;
|
|
|
|
uint16 cbSize;
|
|
|
|
uint8 cb[MAX_CBSIZE];
|
2007-01-04 05:55:56 +01:00
|
|
|
} RD_WAVEFORMATEX;
|
2003-09-30 11:11:08 +02:00
|
|
|
|
2004-04-27 14:55:33 +02:00
|
|
|
typedef struct _RDPCOMP
|
|
|
|
{
|
|
|
|
uint32 roff;
|
|
|
|
uint8 hist[RDP_MPPC_DICT_SIZE];
|
|
|
|
struct stream ns;
|
|
|
|
}
|
|
|
|
RDPCOMP;
|
|
|
|
|
2003-07-01 11:31:25 +02:00
|
|
|
/* RDPDR */
|
2007-01-04 05:55:56 +01:00
|
|
|
typedef uint32 RD_NTSTATUS;
|
|
|
|
typedef uint32 RD_NTHANDLE;
|
2003-07-01 11:31:25 +02:00
|
|
|
|
|
|
|
typedef struct _DEVICE_FNS
|
2003-06-06 13:08:15 +02:00
|
|
|
{
|
2007-01-04 05:55:56 +01:00
|
|
|
RD_NTSTATUS(*create) (uint32 device, uint32 desired_access, uint32 share_mode,
|
|
|
|
uint32 create_disposition, uint32 flags_and_attributes,
|
|
|
|
char *filename, RD_NTHANDLE * handle);
|
|
|
|
RD_NTSTATUS(*close) (RD_NTHANDLE handle);
|
|
|
|
RD_NTSTATUS(*read) (RD_NTHANDLE handle, uint8 * data, uint32 length, uint32 offset,
|
|
|
|
uint32 * result);
|
|
|
|
RD_NTSTATUS(*write) (RD_NTHANDLE handle, uint8 * data, uint32 length, uint32 offset,
|
|
|
|
uint32 * result);
|
|
|
|
RD_NTSTATUS(*device_control) (RD_NTHANDLE handle, uint32 request, STREAM in, STREAM out);
|
2003-06-06 13:08:15 +02:00
|
|
|
}
|
2003-07-01 11:31:25 +02:00
|
|
|
DEVICE_FNS;
|
2004-01-21 15:40:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
typedef struct rdpdr_device_info
|
|
|
|
{
|
2004-01-23 09:35:52 +01:00
|
|
|
uint32 device_type;
|
2007-01-04 05:55:56 +01:00
|
|
|
RD_NTHANDLE handle;
|
2004-01-23 09:35:52 +01:00
|
|
|
char name[8];
|
|
|
|
char *local_path;
|
|
|
|
void *pdevice_data;
|
2004-01-21 15:40:40 +01:00
|
|
|
}
|
|
|
|
RDPDR_DEVICE;
|
|
|
|
|
2017-01-23 12:50:42 +01:00
|
|
|
typedef struct rdpdr_disk_device_info
|
|
|
|
{
|
|
|
|
char name[PATH_MAX];
|
|
|
|
}
|
|
|
|
DISK_DEVICE;
|
|
|
|
|
2004-01-21 15:40:40 +01:00
|
|
|
typedef struct rdpdr_serial_device_info
|
|
|
|
{
|
2004-01-23 09:35:52 +01:00
|
|
|
int dtr;
|
2004-03-04 09:24:40 +01:00
|
|
|
int rts;
|
2004-11-03 14:56:52 +01:00
|
|
|
uint32 control, xonoff, onlimit, offlimit;
|
2004-01-23 09:35:52 +01:00
|
|
|
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;
|
2004-11-03 14:56:52 +01:00
|
|
|
uint8 chars[6];
|
2004-01-23 09:35:52 +01:00
|
|
|
struct termios *ptermios, *pold_termios;
|
2004-11-03 14:56:52 +01:00
|
|
|
int event_txempty, event_cts, event_dsr, event_rlsd, event_pending;
|
2004-01-21 15:40:40 +01:00
|
|
|
}
|
|
|
|
SERIAL_DEVICE;
|
|
|
|
|
|
|
|
typedef struct rdpdr_parallel_device_info
|
|
|
|
{
|
2004-01-23 09:35:52 +01:00
|
|
|
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;
|
2004-01-21 15:40:40 +01:00
|
|
|
}
|
|
|
|
PARALLEL_DEVICE;
|
|
|
|
|
|
|
|
typedef struct rdpdr_printer_info
|
|
|
|
{
|
2004-01-23 09:35:52 +01:00
|
|
|
FILE *printer_fp;
|
|
|
|
char *driver, *printer;
|
|
|
|
uint32 bloblen;
|
|
|
|
uint8 *blob;
|
2007-01-08 05:47:06 +01:00
|
|
|
RD_BOOL default_printer;
|
2004-01-21 15:40:40 +01:00
|
|
|
}
|
|
|
|
PRINTER;
|
2004-03-04 09:24:40 +01:00
|
|
|
|
2004-11-03 14:56:52 +01:00
|
|
|
typedef struct notify_data
|
|
|
|
{
|
|
|
|
time_t modify_time;
|
|
|
|
time_t status_time;
|
|
|
|
time_t total_time;
|
|
|
|
unsigned int num_entries;
|
|
|
|
}
|
|
|
|
NOTIFY;
|
|
|
|
|
2004-03-04 09:24:40 +01:00
|
|
|
typedef struct fileinfo
|
|
|
|
{
|
2004-11-03 14:56:52 +01:00
|
|
|
uint32 device_id, flags_and_attributes, accessmask;
|
2005-08-15 13:44:35 +02:00
|
|
|
char path[PATH_MAX];
|
2004-03-04 09:24:40 +01:00
|
|
|
DIR *pdir;
|
|
|
|
struct dirent *pdirent;
|
2005-08-15 13:44:35 +02:00
|
|
|
char pattern[PATH_MAX];
|
2007-01-08 05:47:06 +01:00
|
|
|
RD_BOOL delete_on_close;
|
2004-11-03 14:56:52 +01:00
|
|
|
NOTIFY notify;
|
|
|
|
uint32 info_class;
|
2004-03-04 09:24:40 +01:00
|
|
|
}
|
|
|
|
FILEINFO;
|
2006-03-02 16:22:25 +01:00
|
|
|
|
2007-01-08 05:47:06 +01:00
|
|
|
typedef RD_BOOL(*str_handle_lines_t) (const char *line, void *data);
|
2017-11-08 09:29:41 +01:00
|
|
|
|
2017-12-21 14:36:18 +01:00
|
|
|
typedef enum {
|
|
|
|
Fixed,
|
|
|
|
PercentageOfScreen,
|
|
|
|
Workarea,
|
|
|
|
Fullscreen,
|
|
|
|
} window_size_type_t;
|
|
|
|
|
2017-11-08 09:29:41 +01:00
|
|
|
#endif /* _TYPES_H */
|