CVS: rdesktop cache.c, 1.26, 1.27 constants.h, 1.48, 1.49 disk.c, 1.57, 1.58 orders.c, 1.50, 1.51 parallel.c, 1.16, 1.17 printer.c, 1.17, 1.18 proto.h, 1.104, 1.105 pstcache.c, 1.8, 1.9 rdesktop.h, 1.36, 1.37 rdp.c, 1.96, 1.97 rdpdr.c, 1.47, 1.48 rdpsnd.c, 1.36, 1.37 rdpsnd.h, 1.10, 1.11 rdpsnd_alsa.c, 1.15, 1.16 rdpsnd_dsp.c, 1.23, 1.24 rdpsnd_dsp.h, 1.4, 1.5 rdpsnd_libao.c, 1.35, 1.36 rdpsnd_oss.c, 1.35, 1.36 rdpsnd_sgi.c, 1.21, 1.22 rdpsnd_sun.c, 1.28, 1.29 serial.c, 1.29, 1.30 types.h, 1.30, 1.31 xwin.c, 1.217, 1.218

Jay Sorg <[email protected]> Wed, 03 Jan 2007 20:55:59 -0800
Newsgroups gmane.network.rdesktop.cvs
Message-ID <[email protected]>
Update of /cvsroot/rdesktop/rdesktop
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv16601

Modified Files:
	cache.c constants.h disk.c orders.c parallel.c printer.c 
	proto.h pstcache.c rdesktop.h rdp.c rdpdr.c rdpsnd.c rdpsnd.h 
	rdpsnd_alsa.c rdpsnd_dsp.c rdpsnd_dsp.h rdpsnd_libao.c 
	rdpsnd_oss.c rdpsnd_sgi.c rdpsnd_sun.c serial.c types.h xwin.c 
Log Message:
RD_ prefix and win32 compatibility for core files

Index: cache.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/cache.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** cache.c	11 Oct 2006 17:59:18 -0000	1.26
--- cache.c	4 Jan 2007 04:55:56 -0000	1.27
***************
*** 41,45 ****
  struct bmpcache_entry
  {
! 	HBITMAP bitmap;
  	sint16 previous;
  	sint16 next;
--- 41,45 ----
  struct bmpcache_entry
  {
! 	RD_HBITMAP bitmap;
  	sint16 previous;
  	sint16 next;
***************
*** 47,51 ****
  
  static struct bmpcache_entry g_bmpcache[3][0xa00];
! static HBITMAP g_volatile_bc[3];
  
  static int g_bmpcache_lru[3] = { NOT_SET, NOT_SET, NOT_SET };
--- 47,51 ----
  
  static struct bmpcache_entry g_bmpcache[3][0xa00];
! static RD_HBITMAP g_volatile_bc[3];
  
  static int g_bmpcache_lru[3] = { NOT_SET, NOT_SET, NOT_SET };
***************
*** 191,195 ****
  
  /* Retrieve a bitmap from the cache */
! HBITMAP
  cache_get_bitmap(uint8 id, uint16 idx)
  {
--- 191,195 ----
  
  /* Retrieve a bitmap from the cache */
! RD_HBITMAP
  cache_get_bitmap(uint8 id, uint16 idx)
  {
***************
*** 215,221 ****
  /* Store a bitmap in the cache */
  void
! cache_put_bitmap(uint8 id, uint16 idx, HBITMAP bitmap)
  {
! 	HBITMAP old;
  
  	if ((id < NUM_ELEMENTS(g_bmpcache)) && (idx < NUM_ELEMENTS(g_bmpcache[0])))
--- 215,221 ----
  /* Store a bitmap in the cache */
  void
! cache_put_bitmap(uint8 id, uint16 idx, RD_HBITMAP bitmap)
  {
! 	RD_HBITMAP old;
  
  	if ((id < NUM_ELEMENTS(g_bmpcache)) && (idx < NUM_ELEMENTS(g_bmpcache[0])))
***************
*** 294,298 ****
  void
  cache_put_font(uint8 font, uint16 character, uint16 offset,
! 	       uint16 baseline, uint16 width, uint16 height, HGLYPH pixmap)
  {
  	FONTGLYPH *glyph;
--- 294,298 ----
  void
  cache_put_font(uint8 font, uint16 character, uint16 offset,
! 	       uint16 baseline, uint16 width, uint16 height, RD_HGLYPH pixmap)
  {
  	FONTGLYPH *glyph;
***************
*** 393,403 ****
  
  /* CURSOR CACHE */
! static HCURSOR g_cursorcache[0x20];
  
  /* Retrieve cursor from cache */
! HCURSOR
  cache_get_cursor(uint16 cache_idx)
  {
! 	HCURSOR cursor;
  
  	if (cache_idx < NUM_ELEMENTS(g_cursorcache))
--- 393,403 ----
  
  /* CURSOR CACHE */
! static RD_HCURSOR g_cursorcache[0x20];
  
  /* Retrieve cursor from cache */
! RD_HCURSOR
  cache_get_cursor(uint16 cache_idx)
  {
! 	RD_HCURSOR cursor;
  
  	if (cache_idx < NUM_ELEMENTS(g_cursorcache))
***************
*** 414,420 ****
  /* Store cursor in cache */
  void
! cache_put_cursor(uint16 cache_idx, HCURSOR cursor)
  {
! 	HCURSOR old;
  
  	if (cache_idx < NUM_ELEMENTS(g_cursorcache))
--- 414,420 ----
  /* Store cursor in cache */
  void
! cache_put_cursor(uint16 cache_idx, RD_HCURSOR cursor)
  {
! 	RD_HCURSOR old;
  
  	if (cache_idx < NUM_ELEMENTS(g_cursorcache))

Index: constants.h
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/constants.h,v
retrieving revision 1.48
retrieving revision 1.49
diff -C2 -d -r1.48 -r1.49
*** constants.h	3 Nov 2006 23:51:35 -0000	1.48
--- constants.h	4 Jan 2007 04:55:56 -0000	1.49
***************
*** 313,318 ****
  
  /* Clipboard constants, "borrowed" from GCC system headers in 
!    the w32 cross compiler */
  
  #define CF_TEXT         1
  #define CF_BITMAP       2
--- 313,320 ----
  
  /* Clipboard constants, "borrowed" from GCC system headers in 
!    the w32 cross compiler
!    this is the CF_ set when WINVER is 0x0400 */
  
+ #ifndef CF_TEXT
  #define CF_TEXT         1
  #define CF_BITMAP       2
***************
*** 341,344 ****
--- 343,347 ----
  #define CF_GDIOBJFIRST  768
  #define CF_GDIOBJLAST   1023
+ #endif
  
  /* Sound format constants */
***************
*** 355,380 ****
  
  /* NT status codes for RDPDR */
! #define STATUS_SUCCESS			0x00000000
! #define STATUS_NOT_IMPLEMENTED          0x00000001
! #define STATUS_PENDING                  0x00000103
  
! #define STATUS_NO_MORE_FILES            0x80000006
! #define STATUS_DEVICE_PAPER_EMPTY       0x8000000e
! #define STATUS_DEVICE_POWERED_OFF       0x8000000f
! #define STATUS_DEVICE_OFF_LINE          0x80000010
! #define STATUS_DEVICE_BUSY              0x80000011
  
! #define STATUS_INVALID_HANDLE           0xc0000008
! #define STATUS_INVALID_PARAMETER	0xc000000d
! #define STATUS_NO_SUCH_FILE             0xc000000f
! #define STATUS_INVALID_DEVICE_REQUEST	0xc0000010
! #define STATUS_ACCESS_DENIED		0xc0000022
! #define STATUS_OBJECT_NAME_COLLISION    0xc0000035
! #define STATUS_DISK_FULL                0xc000007f
! #define STATUS_FILE_IS_A_DIRECTORY      0xc00000ba
! #define STATUS_NOT_SUPPORTED            0xc00000bb
! #define STATUS_TIMEOUT                  0xc0000102
! #define STATUS_NOTIFY_ENUM_DIR          0xc000010c
! #define STATUS_CANCELLED                0xc0000120
  
  
--- 358,383 ----
  
  /* NT status codes for RDPDR */
! #define RD_STATUS_SUCCESS                  0x00000000
! #define RD_STATUS_NOT_IMPLEMENTED          0x00000001
! #define RD_STATUS_PENDING                  0x00000103
  
! #define RD_STATUS_NO_MORE_FILES            0x80000006
! #define RD_STATUS_DEVICE_PAPER_EMPTY       0x8000000e
! #define RD_STATUS_DEVICE_POWERED_OFF       0x8000000f
! #define RD_STATUS_DEVICE_OFF_LINE          0x80000010
! #define RD_STATUS_DEVICE_BUSY              0x80000011
  
! #define RD_STATUS_INVALID_HANDLE           0xc0000008
! #define RD_STATUS_INVALID_PARAMETER        0xc000000d
! #define RD_STATUS_NO_SUCH_FILE             0xc000000f
! #define RD_STATUS_INVALID_DEVICE_REQUEST   0xc0000010
! #define RD_STATUS_ACCESS_DENIED            0xc0000022
! #define RD_STATUS_OBJECT_NAME_COLLISION    0xc0000035
! #define RD_STATUS_DISK_FULL                0xc000007f
! #define RD_STATUS_FILE_IS_A_DIRECTORY      0xc00000ba
! #define RD_STATUS_NOT_SUPPORTED            0xc00000bb
! #define RD_STATUS_TIMEOUT                  0xc0000102
! #define RD_STATUS_NOTIFY_ENUM_DIR          0xc000010c
! #define RD_STATUS_CANCELLED                0xc0000120
  
  

Index: disk.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/disk.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -C2 -d -r1.57 -r1.58
*** disk.c	5 Jul 2006 12:07:48 -0000	1.57
--- disk.c	4 Jan 2007 04:55:56 -0000	1.58
***************
*** 151,155 ****
  } FsInfoType;
  
! static NTSTATUS NotifyInfo(NTHANDLE handle, uint32 info_class, NOTIFY * p);
  
  static time_t
--- 151,155 ----
  } FsInfoType;
  
! static RD_NTSTATUS NotifyInfo(RD_NTHANDLE handle, uint32 info_class, NOTIFY * p);
  
  static time_t
***************
*** 338,346 ****
  
  /* Opens or creates a file or directory */
! static NTSTATUS
  disk_create(uint32 device_id, uint32 accessmask, uint32 sharemode, uint32 create_disposition,
! 	    uint32 flags_and_attributes, char *filename, NTHANDLE * phandle)
  {
! 	NTHANDLE handle;
  	DIR *dirp;
  	int flags, mode;
--- 338,346 ----
  
  /* Opens or creates a file or directory */
! static RD_NTSTATUS
  disk_create(uint32 device_id, uint32 accessmask, uint32 sharemode, uint32 create_disposition,
! 	    uint32 flags_and_attributes, char *filename, RD_NTHANDLE * phandle)
  {
! 	RD_NTHANDLE handle;
  	DIR *dirp;
  	int flags, mode;
***************
*** 396,400 ****
  	{
  		if (flags_and_attributes & FILE_NON_DIRECTORY_FILE)
! 			return STATUS_FILE_IS_A_DIRECTORY;
  		else
  			flags_and_attributes |= FILE_DIRECTORY_FILE;
--- 396,400 ----
  	{
  		if (flags_and_attributes & FILE_NON_DIRECTORY_FILE)
! 			return RD_STATUS_FILE_IS_A_DIRECTORY;
  		else
  			flags_and_attributes |= FILE_DIRECTORY_FILE;
***************
*** 415,428 ****
  				case EACCES:
  
! 					return STATUS_ACCESS_DENIED;
  
  				case ENOENT:
  
! 					return STATUS_NO_SUCH_FILE;
  
  				default:
  
  					perror("opendir");
! 					return STATUS_NO_SUCH_FILE;
  			}
  		}
--- 415,428 ----
  				case EACCES:
  
! 					return RD_STATUS_ACCESS_DENIED;
  
  				case ENOENT:
  
! 					return RD_STATUS_NO_SUCH_FILE;
  
  				default:
  
  					perror("opendir");
! 					return RD_STATUS_NO_SUCH_FILE;
  			}
  		}
***************
*** 453,472 ****
  				case EISDIR:
  
! 					return STATUS_FILE_IS_A_DIRECTORY;
  
  				case EACCES:
  
! 					return STATUS_ACCESS_DENIED;
  
  				case ENOENT:
  
! 					return STATUS_NO_SUCH_FILE;
  				case EEXIST:
  
! 					return STATUS_OBJECT_NAME_COLLISION;
  				default:
  
  					perror("open");
! 					return STATUS_NO_SUCH_FILE;
  			}
  		}
--- 453,472 ----
  				case EISDIR:
  
! 					return RD_STATUS_FILE_IS_A_DIRECTORY;
  
  				case EACCES:
  
! 					return RD_STATUS_ACCESS_DENIED;
  
  				case ENOENT:
  
! 					return RD_STATUS_NO_SUCH_FILE;
  				case EEXIST:
  
! 					return RD_STATUS_OBJECT_NAME_COLLISION;
  				default:
  
  					perror("open");
! 					return RD_STATUS_NO_SUCH_FILE;
  			}
  		}
***************
*** 497,505 ****
  
  	*phandle = handle;
! 	return STATUS_SUCCESS;
  }
  
! static NTSTATUS
! disk_close(NTHANDLE handle)
  {
  	struct fileinfo *pfinfo;
--- 497,505 ----
  
  	*phandle = handle;
! 	return RD_STATUS_SUCCESS;
  }
  
! static RD_NTSTATUS
! disk_close(RD_NTHANDLE handle)
  {
  	struct fileinfo *pfinfo;
***************
*** 509,513 ****
  	g_notify_stamp = True;
  
! 	rdpdr_abort_io(handle, 0, STATUS_CANCELLED);
  
  	if (pfinfo->pdir)
--- 509,513 ----
  	g_notify_stamp = True;
  
! 	rdpdr_abort_io(handle, 0, RD_STATUS_CANCELLED);
  
  	if (pfinfo->pdir)
***************
*** 516,520 ****
  		{
  			perror("closedir");
! 			return STATUS_INVALID_HANDLE;
  		}
  
--- 516,520 ----
  		{
  			perror("closedir");
! 			return RD_STATUS_INVALID_HANDLE;
  		}
  
***************
*** 523,527 ****
  			{
  				perror(pfinfo->path);
! 				return STATUS_ACCESS_DENIED;
  			}
  		pfinfo->delete_on_close = False;
--- 523,527 ----
  			{
  				perror(pfinfo->path);
! 				return RD_STATUS_ACCESS_DENIED;
  			}
  		pfinfo->delete_on_close = False;
***************
*** 532,536 ****
  		{
  			perror("close");
! 			return STATUS_INVALID_HANDLE;
  		}
  		if (pfinfo->delete_on_close)
--- 532,536 ----
  		{
  			perror("close");
! 			return RD_STATUS_INVALID_HANDLE;
  		}
  		if (pfinfo->delete_on_close)
***************
*** 538,542 ****
  			{
  				perror(pfinfo->path);
! 				return STATUS_ACCESS_DENIED;
  			}
  
--- 538,542 ----
  			{
  				perror(pfinfo->path);
! 				return RD_STATUS_ACCESS_DENIED;
  			}
  
***************
*** 544,552 ****
  	}
  
! 	return STATUS_SUCCESS;
  }
  
! static NTSTATUS
! disk_read(NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result)
  {
  	int n;
--- 544,552 ----
  	}
  
! 	return RD_STATUS_SUCCESS;
  }
  
! static RD_NTSTATUS
! disk_read(RD_NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result)
  {
  	int n;
***************
*** 575,582 ****
  				   with STATUS_NOT_IMPLEMENTED server doesn't read again */
  				/* return STATUS_FILE_IS_A_DIRECTORY; */
! 				return STATUS_NOT_IMPLEMENTED;
  			default:
  				perror("read");
! 				return STATUS_INVALID_PARAMETER;
  		}
  	}
--- 575,582 ----
  				   with STATUS_NOT_IMPLEMENTED server doesn't read again */
  				/* return STATUS_FILE_IS_A_DIRECTORY; */
! 				return RD_STATUS_NOT_IMPLEMENTED;
  			default:
  				perror("read");
! 				return RD_STATUS_INVALID_PARAMETER;
  		}
  	}
