Perform host name initialization if computer name can't be read from registry

Dmitry Timoshkov dmitry at baikal.ru
Fri Dec 3 09:37:44 CST 2004


Hello,

due to recent MAX_COMPUTERNAME_LENGTH changes existing Wine/Crossover
installs suffer from old registry keys with computer name being longer
than 15 characters. NtQueryValueKey returns STATUS_BUFFER_OVERFLOW in
that case.

Changelog:
    Dmitry Timoshkov <dmitry at codeweavers.com>
    Perform host name initialization if computer name can't be read
    from registry.

--- cvs/hq/wine/dlls/kernel/computername.c	2004-11-26 19:09:12.000000000 +0800
+++ wine/dlls/kernel/computername.c	2004-12-03 20:01:25.000000000 +0800
@@ -253,7 +253,7 @@ void COMPUTERNAME_Init (void)
     
     st = NtQueryValueKey( hsubkey, &nameW, KeyValuePartialInformation, buf, len, &len );
 
-    if ( st == STATUS_OBJECT_NAME_NOT_FOUND || ( st == STATUS_SUCCESS && get_use_dns_option()))
+    if ( st != STATUS_SUCCESS || get_use_dns_option() )
     {
         char hbuf[256];
         int hlen = sizeof (hbuf);






More information about the wine-patches mailing list