Throughout, use user32 UNICODE functions rather than ANSI functions.

* autoload.cc: Convert all definitions for ANSI user32 functions to
	definitions for the corresponding UNICODE function.
	(SendMessageA): Remove.
	(SendNotifyMessageW): Define.
	* fhandler_windows.cc (fhandler_windows::write): Use SendNotifyMessageW
	call rather than SendMessage to make function always return immediately.
	(fhandler_windows::read): Make function interruptible and a cancellation
	point.  Handle O_NONBLOCK.
	* select.cc (peek_serial): Don't wait for signal_arrived here.
	* window.cc (wininfo::winthread): Call CreateWindowExW directly rather
	than CreateWindow wrapper.
This commit is contained in:
Corinna Vinschen
2011-05-01 14:35:12 +00:00
parent c60d0bbe68
commit 79e741ef6f
7 changed files with 93 additions and 63 deletions

View File

@ -1,7 +1,6 @@
/* fhandler_dev_clipboard: code to access /dev/clipboard
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009
Red Hat, Inc
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009, 2011 Red Hat, Inc
Written by Charles Wilson (cwilson@ece.gatech.edu)
@ -25,7 +24,7 @@ details. */
* changed? How does /dev/clipboard operate under (say) linux?
*/
static const NO_COPY char *CYGWIN_NATIVE = "CYGWIN_NATIVE_CLIPBOARD";
static const NO_COPY WCHAR *CYGWIN_NATIVE = L"CYGWIN_NATIVE_CLIPBOARD";
/* this is MT safe because windows format id's are atomic */
static int cygnativeformat;
@ -35,7 +34,7 @@ fhandler_dev_clipboard::fhandler_dev_clipboard ()
{
/* FIXME: check for errors and loop until we can open the clipboard */
OpenClipboard (NULL);
cygnativeformat = RegisterClipboardFormat (CYGWIN_NATIVE);
cygnativeformat = RegisterClipboardFormatW (CYGWIN_NATIVE);
CloseClipboard ();
}
@ -69,7 +68,7 @@ fhandler_dev_clipboard::open (int flags, mode_t)
free (membuffer);
membuffer = NULL;
if (!cygnativeformat)
cygnativeformat = RegisterClipboardFormat (CYGWIN_NATIVE);
cygnativeformat = RegisterClipboardFormatW (CYGWIN_NATIVE);
nohandle (true);
set_open_status ();
return 1;
@ -96,7 +95,7 @@ set_clipboard (const void *buf, size_t len)
GlobalUnlock (hmem);
EmptyClipboard ();
if (!cygnativeformat)
cygnativeformat = RegisterClipboardFormat (CYGWIN_NATIVE);
cygnativeformat = RegisterClipboardFormatW (CYGWIN_NATIVE);
HANDLE ret = SetClipboardData (cygnativeformat, hmem);
CloseClipboard ();
/* According to MSDN, hmem must not be free'd after transferring the