KERNEL32: limit win9x computer name to 16 characters

Mike McCormack mike at codeweavers.com
Thu Oct 21 03:06:13 CDT 2004


rsaenh.dll provided with IE6 for Windows 9x machines passes a buffer 
size of 16 characters to GetComputerNameA, and if the name is longer 
than 16 characters, an error is returned. When this happens IE6 will 
refuse to load an https page.

Mike


ChangeLog:
* limit win9x computer name to 16 characters
-------------- next part --------------
Index: dlls/kernel/computername.c
===================================================================
RCS file: /cvstrees/crossover/office/wine/dlls/kernel/computername.c,v
retrieving revision 1.1.1.5
diff -u -r1.1.1.5 computername.c
--- dlls/kernel/computername.c	5 Feb 2004 04:00:19 -0000	1.1.1.5
+++ dlls/kernel/computername.c	21 Oct 2004 06:15:15 -0000
@@ -264,7 +264,18 @@
             strcpy ( hbuf, default_ComputerName );
             WARN( "gethostname() error: %d, using host name %s\n", errno, hbuf );
         }
-        hbuf[MAX_COMPUTERNAME_LENGTH] = 0;
+
+        /*
+         * rsaenh.dll provided with Internet Explorer 6 for Win9x
+         * expects that the name of the computer is no longer than
+         * 16 characters.  If we don't limit the name to 16 chars
+         * Internet Explorer cannot load https pages.
+         */
+        if( GetVersion() & 0x80000000 )
+            hbuf[16] = 0;
+        else
+            hbuf[MAX_COMPUTERNAME_LENGTH] = 0;
+
         dot = strchr ( hbuf, '.' );
         if ( dot ) *dot = 0;
         hlen = strlen ( hbuf );


More information about the wine-patches mailing list