***************
*** 584,592 ****
  	*result = n;
  
! 	return STATUS_SUCCESS;
  }
  
! static NTSTATUS
! disk_write(NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result)
  {
  	int n;
--- 584,592 ----
  	*result = n;
  
! 	return RD_STATUS_SUCCESS;
  }
  
! static RD_NTSTATUS
! disk_write(RD_NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result)
  {
  	int n;
***************
*** 603,609 ****
  		{
  			case ENOSPC:
! 				return STATUS_DISK_FULL;
  			default:
! 				return STATUS_ACCESS_DENIED;
  		}
  	}
--- 603,609 ----
  		{
  			case ENOSPC:
! 				return RD_STATUS_DISK_FULL;
  			default:
! 				return RD_STATUS_ACCESS_DENIED;
  		}
  	}
***************
*** 611,619 ****
  	*result = n;
  
! 	return STATUS_SUCCESS;
  }
  
! NTSTATUS
! disk_query_information(NTHANDLE handle, uint32 info_class, STREAM out)
  {
  	uint32 file_attributes, ft_high, ft_low;
--- 611,619 ----
  	*result = n;
  
! 	return RD_STATUS_SUCCESS;
  }
  
! RD_NTSTATUS
! disk_query_information(RD_NTHANDLE handle, uint32 info_class, STREAM out)
  {
  	uint32 file_attributes, ft_high, ft_low;
***************
*** 628,632 ****
  		perror("stat");
  		out_uint8(out, 0);
! 		return STATUS_ACCESS_DENIED;
  	}
  
--- 628,632 ----
  		perror("stat");
  		out_uint8(out, 0);
! 		return RD_STATUS_ACCESS_DENIED;
  	}
  
***************
*** 690,700 ****
  
  			unimpl("IRP Query (File) Information class: 0x%x\n", info_class);
! 			return STATUS_INVALID_PARAMETER;
  	}
! 	return STATUS_SUCCESS;
  }
  
! NTSTATUS
! disk_set_information(NTHANDLE handle, uint32 info_class, STREAM in, STREAM out)
  {
  	uint32 length, file_attributes, ft_high, ft_low, delete_on_close;
--- 690,700 ----
  
  			unimpl("IRP Query (File) Information class: 0x%x\n", info_class);
! 			return RD_STATUS_INVALID_PARAMETER;
  	}
! 	return RD_STATUS_SUCCESS;
  }
  
! RD_NTSTATUS
! disk_set_information(RD_NTHANDLE handle, uint32 info_class, STREAM in, STREAM out)
  {
  	uint32 length, file_attributes, ft_high, ft_low, delete_on_close;
***************
*** 743,747 ****
  
  			if (fstat(handle, &filestat))
! 				return STATUS_ACCESS_DENIED;
  
  			tvs.modtime = filestat.st_mtime;
--- 743,747 ----
  
  			if (fstat(handle, &filestat))
! 				return RD_STATUS_ACCESS_DENIED;
  
  			tvs.modtime = filestat.st_mtime;
***************
*** 769,773 ****
  #endif
  				if (utime(pfinfo->path, &tvs) && errno != EPERM)
! 					return STATUS_ACCESS_DENIED;
  			}
  
--- 769,773 ----
  #endif
  				if (utime(pfinfo->path, &tvs) && errno != EPERM)
! 					return RD_STATUS_ACCESS_DENIED;
  			}
  
***************
*** 788,792 ****
  
  			if (fchmod(handle, mode))
! 				return STATUS_ACCESS_DENIED;
  
  			break;
--- 788,792 ----
  
  			if (fchmod(handle, mode))
! 				return RD_STATUS_ACCESS_DENIED;
  
  			break;
***************
*** 805,809 ****
  			else
  			{
! 				return STATUS_INVALID_PARAMETER;
  			}
  
--- 805,809 ----
  			else
  			{
! 				return RD_STATUS_INVALID_PARAMETER;
  			}
  
***************
*** 814,818 ****
  			{
  				perror("rename");
! 				return STATUS_ACCESS_DENIED;
  			}
  			break;
--- 814,818 ----
  			{
  				perror("rename");
! 				return RD_STATUS_ACCESS_DENIED;
  			}
  			break;
***************
*** 853,861 ****
  			if (STATFS_FN(g_rdpdr_device[pfinfo->device_id].local_path, &stat_fs) == 0)
  				if (stat_fs.f_bfree * stat_fs.f_bsize < length)
! 					return STATUS_DISK_FULL;
  
  			if (ftruncate_growable(handle, length) != 0)
  			{
! 				return STATUS_DISK_FULL;
  			}
  
--- 853,861 ----
  			if (STATFS_FN(g_rdpdr_device[pfinfo->device_id].local_path, &stat_fs) == 0)
  				if (stat_fs.f_bfree * stat_fs.f_bsize < length)
! 					return RD_STATUS_DISK_FULL;
  
  			if (ftruncate_growable(handle, length) != 0)
  			{
! 				return RD_STATUS_DISK_FULL;
  			}
  
***************
*** 864,877 ****
  
  			unimpl("IRP Set File Information class: 0x%x\n", info_class);
! 			return STATUS_INVALID_PARAMETER;
  	}
! 	return STATUS_SUCCESS;
  }
  
! NTSTATUS
! disk_check_notify(NTHANDLE handle)
  {
  	struct fileinfo *pfinfo;
! 	NTSTATUS status = STATUS_PENDING;
  
  	NOTIFY notify;
--- 864,877 ----
  
  			unimpl("IRP Set File Information class: 0x%x\n", info_class);
! 			return RD_STATUS_INVALID_PARAMETER;
  	}
! 	return RD_STATUS_SUCCESS;
  }
  
! RD_NTSTATUS
! disk_check_notify(RD_NTHANDLE handle)
  {
  	struct fileinfo *pfinfo;
! 	RD_NTSTATUS status = RD_STATUS_PENDING;
  
  	NOTIFY notify;
***************
*** 879,883 ****
  	pfinfo = &(g_fileinfo[handle]);
  	if (!pfinfo->pdir)
! 		return STATUS_INVALID_DEVICE_REQUEST;
  
  
--- 879,883 ----
  	pfinfo = &(g_fileinfo[handle]);
  	if (!pfinfo->pdir)
! 		return RD_STATUS_INVALID_DEVICE_REQUEST;
  
  
***************
*** 885,889 ****
  	status = NotifyInfo(handle, pfinfo->info_class, &notify);
  
! 	if (status != STATUS_PENDING)
  		return status;
  
--- 885,889 ----
  	status = NotifyInfo(handle, pfinfo->info_class, &notify);
  
! 	if (status != RD_STATUS_PENDING)
  		return status;
  
***************
*** 892,896 ****
  		/*printf("disk_check_notify found changed event\n"); */
  		memcpy(&pfinfo->notify, &notify, sizeof(NOTIFY));
! 		status = STATUS_NOTIFY_ENUM_DIR;
  	}
  
--- 892,896 ----
  		/*printf("disk_check_notify found changed event\n"); */
  		memcpy(&pfinfo->notify, &notify, sizeof(NOTIFY));
! 		status = RD_STATUS_NOTIFY_ENUM_DIR;
  	}
  
***************
*** 900,909 ****
  }
  
! NTSTATUS
! disk_create_notify(NTHANDLE handle, uint32 info_class)
  {
  
  	struct fileinfo *pfinfo;
! 	NTSTATUS ret = STATUS_PENDING;
  
  	/* printf("start disk_create_notify info_class %X\n", info_class); */
--- 900,909 ----
  }
  
! RD_NTSTATUS
! disk_create_notify(RD_NTHANDLE handle, uint32 info_class)
  {
  
  	struct fileinfo *pfinfo;
! 	RD_NTSTATUS ret = RD_STATUS_PENDING;
  
  	/* printf("start disk_create_notify info_class %X\n", info_class); */
***************
*** 916,921 ****
  	if (info_class & 0x1000)
  	{			/* ???? */
! 		if (ret == STATUS_PENDING)
! 			return STATUS_SUCCESS;
  	}
  
--- 916,921 ----
  	if (info_class & 0x1000)
  	{			/* ???? */
! 		if (ret == RD_STATUS_PENDING)
! 			return RD_STATUS_SUCCESS;
  	}
  
***************
*** 927,932 ****
  }
  
! static NTSTATUS
! NotifyInfo(NTHANDLE handle, uint32 info_class, NOTIFY * p)
  {
  	struct fileinfo *pfinfo;
--- 927,932 ----
  }
  
! static RD_NTSTATUS
! NotifyInfo(RD_NTHANDLE handle, uint32 info_class, NOTIFY * p)
  {
  	struct fileinfo *pfinfo;
***************
*** 940,944 ****
  	{
  		perror("NotifyInfo");
! 		return STATUS_ACCESS_DENIED;
  	}
  	p->modify_time = buf.st_mtime;
--- 940,944 ----
  	{
  		perror("NotifyInfo");
! 		return RD_STATUS_ACCESS_DENIED;
  	}
  	p->modify_time = buf.st_mtime;
***************
*** 952,956 ****
  	{
  		perror("NotifyInfo");
! 		return STATUS_ACCESS_DENIED;
  	}
  
--- 952,956 ----
  	{
  		perror("NotifyInfo");
! 		return RD_STATUS_ACCESS_DENIED;
  	}
  
***************
*** 973,977 ****
  	closedir(dpr);
  
! 	return STATUS_PENDING;
  }
  
