freerdp: get rid of old types

This commit is contained in:
Marc-André Moreau
2012-10-09 03:26:39 -04:00
parent 1bf8a45519
commit 9d064171a7
265 changed files with 3634 additions and 3668 deletions

View File

@@ -66,13 +66,13 @@ struct _SERIAL_DEVICE
fd_set read_fds;
fd_set write_fds;
uint32 nfds;
UINT32 nfds;
struct timeval tv;
uint32 select_timeout;
uint32 timeout_id;
UINT32 select_timeout;
UINT32 timeout_id;
};
static void serial_abort_single_io(SERIAL_DEVICE* serial, uint32 file_id, uint32 abort_io, uint32 io_status);
static void serial_abort_single_io(SERIAL_DEVICE* serial, UINT32 file_id, UINT32 abort_io, UINT32 io_status);
static void serial_check_for_events(SERIAL_DEVICE* serial);
static void serial_handle_async_irp(SERIAL_DEVICE* serial, IRP* irp);
static BOOL serial_check_fds(SERIAL_DEVICE* serial);
@@ -81,12 +81,12 @@ static void serial_process_irp_create(SERIAL_DEVICE* serial, IRP* irp)
{
char* path;
SERIAL_TTY* tty;
uint32 PathLength;
uint32 FileId;
UINT32 PathLength;
UINT32 FileId;
stream_seek(irp->input, 28); /* DesiredAccess(4) AllocationSize(8), FileAttributes(4) */
/* SharedAccess(4) CreateDisposition(4), CreateOptions(4) */
stream_read_uint32(irp->input, PathLength);
stream_read_UINT32(irp->input, PathLength);
freerdp_UnicodeToAsciiAlloc((WCHAR*) stream_get_tail(irp->input), &path, PathLength / 2);
@@ -107,7 +107,7 @@ static void serial_process_irp_create(SERIAL_DEVICE* serial, IRP* irp)
DEBUG_SVC("%s(%d) created.", serial->path, FileId);
}
stream_write_uint32(irp->output, FileId);
stream_write_UINT32(irp->output, FileId);
stream_write_BYTE(irp->output, 0);
free(path);
@@ -142,12 +142,12 @@ static void serial_process_irp_close(SERIAL_DEVICE* serial, IRP* irp)
static void serial_process_irp_read(SERIAL_DEVICE* serial, IRP* irp)
{
SERIAL_TTY* tty;
uint32 Length;
uint64 Offset;
UINT32 Length;
UINT64 Offset;
BYTE* buffer = NULL;
stream_read_uint32(irp->input, Length);
stream_read_uint64(irp->input, Offset);
stream_read_UINT32(irp->input, Length);
stream_read_UINT64(irp->input, Offset);
DEBUG_SVC("length %u offset %llu", Length, Offset);
@@ -179,7 +179,7 @@ static void serial_process_irp_read(SERIAL_DEVICE* serial, IRP* irp)
}
}
stream_write_uint32(irp->output, Length);
stream_write_UINT32(irp->output, Length);
if (Length > 0)
{
@@ -195,11 +195,11 @@ static void serial_process_irp_read(SERIAL_DEVICE* serial, IRP* irp)
static void serial_process_irp_write(SERIAL_DEVICE* serial, IRP* irp)
{
SERIAL_TTY* tty;
uint32 Length;
uint64 Offset;
UINT32 Length;
UINT64 Offset;
stream_read_uint32(irp->input, Length);
stream_read_uint64(irp->input, Offset);
stream_read_UINT32(irp->input, Length);
stream_read_UINT64(irp->input, Offset);
stream_seek(irp->input, 20); /* Padding */
DEBUG_SVC("length %u offset %llu", Length, Offset);
@@ -225,7 +225,7 @@ static void serial_process_irp_write(SERIAL_DEVICE* serial, IRP* irp)
DEBUG_SVC("write %llu-%llu to %s(%d).", Offset, Offset + Length, serial->path, tty->id);
}
stream_write_uint32(irp->output, Length);
stream_write_UINT32(irp->output, Length);
stream_write_BYTE(irp->output, 0); /* Padding */
irp->Complete(irp);
@@ -234,16 +234,16 @@ static void serial_process_irp_write(SERIAL_DEVICE* serial, IRP* irp)
static void serial_process_irp_device_control(SERIAL_DEVICE* serial, IRP* irp)
{
SERIAL_TTY* tty;
uint32 IoControlCode;
uint32 InputBufferLength;
uint32 OutputBufferLength;
uint32 abort_io = SERIAL_ABORT_IO_NONE;
UINT32 IoControlCode;
UINT32 InputBufferLength;
UINT32 OutputBufferLength;
UINT32 abort_io = SERIAL_ABORT_IO_NONE;
DEBUG_SVC("[in] pending size %d", list_size(serial->pending_irps));
stream_read_uint32(irp->input, InputBufferLength);
stream_read_uint32(irp->input, OutputBufferLength);
stream_read_uint32(irp->input, IoControlCode);
stream_read_UINT32(irp->input, InputBufferLength);
stream_read_UINT32(irp->input, OutputBufferLength);
stream_read_UINT32(irp->input, IoControlCode);
stream_seek(irp->input, 20); /* Padding */
tty = serial->tty;
@@ -436,10 +436,10 @@ int DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints)
return 0;
}
static void serial_abort_single_io(SERIAL_DEVICE* serial, uint32 file_id, uint32 abort_io, uint32 io_status)
static void serial_abort_single_io(SERIAL_DEVICE* serial, UINT32 file_id, UINT32 abort_io, UINT32 io_status)
{
IRP* irp = NULL;
uint32 major;
UINT32 major;
SERIAL_TTY* tty;
DEBUG_SVC("[in] pending size %d", list_size(serial->pending_irps));
@@ -478,7 +478,7 @@ static void serial_abort_single_io(SERIAL_DEVICE* serial, uint32 file_id, uint32
/* Process a SINGLE FileId and MajorFunction */
list_remove(serial->pending_irps, irp);
irp->IoStatus = io_status;
stream_write_uint32(irp->output, 0);
stream_write_UINT32(irp->output, 0);
irp->Complete(irp);
wait_obj_set(serial->in_event);
@@ -492,7 +492,7 @@ static void serial_check_for_events(SERIAL_DEVICE* serial)
{
IRP* irp = NULL;
IRP* prev;
uint32 result = 0;
UINT32 result = 0;
SERIAL_TTY* tty;
tty = serial->tty;
@@ -512,7 +512,7 @@ static void serial_check_for_events(SERIAL_DEVICE* serial)
DEBUG_SVC("got event result %u", result);
irp->IoStatus = STATUS_SUCCESS;
stream_write_uint32(irp->output, result);
stream_write_UINT32(irp->output, result);
irp->Complete(irp);
prev = irp;
@@ -530,14 +530,14 @@ static void serial_check_for_events(SERIAL_DEVICE* serial)
DEBUG_SVC("[out] pending size %d", list_size(serial->pending_irps));
}
void serial_get_timeouts(SERIAL_DEVICE* serial, IRP* irp, uint32* timeout, uint32* interval_timeout)
void serial_get_timeouts(SERIAL_DEVICE* serial, IRP* irp, UINT32* timeout, UINT32* interval_timeout)
{
SERIAL_TTY* tty;
uint32 Length;
uint32 pos;
UINT32 Length;
UINT32 pos;
pos = stream_get_pos(irp->input);
stream_read_uint32(irp->input, Length);
stream_read_UINT32(irp->input, Length);
stream_set_pos(irp->input, pos);
DEBUG_SVC("length read %u", Length);
@@ -552,8 +552,8 @@ void serial_get_timeouts(SERIAL_DEVICE* serial, IRP* irp, uint32* timeout, uint3
static void serial_handle_async_irp(SERIAL_DEVICE* serial, IRP* irp)
{
uint32 timeout = 0;
uint32 itv_timeout = 0;
UINT32 timeout = 0;
UINT32 itv_timeout = 0;
SERIAL_TTY* tty;
tty = serial->tty;
@@ -603,7 +603,7 @@ static void __serial_check_fds(SERIAL_DEVICE* serial)
IRP* irp;
IRP* prev;
SERIAL_TTY* tty;
uint32 result = 0;
UINT32 result = 0;
memset(&serial->tv, 0, sizeof(struct timeval));
tty = serial->tty;
@@ -639,7 +639,7 @@ static void __serial_check_fds(SERIAL_DEVICE* serial)
DEBUG_SVC("got event result %u", result);
irp->IoStatus = STATUS_SUCCESS;
stream_write_uint32(irp->output, result);
stream_write_UINT32(irp->output, result);
irp->Complete(irp);
}
break;

View File

@@ -73,42 +73,42 @@
#define TIOCOUTQ FIONWRITE
#endif
static uint32 tty_write_data(SERIAL_TTY* tty, BYTE* data, int len);
static UINT32 tty_write_data(SERIAL_TTY* tty, BYTE* data, int len);
static void tty_set_termios(SERIAL_TTY* tty);
static BOOL tty_get_termios(SERIAL_TTY* tty);
static int tty_get_error_status();
uint32 serial_tty_control(SERIAL_TTY* tty, uint32 IoControlCode, STREAM* input, STREAM* output, uint32* abort_io)
UINT32 serial_tty_control(SERIAL_TTY* tty, UINT32 IoControlCode, STREAM* input, STREAM* output, UINT32* abort_io)
{
int purge_mask;
uint32 result;
uint32 modemstate;
UINT32 result;
UINT32 modemstate;
BYTE immediate;
uint32 ret = STATUS_SUCCESS;
uint32 length = 0;
uint32 pos;
UINT32 ret = STATUS_SUCCESS;
UINT32 length = 0;
UINT32 pos;
DEBUG_SVC("in");
stream_seek(output, sizeof(uint32));
stream_seek(output, sizeof(UINT32));
switch (IoControlCode)
{
case IOCTL_SERIAL_SET_BAUD_RATE:
stream_read_uint32(input, tty->baud_rate);
stream_read_UINT32(input, tty->baud_rate);
tty_set_termios(tty);
DEBUG_SVC("SERIAL_SET_BAUD_RATE %d", tty->baud_rate);
break;
case IOCTL_SERIAL_GET_BAUD_RATE:
length = 4;
stream_write_uint32(output, tty->baud_rate);
stream_write_UINT32(output, tty->baud_rate);
DEBUG_SVC("SERIAL_GET_BAUD_RATE %d", tty->baud_rate);
break;
case IOCTL_SERIAL_SET_QUEUE_SIZE:
stream_read_uint32(input, tty->queue_in_size);
stream_read_uint32(input, tty->queue_out_size);
stream_read_UINT32(input, tty->queue_in_size);
stream_read_UINT32(input, tty->queue_out_size);
DEBUG_SVC("SERIAL_SET_QUEUE_SIZE in %d out %d", tty->queue_in_size, tty->queue_out_size);
break;
@@ -138,7 +138,7 @@ uint32 serial_tty_control(SERIAL_TTY* tty, uint32 IoControlCode, STREAM* input,
case IOCTL_SERIAL_CONFIG_SIZE:
DEBUG_SVC("SERIAL_CONFIG_SIZE");
length = 4;
stream_write_uint32(output, 0);
stream_write_UINT32(output, 0);
break;
case IOCTL_SERIAL_GET_CHARS:
@@ -156,30 +156,30 @@ uint32 serial_tty_control(SERIAL_TTY* tty, uint32 IoControlCode, STREAM* input,
case IOCTL_SERIAL_GET_HANDFLOW:
length = 16;
tty_get_termios(tty);
stream_write_uint32(output, tty->control);
stream_write_uint32(output, tty->xonoff);
stream_write_uint32(output, tty->onlimit);
stream_write_uint32(output, tty->offlimit);
stream_write_UINT32(output, tty->control);
stream_write_UINT32(output, tty->xonoff);
stream_write_UINT32(output, tty->onlimit);
stream_write_UINT32(output, tty->offlimit);
DEBUG_SVC("IOCTL_SERIAL_GET_HANDFLOW %X %X %X %X",
tty->control, tty->xonoff, tty->onlimit, tty->offlimit);
break;
case IOCTL_SERIAL_SET_HANDFLOW:
stream_read_uint32(input, tty->control);
stream_read_uint32(input, tty->xonoff);
stream_read_uint32(input, tty->onlimit);
stream_read_uint32(input, tty->offlimit);
stream_read_UINT32(input, tty->control);
stream_read_UINT32(input, tty->xonoff);
stream_read_UINT32(input, tty->onlimit);
stream_read_UINT32(input, tty->offlimit);
DEBUG_SVC("IOCTL_SERIAL_SET_HANDFLOW %X %X %X %X",
tty->control, tty->xonoff, tty->onlimit, tty->offlimit);
tty_set_termios(tty);
break;
case IOCTL_SERIAL_SET_TIMEOUTS:
stream_read_uint32(input, tty->read_interval_timeout);
stream_read_uint32(input, tty->read_total_timeout_multiplier);
stream_read_uint32(input, tty->read_total_timeout_constant);
stream_read_uint32(input, tty->write_total_timeout_multiplier);
stream_read_uint32(input, tty->write_total_timeout_constant);
stream_read_UINT32(input, tty->read_interval_timeout);
stream_read_UINT32(input, tty->read_total_timeout_multiplier);
stream_read_UINT32(input, tty->read_total_timeout_constant);
stream_read_UINT32(input, tty->write_total_timeout_multiplier);
stream_read_UINT32(input, tty->write_total_timeout_constant);
/* http://www.codeproject.com/KB/system/chaiyasit_t.aspx, see 'ReadIntervalTimeout' section
http://msdn.microsoft.com/en-us/library/ms885171.aspx */
@@ -201,21 +201,21 @@ uint32 serial_tty_control(SERIAL_TTY* tty, uint32 IoControlCode, STREAM* input,
tty->read_total_timeout_multiplier,
tty->read_total_timeout_constant);
length = 20;
stream_write_uint32(output, tty->read_interval_timeout);
stream_write_uint32(output, tty->read_total_timeout_multiplier);
stream_write_uint32(output, tty->read_total_timeout_constant);
stream_write_uint32(output, tty->write_total_timeout_multiplier);
stream_write_uint32(output, tty->write_total_timeout_constant);
stream_write_UINT32(output, tty->read_interval_timeout);
stream_write_UINT32(output, tty->read_total_timeout_multiplier);
stream_write_UINT32(output, tty->read_total_timeout_constant);
stream_write_UINT32(output, tty->write_total_timeout_multiplier);
stream_write_UINT32(output, tty->write_total_timeout_constant);
break;
case IOCTL_SERIAL_GET_WAIT_MASK:
DEBUG_SVC("SERIAL_GET_WAIT_MASK %X", tty->wait_mask);
length = 4;
stream_write_uint32(output, tty->wait_mask);
stream_write_UINT32(output, tty->wait_mask);
break;
case IOCTL_SERIAL_SET_WAIT_MASK:
stream_read_uint32(input, tty->wait_mask);
stream_read_UINT32(input, tty->wait_mask);
DEBUG_SVC("SERIAL_SET_WAIT_MASK %X", tty->wait_mask);
break;
@@ -270,19 +270,19 @@ uint32 serial_tty_control(SERIAL_TTY* tty, uint32 IoControlCode, STREAM* input,
#endif
DEBUG_SVC("SERIAL_GET_MODEMSTATUS %X", modemstate);
length = 4;
stream_write_uint32(output, modemstate);
stream_write_UINT32(output, modemstate);
break;
case IOCTL_SERIAL_GET_COMMSTATUS:
length = 18;
stream_write_uint32(output, 0); /* Errors */
stream_write_uint32(output, 0); /* Hold reasons */
stream_write_UINT32(output, 0); /* Errors */
stream_write_UINT32(output, 0); /* Hold reasons */
result = 0;
#ifdef TIOCINQ
ioctl(tty->fd, TIOCINQ, &result);
#endif
stream_write_uint32(output, result); /* Amount in in queue */
stream_write_UINT32(output, result); /* Amount in in queue */
if (result)
DEBUG_SVC("SERIAL_GET_COMMSTATUS in queue %d", result);
@@ -290,7 +290,7 @@ uint32 serial_tty_control(SERIAL_TTY* tty, uint32 IoControlCode, STREAM* input,
#ifdef TIOCOUTQ
ioctl(tty->fd, TIOCOUTQ, &result);
#endif
stream_write_uint32(output, result); /* Amount in out queue */
stream_write_UINT32(output, result); /* Amount in out queue */
DEBUG_SVC("SERIAL_GET_COMMSTATUS out queue %d", result);
stream_write_BYTE(output, 0); /* EofReceived */
@@ -298,7 +298,7 @@ uint32 serial_tty_control(SERIAL_TTY* tty, uint32 IoControlCode, STREAM* input,
break;
case IOCTL_SERIAL_PURGE:
stream_read_uint32(input, purge_mask);
stream_read_UINT32(input, purge_mask);
DEBUG_SVC("SERIAL_PURGE purge_mask %X", purge_mask);
/* See http://msdn.microsoft.com/en-us/library/ms901431.aspx
@@ -327,7 +327,7 @@ uint32 serial_tty_control(SERIAL_TTY* tty, uint32 IoControlCode, STREAM* input,
if (serial_tty_get_event(tty, &result))
{
DEBUG_SVC("WAIT end event = %X", result);
stream_write_uint32(output, result);
stream_write_UINT32(output, result);
break;
}
ret = STATUS_PENDING;
@@ -363,13 +363,13 @@ uint32 serial_tty_control(SERIAL_TTY* tty, uint32 IoControlCode, STREAM* input,
/* Write OutputBufferLength */
pos = stream_get_pos(output);
stream_set_pos(output, 16);
stream_write_uint32(output, length);
stream_write_UINT32(output, length);
stream_set_pos(output, pos);
return ret;
}
BOOL serial_tty_read(SERIAL_TTY* tty, BYTE* buffer, uint32* Length)
BOOL serial_tty_read(SERIAL_TTY* tty, BYTE* buffer, UINT32* Length)
{
long timeout = 90;
struct termios *ptermios;
@@ -418,10 +418,10 @@ BOOL serial_tty_read(SERIAL_TTY* tty, BYTE* buffer, uint32* Length)
return TRUE;
}
BOOL serial_tty_write(SERIAL_TTY* tty, BYTE* buffer, uint32 Length)
BOOL serial_tty_write(SERIAL_TTY* tty, BYTE* buffer, UINT32 Length)
{
ssize_t r;
uint32 event_txempty = Length;
UINT32 event_txempty = Length;
DEBUG_SVC("in");
@@ -463,7 +463,7 @@ void serial_tty_free(SERIAL_TTY* tty)
}
SERIAL_TTY* serial_tty_new(const char* path, uint32 id)
SERIAL_TTY* serial_tty_new(const char* path, UINT32 id)
{
SERIAL_TTY* tty;
@@ -531,7 +531,7 @@ SERIAL_TTY* serial_tty_new(const char* path, uint32 id)
return tty;
}
BOOL serial_tty_get_event(SERIAL_TTY* tty, uint32* result)
BOOL serial_tty_get_event(SERIAL_TTY* tty, UINT32* result)
{
int bytes;
BOOL ret = FALSE;
@@ -969,7 +969,7 @@ static void tty_set_termios(SERIAL_TTY* tty)
tcsetattr(tty->fd, TCSANOW, ptermios);
}
static uint32 tty_write_data(SERIAL_TTY* tty, BYTE* data, int len)
static UINT32 tty_write_data(SERIAL_TTY* tty, BYTE* data, int len)
{
ssize_t r;

View File

@@ -35,24 +35,24 @@ typedef struct _SERIAL_TTY SERIAL_TTY;
struct _SERIAL_TTY
{
uint32 id;
UINT32 id;
int fd;
int dtr;
int rts;
uint32 control;
uint32 xonoff;
uint32 onlimit;
uint32 offlimit;
uint32 baud_rate;
uint32 queue_in_size;
uint32 queue_out_size;
uint32 wait_mask;
uint32 read_interval_timeout;
uint32 read_total_timeout_multiplier;
uint32 read_total_timeout_constant;
uint32 write_total_timeout_multiplier;
uint32 write_total_timeout_constant;
UINT32 control;
UINT32 xonoff;
UINT32 onlimit;
UINT32 offlimit;
UINT32 baud_rate;
UINT32 queue_in_size;
UINT32 queue_out_size;
UINT32 wait_mask;
UINT32 read_interval_timeout;
UINT32 read_total_timeout_multiplier;
UINT32 read_total_timeout_constant;
UINT32 write_total_timeout_multiplier;
UINT32 write_total_timeout_constant;
BYTE stop_bits;
BYTE parity;
BYTE word_length;
@@ -66,13 +66,13 @@ struct _SERIAL_TTY
int event_pending;
};
SERIAL_TTY* serial_tty_new(const char* path, uint32 id);
SERIAL_TTY* serial_tty_new(const char* path, UINT32 id);
void serial_tty_free(SERIAL_TTY* tty);
BOOL serial_tty_read(SERIAL_TTY* tty, BYTE* buffer, uint32* Length);
BOOL serial_tty_write(SERIAL_TTY* tty, BYTE* buffer, uint32 Length);
uint32 serial_tty_control(SERIAL_TTY* tty, uint32 IoControlCode, STREAM* input, STREAM* output, uint32* abort_io);
BOOL serial_tty_read(SERIAL_TTY* tty, BYTE* buffer, UINT32* Length);
BOOL serial_tty_write(SERIAL_TTY* tty, BYTE* buffer, UINT32 Length);
UINT32 serial_tty_control(SERIAL_TTY* tty, UINT32 IoControlCode, STREAM* input, STREAM* output, UINT32* abort_io);
BOOL serial_tty_get_event(SERIAL_TTY* tty, uint32* result);
BOOL serial_tty_get_event(SERIAL_TTY* tty, UINT32* result);
#endif /* __SERIAL_TTY_H */