change HANDLE to NTHANDLE to avoid conflics

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@775 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Jay Sorg 2004-10-02 01:30:33 +00:00
parent d3c773173d
commit c0651b51a1
8 changed files with 71 additions and 71 deletions

20
disk.c
View File

@ -169,9 +169,9 @@ disk_enum_devices(uint32 * id, char *optarg)
/* Opens or creates a file or directory */ /* Opens or creates a file or directory */
static NTSTATUS static NTSTATUS
disk_create(uint32 device_id, uint32 accessmask, uint32 sharemode, uint32 create_disposition, disk_create(uint32 device_id, uint32 accessmask, uint32 sharemode, uint32 create_disposition,
uint32 flags_and_attributes, char *filename, HANDLE * phandle) uint32 flags_and_attributes, char *filename, NTHANDLE * phandle)
{ {
HANDLE handle; NTHANDLE handle;
DIR *dirp; DIR *dirp;
int flags, mode; int flags, mode;
char path[256]; char path[256];
@ -325,7 +325,7 @@ disk_create(uint32 device_id, uint32 accessmask, uint32 sharemode, uint32 create
} }
static NTSTATUS static NTSTATUS
disk_close(HANDLE handle) disk_close(NTHANDLE handle)
{ {
struct fileinfo *pfinfo; struct fileinfo *pfinfo;
@ -345,7 +345,7 @@ disk_close(HANDLE handle)
} }
static NTSTATUS static NTSTATUS
disk_read(HANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result) disk_read(NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result)
{ {
int n; int n;
@ -382,7 +382,7 @@ disk_read(HANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * re
} }
static NTSTATUS static NTSTATUS
disk_write(HANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result) disk_write(NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result)
{ {
int n; int n;
@ -409,7 +409,7 @@ disk_write(HANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * r
} }
NTSTATUS NTSTATUS
disk_query_information(HANDLE handle, uint32 info_class, STREAM out) disk_query_information(NTHANDLE handle, uint32 info_class, STREAM out)
{ {
uint32 file_attributes, ft_high, ft_low; uint32 file_attributes, ft_high, ft_low;
struct stat filestat; struct stat filestat;
@ -490,7 +490,7 @@ disk_query_information(HANDLE handle, uint32 info_class, STREAM out)
} }
NTSTATUS NTSTATUS
disk_set_information(HANDLE handle, uint32 info_class, STREAM in, STREAM out) disk_set_information(NTHANDLE handle, uint32 info_class, STREAM in, STREAM out)
{ {
uint32 device_id, length, file_attributes, ft_high, ft_low; uint32 device_id, length, file_attributes, ft_high, ft_low;
char newname[256], fullpath[256]; char newname[256], fullpath[256];
@ -744,7 +744,7 @@ FsVolumeInfo(char *fpath)
NTSTATUS NTSTATUS
disk_query_volume_information(HANDLE handle, uint32 info_class, STREAM out) disk_query_volume_information(NTHANDLE handle, uint32 info_class, STREAM out)
{ {
struct STATFS_T stat_fs; struct STATFS_T stat_fs;
struct fileinfo *pfinfo; struct fileinfo *pfinfo;
@ -809,7 +809,7 @@ disk_query_volume_information(HANDLE handle, uint32 info_class, STREAM out)
} }
NTSTATUS NTSTATUS
disk_query_directory(HANDLE handle, uint32 info_class, char *pattern, STREAM out) disk_query_directory(NTHANDLE handle, uint32 info_class, char *pattern, STREAM out)
{ {
uint32 file_attributes, ft_low, ft_high; uint32 file_attributes, ft_low, ft_high;
char *dirname, fullpath[256]; char *dirname, fullpath[256];
@ -919,7 +919,7 @@ disk_query_directory(HANDLE handle, uint32 info_class, char *pattern, STREAM out
static NTSTATUS static NTSTATUS
disk_device_control(HANDLE handle, uint32 request, STREAM in, STREAM out) disk_device_control(NTHANDLE handle, uint32 request, STREAM in, STREAM out)
{ {
uint32 result; uint32 result;

View File

@ -19,7 +19,7 @@ extern int errno;
extern RDPDR_DEVICE g_rdpdr_device[]; extern RDPDR_DEVICE g_rdpdr_device[];
static PARALLEL_DEVICE * static PARALLEL_DEVICE *
get_parallel_data(HANDLE handle) get_parallel_data(NTHANDLE handle)
{ {
int index; int index;
@ -74,7 +74,7 @@ parallel_enum_devices(uint32 * id, char *optarg)
static NTSTATUS static NTSTATUS
parallel_create(uint32 device_id, uint32 access, uint32 share_mode, uint32 disposition, parallel_create(uint32 device_id, uint32 access, uint32 share_mode, uint32 disposition,
uint32 flags, char *filename, HANDLE * handle) uint32 flags, char *filename, NTHANDLE * handle)
{ {
int parallel_fd; int parallel_fd;
@ -102,7 +102,7 @@ parallel_create(uint32 device_id, uint32 access, uint32 share_mode, uint32 dispo
} }
static NTSTATUS static NTSTATUS
parallel_close(HANDLE handle) parallel_close(NTHANDLE handle)
{ {
int i = get_device_index(handle); int i = get_device_index(handle);
if (i >= 0) if (i >= 0)
@ -112,14 +112,14 @@ parallel_close(HANDLE handle)
} }
static NTSTATUS static NTSTATUS
parallel_read(HANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result) parallel_read(NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result)
{ {
*result = read(handle, data, length); *result = read(handle, data, length);
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
static NTSTATUS static NTSTATUS
parallel_write(HANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result) parallel_write(NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result)
{ {
int rc = STATUS_SUCCESS; int rc = STATUS_SUCCESS;
@ -153,7 +153,7 @@ parallel_write(HANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32
} }
static NTSTATUS static NTSTATUS
parallel_device_control(HANDLE handle, uint32 request, STREAM in, STREAM out) parallel_device_control(NTHANDLE handle, uint32 request, STREAM in, STREAM out)
{ {
if ((request >> 16) != FILE_DEVICE_PARALLEL) if ((request >> 16) != FILE_DEVICE_PARALLEL)
return STATUS_INVALID_PARAMETER; return STATUS_INVALID_PARAMETER;

View File

@ -3,7 +3,7 @@
extern RDPDR_DEVICE g_rdpdr_device[]; extern RDPDR_DEVICE g_rdpdr_device[];
static PRINTER * static PRINTER *
get_printer_data(HANDLE handle) get_printer_data(NTHANDLE handle)
{ {
int index; int index;
@ -83,7 +83,7 @@ printer_enum_devices(uint32 * id, char *optarg)
static NTSTATUS static NTSTATUS
printer_create(uint32 device_id, uint32 access, uint32 share_mode, uint32 disposition, uint32 flags, printer_create(uint32 device_id, uint32 access, uint32 share_mode, uint32 disposition, uint32 flags,
char *filename, HANDLE * handle) char *filename, NTHANDLE * handle)
{ {
char cmd[256]; char cmd[256];
PRINTER *pprinter_data; PRINTER *pprinter_data;
@ -107,7 +107,7 @@ printer_create(uint32 device_id, uint32 access, uint32 share_mode, uint32 dispos
} }
static NTSTATUS static NTSTATUS
printer_close(HANDLE handle) printer_close(NTHANDLE handle)
{ {
int i = get_device_index(handle); int i = get_device_index(handle);
if (i >= 0) if (i >= 0)
@ -121,7 +121,7 @@ printer_close(HANDLE handle)
} }
static NTSTATUS static NTSTATUS
printer_write(HANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result) printer_write(NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result)
{ {
PRINTER *pprinter_data; PRINTER *pprinter_data;

12
proto.h
View File

@ -28,10 +28,10 @@ void cliprdr_send_data(uint8 * data, uint32 length);
BOOL cliprdr_init(void); BOOL cliprdr_init(void);
/* disk.c */ /* disk.c */
int disk_enum_devices(uint32 * id, char *optarg); int disk_enum_devices(uint32 * id, char *optarg);
NTSTATUS disk_query_information(HANDLE handle, uint32 info_class, STREAM out); NTSTATUS disk_query_information(NTHANDLE handle, uint32 info_class, STREAM out);
NTSTATUS disk_set_information(HANDLE handle, uint32 info_class, STREAM in, STREAM out); NTSTATUS disk_set_information(NTHANDLE handle, uint32 info_class, STREAM in, STREAM out);
NTSTATUS disk_query_volume_information(HANDLE handle, uint32 info_class, STREAM out); NTSTATUS disk_query_volume_information(NTHANDLE handle, uint32 info_class, STREAM out);
NTSTATUS disk_query_directory(HANDLE handle, uint32 info_class, char *pattern, STREAM out); NTSTATUS disk_query_directory(NTHANDLE handle, uint32 info_class, char *pattern, STREAM out);
/* mppc.c */ /* mppc.c */
int mppc_expand(uint8 * data, uint32 clen, uint8 ctype, uint32 * roff, uint32 * rlen); int mppc_expand(uint8 * data, uint32 clen, uint8 ctype, uint32 * roff, uint32 * rlen);
/* ewmhints.c */ /* ewmhints.c */
@ -108,7 +108,7 @@ BOOL rdp_connect(char *server, uint32 flags, char *domain, char *password, char
char *directory); char *directory);
void rdp_disconnect(void); void rdp_disconnect(void);
/* rdpdr.c */ /* rdpdr.c */
int get_device_index(HANDLE handle); int get_device_index(NTHANDLE handle);
void convert_to_unix_filename(char *filename); void convert_to_unix_filename(char *filename);
BOOL rdpdr_init(void); BOOL rdpdr_init(void);
void rdpdr_add_fds(int *n, fd_set * rfds, fd_set * wfds, struct timeval *tv, BOOL * timeout); void rdpdr_add_fds(int *n, fd_set * rfds, fd_set * wfds, struct timeval *tv, BOOL * timeout);
@ -143,7 +143,7 @@ BOOL sec_connect(char *server, char *username);
void sec_disconnect(void); void sec_disconnect(void);
/* serial.c */ /* serial.c */
int serial_enum_devices(uint32 * id, char *optarg); int serial_enum_devices(uint32 * id, char *optarg);
BOOL serial_get_timeout(HANDLE handle, uint32 length, uint32 * timeout, uint32 * itv_timeout); BOOL serial_get_timeout(NTHANDLE handle, uint32 length, uint32 * timeout, uint32 * itv_timeout);
/* tcp.c */ /* tcp.c */
STREAM tcp_init(uint32 maxlen); STREAM tcp_init(uint32 maxlen);
void tcp_send(STREAM s); void tcp_send(STREAM s);

View File

@ -65,7 +65,7 @@ extern FILEINFO g_fileinfo[];
static VCHANNEL *rdpdr_channel; static VCHANNEL *rdpdr_channel;
/* If select() times out, the request for the device with handle g_min_timeout_fd is aborted */ /* If select() times out, the request for the device with handle g_min_timeout_fd is aborted */
HANDLE g_min_timeout_fd; NTHANDLE g_min_timeout_fd;
uint32 g_num_devices; uint32 g_num_devices;
/* Table with information about rdpdr devices */ /* Table with information about rdpdr devices */
@ -90,7 +90,7 @@ struct async_iorequest *g_iorequest;
/* Return device_id for a given handle */ /* Return device_id for a given handle */
int int
get_device_index(HANDLE handle) get_device_index(NTHANDLE handle)
{ {
int i; int i;
for (i = 0; i < RDPDR_MAX_DEVICES; i++) for (i = 0; i < RDPDR_MAX_DEVICES; i++)

View File

@ -88,7 +88,7 @@
extern RDPDR_DEVICE g_rdpdr_device[]; extern RDPDR_DEVICE g_rdpdr_device[];
static SERIAL_DEVICE * static SERIAL_DEVICE *
get_serial_info(HANDLE handle) get_serial_info(NTHANDLE handle)
{ {
int index; int index;
@ -101,7 +101,7 @@ get_serial_info(HANDLE handle)
} }
static BOOL static BOOL
get_termios(SERIAL_DEVICE * pser_inf, HANDLE serial_fd) get_termios(SERIAL_DEVICE * pser_inf, NTHANDLE serial_fd)
{ {
speed_t speed; speed_t speed;
struct termios *ptermios; struct termios *ptermios;
@ -224,7 +224,7 @@ get_termios(SERIAL_DEVICE * pser_inf, HANDLE serial_fd)
} }
static void static void
set_termios(SERIAL_DEVICE * pser_inf, HANDLE serial_fd) set_termios(SERIAL_DEVICE * pser_inf, NTHANDLE serial_fd)
{ {
speed_t speed; speed_t speed;
@ -407,9 +407,9 @@ serial_enum_devices(uint32 * id, char *optarg)
static NTSTATUS static NTSTATUS
serial_create(uint32 device_id, uint32 access, uint32 share_mode, uint32 disposition, serial_create(uint32 device_id, uint32 access, uint32 share_mode, uint32 disposition,
uint32 flags_and_attributes, char *filename, HANDLE * handle) uint32 flags_and_attributes, char *filename, NTHANDLE * handle)
{ {
HANDLE serial_fd; NTHANDLE serial_fd;
SERIAL_DEVICE *pser_inf; SERIAL_DEVICE *pser_inf;
struct termios *ptermios; struct termios *ptermios;
@ -462,7 +462,7 @@ serial_create(uint32 device_id, uint32 access, uint32 share_mode, uint32 disposi
} }
static NTSTATUS static NTSTATUS
serial_close(HANDLE handle) serial_close(NTHANDLE handle)
{ {
int i = get_device_index(handle); int i = get_device_index(handle);
if (i >= 0) if (i >= 0)
@ -472,7 +472,7 @@ serial_close(HANDLE handle)
} }
static NTSTATUS static NTSTATUS
serial_read(HANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result) serial_read(NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result)
{ {
long timeout; long timeout;
SERIAL_DEVICE *pser_inf; SERIAL_DEVICE *pser_inf;
@ -519,14 +519,14 @@ serial_read(HANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 *
} }
static NTSTATUS static NTSTATUS
serial_write(HANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result) serial_write(NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result)
{ {
*result = write(handle, data, length); *result = write(handle, data, length);
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
static NTSTATUS static NTSTATUS
serial_device_control(HANDLE handle, uint32 request, STREAM in, STREAM out) serial_device_control(NTHANDLE handle, uint32 request, STREAM in, STREAM out)
{ {
#if 0 #if 0
int flush_mask, purge_mask; int flush_mask, purge_mask;
@ -684,7 +684,7 @@ serial_device_control(HANDLE handle, uint32 request, STREAM in, STREAM out)
/* Read timeout for a given file descripter (device) when adding fd's to select() */ /* Read timeout for a given file descripter (device) when adding fd's to select() */
BOOL BOOL
serial_get_timeout(HANDLE handle, uint32 length, uint32 * timeout, uint32 * itv_timeout) serial_get_timeout(NTHANDLE handle, uint32 length, uint32 * timeout, uint32 * itv_timeout)
{ {
int index; int index;
SERIAL_DEVICE *pser_inf; SERIAL_DEVICE *pser_inf;

14
types.h
View File

@ -166,19 +166,19 @@ RDPCOMP;
/* RDPDR */ /* RDPDR */
typedef uint32 NTSTATUS; typedef uint32 NTSTATUS;
typedef uint32 HANDLE; typedef uint32 NTHANDLE;
typedef struct _DEVICE_FNS typedef struct _DEVICE_FNS
{ {
NTSTATUS(*create) (uint32 device, uint32 desired_access, uint32 share_mode, NTSTATUS(*create) (uint32 device, uint32 desired_access, uint32 share_mode,
uint32 create_disposition, uint32 flags_and_attributes, char *filename, uint32 create_disposition, uint32 flags_and_attributes, char *filename,
HANDLE * handle); NTHANDLE * handle);
NTSTATUS(*close) (HANDLE handle); NTSTATUS(*close) (NTHANDLE handle);
NTSTATUS(*read) (HANDLE handle, uint8 * data, uint32 length, uint32 offset, NTSTATUS(*read) (NTHANDLE handle, uint8 * data, uint32 length, uint32 offset,
uint32 * result); uint32 * result);
NTSTATUS(*write) (HANDLE handle, uint8 * data, uint32 length, uint32 offset, NTSTATUS(*write) (NTHANDLE handle, uint8 * data, uint32 length, uint32 offset,
uint32 * result); uint32 * result);
NTSTATUS(*device_control) (HANDLE handle, uint32 request, STREAM in, STREAM out); NTSTATUS(*device_control) (NTHANDLE handle, uint32 request, STREAM in, STREAM out);
} }
DEVICE_FNS; DEVICE_FNS;
@ -186,7 +186,7 @@ DEVICE_FNS;
typedef struct rdpdr_device_info typedef struct rdpdr_device_info
{ {
uint32 device_type; uint32 device_type;
HANDLE handle; NTHANDLE handle;
char name[8]; char name[8];
char *local_path; char *local_path;
void *pdevice_data; void *pdevice_data;

View File

@ -1,8 +1,7 @@
/* /*
rdesktop: A Remote Desktop Protocol client. rdesktop: A Remote Desktop Protocol client.
User interface services - X Window System User interface services - X Window System
Copyright (C) Matthew Chapman 1999-2004 Copyright (C) Jay Sorg 2004
qte.cpp by Jay Sorg
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -21,7 +20,6 @@
//#define SHARP //#define SHARP
#include "../rdesktop.h"
#ifdef SHARP #ifdef SHARP
#include <qpe/qpeapplication.h> #include <qpe/qpeapplication.h>
#else #else
@ -41,10 +39,26 @@
#include <qfile.h> #include <qfile.h>
#include <qcheckbox.h> #include <qcheckbox.h>
#include <qpopupmenu.h> #include <qpopupmenu.h>
#include "qtewin.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> // va_list va_start va_end #include <stdarg.h> // va_list va_start va_end
#include "../rdesktop.h"
#include "qtewin.h"
/* types */
struct QColorMap
{
uint32 RGBColors[256];
int NumColors;
};
struct bitmap
{
int w;
int h;
uint8* data;
};
uint32 g_flags = 0; uint32 g_flags = 0;
char g_server[64] = ""; char g_server[64] = "";
char g_domain[16] = ""; char g_domain[16] = "";
@ -79,29 +93,15 @@ QPEApplication* g_App = 0;
#else #else
QApplication* g_App = 0; QApplication* g_App = 0;
#endif #endif
QMyMainWindow* g_MW = 0; static QMyMainWindow *g_MW = 0;
QMyScrollView* g_SV = 0; static QMyScrollView *g_SV = 0;
struct QColorMap static struct QColorMap *g_CM = 0;
{ static uint8 *g_BS = 0;
uint32 RGBColors[256];
int NumColors;
};
struct QColorMap* g_CM = 0;
uint8* g_BS = 0;
int g_clipx = 0; static int g_clipx = 0;
int g_clipy = 0; static int g_clipy = 0;
int g_clipcx = 0; static int g_clipcx = 0;
int g_clipcy = 0; static int g_clipcy = 0;
struct bitmap
{
int w;
int h;
uint8* data;
};
int owncolmap = False;
//***************************************************************************** //*****************************************************************************
void CleanString(QString* Item) void CleanString(QString* Item)