--- 973,977 ----
  	closedir(dpr);
  
! 	return RD_STATUS_PENDING;
  }
  
***************
*** 1044,1049 ****
  
  
! NTSTATUS
! disk_query_volume_information(NTHANDLE handle, uint32 info_class, STREAM out)
  {
  	struct STATFS_T stat_fs;
--- 1044,1049 ----
  
  
! RD_NTSTATUS
! disk_query_volume_information(RD_NTHANDLE handle, uint32 info_class, STREAM out)
  {
  	struct STATFS_T stat_fs;
***************
*** 1056,1060 ****
  	{
  		perror("statfs");
! 		return STATUS_ACCESS_DENIED;
  	}
  
--- 1056,1060 ----
  	{
  		perror("statfs");
! 		return RD_STATUS_ACCESS_DENIED;
  	}
  
***************
*** 1104,1114 ****
  
  			unimpl("IRP Query Volume Information class: 0x%x\n", info_class);
! 			return STATUS_INVALID_PARAMETER;
  	}
! 	return STATUS_SUCCESS;
  }
  
! NTSTATUS
! disk_query_directory(NTHANDLE handle, uint32 info_class, char *pattern, STREAM out)
  {
  	uint32 file_attributes, ft_low, ft_high;
--- 1104,1114 ----
  
  			unimpl("IRP Query Volume Information class: 0x%x\n", info_class);
! 			return RD_STATUS_INVALID_PARAMETER;
  	}
! 	return RD_STATUS_SUCCESS;
  }
  
! RD_NTSTATUS
! disk_query_directory(RD_NTHANDLE handle, uint32 info_class, char *pattern, STREAM out)
  {
  	uint32 file_attributes, ft_low, ft_high;
***************
*** 1141,1145 ****
  
  			if (pdirent == NULL)
! 				return STATUS_NO_MORE_FILES;
  
  			/* Get information for directory entry */
--- 1141,1145 ----
  
  			if (pdirent == NULL)
! 				return RD_STATUS_NO_MORE_FILES;
  
  			/* Get information for directory entry */
***************
*** 1161,1165 ****
  						perror(fullpath);
  						out_uint8(out, 0);
! 						return STATUS_NO_SUCH_FILE;
  				}
  			}
--- 1161,1165 ----
  						perror(fullpath);
  						out_uint8(out, 0);
! 						return RD_STATUS_NO_SUCH_FILE;
  				}
  			}
***************
*** 1211,1227 ****
  
  			unimpl("IRP Query Directory sub: 0x%x\n", info_class);
! 			return STATUS_INVALID_PARAMETER;
  	}
  
! 	return STATUS_SUCCESS;
  }
  
  
  
! static NTSTATUS
! disk_device_control(NTHANDLE handle, uint32 request, STREAM in, STREAM out)
  {
  	if (((request >> 16) != 20) || ((request >> 16) != 9))
! 		return STATUS_INVALID_PARAMETER;
  
  	/* extract operation */
--- 1211,1227 ----
  
  			unimpl("IRP Query Directory sub: 0x%x\n", info_class);
! 			return RD_STATUS_INVALID_PARAMETER;
  	}
  
! 	return RD_STATUS_SUCCESS;
  }
  
  
  
! static RD_NTSTATUS
! disk_device_control(RD_NTHANDLE handle, uint32 request, STREAM in, STREAM out)
  {
  	if (((request >> 16) != 20) || ((request >> 16) != 9))
! 		return RD_STATUS_INVALID_PARAMETER;
  
  	/* extract operation */
***************
*** 1237,1244 ****
  		default:
  			unimpl("DISK IOCTL %d\n", request);
! 			return STATUS_INVALID_PARAMETER;
  	}
  
! 	return STATUS_SUCCESS;
  }
  
--- 1237,1244 ----
  		default:
  			unimpl("DISK IOCTL %d\n", request);
! 			return RD_STATUS_INVALID_PARAMETER;
  	}
  
! 	return RD_STATUS_SUCCESS;
  }
  

Index: orders.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/orders.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -d -r1.50 -r1.51
*** orders.c	23 Apr 2005 22:36:42 -0000	1.50
--- orders.c	4 Jan 2007 04:55:56 -0000	1.51
***************
*** 380,384 ****
  process_memblt(STREAM s, MEMBLT_ORDER * os, uint32 present, BOOL delta)
  {
! 	HBITMAP bitmap;
  
  	if (present & 0x0001)
--- 380,384 ----
  process_memblt(STREAM s, MEMBLT_ORDER * os, uint32 present, BOOL delta)
  {
! 	RD_HBITMAP bitmap;
  
  	if (present & 0x0001)
***************
*** 426,430 ****
  process_triblt(STREAM s, TRIBLT_ORDER * os, uint32 present, BOOL delta)
  {
! 	HBITMAP bitmap;
  
  	if (present & 0x000001)
--- 426,430 ----
  process_triblt(STREAM s, TRIBLT_ORDER * os, uint32 present, BOOL delta)
  {
! 	RD_HBITMAP bitmap;
  
  	if (present & 0x000001)
***************
*** 487,491 ****
  	int index, data, next;
  	uint8 flags = 0;
! 	POINT *points;
  
  	if (present & 0x01)
--- 487,491 ----
  	int index, data, next;
  	uint8 flags = 0;
! 	RD_POINT *points;
  
  	if (present & 0x01)
***************
*** 529,534 ****
  	}
  
! 	points = (POINT *) xmalloc((os->npoints + 1) * sizeof(POINT));
! 	memset(points, 0, (os->npoints + 1) * sizeof(POINT));
  
  	points[0].x = os->x;
--- 529,534 ----
  	}
  
! 	points = (RD_POINT *) xmalloc((os->npoints + 1) * sizeof(RD_POINT));
! 	memset(points, 0, (os->npoints + 1) * sizeof(RD_POINT));
  
  	points[0].x = os->x;
***************
*** 566,570 ****
  	int index, data, next;
  	uint8 flags = 0;
! 	POINT *points;
  
  	if (present & 0x0001)
--- 566,570 ----
  	int index, data, next;
  	uint8 flags = 0;
! 	RD_POINT *points;
  
  	if (present & 0x0001)
***************
*** 614,619 ****
  	}
  
! 	points = (POINT *) xmalloc((os->npoints + 1) * sizeof(POINT));
! 	memset(points, 0, (os->npoints + 1) * sizeof(POINT));
  
  	points[0].x = os->x;
--- 614,619 ----
  	}
  
! 	points = (RD_POINT *) xmalloc((os->npoints + 1) * sizeof(RD_POINT));
! 	memset(points, 0, (os->npoints + 1) * sizeof(RD_POINT));
  
  	points[0].x = os->x;
***************
*** 652,656 ****
  	uint8 flags = 0;
  	PEN pen;
! 	POINT *points;
  
  	if (present & 0x01)
--- 652,656 ----
  	uint8 flags = 0;
  	PEN pen;
! 	RD_POINT *points;
  
  	if (present & 0x01)
***************
*** 691,696 ****
  	}
  
! 	points = (POINT *) xmalloc((os->lines + 1) * sizeof(POINT));
! 	memset(points, 0, (os->lines + 1) * sizeof(POINT));
  
  	points[0].x = os->x;
--- 691,696 ----
  	}
  
! 	points = (RD_POINT *) xmalloc((os->lines + 1) * sizeof(RD_POINT));
! 	memset(points, 0, (os->lines + 1) * sizeof(RD_POINT));
  
  	points[0].x = os->x;
