changeset 4903:70089046adef

fix compile problems in intl-encap* under VS6 -------------------- ChangeLog entries follow: -------------------- lib-src/ChangeLog addition: 2010-01-30 Ben Wing <ben@xemacs.org> * make-mswin-unicode.pl: Make it possible to specify an overridden prototype in cases where either Cygwin or Visual Studio has errors in their headers that can be corrected by falling back to a less qualified type (typically without const). src/ChangeLog addition: 2010-01-30 Ben Wing <ben@xemacs.org> * intl-auto-encap-win32.c: * intl-auto-encap-win32.c (qxeExtractAssociatedIcon): * intl-auto-encap-win32.c (qxeExtractIconEx): * intl-auto-encap-win32.c (qxeCreateMDIWindow): * intl-auto-encap-win32.c (qxeCreateWindowStation): * intl-auto-encap-win32.c (qxeDdeCreateStringHandle): * intl-auto-encap-win32.c (qxeAbortSystemShutdown): * intl-auto-encap-win32.c (qxeRegConnectRegistry): * intl-auto-encap-win32.c (qxeGetICMProfile): * intl-auto-encap-win32.h: Rebuild. * intl-encap-win32.c: * intl-encap-win32.c (qxeUpdateICMRegKey): Delete manual definitions of functions with former errors in Cygwin headers but no longer. Use "override" with some functions where Cygwin or VS6 accidentally omits a const declaration or includes an extra one. Use "no" on SendMessageTimeout, which has an error in the VS6 prototype (you could manually fix this with an ifdef to split the Cygwin vs. VS6 calls, if we ever actually used this function).
author Ben Wing <ben@xemacs.org>
date Sat, 30 Jan 2010 20:34:23 -0600
parents c902301f8b7d
children e91e3e353805 6ef8256a020a
files lib-src/ChangeLog lib-src/make-mswin-unicode.pl src/ChangeLog src/intl-auto-encap-win32.c src/intl-auto-encap-win32.h src/intl-encap-win32.c
diffstat 6 files changed, 227 insertions(+), 134 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/ChangeLog	Sat Jan 30 18:47:17 2010 -0600
+++ b/lib-src/ChangeLog	Sat Jan 30 20:34:23 2010 -0600
@@ -1,3 +1,11 @@
+2010-01-30  Ben Wing  <ben@xemacs.org>
+
+	* make-mswin-unicode.pl:
+	Make it possible to specify an overridden prototype in cases where
+	either Cygwin or Visual Studio has errors in their headers that
+	can be corrected by falling back to a less qualified type (typically
+	without const).
+
 2010-01-28  Jerry James  <james@xemacs.org>
 
 	* Makefile.in.in: Remove make-msgfile and make-po rules.
--- a/lib-src/make-mswin-unicode.pl	Sat Jan 30 18:47:17 2010 -0600
+++ b/lib-src/make-mswin-unicode.pl	Sat Jan 30 20:34:23 2010 -0600
@@ -156,6 +156,43 @@
 my $current_file;
 my @current_bracket;
 