***************
*** 875,879 ****
  process_raw_bmpcache(STREAM s)
  {
! 	HBITMAP bitmap;
  	uint16 cache_idx, bufsize;
  	uint8 cache_id, width, height, bpp, Bpp;
--- 875,879 ----
  process_raw_bmpcache(STREAM s)
  {
! 	RD_HBITMAP bitmap;
  	uint16 cache_idx, bufsize;
  	uint8 cache_id, width, height, bpp, Bpp;
***************
*** 908,912 ****
  process_bmpcache(STREAM s)
  {
! 	HBITMAP bitmap;
  	uint16 cache_idx, size;
  	uint8 cache_id, width, height, bpp, Bpp;
--- 908,912 ----
  process_bmpcache(STREAM s)
  {
! 	RD_HBITMAP bitmap;
  	uint16 cache_idx, size;
  	uint8 cache_id, width, height, bpp, Bpp;
***************
*** 964,968 ****
  process_bmpcache2(STREAM s, uint16 flags, BOOL compressed)
  {
! 	HBITMAP bitmap;
  	int y;
  	uint8 cache_id, cache_idx_low, width, height, Bpp;
--- 964,968 ----
  process_bmpcache2(STREAM s, uint16 flags, BOOL compressed)
  {
! 	RD_HBITMAP bitmap;
  	int y;
  	uint8 cache_id, cache_idx_low, width, height, Bpp;
***************
*** 1046,1050 ****
  	COLOURENTRY *entry;
  	COLOURMAP map;
! 	HCOLOURMAP hmap;
  	uint8 cache_id;
  	int i;
--- 1046,1050 ----
  	COLOURENTRY *entry;
  	COLOURMAP map;
! 	RD_HCOLOURMAP hmap;
  	uint8 cache_id;
  	int i;
***************
*** 1078,1082 ****
  process_fontcache(STREAM s)
  {
! 	HGLYPH bitmap;
  	uint8 font, nglyphs;
  	uint16 character, offset, baseline, width, height;
--- 1078,1082 ----
  process_fontcache(STREAM s)
  {
! 	RD_HGLYPH bitmap;
  	uint8 font, nglyphs;
  	uint16 character, offset, baseline, width, height;

Index: parallel.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/parallel.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** parallel.c	23 Aug 2005 20:27:14 -0000	1.16
--- parallel.c	4 Jan 2007 04:55:56 -0000	1.17
***************
*** 2,6 ****
     rdesktop: A Remote Desktop Protocol client.
     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
--- 2,6 ----
     rdesktop: A Remote Desktop Protocol client.
     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
***************
*** 12,16 ****
     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
--- 12,16 ----
     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
***************
*** 76,82 ****
  }
  
! static NTSTATUS
  parallel_create(uint32 device_id, uint32 access, uint32 share_mode, uint32 disposition,
! 		uint32 flags, char *filename, NTHANDLE * handle)
  {
  	int parallel_fd;
--- 76,82 ----
  }
  
! static RD_NTSTATUS
  parallel_create(uint32 device_id, uint32 access, uint32 share_mode, uint32 disposition,
! 		uint32 flags, char *filename, RD_NTHANDLE * handle)
  {
  	int parallel_fd;
***************
*** 86,90 ****
  	{
  		perror("open");
! 		return STATUS_ACCESS_DENIED;
  	}
  
--- 86,90 ----
  	{
  		perror("open");
! 		return RD_STATUS_ACCESS_DENIED;
  	}
  
***************
*** 102,110 ****
  	*handle = parallel_fd;
  
! 	return STATUS_SUCCESS;
  }
  
! static NTSTATUS
! parallel_close(NTHANDLE handle)
  {
  	int i = get_device_index(handle);
--- 102,110 ----
  	*handle = parallel_fd;
  
! 	return RD_STATUS_SUCCESS;
  }
  
! static RD_NTSTATUS
! parallel_close(RD_NTHANDLE handle)
  {
  	int i = get_device_index(handle);
***************
*** 112,129 ****
  		g_rdpdr_device[i].handle = 0;
  	close(handle);
! 	return STATUS_SUCCESS;
  }
  
! static NTSTATUS
! parallel_read(NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result)
  {
  	*result = read(handle, data, length);
! 	return STATUS_SUCCESS;
  }
  
! static NTSTATUS
! parallel_write(NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result)
  {
! 	int rc = STATUS_SUCCESS;
  
  	int n = write(handle, data, length);
--- 112,129 ----
  		g_rdpdr_device[i].handle = 0;
  	close(handle);
! 	return RD_STATUS_SUCCESS;
  }
  
! static RD_NTSTATUS
! parallel_read(RD_NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result)
  {
  	*result = read(handle, data, length);
! 	return RD_STATUS_SUCCESS;
  }
  
! static RD_NTSTATUS
! parallel_write(RD_NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result)
  {
! 	int rc = RD_STATUS_SUCCESS;
  
  	int n = write(handle, data, length);
***************
*** 138,148 ****
  		{
  			case EAGAIN:
! 				rc = STATUS_DEVICE_OFF_LINE;
  			case ENOSPC:
! 				rc = STATUS_DEVICE_PAPER_EMPTY;
  			case EIO:
! 				rc = STATUS_DEVICE_OFF_LINE;
  			default:
! 				rc = STATUS_DEVICE_POWERED_OFF;
  		}
  #if defined(LPGETSTATUS)
--- 138,148 ----
  		{
  			case EAGAIN:
! 				rc = RD_STATUS_DEVICE_OFF_LINE;
  			case ENOSPC:
! 				rc = RD_STATUS_DEVICE_PAPER_EMPTY;
  			case EIO:
! 				rc = RD_STATUS_DEVICE_OFF_LINE;
  			default:
! 				rc = RD_STATUS_DEVICE_POWERED_OFF;
  		}
  #if defined(LPGETSTATUS)
***************
*** 158,166 ****
  }
  
! static NTSTATUS
! parallel_device_control(NTHANDLE handle, uint32 request, STREAM in, STREAM out)
  {
  	if ((request >> 16) != FILE_DEVICE_PARALLEL)
! 		return STATUS_INVALID_PARAMETER;
  
  	/* extract operation */
--- 158,166 ----
  }
  
! static RD_NTSTATUS
! parallel_device_control(RD_NTHANDLE handle, uint32 request, STREAM in, STREAM out)
  {
  	if ((request >> 16) != FILE_DEVICE_PARALLEL)
! 		return RD_STATUS_INVALID_PARAMETER;
  
  	/* extract operation */
***************
*** 179,183 ****
  			unimpl("UNKNOWN IOCTL %d\n", request);
  	}
! 	return STATUS_SUCCESS;
  }
  
--- 179,183 ----
  			unimpl("UNKNOWN IOCTL %d\n", request);
  	}
! 	return RD_STATUS_SUCCESS;
  }
  

Index: printer.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/printer.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** printer.c	3 Aug 2005 10:56:16 -0000	1.17
--- printer.c	4 Jan 2007 04:55:56 -0000	1.18
***************
*** 23,27 ****
  
  static PRINTER *
! get_printer_data(NTHANDLE handle)
  {
  	int index;
--- 23,27 ----
  
  static PRINTER *
! get_printer_data(RD_NTHANDLE handle)
  {
  	int index;
***************
*** 101,107 ****
  }
  
! static NTSTATUS
  printer_create(uint32 device_id, uint32 access, uint32 share_mode, uint32 disposition, uint32 flags,
! 	       char *filename, NTHANDLE * handle)
  {
  	char cmd[256];
--- 101,107 ----
  }
  
! static RD_NTSTATUS
  printer_create(uint32 device_id, uint32 access, uint32 share_mode, uint32 disposition, uint32 flags,
! 	       char *filename, RD_NTHANDLE * handle)
  {
  	char cmd[256];
***************
*** 123,131 ****
  	g_rdpdr_device[device_id].handle = fileno(pprinter_data->printer_fp);
  	*handle = g_rdpdr_device[device_id].handle;
! 	return STATUS_SUCCESS;
  }
  
! static NTSTATUS
! printer_close(NTHANDLE handle)
  {
  	int i = get_device_index(handle);
--- 123,131 ----
  	g_rdpdr_device[device_id].handle = fileno(pprinter_data->printer_fp);
  	*handle = g_rdpdr_device[device_id].handle;
! 	return RD_STATUS_SUCCESS;
  }
  
! static RD_NTSTATUS
! printer_close(RD_NTHANDLE handle)
  {
  	int i = get_device_index(handle);
***************
*** 137,145 ****
  		g_rdpdr_device[i].handle = 0;
  	}
! 	return STATUS_SUCCESS;
  }
  
! static NTSTATUS
! printer_write(NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result)
  {
  	PRINTER *pprinter_data;
--- 137,145 ----
  		g_rdpdr_device[i].handle = 0;
  	}
! 	return RD_STATUS_SUCCESS;
  }
  
! static RD_NTSTATUS
! printer_write(RD_NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result)
  {
  	PRINTER *pprinter_data;
***************
*** 151,157 ****
  	{
  		*result = 0;
! 		return STATUS_INVALID_HANDLE;
  	}
! 	return STATUS_SUCCESS;
  }
  
--- 151,157 ----
  	{
  		*result = 0;
! 		return RD_STATUS_INVALID_HANDLE;
  	}
! 	return RD_STATUS_SUCCESS;
  }
  

Index: proto.h
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/proto.h,v
retrieving revision 1.104
retrieving revision 1.105
diff -C2 -d -r1.104 -r1.105
*** proto.h	2 Jan 2007 16:30:06 -0000	1.104
--- proto.h	4 Jan 2007 04:55:56 -0000	1.105
***************
*** 32,41 ****
  void cache_bump_bitmap(uint8 id, uint16 idx, int bump);
  void cache_evict_bitmap(uint8 id);
! HBITMAP cache_get_bitmap(uint8 id, uint16 idx);
! void cache_put_bitmap(uint8 id, uint16 idx, HBITMAP bitmap);
  void cache_save_state(void);
  FONTGLYPH *cache_get_font(uint8 font, uint16 character);
  void cache_put_font(uint8 font, uint16 character, uint16 offset, uint16 baseline, uint16 width,
! 		    uint16 height, HGLYPH pixmap);
  DATABLOB *cache_get_text(uint8 cache_id);
  void cache_put_text(uint8 cache_id, void *data, int length);
--- 32,41 ----
  void cache_bump_bitmap(uint8 id, uint16 idx, int bump);
  void cache_evict_bitmap(uint8 id);
! RD_HBITMAP cache_get_bitmap(uint8 id, uint16 idx);
! void cache_put_bitmap(uint8 id, uint16 idx, RD_HBITMAP bitmap);
  void cache_save_state(void);
  FONTGLYPH *cache_get_font(uint8 font, uint16 character);
  void cache_put_font(uint8 font, uint16 character, uint16 offset, uint16 baseline, uint16 width,
! 		    uint16 height, RD_HGLYPH pixmap);
  DATABLOB *cache_get_text(uint8 cache_id);
  void cache_put_text(uint8 cache_id, void *data, int length);
***************
*** 43,48 ****
  void cache_put_desktop(uint32 offset, int cx, int cy, int scanline, int bytes_per_pixel,
  		       uint8 * data);
! HCURSOR cache_get_cursor(uint16 cache_idx);
! void cache_put_cursor(uint16 cache_idx, HCURSOR cursor);
  /* channels.c */
  VCHANNEL *channel_register(char *name, uint32 flags, void (*callback) (STREAM));
--- 43,48 ----
  void cache_put_desktop(uint32 offset, int cx, int cy, int scanline, int bytes_per_pixel,
  		       uint8 * data);
! RD_HCURSOR cache_get_cursor(uint16 cache_idx);
! void cache_put_cursor(uint16 cache_idx, RD_HCURSOR cursor);
  /* channels.c */
  VCHANNEL *channel_register(char *name, uint32 flags, void (*callback) (STREAM));
***************
*** 59,68 ****
  /* disk.c */
  int disk_enum_devices(uint32 * id, char *optarg);
! NTSTATUS disk_query_information(NTHANDLE handle, uint32 info_class, STREAM out);
! NTSTATUS disk_set_information(NTHANDLE handle, uint32 info_class, STREAM in, STREAM out);
! NTSTATUS disk_check_notify(NTHANDLE handle);
! NTSTATUS disk_create_notify(NTHANDLE handle, uint32 info_class);
! NTSTATUS disk_query_volume_information(NTHANDLE handle, uint32 info_class, STREAM out);
! NTSTATUS disk_query_directory(NTHANDLE handle, uint32 info_class, char *pattern, STREAM out);
  /* mppc.c */
  int mppc_expand(uint8 * data, uint32 clen, uint8 ctype, uint32 * roff, uint32 * rlen);
--- 59,68 ----
  /* disk.c */
  int disk_enum_devices(uint32 * id, char *optarg);
! RD_NTSTATUS disk_query_information(RD_NTHANDLE handle, uint32 info_class, STREAM out);
! RD_NTSTATUS disk_set_information(RD_NTHANDLE handle, uint32 info_class, STREAM in, STREAM out);
! RD_NTSTATUS disk_check_notify(RD_NTHANDLE handle);
! RD_NTSTATUS disk_create_notify(RD_NTHANDLE handle, uint32 info_class);
! RD_NTSTATUS disk_query_volume_information(RD_NTHANDLE handle, uint32 info_class, STREAM out);
! RD_NTSTATUS disk_query_directory(RD_NTHANDLE handle, uint32 info_class, char *pattern, STREAM out);
  /* mppc.c */
  int mppc_expand(uint8 * data, uint32 clen, uint8 ctype, uint32 * roff, uint32 * rlen);
***************
*** 156,160 ****
  void rdp_disconnect(void);
  /* rdpdr.c */
! int get_device_index(NTHANDLE handle);
  void convert_to_unix_filename(char *filename);
  void rdpdr_send_completion(uint32 device, uint32 id, uint32 status, uint32 result, uint8 * buffer,
--- 156,160 ----
  void rdp_disconnect(void);
  /* rdpdr.c */
! int get_device_index(RD_NTHANDLE handle);
  void convert_to_unix_filename(char *filename);
  void rdpdr_send_completion(uint32 device, uint32 id, uint32 status, uint32 result, uint8 * buffer,
***************
*** 165,169 ****
  					       struct async_iorequest *iorq);
  void rdpdr_check_fds(fd_set * rfds, fd_set * wfds, BOOL timed_out);
! BOOL rdpdr_abort_io(uint32 fd, uint32 major, NTSTATUS status);
  /* rdpsnd.c */
  void rdpsnd_record(const void *data, unsigned int size);
--- 165,169 ----
  					       struct async_iorequest *iorq);
  void rdpdr_check_fds(fd_set * rfds, fd_set * wfds, BOOL timed_out);
! BOOL rdpdr_abort_io(uint32 fd, uint32 major, RD_NTSTATUS status);
  /* rdpsnd.c */
  void rdpsnd_record(const void *data, unsigned int size);
***************
*** 194,199 ****
  /* serial.c */
  int serial_enum_devices(uint32 * id, char *optarg);
! BOOL serial_get_event(NTHANDLE handle, uint32 * result);
! BOOL serial_get_timeout(NTHANDLE handle, uint32 length, uint32 * timeout, uint32 * itv_timeout);
  /* tcp.c */
  STREAM tcp_init(uint32 maxlen);
--- 194,199 ----
  /* serial.c */
  int serial_enum_devices(uint32 * id, char *optarg);
! BOOL serial_get_event(RD_NTHANDLE handle, uint32 * result);
! BOOL serial_get_timeout(RD_NTHANDLE handle, uint32 length, uint32 * timeout, uint32 * itv_timeout);
  /* tcp.c */
  STREAM tcp_init(uint32 maxlen);
***************
*** 240,256 ****
  int ui_select(int rdp_socket);
  void ui_move_pointer(int x, int y);
! HBITMAP ui_create_bitmap(int width, int height, uint8 * data);
  void ui_paint_bitmap(int x, int y, int cx, int cy, int width, int height, uint8 * data);
! void ui_destroy_bitmap(HBITMAP bmp);
! HGLYPH ui_create_glyph(int width, int height, uint8 * data);
! void ui_destroy_glyph(HGLYPH glyph);
! HCURSOR ui_create_cursor(unsigned int x, unsigned int y, int width, int height, uint8 * andmask,
! 			 uint8 * xormask);
! void ui_set_cursor(HCURSOR cursor);
! void ui_destroy_cursor(HCURSOR cursor);
  void ui_set_null_cursor(void);
! HCOLOURMAP ui_create_colourmap(COLOURMAP * colours);
! void ui_destroy_colourmap(HCOLOURMAP map);
! void ui_set_colourmap(HCOLOURMAP map);
  void ui_set_clip(int x, int y, int cx, int cy);
  void ui_reset_clip(void);
--- 240,256 ----
  int ui_select(int rdp_socket);
  void ui_move_pointer(int x, int y);
! RD_HBITMAP ui_create_bitmap(int width, int height, uint8 * data);
  void ui_paint_bitmap(int x, int y, int cx, int cy, int width, int height, uint8 * data);
! void ui_destroy_bitmap(RD_HBITMAP bmp);
! RD_HGLYPH ui_create_glyph(int width, int height, uint8 * data);
! void ui_destroy_glyph(RD_HGLYPH glyph);
! RD_HCURSOR ui_create_cursor(unsigned int x, unsigned int y, int width, int height, uint8 * andmask,
! 			    uint8 * xormask);
! void ui_set_cursor(RD_HCURSOR cursor);
! void ui_destroy_cursor(RD_HCURSOR cursor);
  void ui_set_null_cursor(void);
! RD_HCOLOURMAP ui_create_colourmap(COLOURMAP * colours);
! void ui_destroy_colourmap(RD_HCOLOURMAP map);
! void ui_set_colourmap(RD_HCOLOURMAP map);
  void ui_set_clip(int x, int y, int cx, int cy);
  void ui_reset_clip(void);
***************
*** 260,274 ****
  	       int fgcolour);
  void ui_screenblt(uint8 opcode, int x, int y, int cx, int cy, int srcx, int srcy);
! void ui_memblt(uint8 opcode, int x, int y, int cx, int cy, HBITMAP src, int srcx, int srcy);
! void ui_triblt(uint8 opcode, int x, int y, int cx, int cy, HBITMAP src, int srcx, int srcy,
  	       BRUSH * brush, int bgcolour, int fgcolour);
  void ui_line(uint8 opcode, int startx, int starty, int endx, int endy, PEN * pen);
  void ui_rect(int x, int y, int cx, int cy, int colour);
! void ui_polygon(uint8 opcode, uint8 fillmode, POINT * point, int npoints, BRUSH * brush,
  		int bgcolour, int fgcolour);
! void ui_polyline(uint8 opcode, POINT * points, int npoints, PEN * pen);
  void ui_ellipse(uint8 opcode, uint8 fillmode, int x, int y, int cx, int cy, BRUSH * brush,
  		int bgcolour, int fgcolour);
! void ui_draw_glyph(int mixmode, int x, int y, int cx, int cy, HGLYPH glyph, int srcx, int srcy,
  		   int bgcolour, int fgcolour);
  void ui_draw_text(uint8 font, uint8 flags, uint8 opcode, int mixmode, int x, int y, int clipx,
--- 260,274 ----
  	       int fgcolour);
  void ui_screenblt(uint8 opcode, int x, int y, int cx, int cy, int srcx, int srcy);
! void ui_memblt(uint8 opcode, int x, int y, int cx, int cy, RD_HBITMAP src, int srcx, int srcy);
! void ui_triblt(uint8 opcode, int x, int y, int cx, int cy, RD_HBITMAP src, int srcx, int srcy,
  	       BRUSH * brush, int bgcolour, int fgcolour);
  void ui_line(uint8 opcode, int startx, int starty, int endx, int endy, PEN * pen);
  void ui_rect(int x, int y, int cx, int cy, int colour);
! void ui_polygon(uint8 opcode, uint8 fillmode, RD_POINT * point, int npoints, BRUSH * brush,
  		int bgcolour, int fgcolour);
! void ui_polyline(uint8 opcode, RD_POINT * points, int npoints, PEN * pen);
  void ui_ellipse(uint8 opcode, uint8 fillmode, int x, int y, int cx, int cy, BRUSH * brush,
  		int bgcolour, int fgcolour);
! void ui_draw_glyph(int mixmode, int x, int y, int cx, int cy, RD_HGLYPH glyph, int srcx, int srcy,
  		   int bgcolour, int fgcolour);
  void ui_draw_text(uint8 font, uint8 flags, uint8 opcode, int mixmode, int x, int y, int clipx,

Index: pstcache.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/pstcache.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** pstcache.c	8 Apr 2006 04:19:11 -0000	1.8
--- pstcache.c	4 Jan 2007 04:55:56 -0000	1.9
***************
*** 57,61 ****
  	int fd;
  	CELLHEADER cellhdr;
! 	HBITMAP bitmap;
  
  	if (!g_bitmap_cache_persist_enable)
--- 57,61 ----
  	int fd;
  	CELLHEADER cellhdr;
! 	RD_HBITMAP bitmap;
  
  	if (!g_bitmap_cache_persist_enable)

Index: rdesktop.h
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdesktop.h,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** rdesktop.h	6 Dec 2006 12:12:37 -0000	1.36
--- rdesktop.h	4 Jan 2007 04:55:56 -0000	1.37
***************
*** 3,17 ****
     Master include file
     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
--- 3,17 ----
     Master include file
     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
***************
*** 22,25 ****
--- 22,32 ----
  #include <stdio.h>
  #include <string.h>
+ #ifdef _WIN32
+ #define WINVER 0x0400
+ #include <windows.h>
+ #include <winsock.h>
+ #include <time.h>
+ #define DIR int
+ #else
  #include <dirent.h>
  #include <sys/time.h>
***************
*** 30,33 ****
--- 37,41 ----
  #include <unistd.h>
  #endif
+ #endif
  #include <limits.h>		/* PATH_MAX */
  

Index: rdp.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdp.c,v
retrieving revision 1.96
retrieving revision 1.97
diff -C2 -d -r1.96 -r1.97
*** rdp.c	1 Nov 2006 18:38:40 -0000	1.96
--- rdp.c	4 Jan 2007 04:55:56 -0000	1.97
***************
*** 20,25 ****
--- 20,27 ----
  
  #include <time.h>
+ #ifndef _WIN32
  #include <errno.h>
  #include <unistd.h>
+ #endif
  #include "rdesktop.h"
  
***************
*** 997,1001 ****
  	uint16 x, y, width, height, cache_idx, masklen, datalen;
  	uint8 *mask, *data;
! 	HCURSOR cursor;
  
  	in_uint16_le(s, cache_idx);
--- 999,1003 ----
  	uint16 x, y, width, height, cache_idx, masklen, datalen;
  	uint8 *mask, *data;
! 	RD_HCURSOR cursor;
  
  	in_uint16_le(s, cache_idx);
***************
*** 1154,1158 ****
  	COLOURENTRY *entry;
  	COLOURMAP map;
! 	HCOLOURMAP hmap;
  	int i;
  
--- 1156,1160 ----
  	COLOURENTRY *entry;
  	COLOURMAP map;
! 	RD_HCOLOURMAP hmap;
  	int i;
  

Index: rdpdr.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdpdr.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -d -r1.47 -r1.48
*** rdpdr.c	3 Nov 2006 23:51:35 -0000	1.47
--- rdpdr.c	4 Jan 2007 04:55:56 -0000	1.48
***************
*** 70,74 ****
  
  /* If select() times out, the request for the device with handle g_min_timeout_fd is aborted */
! NTHANDLE g_min_timeout_fd;
  uint32 g_num_devices;
  
--- 70,74 ----
  
  /* If select() times out, the request for the device with handle g_min_timeout_fd is aborted */
! RD_NTHANDLE g_min_timeout_fd;
  uint32 g_num_devices;
  
***************
*** 95,99 ****
  /* Return device_id for a given handle */
  int
! get_device_index(NTHANDLE handle)
  {
  	int i;
--- 95,99 ----
  /* Return device_id for a given handle */
  int
! get_device_index(RD_NTHANDLE handle)
  {
  	int i;
***************
*** 367,371 ****
  	DEVICE_FNS *fns;
  	BOOL rw_blocking = True;
! 	NTSTATUS status = STATUS_INVALID_DEVICE_REQUEST;
  
  	in_uint32_le(s, device);
--- 367,371 ----
  	DEVICE_FNS *fns;
  	BOOL rw_blocking = True;
! 	RD_NTSTATUS status = RD_STATUS_INVALID_DEVICE_REQUEST;
  
  	in_uint32_le(s, device);
***************
*** 440,444 ****
  			if (!fns->create)
  			{
! 				status = STATUS_NOT_SUPPORTED;
  				break;
  			}
--- 440,444 ----
  			if (!fns->create)
  			{
! 				status = RD_STATUS_NOT_SUPPORTED;
  				break;
  			}
***************
*** 452,456 ****
  			if (!fns->close)
  			{
! 				status = STATUS_NOT_SUPPORTED;
  				break;
  			}
--- 452,456 ----
  			if (!fns->close)
  			{
! 				status = RD_STATUS_NOT_SUPPORTED;
  				break;
  			}
***************
*** 463,467 ****
  			if (!fns->read)
  			{
! 				status = STATUS_NOT_SUPPORTED;
  				break;
  			}
--- 463,467 ----
  			if (!fns->read)
  			{
! 				status = RD_STATUS_NOT_SUPPORTED;
  				break;
  			}
***************
*** 474,478 ****
  			if (!rdpdr_handle_ok(device, file))
  			{
! 				status = STATUS_INVALID_HANDLE;
  				break;
  			}
--- 474,478 ----
  			if (!rdpdr_handle_ok(device, file))
  			{
! 				status = RD_STATUS_INVALID_HANDLE;
  				break;
  			}
***************
*** 483,487 ****
  				if (!buffer)
  				{
! 					status = STATUS_CANCELLED;
  					break;
  				}
--- 483,487 ----
  				if (!buffer)
  				{
! 					status = RD_STATUS_CANCELLED;
  					break;
  				}
***************
*** 495,499 ****
  			if (!pst_buf)
  			{
! 				status = STATUS_CANCELLED;
  				break;
  			}
--- 495,499 ----
  			if (!pst_buf)
  			{
! 				status = RD_STATUS_CANCELLED;
  				break;
  			}
***************
*** 503,511 ****
  			     pst_buf, offset))
  			{
! 				status = STATUS_PENDING;
  				break;
  			}
  
! 			status = STATUS_CANCELLED;
  			break;
  		case IRP_MJ_WRITE:
--- 503,511 ----
  			     pst_buf, offset))
  			{
! 				status = RD_STATUS_PENDING;
  				break;
  			}
  
! 			status = RD_STATUS_CANCELLED;
  			break;
  		case IRP_MJ_WRITE:
***************
*** 515,519 ****
  			if (!fns->write)
  			{
! 				status = STATUS_NOT_SUPPORTED;
  				break;
  			}
--- 515,519 ----
  			if (!fns->write)
  			{
! 				status = RD_STATUS_NOT_SUPPORTED;
  				break;
  			}
***************
*** 527,531 ****
  			if (!rdpdr_handle_ok(device, file))
  			{
! 				status = STATUS_INVALID_HANDLE;
  				break;
  			}
--- 527,531 ----
  			if (!rdpdr_handle_ok(device, file))
  			{
! 				status = RD_STATUS_INVALID_HANDLE;
  				break;
  			}
***************
*** 541,545 ****
  			if (!pst_buf)
  			{
! 				status = STATUS_CANCELLED;
  				break;
  			}
--- 541,545 ----
  			if (!pst_buf)
  			{
! 				status = RD_STATUS_CANCELLED;
  				break;
  			}
***************
*** 550,558 ****
  			    (device, file, id, major, length, fns, 0, 0, pst_buf, offset))
  			{
! 				status = STATUS_PENDING;
  				break;
  			}
  
! 			status = STATUS_CANCELLED;
  			break;
  
--- 550,558 ----
  			    (device, file, id, major, length, fns, 0, 0, pst_buf, offset))
  			{
! 				status = RD_STATUS_PENDING;
  				break;
  			}
  
! 			status = RD_STATUS_CANCELLED;
  			break;
  
***************
*** 561,565 ****
  			if (g_rdpdr_device[device].device_type != DEVICE_TYPE_DISK)
  			{
! 				status = STATUS_INVALID_HANDLE;
  				break;
  			}
--- 561,565 ----
  			if (g_rdpdr_device[device].device_type != DEVICE_TYPE_DISK)
  			{
! 				status = RD_STATUS_INVALID_HANDLE;
  				break;
  			}
***************
*** 577,581 ****
  			if (g_rdpdr_device[device].device_type != DEVICE_TYPE_DISK)
  			{
! 				status = STATUS_INVALID_HANDLE;
  				break;
  			}
--- 577,581 ----
  			if (g_rdpdr_device[device].device_type != DEVICE_TYPE_DISK)
  			{
! 				status = RD_STATUS_INVALID_HANDLE;
  				break;
  			}
***************
*** 593,597 ****
  			if (g_rdpdr_device[device].device_type != DEVICE_TYPE_DISK)
  			{
! 				status = STATUS_INVALID_HANDLE;
  				break;
  			}
--- 593,597 ----
  			if (g_rdpdr_device[device].device_type != DEVICE_TYPE_DISK)
  			{
! 				status = RD_STATUS_INVALID_HANDLE;
  				break;
  			}
***************
*** 609,613 ****
  			if (g_rdpdr_device[device].device_type != DEVICE_TYPE_DISK)
  			{
! 				status = STATUS_INVALID_HANDLE;
  				break;
  			}
--- 609,613 ----
  			if (g_rdpdr_device[device].device_type != DEVICE_TYPE_DISK)
  			{
! 				status = RD_STATUS_INVALID_HANDLE;
  				break;
  			}
***************
*** 651,655 ****
  					result = 0;
  
! 					if (status == STATUS_PENDING)
  						add_async_iorequest(device, file, id, major, length,
  								    fns, 0, 0, NULL, 0);
--- 651,655 ----
  					result = 0;
  
! 					if (status == RD_STATUS_PENDING)
  						add_async_iorequest(device, file, id, major, length,
  								    fns, 0, 0, NULL, 0);
***************
*** 658,662 ****
  				default:
  
! 					status = STATUS_INVALID_PARAMETER;
  					/* JIF */
  					unimpl("IRP major=0x%x minor=0x%x\n", major, minor);
--- 658,662 ----
  				default:
  
! 					status = RD_STATUS_INVALID_PARAMETER;
  					/* JIF */
  					unimpl("IRP major=0x%x minor=0x%x\n", major, minor);