+my ($ws_re, $must_ws_re, $tok_ch) =
+  ("\\s*", "\\s+", "\\w");
+# unfortunately there is no surefire way short of
+# parsing all include files for typedefs to
+# distinguish types from parameters, and prototypes
+# appear in the include files both with and without
+# parameters -- the latter kinds appear in a very
+# different style and were obviously added later.  so
+# we rely on the fact that defined types are all
+# upper-case, and parameters generally are not, and
+# special-case the exceptions.
+my $typeword_re =
+  # note the negative lookahead assertions: the first
+  # one excludes the words "X" and "Y" from type
+  # words, since they appear as parameter names in
+  # CreateWindowEx; the second prevents "void
+  # *Argument" from being parsed as a type "void *A"
+  # followed by a parameter "rgument".
+  "(?:(?!(?:X\\b|Y\\b))(?:unsigned|int|long|const|short|va_list|[A-Z_0-9]+)(?!${tok_ch}))";
+my $typetoken_re = "(?:$typeword_re$ws_re\\**$ws_re)";
+# Regexp matching a particular argument
+my $arg_re = "(?:(?:$typetoken_re+)(?:${tok_ch}+)?(?: OPTIONAL)?)";
+# Same, but with groups to match the type and name
+my $argmatch_re = "(?:($typetoken_re+)(${tok_ch}+)?(?: OPTIONAL)?)";
+# regexp matching a parenthesized argument list in a prototype
+my $args_re = "\\(((?:${ws_re}${arg_re}${ws_re},)*${ws_re}${arg_re}${ws_re})\\)";
+# regexp matching a return type in a protype
+my $rettype_re = "(SHSTDAPI_\\(${tok_ch}+\\)|${tok_ch}" . "[A-Za-z_0-9 \t\n\r\f]*?${tok_ch})";
+# regexp matching a function name
+my $funname_re = "(${tok_ch}+)";
+# Regexp matching a function prototype, $1 = rettype, $2 = name, $3 = args
+my $fun_re = "${rettype_re}${ws_re}${funname_re}${ws_re}${args_re};";
+# Regexp matching a particular Unicode function (ending in ...W)
+my $wfun_re = "${rettype_re}${ws_re}${funname_re}W${ws_re}${args_re};";
+
+# print "regexp: $wfun_re\n";
+
 while (<>)
   {
     chomp;
@@ -176,7 +213,7 @@
       {
 	next if (m!^//!);
 	next if (/^[ \t]*$/);
-	if (/(file|yes|soon|no|review|skip|split|begin-bracket|end-bracket)(?: (.*))?/)
+	if (/(file|yes|soon|no|review|skip|split|begin-bracket|end-bracket|override)(?: (.*))?/)
 	  {
 	    my ($command, $parms) = ($1, $2);
 	    if ($command eq "file")
@@ -200,6 +237,15 @@
 	      {
 		pop @current_bracket;
 	      }
+	    elsif ($command eq "override")
+	      {
+		die "Cannot parse prototype $parms" unless $parms =~ /$wfun_re(?: ?(.*))?/;
+		my ($rettype, $fun, $args, $reason) = ($1, $2, $3, $4);
+		$files{$current_file}{$fun} =
+		  [$command, $reason, $rettype, $fun, $args];
+		$bracket{$current_file}{$fun} =
+		  $current_bracket[$#current_bracket];
+	      }
 	    else
 	      {
 		my ($fun, $reason) = split /\s+/, $parms, 2;
@@ -233,31 +279,7 @@
 
 ";
 
-    my ($ws_re, $must_ws_re, $tok_ch) =
-      ("\\s*", "\\s+", "\\w");
-    # unfortunately there is no surefire way short of
-    # parsing all include files for typedefs to
-    # distinguish types from parameters, and prototypes
-    # appear in the include files both with and without
-    # parameters -- the latter kinds appear in a very
-    # different style and were obviously added later.  so
-    # we rely on the fact that defined types are all
-    # upper-case, and parameters generally are not, and
-    # special-case the exceptions.
-    my $typeword_re =
-      # note the negative lookahead assertions: the first
-      # one excludes the words "X" and "Y" from type
-      # words, since they appear as parameter names in
-      # CreateWindowEx; the second prevents "void
-      # *Argument" from being parsed as a type "void *A"
-      # followed by a parameter "rgument".
-      "(?:(?!(?:X\\b|Y\\b))(?:unsigned|int|long|const|short|va_list|[A-Z_0-9]+)(?!${tok_ch}))";
-    my $typetoken_re = "(?:$typeword_re$ws_re\\**$ws_re)";
-    my $arg_re = "(?:($typetoken_re+)(${tok_ch}+)?(?: OPTIONAL)?)";
-    my $fun_re = "(SHSTDAPI_\\(${tok_ch}+\\)|${tok_ch}" . "[A-Za-z_0-9 \t\n\r\f]*?${tok_ch})${ws_re}(${tok_ch}+)W${ws_re}\\(((${ws_re}${arg_re}${ws_re},)*${ws_re}${arg_re}${ws_re})\\);";
-
-    # print "regexp: $fun_re\n";
-    while ($slurp =~ /$fun_re/g)
+    while ($slurp =~ /$wfun_re/g)
       {
 	my ($rettype, $fun, $args) = ($1, $2, $3);
 
@@ -271,7 +293,12 @@
 
 	print "Processing: $fun";
 
-	my ($command, $reason) = ($files{$file}{$fun}[0], $files{$file}{$fun}[1]);
+	#my ($command, $reason) = ($files{$file}{$fun}[0], $files{$file}{$fun}[1]);
+	# Fuck perl!  There seems to be no way to write something like
+	# my ($command, $reason) = @$files{$file}{$fun};
+	# You have to use a temporary var.
+	my $filesarr = $files{$file}{$fun};
+	my ($command, $reason) = @$filesarr;
 	if (!defined ($command))
 	  {
 	    print " (no command found)\n";
@@ -327,8 +354,21 @@
 		  {
 		    ($split_struct, $reason) = split /\s+/, $reason, 2;
 		  }
+		elsif ($command eq "override")
+		  {
+		    my ($nrettype, $nfun, $nargs) = @$filesarr[2 .. 4];
+		    $reason = "$reason.\n   NOTE: " if $reason;
+		    $reason = "${reason}Prototype manually overridden.
+         Header file claims:
+           $rettype $fun($args)
+         Overridden with:
+           $nrettype $nfun($nargs)
+         Differences in return-type qualifiers, e.g. WINAPI, are not important.
+";
+		    ($rettype, $fun, $args) = ($nrettype, $nfun, $nargs);
+		  }
 		my $argno = 0;
-		while ($args =~ /$arg_re/g)
+		while ($args =~ /$argmatch_re/g)
 		  {
 		    $argno++;
 		    my ($argtype, $argname) = ($1, $2);
--- a/src/ChangeLog	Sat Jan 30 18:47:17 2010 -0600
+++ b/src/ChangeLog	Sat Jan 30 20:34:23 2010 -0600
@@ -1,3 +1,27 @@
+2010-01-30  Ben Wing  <ben@xemacs.org>
+
+	* intl-auto-encap-win32.c:
+	* intl-auto-encap-win32.c (qxeExtractAssociatedIcon):
+	* intl-auto-encap-win32.c (qxeExtractIconEx):
+	* intl-auto-encap-win32.c (qxeCreateMDIWindow):
+	* intl-auto-encap-win32.c (qxeCreateWindowStation):
+	* intl-auto-encap-win32.c (qxeDdeCreateStringHandle):
+	* intl-auto-encap-win32.c (qxeAbortSystemShutdown):
+	* intl-auto-encap-win32.c (qxeRegConnectRegistry):
+	* intl-auto-encap-win32.c (qxeGetICMProfile):
+	* intl-auto-encap-win32.h:
+	Rebuild.
+	
+	* intl-encap-win32.c:
+	* intl-encap-win32.c (qxeUpdateICMRegKey):
+	Delete manual definitions of functions with former errors in
+	Cygwin headers but no longer.  Use "override" with some functions
+	where Cygwin or VS6 accidentally omits a const declaration or
+	includes an extra one.  Use "no" on SendMessageTimeout, which
+	has an error in the VS6 prototype (you could manually fix this
+	with an ifdef to split the Cygwin vs. VS6 calls, if we ever
+	actually used this function).
+
 2010-01-30  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* search.c (search_buffer):
--- a/src/intl-auto-encap-win32.c	Sat Jan 30 18:47:17 2010 -0600
+++ b/src/intl-auto-encap-win32.c	Sat Jan 30 20:34:23 2010 -0600
@@ -142,13 +142,21 @@
     return DragQueryFileA (arg1, arg2, (LPSTR) arg3, arg4);
 }
 
+/* NOTE: error arg2, Cygwin prototype, extra const.
+   NOTE: Prototype manually overridden.
+         Header file claims:
+           HICON WINAPI ExtractAssociatedIcon(HINSTANCE,LPCWSTR,PWORD)
+         Overridden with:
+           HICON ExtractAssociatedIcon(HINSTANCE, LPWSTR, LPWORD)
+         Differences in return-type qualifiers, e.g. WINAPI, are not important.
+ */
 HICON
-qxeExtractAssociatedIcon (HINSTANCE arg1, const Extbyte * arg2, PWORD arg3)
-{
-  if (XEUNICODE_P)
-    return ExtractAssociatedIconW (arg1, (LPCWSTR) arg2, arg3);
-  else
-    return ExtractAssociatedIconA (arg1, (LPCSTR) arg2, arg3);
+qxeExtractAssociatedIcon (HINSTANCE arg1, Extbyte * arg2, LPWORD arg3)
+{
+  if (XEUNICODE_P)
+    return ExtractAssociatedIconW (arg1, (LPWSTR) arg2, arg3);
+  else
+    return ExtractAssociatedIconA (arg1, (LPSTR) arg2, arg3);
 }
 
 HICON
@@ -160,7 +168,15 @@
     return ExtractIconA (arg1, (LPCSTR) arg2, arg3);
 }
 
-/* Skipping ExtractIconEx because NT 4.0+ only, error in Cygwin prototype */
+/* NOTE: NT 4.0+ only, former error in Cygwin prototype but no more (Cygwin 1.7, 1-30-10) */
+UINT
+qxeExtractIconEx (const Extbyte * arg1, int arg2, HICON* arg3, HICON* arg4, UINT arg5)
+{
+  if (XEUNICODE_P)
+    return ExtractIconExW ((LPCWSTR) arg1, arg2, arg3, arg4, arg5);
+  else
+    return ExtractIconExA ((LPCSTR) arg1, arg2, arg3, arg4, arg5);
+}
 
 HINSTANCE
 qxeFindExecutable (const Extbyte * arg1, const Extbyte * arg2, Extbyte * arg3)
@@ -926,13 +942,21 @@
     return CreateDialogParamA (arg1, (LPCSTR) arg2, arg3, arg4, arg5);
 }
 
+/* NOTE: error arg 1, VS6 prototype, missing const.
+   NOTE: Prototype manually overridden.
+         Header file claims:
+           WINUSERAPI HWND WINAPI CreateMDIWindow(LPCWSTR,LPCWSTR,DWORD,int,int,int,int,HWND,HINSTANCE,LPARAM)
+         Overridden with:
+           HWND CreateMDIWindow(LPWSTR,LPCWSTR,DWORD,int,int,int,int,HWND,HINSTANCE,LPARAM)
+         Differences in return-type qualifiers, e.g. WINAPI, are not important.
+ */
 HWND
-qxeCreateMDIWindow (const Extbyte * arg1, const Extbyte * arg2, DWORD arg3, int arg4, int arg5, int arg6, int arg7, HWND arg8, HINSTANCE arg9, LPARAM arg10)
-{
-  if (XEUNICODE_P)
-    return CreateMDIWindowW ((LPCWSTR) arg1, (LPCWSTR) arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
-  else
-    return CreateMDIWindowA ((LPCSTR) arg1, (LPCSTR) arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
+qxeCreateMDIWindow (Extbyte * arg1, const Extbyte * arg2, DWORD arg3, int arg4, int arg5, int arg6, int arg7, HWND arg8, HINSTANCE arg9, LPARAM arg10)
+{
+  if (XEUNICODE_P)
+    return CreateMDIWindowW ((LPWSTR) arg1, (LPCWSTR) arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
+  else
+    return CreateMDIWindowA ((LPSTR) arg1, (LPCSTR) arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
 }
 
 HWND
@@ -944,13 +968,21 @@
     return CreateWindowExA (arg1, (LPCSTR) arg2, (LPCSTR) arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12);
 }
 
+/* NOTE: error arg 1, VS6 prototype, missing const.
+   NOTE: Prototype manually overridden.
+         Header file claims:
+           WINUSERAPI HWINSTA WINAPI CreateWindowStation(LPCWSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES)
+         Overridden with:
+           HWINSTA CreateWindowStation(LPWSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES)
+         Differences in return-type qualifiers, e.g. WINAPI, are not important.
+ */
 HWINSTA
-qxeCreateWindowStation (const Extbyte * arg1, DWORD arg2, DWORD arg3, LPSECURITY_ATTRIBUTES arg4)
-{
-  if (XEUNICODE_P)
-    return CreateWindowStationW ((LPCWSTR) arg1, arg2, arg3, arg4);
-  else
-    return CreateWindowStationA ((LPCSTR) arg1, arg2, arg3, arg4);
+qxeCreateWindowStation (Extbyte * arg1, DWORD arg2, DWORD arg3, LPSECURITY_ATTRIBUTES arg4)
+{
+  if (XEUNICODE_P)
+    return CreateWindowStationW ((LPWSTR) arg1, arg2, arg3, arg4);
+  else
+    return CreateWindowStationA ((LPSTR) arg1, arg2, arg3, arg4);
 }
 
 /* Error if DefDlgProc used: return value is conditionalized on _MAC, messes up parser */
@@ -1593,14 +1625,7 @@
     return SendMessageCallbackA (arg1, arg2, arg3, arg4, arg5, arg6);
 }
 
-LRESULT
-qxeSendMessageTimeout (HWND arg1, UINT arg2, WPARAM arg3, LPARAM arg4, UINT arg5, UINT arg6, PDWORD_PTR arg7)
-{
-  if (XEUNICODE_P)
-    return SendMessageTimeoutW (arg1, arg2, arg3, arg4, arg5, arg6, arg7);
-  else
-    return SendMessageTimeoutA (arg1, arg2, arg3, arg4, arg5, arg6, arg7);
-}
+/* Error if SendMessageTimeout used: VS6 has erroneous seventh parameter DWORD_PTR instead of PDWORD_PTR */
 
 /* Skipping SendMessage because split messages and structures */
 
@@ -1749,7 +1774,15 @@
 /*                       Processing file DDEML.H                        */
 /*----------------------------------------------------------------------*/
 
-/* Skipping DdeCreateStringHandle because error in Cygwin prototype */
+/* NOTE: former error in Cygwin prototype, but no more (Cygwin 1.7, 1-30-10) */
+HSZ
+qxeDdeCreateStringHandle (DWORD arg1, const Extbyte * arg2, int arg3)
+{
+  if (XEUNICODE_P)
+    return DdeCreateStringHandleW (arg1, (LPCWSTR) arg2, arg3);
+  else
+    return DdeCreateStringHandleA (arg1, (LPCSTR) arg2, arg3);
+}
 
 UINT
 qxeDdeInitialize (PDWORD arg1, PFNCALLBACK arg2, DWORD arg3, DWORD arg4)
@@ -1774,13 +1807,21 @@
 /*                       Processing file WINREG.H                       */
 /*----------------------------------------------------------------------*/
 
+/* NOTE: error arg 1, Cygwin prototype, extra const.
+   NOTE: Prototype manually overridden.
+         Header file claims:
+           WINADVAPI BOOL WINAPI AbortSystemShutdown(LPCWSTR)
+         Overridden with:
+           BOOL AbortSystemShutdown(LPWSTR)
+         Differences in return-type qualifiers, e.g. WINAPI, are not important.
+ */
 BOOL
-qxeAbortSystemShutdown (const Extbyte * arg1)
-{
-  if (XEUNICODE_P)
-    return AbortSystemShutdownW ((LPCWSTR) arg1);
-  else
-    return AbortSystemShutdownA ((LPCSTR) arg1);
+qxeAbortSystemShutdown (Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return AbortSystemShutdownW ((LPWSTR) arg1);
+  else
+    return AbortSystemShutdownA ((LPSTR) arg1);
 }
 
 BOOL
@@ -1792,7 +1833,15 @@
     return InitiateSystemShutdownA ((LPSTR) arg1, (LPSTR) arg2, arg3, arg4, arg5);
 }
 
-/* Skipping RegConnectRegistry because error in Cygwin prototype */
+/* NOTE: former error in Cygwin prototype, but no more (Cygwin 1.7, 1-30-10) */
+LONG
+qxeRegConnectRegistry (const Extbyte * arg1, HKEY arg2, PHKEY arg3)
+{
+  if (XEUNICODE_P)
+    return RegConnectRegistryW ((LPCWSTR) arg1, arg2, arg3);
+  else
+    return RegConnectRegistryA ((LPCSTR) arg1, arg2, arg3);
+}
 
 LONG
 qxeRegCreateKeyEx (HKEY arg1, const Extbyte * arg2, DWORD arg3, Extbyte * arg4, DWORD arg5, REGSAM arg6, LPSECURITY_ATTRIBUTES arg7, PHKEY arg8, PDWORD arg9)
@@ -2342,7 +2391,15 @@
 
 #if defined (HAVE_MS_WINDOWS)
 
-/* Skipping GetICMProfile because NT 4.0+ only, error in Cygwin prototype */
+/* NOTE: NT 4.0+ only, former error in Cygwin prototype but no more (Cygwin 1.7, 1-30-10) */
+BOOL
+qxeGetICMProfile (HDC arg1, LPDWORD arg2, Extbyte * arg3)
+{
+  if (XEUNICODE_P)
+    return GetICMProfileW (arg1, arg2, (LPWSTR) arg3);
+  else
+    return GetICMProfileA (arg1, arg2, (LPSTR) arg3);
+}
 
 #endif /* defined (HAVE_MS_WINDOWS) */
 
--- a/src/intl-auto-encap-win32.h	Sat Jan 30 18:47:17 2010 -0600
+++ b/src/intl-auto-encap-win32.h	Sat Jan 30 20:34:23 2010 -0600
@@ -96,7 +96,7 @@
 #undef ExtractAssociatedIcon
 #define ExtractAssociatedIcon error_use_qxeExtractAssociatedIcon_or_ExtractAssociatedIconA_and_ExtractAssociatedIconW
 #endif
-HICON qxeExtractAssociatedIcon (HINSTANCE arg1, const Extbyte * arg2, PWORD arg3);
+HICON qxeExtractAssociatedIcon (HINSTANCE arg1, Extbyte * arg2, LPWORD arg3);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef ExtractIcon
@@ -104,7 +104,11 @@
 #endif
 HICON qxeExtractIcon (HINSTANCE arg1, const Extbyte * arg2, UINT arg3);
 
-/* Skipping ExtractIconEx because NT 4.0+ only, error in Cygwin prototype */
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef ExtractIconEx
+#define ExtractIconEx error_use_qxeExtractIconEx_or_ExtractIconExA_and_ExtractIconExW
+#endif
+UINT qxeExtractIconEx (const Extbyte * arg1, int arg2, HICON* arg3, HICON* arg4, UINT arg5);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef FindExecutable
@@ -657,7 +661,7 @@
 #undef CreateMDIWindow
 #define CreateMDIWindow error_use_qxeCreateMDIWindow_or_CreateMDIWindowA_and_CreateMDIWindowW
 #endif
-HWND qxeCreateMDIWindow (const Extbyte * arg1, const Extbyte * arg2, DWORD arg3, int arg4, int arg5, int arg6, int arg7, HWND arg8, HINSTANCE arg9, LPARAM arg10);
+HWND qxeCreateMDIWindow (Extbyte * arg1, const Extbyte * arg2, DWORD arg3, int arg4, int arg5, int arg6, int arg7, HWND arg8, HINSTANCE arg9, LPARAM arg10);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef CreateWindowEx
@@ -669,7 +673,7 @@
 #undef CreateWindowStation
 #define CreateWindowStation error_use_qxeCreateWindowStation_or_CreateWindowStationA_and_CreateWindowStationW
 #endif
-HWINSTA qxeCreateWindowStation (const Extbyte * arg1, DWORD arg2, DWORD arg3, LPSECURITY_ATTRIBUTES arg4);
+HWINSTA qxeCreateWindowStation (Extbyte * arg1, DWORD arg2, DWORD arg3, LPSECURITY_ATTRIBUTES arg4);
 
 #undef DefDlgProc
 #define DefDlgProc error_return_value_is_conditionalized_on__MAC__messes_up_parser
@@ -1121,11 +1125,8 @@
 #endif
 BOOL qxeSendMessageCallback (HWND arg1, UINT arg2, WPARAM arg3, LPARAM arg4, SENDASYNCPROC arg5, DWORD arg6);
 
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef SendMessageTimeout
-#define SendMessageTimeout error_use_qxeSendMessageTimeout_or_SendMessageTimeoutA_and_SendMessageTimeoutW
-#endif
-LRESULT qxeSendMessageTimeout (HWND arg1, UINT arg2, WPARAM arg3, LPARAM arg4, UINT arg5, UINT arg6, PDWORD_PTR arg7);
+#define SendMessageTimeout error_VS6_has_erroneous_seventh_parameter_DWORD_PTR_instead_of_PDWORD_PTR
 
 /* Skipping SendMessage because split messages and structures */
 
@@ -1232,7 +1233,11 @@
 
 /* Processing file DDEML.H */
 
-/* Skipping DdeCreateStringHandle because error in Cygwin prototype */
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef DdeCreateStringHandle
+#define DdeCreateStringHandle error_use_qxeDdeCreateStringHandle_or_DdeCreateStringHandleA_and_DdeCreateStringHandleW
+#endif
+HSZ qxeDdeCreateStringHandle (DWORD arg1, const Extbyte * arg2, int arg3);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef DdeInitialize
@@ -1253,7 +1258,7 @@
 #undef AbortSystemShutdown
 #define AbortSystemShutdown error_use_qxeAbortSystemShutdown_or_AbortSystemShutdownA_and_AbortSystemShutdownW
 #endif
-BOOL qxeAbortSystemShutdown (const Extbyte * arg1);
+BOOL qxeAbortSystemShutdown (Extbyte * arg1);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef InitiateSystemShutdown
@@ -1261,7 +1266,11 @@
 #endif
 BOOL qxeInitiateSystemShutdown (Extbyte * arg1, Extbyte * arg2, DWORD arg3, BOOL arg4, BOOL arg5);
 
-/* Skipping RegConnectRegistry because error in Cygwin prototype */
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef RegConnectRegistry
+#define RegConnectRegistry error_use_qxeRegConnectRegistry_or_RegConnectRegistryA_and_RegConnectRegistryW
+#endif
+LONG qxeRegConnectRegistry (const Extbyte * arg1, HKEY arg2, PHKEY arg3);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef RegCreateKeyEx
@@ -1658,7 +1667,11 @@
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
-/* Skipping GetICMProfile because NT 4.0+ only, error in Cygwin prototype */
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetICMProfile
+#define GetICMProfile error_use_qxeGetICMProfile_or_GetICMProfileA_and_GetICMProfileW
+#endif
+BOOL qxeGetICMProfile (HDC arg1, LPDWORD arg2, Extbyte * arg3);
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
--- a/src/intl-encap-win32.c	Sat Jan 30 18:47:17 2010 -0600
+++ b/src/intl-encap-win32.c	Sat Jan 30 20:34:23 2010 -0600
@@ -312,7 +312,7 @@
 no CreateDesktop split-sized LPDEVMODE
 yes OpenDesktop
 split EnumDesktops DESKTOPENUMPROC // callback fun differs only in string pointer type
-yes CreateWindowStation
+override HWINSTA CreateWindowStationW(LPWSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES); error arg 1, VS6 prototype, missing const
 yes OpenWindowStation
 split EnumWindowStations WINSTAENUMPROC // callback fun differs only in string pointer type
 yes GetUserObjectInformation
@@ -322,7 +322,7 @@
 yes DispatchMessage
 yes PeekMessage
 skip SendMessage split messages and structures
-yes SendMessageTimeout
+no SendMessageTimeout VS6 has erroneous seventh parameter DWORD_PTR instead of PDWORD_PTR
 yes SendNotifyMessage
 yes SendMessageCallback
 no BroadcastSystemMessage win95 version not split; NT 4.0+ only
@@ -429,7 +429,7 @@
 yes DlgDirSelectComboBoxEx
 yes DefFrameProc
 no DefMDIChildProc return value is conditionalized on _MAC, messes up parser
-yes CreateMDIWindow
+override HWND CreateMDIWindowW(LPWSTR,LPCWSTR,DWORD,int,int,int,int,HWND,HINSTANCE,LPARAM); error arg 1, VS6 prototype, missing const
 yes WinHelp
 no ChangeDisplaySettings split-sized LPDEVMODE
 no ChangeDisplaySettingsEx split-sized LPDEVMODE; NT 5.0/Win98+ only
@@ -516,7 +516,7 @@
 // split-simple function pointer ICMENUMPROC
 no GetLogColorSpace split-sized LPLOGCOLORSPACE; NT 4.0+ only
 no CreateColorSpace split-sized LPLOGCOLORSPACE; NT 4.0+ only
-skip GetICMProfile NT 4.0+ only, error in Cygwin prototype
+yes GetICMProfile NT 4.0+ only, former error in Cygwin prototype but no more (Cygwin 1.7, 1-30-10)
 yes SetICMProfile NT 4.0+ only
 split EnumICMProfiles ICMENUMPROC NT 4.0+ only
 skip UpdateICMRegKey NT 4.0+ only, error in Cygwin prototype
@@ -602,14 +602,14 @@
 yes FindExecutable
 no CommandLineToArgv Unicode-only
 yes ShellAbout
-yes ExtractAssociatedIcon
+override HICON ExtractAssociatedIconW(HINSTANCE, LPWSTR, LPWORD); error arg2, Cygwin prototype, extra const
 yes ExtractIcon
 // split-simple DRAGINFO, used ??? (docs say "Not currently supported")
 begin-bracket !defined (CYGWIN_HEADERS)
 yes DoEnvironmentSubst NT 4.0+ only
 end-bracket
 no FindEnvironmentString causes link error; NT 4.0+ only
-skip ExtractIconEx NT 4.0+ only, error in Cygwin prototype
+yes ExtractIconEx NT 4.0+ only, former error in Cygwin prototype but no more (Cygwin 1.7, 1-30-10)
 // split-simple SHFILEOPSTRUCT, used in SHFileOperation
 // split-simple SHNAMEMAPPING, used in SHFileOperation
 split SHFileOperation LPSHFILEOPSTRUCT NT 4.0+ only
@@ -853,7 +853,7 @@
 file DDEML.H
 
 yes DdeInitialize
-skip DdeCreateStringHandle error in Cygwin prototype
+yes DdeCreateStringHandle former error in Cygwin prototype, but no more (Cygwin 1.7, 1-30-10)
 yes DdeQueryString
 // #### split-sized (or split-simple??? not completely obvious) structure MONHSZSTRUCT, used when DDE event MF_HSZ_INFO is sent as part of the XTYP_MONITOR transaction sent to a DDE callback; not yet handled
 
@@ -1055,7 +1055,7 @@
 
 file WINREG.H
 
-skip RegConnectRegistry error in Cygwin prototype
+yes RegConnectRegistry former error in Cygwin prototype, but no more (Cygwin 1.7, 1-30-10)
 yes RegCreateKey
 yes RegCreateKeyEx
 yes RegDeleteKey
@@ -1077,7 +1077,7 @@
 yes RegSetValueEx
 yes RegUnLoadKey
 yes InitiateSystemShutdown
-yes AbortSystemShutdown
+override BOOL AbortSystemShutdownW(LPWSTR); error arg 1, Cygwin prototype, extra const
 review RegDeleteKeyEx
 
 file EXCPT.H
@@ -1241,59 +1241,10 @@
 /*           would be encapsulatable but for Cygwin problems            */
 /************************************************************************/
 
-LONG
-qxeRegConnectRegistry (const Extbyte * lpMachineName, HKEY hKey, PHKEY phkResult)
-{
-  /* Cygwin mistakenly omits const in first argument. */
-  if (XEUNICODE_P)
-    return RegConnectRegistryW ((LPWSTR) lpMachineName, hKey, phkResult);
-  else
-    return RegConnectRegistryA ((LPSTR) lpMachineName, hKey, phkResult);
-}
-
-HSZ
-qxeDdeCreateStringHandle (DWORD idInst, const Extbyte * psz, int iCodePage)
-{
-  /* Cygwin mistakenly omits const in second argument. */
-  if (XEUNICODE_P)
-    return DdeCreateStringHandleW (idInst, (LPWSTR) psz, iCodePage);
-  else
-    return DdeCreateStringHandleA (idInst, (LPSTR) psz, iCodePage);
-}
-
-/* NOTE: NT 4.0+ only */
-UINT
-qxeExtractIconEx (const Extbyte * lpszFile, int nIconIndex, HICON FAR * phiconLarge, HICON FAR * phiconSmall, UINT nIcons)
-{
-  /* Cygwin mistakenly declares the return type as HICON. */
-  if (XEUNICODE_P)
-    return (UINT) ExtractIconExW ((LPCWSTR) lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
-  else
-    return (UINT) ExtractIconExA ((LPCSTR) lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
-}
-
 #ifdef HAVE_MS_WINDOWS
 
 /* NOTE: NT 4.0+ only */
 BOOL
-qxeGetICMProfile (HDC arg1, LPDWORD arg2, Extbyte * arg3)
-{
-#if 0 /* defined (CYGWIN_HEADERS) */ /* fixed at some point <= GCC 3.4.4 */
-  /* Cygwin mistakenly declares the second argument as DWORD. */
-  if (XEUNICODE_P)
-    return GetICMProfileW (arg1, (DWORD) arg2, (LPWSTR) arg3);
-  else
-    return GetICMProfileA (arg1, (DWORD) arg2, (LPSTR) arg3);
-#else
-  if (XEUNICODE_P)
-    return GetICMProfileW (arg1, arg2, (LPWSTR) arg3);
-  else
-    return GetICMProfileA (arg1, arg2, (LPSTR) arg3);
-#endif /* CYGWIN_HEADERS */
-}
-
-/* NOTE: NT 4.0+ only */
-BOOL
 qxeUpdateICMRegKey (DWORD arg1, Extbyte * arg2, Extbyte * arg3, UINT arg4)
 {
 #ifdef CYGWIN_HEADERS