***************
*** 668,672 ****
  			if (!fns->device_control)
  			{
! 				status = STATUS_NOT_SUPPORTED;
  				break;
  			}
--- 668,672 ----
  			if (!fns->device_control)
  			{
! 				status = RD_STATUS_NOT_SUPPORTED;
  				break;
  			}
***************
*** 680,684 ****
  			if (!buffer)
  			{
! 				status = STATUS_CANCELLED;
  				break;
  			}
--- 680,684 ----
  			if (!buffer)
  			{
! 				status = RD_STATUS_CANCELLED;
  				break;
  			}
***************
*** 700,715 ****
  
  			/* Serial SERIAL_WAIT_ON_MASK */
! 			if (status == STATUS_PENDING)
  			{
  				if (add_async_iorequest
  				    (device, file, id, major, length, fns, 0, 0, NULL, 0))
  				{
! 					status = STATUS_PENDING;
  					break;
  				}
  			}
  #ifdef WITH_SCARD
! 			else if (status == (STATUS_PENDING | 0xC0000000))
! 				status = STATUS_PENDING;
  #endif
  			break;
--- 700,715 ----
  
  			/* Serial SERIAL_WAIT_ON_MASK */
! 			if (status == RD_STATUS_PENDING)
  			{
  				if (add_async_iorequest
  				    (device, file, id, major, length, fns, 0, 0, NULL, 0))
  				{
! 					status = RD_STATUS_PENDING;
  					break;
  				}
  			}
  #ifdef WITH_SCARD
! 			else if (status == (RD_STATUS_PENDING | 0xC0000000))
! 				status = RD_STATUS_PENDING;
  #endif
  			break;
***************
*** 720,724 ****
  			if (g_rdpdr_device[device].device_type != DEVICE_TYPE_DISK)
  			{
! 				status = STATUS_INVALID_HANDLE;
  				break;
  			}
--- 720,724 ----
  			if (g_rdpdr_device[device].device_type != DEVICE_TYPE_DISK)
  			{
! 				status = RD_STATUS_INVALID_HANDLE;
  				break;
  			}
***************
*** 730,734 ****
  			/* FIXME: Perhaps consider actually *do*
  			   something here :-) */
! 			status = STATUS_SUCCESS;
  			result = buffer_len = out.p - out.data;
  			break;
--- 730,734 ----
  			/* FIXME: Perhaps consider actually *do*
  			   something here :-) */
! 			status = RD_STATUS_SUCCESS;
  			result = buffer_len = out.p - out.data;
  			break;
***************
*** 739,743 ****
  	}
  
! 	if (status != STATUS_PENDING)
  	{
  		rdpdr_send_completion(device, id, status, result, buffer, buffer_len);
--- 739,743 ----
  	}
  
! 	if (status != RD_STATUS_PENDING)
  	{
  		rdpdr_send_completion(device, id, status, result, buffer, buffer_len);
***************
*** 961,965 ****
  _rdpdr_check_fds(fd_set * rfds, fd_set * wfds, BOOL timed_out)
  {
! 	NTSTATUS status;
  	uint32 result = 0;
  	DEVICE_FNS *fns;
--- 961,965 ----
  _rdpdr_check_fds(fd_set * rfds, fd_set * wfds, BOOL timed_out)
  {
! 	RD_NTSTATUS status;
  	uint32 result = 0;
  	DEVICE_FNS *fns;
***************
*** 990,994 ****
  					/*printf("RDPDR: IVT total %u bytes read of %u\n", iorq->partial_len, iorq->length); */
  					rdpdr_send_completion(iorq->device,
! 							      iorq->id, STATUS_SUCCESS,
  							      iorq->partial_len,
  							      iorq->buffer, iorq->partial_len);
--- 990,994 ----
  					/*printf("RDPDR: IVT total %u bytes read of %u\n", iorq->partial_len, iorq->length); */
  					rdpdr_send_completion(iorq->device,
! 							      iorq->id, RD_STATUS_SUCCESS,
  							      iorq->partial_len,
  							      iorq->buffer, iorq->partial_len);
***************
*** 1014,1018 ****
  		}
  
! 		rdpdr_abort_io(g_min_timeout_fd, 0, STATUS_TIMEOUT);
  		return;
  	}
--- 1014,1018 ----
  		}
  
! 		rdpdr_abort_io(g_min_timeout_fd, 0, RD_STATUS_TIMEOUT);
  		return;
  	}
***************
*** 1118,1122 ****
  						out_uint32_le(&out, result);
  						result = buffer_len = out.p - out.data;
! 						status = STATUS_SUCCESS;
  						rdpdr_send_completion(iorq->device, iorq->id,
  								      status, result, buffer,
--- 1118,1122 ----
  						out_uint32_le(&out, result);
  						result = buffer_len = out.p - out.data;
! 						status = RD_STATUS_SUCCESS;
  						rdpdr_send_completion(iorq->device, iorq->id,
  								      status, result, buffer,
***************
*** 1154,1158 ****
  							g_notify_stamp = False;
  							status = disk_check_notify(iorq->fd);
! 							if (status != STATUS_PENDING)
  							{
  								rdpdr_send_completion(iorq->device,
--- 1154,1158 ----
  							g_notify_stamp = False;
  							status = disk_check_notify(iorq->fd);
! 							if (status != RD_STATUS_PENDING)
  							{
  								rdpdr_send_completion(iorq->device,
***************
*** 1199,1203 ****
  /* Abort a pending io request for a given handle and major */
  BOOL
! rdpdr_abort_io(uint32 fd, uint32 major, NTSTATUS status)
  {
  	uint32 result;
--- 1199,1203 ----
  /* Abort a pending io request for a given handle and major */
  BOOL
! rdpdr_abort_io(uint32 fd, uint32 major, RD_NTSTATUS status)
  {
  	uint32 result;

Index: rdpsnd.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdpsnd.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** rdpsnd.c	2 Jan 2007 16:30:06 -0000	1.36
--- rdpsnd.c	4 Jan 2007 04:55:56 -0000	1.37
***************
*** 54,62 ****
  static BOOL rec_device_open;
  
! static WAVEFORMATEX formats[MAX_FORMATS];
  static unsigned int format_count;
  static unsigned int current_format;
  
! static WAVEFORMATEX rec_formats[MAX_FORMATS];
  static unsigned int rec_format_count;
  
--- 54,62 ----
  static BOOL rec_device_open;
  
! static RD_WAVEFORMATEX formats[MAX_FORMATS];
  static unsigned int format_count;
  static unsigned int current_format;
  
! static RD_WAVEFORMATEX rec_formats[MAX_FORMATS];
  static unsigned int rec_format_count;
  
***************
*** 213,217 ****
  	uint8 pad;
  	uint16 version;
! 	WAVEFORMATEX *format;
  	STREAM out;
  	BOOL device_available = False;
--- 213,217 ----
  	uint8 pad;
  	uint16 version;
! 	RD_WAVEFORMATEX *format;
  	STREAM out;
  	BOOL device_available = False;
***************
*** 327,331 ****
  	uint16 in_format_count, i;
  	uint16 version;
! 	WAVEFORMATEX *format;
  	STREAM out;
  	BOOL device_available = False;
--- 327,331 ----
  	uint16 in_format_count, i;
  	uint16 version;
! 	RD_WAVEFORMATEX *format;
  	STREAM out;
  	BOOL device_available = False;

Index: rdpsnd.h
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdpsnd.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** rdpsnd.h	2 Jan 2007 16:30:06 -0000	1.10
--- rdpsnd.h	4 Jan 2007 04:55:56 -0000	1.11
***************
*** 36,47 ****
  	  BOOL(*wave_out_open) (void);
  	void (*wave_out_close) (void);
! 	  BOOL(*wave_out_format_supported) (WAVEFORMATEX * pwfx);
! 	  BOOL(*wave_out_set_format) (WAVEFORMATEX * pwfx);
  	void (*wave_out_volume) (uint16 left, uint16 right);
  
  	  BOOL(*wave_in_open) (void);
  	void (*wave_in_close) (void);
! 	  BOOL(*wave_in_format_supported) (WAVEFORMATEX * pwfx);
! 	  BOOL(*wave_in_set_format) (WAVEFORMATEX * pwfx);
  	void (*wave_in_volume) (uint16 left, uint16 right);
  
--- 36,47 ----
  	  BOOL(*wave_out_open) (void);
  	void (*wave_out_close) (void);
! 	  BOOL(*wave_out_format_supported) (RD_WAVEFORMATEX * pwfx);
! 	  BOOL(*wave_out_set_format) (RD_WAVEFORMATEX * pwfx);
  	void (*wave_out_volume) (uint16 left, uint16 right);
  
  	  BOOL(*wave_in_open) (void);
  	void (*wave_in_close) (void);
! 	  BOOL(*wave_in_format_supported) (RD_WAVEFORMATEX * pwfx);
! 	  BOOL(*wave_in_set_format) (RD_WAVEFORMATEX * pwfx);
  	void (*wave_in_volume) (uint16 left, uint16 right);
  

Index: rdpsnd_alsa.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdpsnd_alsa.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** rdpsnd_alsa.c	2 Jan 2007 16:36:51 -0000	1.15
--- rdpsnd_alsa.c	4 Jan 2007 04:55:56 -0000	1.16
***************
*** 165,169 ****
  
  static BOOL
! alsa_set_format(snd_pcm_t * pcm, WAVEFORMATEX * pwfx)
  {
  	snd_pcm_hw_params_t *hwparams = NULL;
--- 165,169 ----
  
  static BOOL
! alsa_set_format(snd_pcm_t * pcm, RD_WAVEFORMATEX * pwfx)
  {
  	snd_pcm_hw_params_t *hwparams = NULL;

Index: rdpsnd_dsp.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdpsnd_dsp.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** rdpsnd_dsp.c	6 Dec 2006 13:29:42 -0000	1.23
--- rdpsnd_dsp.c	4 Jan 2007 04:55:56 -0000	1.24
***************
*** 51,55 ****
  
  void
! rdpsnd_dsp_softvol(unsigned char *buffer, unsigned int size, WAVEFORMATEX * format)
  {
  	unsigned int factor_left, factor_right;
--- 51,55 ----
  
  void
! rdpsnd_dsp_softvol(unsigned char *buffer, unsigned int size, RD_WAVEFORMATEX * format)
  {
  	unsigned int factor_left, factor_right;
***************
*** 112,116 ****
  
  void
! rdpsnd_dsp_swapbytes(unsigned char *buffer, unsigned int size, WAVEFORMATEX * format)
  {
  	int i;
--- 112,116 ----
  
  void
! rdpsnd_dsp_swapbytes(unsigned char *buffer, unsigned int size, RD_WAVEFORMATEX * format)
  {
  	int i;
***************
*** 160,164 ****
  
  BOOL
! rdpsnd_dsp_resample_supported(WAVEFORMATEX * format)
  {
  	if (format->wFormatTag != WAVE_FORMAT_PCM)
--- 160,164 ----
  
  BOOL
! rdpsnd_dsp_resample_supported(RD_WAVEFORMATEX * format)
  {
  	if (format->wFormatTag != WAVE_FORMAT_PCM)
***************
*** 174,178 ****
  uint32
  rdpsnd_dsp_resample(unsigned char **out, unsigned char *in, unsigned int size,
! 		    WAVEFORMATEX * format, BOOL stream_be)
  {
  #ifdef HAVE_LIBSAMPLERATE
--- 174,178 ----
  uint32
  rdpsnd_dsp_resample(unsigned char **out, unsigned char *in, unsigned int size,
! 		    RD_WAVEFORMATEX * format, BOOL stream_be)
  {
  #ifdef HAVE_LIBSAMPLERATE
***************
*** 386,390 ****
  STREAM
  rdpsnd_dsp_process(unsigned char *data, unsigned int size, struct audio_driver * current_driver,
! 		   WAVEFORMATEX * format)
  {
  	static struct stream out;
--- 386,390 ----
  STREAM
  rdpsnd_dsp_process(unsigned char *data, unsigned int size, struct audio_driver * current_driver,
! 		   RD_WAVEFORMATEX * format)
  {
  	static struct stream out;

Index: rdpsnd_dsp.h
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdpsnd_dsp.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** rdpsnd_dsp.h	6 Dec 2006 13:29:42 -0000	1.4
--- rdpsnd_dsp.h	4 Jan 2007 04:55:56 -0000	1.5
***************
*** 25,30 ****
  BOOL rdpsnd_dsp_resample_set(uint32 device_srate, uint16 device_bitspersample,
  			     uint16 device_channels);
! BOOL rdpsnd_dsp_resample_supported(WAVEFORMATEX * pwfx);
  
  STREAM rdpsnd_dsp_process(unsigned char *data, unsigned int size,
! 			  struct audio_driver *current_driver, WAVEFORMATEX * format);
--- 25,30 ----
  BOOL rdpsnd_dsp_resample_set(uint32 device_srate, uint16 device_bitspersample,
  			     uint16 device_channels);
! BOOL rdpsnd_dsp_resample_supported(RD_WAVEFORMATEX * pwfx);
  
  STREAM rdpsnd_dsp_process(unsigned char *data, unsigned int size,
! 			  struct audio_driver *current_driver, RD_WAVEFORMATEX * format);

Index: rdpsnd_libao.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdpsnd_libao.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** rdpsnd_libao.c	2 Jan 2007 11:39:56 -0000	1.35
--- rdpsnd_libao.c	4 Jan 2007 04:55:56 -0000	1.36
***************
*** 107,111 ****
  
  BOOL
! libao_set_format(WAVEFORMATEX * pwfx)
  {
  	ao_sample_format format;
--- 107,111 ----
  
  BOOL
! libao_set_format(RD_WAVEFORMATEX * pwfx)
  {
  	ao_sample_format format;

Index: rdpsnd_oss.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdpsnd_oss.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** rdpsnd_oss.c	2 Jan 2007 16:37:54 -0000	1.35
--- rdpsnd_oss.c	4 Jan 2007 04:55:56 -0000	1.36
***************
*** 220,224 ****
  
  BOOL
! oss_format_supported(WAVEFORMATEX * pwfx)
  {
  	if (pwfx->wFormatTag != WAVE_FORMAT_PCM)
--- 220,224 ----
  
  BOOL
! oss_format_supported(RD_WAVEFORMATEX * pwfx)
  {
  	if (pwfx->wFormatTag != WAVE_FORMAT_PCM)
***************
*** 233,237 ****
  
  BOOL
! oss_set_format(WAVEFORMATEX * pwfx)
  {
  	int fragments;
--- 233,237 ----
  
  BOOL
! oss_set_format(RD_WAVEFORMATEX * pwfx)
  {
  	int fragments;

Index: rdpsnd_sgi.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdpsnd_sgi.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** rdpsnd_sgi.c	2 Jan 2007 11:39:56 -0000	1.21
--- rdpsnd_sgi.c	4 Jan 2007 04:55:56 -0000	1.22
***************
*** 129,133 ****
  
  BOOL
! sgi_format_supported(WAVEFORMATEX * pwfx)
  {
  	if (pwfx->wFormatTag != WAVE_FORMAT_PCM)
--- 129,133 ----
  
  BOOL
! sgi_format_supported(RD_WAVEFORMATEX * pwfx)
  {
  	if (pwfx->wFormatTag != WAVE_FORMAT_PCM)
***************
*** 142,146 ****
  
  BOOL
! sgi_set_format(WAVEFORMATEX * pwfx)
  {
  	int channels;
--- 142,146 ----
  
  BOOL
! sgi_set_format(RD_WAVEFORMATEX * pwfx)
  {
  	int channels;

Index: rdpsnd_sun.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdpsnd_sun.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** rdpsnd_sun.c	2 Jan 2007 11:39:56 -0000	1.28
--- rdpsnd_sun.c	4 Jan 2007 04:55:56 -0000	1.29
***************
*** 101,105 ****
  
  BOOL
! sun_format_supported(WAVEFORMATEX * pwfx)
  {
  	if (pwfx->wFormatTag != WAVE_FORMAT_PCM)
--- 101,105 ----
  
  BOOL
! sun_format_supported(RD_WAVEFORMATEX * pwfx)
  {
  	if (pwfx->wFormatTag != WAVE_FORMAT_PCM)
***************
*** 114,118 ****
  
  BOOL
! sun_set_format(WAVEFORMATEX * pwfx)
  {
  	audio_info_t info;
--- 114,118 ----
  
  BOOL
! sun_set_format(RD_WAVEFORMATEX * pwfx)
  {
  	audio_info_t info;

Index: serial.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/serial.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** serial.c	3 Aug 2005 10:56:16 -0000	1.29
--- serial.c	4 Jan 2007 04:55:56 -0000	1.30
***************
*** 3,12 ****
  
     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
--- 3,12 ----
  
     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
***************
*** 151,155 ****
  
  static SERIAL_DEVICE *
! get_serial_info(NTHANDLE handle)
  {
  	int index;
--- 151,155 ----
  
  static SERIAL_DEVICE *
! get_serial_info(RD_NTHANDLE handle)
  {
  	int index;
***************
*** 164,168 ****
  
  static BOOL
! get_termios(SERIAL_DEVICE * pser_inf, NTHANDLE serial_fd)
  {
  	speed_t speed;
--- 164,168 ----
  
  static BOOL
! get_termios(SERIAL_DEVICE * pser_inf, RD_NTHANDLE serial_fd)
  {
  	speed_t speed;
***************
*** 317,321 ****
  
  static void
! set_termios(SERIAL_DEVICE * pser_inf, NTHANDLE serial_fd)
  {
  	speed_t speed;
--- 317,321 ----
  
  static void
! set_termios(SERIAL_DEVICE * pser_inf, RD_NTHANDLE serial_fd)
  {
  	speed_t speed;
***************
*** 554,562 ****
  }
  
! static NTSTATUS
  serial_create(uint32 device_id, uint32 access, uint32 share_mode, uint32 disposition,
! 	      uint32 flags_and_attributes, char *filename, NTHANDLE * handle)
  {
! 	NTHANDLE serial_fd;
  	SERIAL_DEVICE *pser_inf;
  	struct termios *ptermios;
--- 554,562 ----
  }
  
! static RD_NTSTATUS
  serial_create(uint32 device_id, uint32 access, uint32 share_mode, uint32 disposition,
! 	      uint32 flags_and_attributes, char *filename, RD_NTHANDLE * handle)
  {
! 	RD_NTHANDLE serial_fd;
  	SERIAL_DEVICE *pser_inf;
  	struct termios *ptermios;
***************
*** 569,573 ****
  	{
  		perror("open");
! 		return STATUS_ACCESS_DENIED;
  	}
  
--- 569,573 ----
  	{
  		perror("open");
! 		return RD_STATUS_ACCESS_DENIED;
  	}
  
***************
*** 576,580 ****
  		printf("INFO: SERIAL %s access denied\n", g_rdpdr_device[device_id].name);
  		fflush(stdout);
! 		return STATUS_ACCESS_DENIED;
  	}
  
--- 576,580 ----
  		printf("INFO: SERIAL %s access denied\n", g_rdpdr_device[device_id].name);
  		fflush(stdout);
! 		return RD_STATUS_ACCESS_DENIED;
  	}
  
***************
*** 608,616 ****
  	pser_inf->read_total_timeout_constant = 5;
  
! 	return STATUS_SUCCESS;
  }
  
! static NTSTATUS
! serial_close(NTHANDLE handle)
  {
  	int i = get_device_index(handle);
--- 608,616 ----
  	pser_inf->read_total_timeout_constant = 5;
  
! 	return RD_STATUS_SUCCESS;
  }
  
! static RD_NTSTATUS
! serial_close(RD_NTHANDLE handle)
  {
  	int i = get_device_index(handle);
***************
*** 618,628 ****
  		g_rdpdr_device[i].handle = 0;
  
! 	rdpdr_abort_io(handle, 0, STATUS_TIMEOUT);
  	close(handle);
! 	return STATUS_SUCCESS;
  }
  
! static NTSTATUS
! serial_read(NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result)
  {
  	long timeout;
--- 618,628 ----
  		g_rdpdr_device[i].handle = 0;
  
! 	rdpdr_abort_io(handle, 0, RD_STATUS_TIMEOUT);
  	close(handle);
! 	return RD_STATUS_SUCCESS;
  }
  
! static RD_NTSTATUS
! serial_read(RD_NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result)
  {
  	long timeout;
***************
*** 679,687 ****
  #endif
  
! 	return STATUS_SUCCESS;
  }
  
! static NTSTATUS
! serial_write(NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result)
  {
  	SERIAL_DEVICE *pser_inf;
--- 679,687 ----
  #endif
  
! 	return RD_STATUS_SUCCESS;
  }
  
! static RD_NTSTATUS
! serial_write(RD_NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result)
  {
  	SERIAL_DEVICE *pser_inf;
***************
*** 696,704 ****
  	DEBUG_SERIAL(("serial_write length %d, offset %d result %d\n", length, offset, *result));
  
! 	return STATUS_SUCCESS;
  }
  
! static NTSTATUS
! serial_device_control(NTHANDLE handle, uint32 request, STREAM in, STREAM out)
  {
  	int flush_mask, purge_mask;
--- 696,704 ----
  	DEBUG_SERIAL(("serial_write length %d, offset %d result %d\n", length, offset, *result));
  
! 	return RD_STATUS_SUCCESS;
  }
  
! static RD_NTSTATUS
! serial_device_control(RD_NTHANDLE handle, uint32 request, STREAM in, STREAM out)
  {
  	int flush_mask, purge_mask;
***************
*** 709,713 ****
  
  	if ((request >> 16) != FILE_DEVICE_SERIAL_PORT)
! 		return STATUS_INVALID_PARAMETER;
  
  	pser_inf = get_serial_info(handle);
--- 709,713 ----
  
  	if ((request >> 16) != FILE_DEVICE_SERIAL_PORT)
! 		return RD_STATUS_INVALID_PARAMETER;
  
  	pser_inf = get_serial_info(handle);
***************
*** 905,911 ****
  				tcflush(handle, flush_mask);
  			if (purge_mask & SERIAL_PURGE_TXABORT)
! 				rdpdr_abort_io(handle, 4, STATUS_CANCELLED);
  			if (purge_mask & SERIAL_PURGE_RXABORT)
! 				rdpdr_abort_io(handle, 3, STATUS_CANCELLED);
  			break;
  		case SERIAL_WAIT_ON_MASK:
--- 905,911 ----
  				tcflush(handle, flush_mask);
  			if (purge_mask & SERIAL_PURGE_TXABORT)
! 				rdpdr_abort_io(handle, 4, RD_STATUS_CANCELLED);
  			if (purge_mask & SERIAL_PURGE_RXABORT)
! 				rdpdr_abort_io(handle, 3, RD_STATUS_CANCELLED);
  			break;
  		case SERIAL_WAIT_ON_MASK:
***************
*** 919,923 ****
  				break;
  			}
! 			return STATUS_PENDING;
  			break;
  		case SERIAL_SET_BREAK_ON:
--- 919,923 ----
  				break;
  			}
! 			return RD_STATUS_PENDING;
  			break;
  		case SERIAL_SET_BREAK_ON:
***************
*** 940,951 ****
  		default:
  			unimpl("SERIAL IOCTL %d\n", request);
! 			return STATUS_INVALID_PARAMETER;
  	}
  
! 	return STATUS_SUCCESS;
  }
  
  BOOL
! serial_get_event(NTHANDLE handle, uint32 * result)
  {
  	int index;
--- 940,951 ----
  		default:
  			unimpl("SERIAL IOCTL %d\n", request);
! 			return RD_STATUS_INVALID_PARAMETER;
  	}
  
! 	return RD_STATUS_SUCCESS;
  }
  
  BOOL
! serial_get_event(RD_NTHANDLE handle, uint32 * result)
  {
  	int index;
***************
*** 1045,1049 ****
  /* Read timeout for a given file descripter (device) when adding fd's to select() */
  BOOL
! serial_get_timeout(NTHANDLE handle, uint32 length, uint32 * timeout, uint32 * itv_timeout)
  {
  	int index;
--- 1045,1049 ----
  /* Read timeout for a given file descripter (device) when adding fd's to select() */
  BOOL
! serial_get_timeout(RD_NTHANDLE handle, uint32 length, uint32 * timeout, uint32 * itv_timeout)
  {
  	int index;

Index: types.h
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/types.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** types.h	1 Nov 2006 21:23:08 -0000	1.30
--- types.h	4 Jan 2007 04:55:56 -0000	1.31
***************
*** 3,7 ****
     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
--- 3,7 ----
     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
***************
*** 13,17 ****
     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
--- 13,17 ----
     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
***************
*** 41,54 ****
  typedef signed int sint32;
  
! typedef void *HBITMAP;
! typedef void *HGLYPH;
! typedef void *HCOLOURMAP;
! typedef void *HCURSOR;
  
! typedef struct _POINT
  {
  	sint16 x, y;
  }
! POINT;
  
  typedef struct _COLOURENTRY
--- 41,54 ----
  typedef signed int sint32;
  
! typedef void *RD_HBITMAP;
! typedef void *RD_HGLYPH;
! typedef void *RD_HCOLOURMAP;
! typedef void *RD_HCURSOR;
  
! typedef struct _RD_POINT
  {
  	sint16 x, y;
  }
! RD_POINT;
  
  typedef struct _COLOURENTRY
***************
*** 104,108 ****
  	uint16 width;
  	uint16 height;
! 	HBITMAP pixmap;
  
  }
--- 104,108 ----
  	uint16 width;
  	uint16 height;
! 	RD_HBITMAP pixmap;
  
  }
***************
*** 154,158 ****
  
  /* RDPSND */
! typedef struct
  {
  	uint16 wFormatTag;
--- 154,158 ----
  
  /* RDPSND */
! typedef struct _RD_WAVEFORMATEX
  {
  	uint16 wFormatTag;
***************
*** 164,168 ****
  	uint16 cbSize;
  	uint8 cb[MAX_CBSIZE];
! } WAVEFORMATEX;
  
  typedef struct _RDPCOMP
--- 164,168 ----
  	uint16 cbSize;
  	uint8 cb[MAX_CBSIZE];
! } RD_WAVEFORMATEX;
  
  typedef struct _RDPCOMP
***************
*** 175,192 ****
  
  /* RDPDR */
! typedef uint32 NTSTATUS;
! typedef uint32 NTHANDLE;
  
  typedef struct _DEVICE_FNS
  {
! 	NTSTATUS(*create) (uint32 device, uint32 desired_access, uint32 share_mode,
! 			   uint32 create_disposition, uint32 flags_and_attributes, char *filename,
! 			   NTHANDLE * handle);
! 	NTSTATUS(*close) (NTHANDLE handle);
! 	NTSTATUS(*read) (NTHANDLE handle, uint8 * data, uint32 length, uint32 offset,
! 			 uint32 * result);
! 	NTSTATUS(*write) (NTHANDLE handle, uint8 * data, uint32 length, uint32 offset,
! 			  uint32 * result);
! 	NTSTATUS(*device_control) (NTHANDLE handle, uint32 request, STREAM in, STREAM out);
  }
  DEVICE_FNS;
--- 175,192 ----
  
  /* RDPDR */
! typedef uint32 RD_NTSTATUS;
! typedef uint32 RD_NTHANDLE;
  
  typedef struct _DEVICE_FNS
  {
! 	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);
  }
  DEVICE_FNS;
***************
*** 196,200 ****
  {
  	uint32 device_type;
! 	NTHANDLE handle;
  	char name[8];
  	char *local_path;
--- 196,200 ----
  {
  	uint32 device_type;
! 	RD_NTHANDLE handle;
  	char name[8];
  	char *local_path;

Index: xwin.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/xwin.c,v
retrieving revision 1.217
retrieving revision 1.218
diff -C2 -d -r1.217 -r1.218
*** xwin.c	7 Dec 2006 15:23:45 -0000	1.217
--- xwin.c	4 Jan 2007 04:55:56 -0000	1.218
***************
*** 106,110 ****
  static XModifierKeymap *g_mod_map;
  static Cursor g_current_cursor;
! static HCURSOR g_null_cursor = NULL;
  static Atom g_protocol_atom, g_kill_atom;
  extern Atom g_net_wm_state_atom;
--- 106,110 ----
  static XModifierKeymap *g_mod_map;
  static Cursor g_current_cursor;
! static RD_HCURSOR g_null_cursor = NULL;
  static Atom g_protocol_atom, g_kill_atom;
  extern Atom g_net_wm_state_atom;
***************
*** 2315,2319 ****
  }
  
! HBITMAP
  ui_create_bitmap(int width, int height, uint8 * data)
  {
--- 2315,2319 ----
  }
  
! RD_HBITMAP
  ui_create_bitmap(int width, int height, uint8 * data)
  {
***************
*** 2345,2349 ****
  	if (tdata != data)
  		xfree(tdata);
! 	return (HBITMAP) bitmap;
  }
  
--- 2345,2349 ----
  	if (tdata != data)
  		xfree(tdata);
! 	return (RD_HBITMAP) bitmap;
  }
  
***************
*** 2393,2402 ****
  
  void
! ui_destroy_bitmap(HBITMAP bmp)
  {
  	XFreePixmap(g_display, (Pixmap) bmp);
  }
  
! HGLYPH
  ui_create_glyph(int width, int height, uint8 * data)
  {
--- 2393,2402 ----
  
  void
! ui_destroy_bitmap(RD_HBITMAP bmp)
  {
  	XFreePixmap(g_display, (Pixmap) bmp);
  }
  
! RD_HGLYPH
  ui_create_glyph(int width, int height, uint8 * data)
  {
***************
*** 2420,2437 ****
  
  	XFree(image);
! 	return (HGLYPH) bitmap;
  }
  
  void
! ui_destroy_glyph(HGLYPH glyph)
  {
  	XFreePixmap(g_display, (Pixmap) glyph);
  }
  
! HCURSOR
  ui_create_cursor(unsigned int x, unsigned int y, int width, int height,
  		 uint8 * andmask, uint8 * xormask)
  {
! 	HGLYPH maskglyph, cursorglyph;
  	XColor bg, fg;
  	Cursor xcursor;
--- 2420,2437 ----
  
  	XFree(image);
! 	return (RD_HGLYPH) bitmap;
  }
  
  void
! ui_destroy_glyph(RD_HGLYPH glyph)
  {
  	XFreePixmap(g_display, (Pixmap) glyph);
  }
  
! RD_HCURSOR
  ui_create_cursor(unsigned int x, unsigned int y, int width, int height,
  		 uint8 * andmask, uint8 * xormask)
  {
! 	RD_HGLYPH maskglyph, cursorglyph;
  	XColor bg, fg;
  	Cursor xcursor;
***************
*** 2497,2505 ****
  	xfree(mask);
  	xfree(cursor);
! 	return (HCURSOR) xcursor;
  }
  
  void
! ui_set_cursor(HCURSOR cursor)
  {
  	g_current_cursor = (Cursor) cursor;
--- 2497,2505 ----
  	xfree(mask);
  	xfree(cursor);
! 	return (RD_HCURSOR) xcursor;
  }
  
  void
! ui_set_cursor(RD_HCURSOR cursor)
  {
  	g_current_cursor = (Cursor) cursor;
***************
*** 2509,2513 ****
  
  void
! ui_destroy_cursor(HCURSOR cursor)
  {
  	XFreeCursor(g_display, (Cursor) cursor);
--- 2509,2513 ----
  
  void
! ui_destroy_cursor(RD_HCURSOR cursor)
  {
  	XFreeCursor(g_display, (Cursor) cursor);
***************
*** 2527,2531 ****
  
  
! HCOLOURMAP
  ui_create_colourmap(COLOURMAP * colours)
  {
--- 2527,2531 ----
  
  
! RD_HCOLOURMAP
  ui_create_colourmap(COLOURMAP * colours)
  {
***************
*** 2623,2632 ****
  
  		xfree(xcolours);
! 		return (HCOLOURMAP) map;
  	}
  }
  
  void
! ui_destroy_colourmap(HCOLOURMAP map)
  {
  	if (!g_owncolmap)
--- 2623,2632 ----
  
  		xfree(xcolours);
! 		return (RD_HCOLOURMAP) map;
  	}
  }
  
  void
! ui_destroy_colourmap(RD_HCOLOURMAP map)
  {
  	if (!g_owncolmap)
***************
*** 2637,2641 ****
  
  void
! ui_set_colourmap(HCOLOURMAP map)
  {
  	if (!g_owncolmap)
--- 2637,2641 ----
  
  void
! ui_set_colourmap(RD_HCOLOURMAP map)
  {
  	if (!g_owncolmap)
***************
*** 2725,2729 ****
  			XSetFillStyle(g_display, g_gc, FillSolid);
  			XSetTSOrigin(g_display, g_gc, 0, 0);
! 			ui_destroy_glyph((HGLYPH) fill);
  			break;
  
--- 2725,2729 ----
  			XSetFillStyle(g_display, g_gc, FillSolid);
  			XSetTSOrigin(g_display, g_gc, 0, 0);
! 			ui_destroy_glyph((RD_HGLYPH) fill);
  			break;
  
***************
*** 2740,2744 ****
  			XSetFillStyle(g_display, g_gc, FillSolid);
  			XSetTSOrigin(g_display, g_gc, 0, 0);
! 			ui_destroy_glyph((HGLYPH) fill);
  			break;
  
--- 2740,2744 ----
  			XSetFillStyle(g_display, g_gc, FillSolid);
  			XSetTSOrigin(g_display, g_gc, 0, 0);
! 			ui_destroy_glyph((RD_HGLYPH) fill);
  			break;
  
***************
*** 2783,2787 ****
  ui_memblt(uint8 opcode,
  	  /* dest */ int x, int y, int cx, int cy,
! 	  /* src */ HBITMAP src, int srcx, int srcy)
  {
  	SET_FUNCTION(opcode);
--- 2783,2787 ----
  ui_memblt(uint8 opcode,
  	  /* dest */ int x, int y, int cx, int cy,
! 	  /* src */ RD_HBITMAP src, int srcx, int srcy)
  {
  	SET_FUNCTION(opcode);
***************
*** 2798,2802 ****
  ui_triblt(uint8 opcode,
  	  /* dest */ int x, int y, int cx, int cy,
! 	  /* src */ HBITMAP src, int srcx, int srcy,
  	  /* brush */ BRUSH * brush, int bgcolour, int fgcolour)
  {
--- 2798,2802 ----
  ui_triblt(uint8 opcode,
  	  /* dest */ int x, int y, int cx, int cy,
! 	  /* src */ RD_HBITMAP src, int srcx, int srcy,
  	  /* brush */ BRUSH * brush, int bgcolour, int fgcolour)
  {
***************
*** 2856,2860 ****
  ui_polygon(uint8 opcode,
  	   /* mode */ uint8 fillmode,
! 	   /* dest */ POINT * point, int npoints,
  	   /* brush */ BRUSH * brush, int bgcolour, int fgcolour)
  {
--- 2856,2860 ----
  ui_polygon(uint8 opcode,
  	   /* mode */ uint8 fillmode,
! 	   /* dest */ RD_POINT * point, int npoints,
  	   /* brush */ BRUSH * brush, int bgcolour, int fgcolour)
  {
***************
*** 2899,2903 ****
  			XSetFillStyle(g_display, g_gc, FillSolid);
  			XSetTSOrigin(g_display, g_gc, 0, 0);
! 			ui_destroy_glyph((HGLYPH) fill);
  			break;
  
--- 2899,2903 ----
  			XSetFillStyle(g_display, g_gc, FillSolid);
  			XSetTSOrigin(g_display, g_gc, 0, 0);
! 			ui_destroy_glyph((RD_HGLYPH) fill);
  			break;
  
***************
*** 2914,2918 ****
  			XSetFillStyle(g_display, g_gc, FillSolid);
  			XSetTSOrigin(g_display, g_gc, 0, 0);
! 			ui_destroy_glyph((HGLYPH) fill);
  			break;
  
--- 2914,2918 ----
  			XSetFillStyle(g_display, g_gc, FillSolid);
  			XSetTSOrigin(g_display, g_gc, 0, 0);
! 			ui_destroy_glyph((RD_HGLYPH) fill);
  			break;
  
***************
*** 2926,2930 ****
  void
  ui_polyline(uint8 opcode,
! 	    /* dest */ POINT * points, int npoints,
  	    /* pen */ PEN * pen)
  {
--- 2926,2930 ----
  void
  ui_polyline(uint8 opcode,
! 	    /* dest */ RD_POINT * points, int npoints,
  	    /* pen */ PEN * pen)
  {
***************
*** 2977,2981 ****
  			XSetFillStyle(g_display, g_gc, FillSolid);
  			XSetTSOrigin(g_display, g_gc, 0, 0);
! 			ui_destroy_glyph((HGLYPH) fill);
  			break;
  
--- 2977,2981 ----
  			XSetFillStyle(g_display, g_gc, FillSolid);
  			XSetTSOrigin(g_display, g_gc, 0, 0);
! 			ui_destroy_glyph((RD_HGLYPH) fill);
  			break;
  
***************
*** 2992,2996 ****
  			XSetFillStyle(g_display, g_gc, FillSolid);
  			XSetTSOrigin(g_display, g_gc, 0, 0);
! 			ui_destroy_glyph((HGLYPH) fill);
  			break;
  
--- 2992,2996 ----
  			XSetFillStyle(g_display, g_gc, FillSolid);
  			XSetTSOrigin(g_display, g_gc, 0, 0);
! 			ui_destroy_glyph((RD_HGLYPH) fill);
  			break;
  
***************
*** 3006,3010 ****
  ui_draw_glyph(int mixmode,
  	      /* dest */ int x, int y, int cx, int cy,
! 	      /* src */ HGLYPH glyph, int srcx, int srcy,
  	      int bgcolour, int fgcolour)
  {
--- 3006,3010 ----
  ui_draw_glyph(int mixmode,
  	      /* dest */ int x, int y, int cx, int cy,
! 	      /* src */ RD_HGLYPH glyph, int srcx, int srcy,
  	      int bgcolour, int fgcolour)
  {


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV