From aa5358fdae5c24c29a151f4cee03268d05e4be8c Mon Sep 17 00:00:00 2001 From: Vitaly Lipatov Date: Fri, 28 Nov 2008 16:27:04 +0300 Subject: [PATCH] kernel32: gethostname returns string in CP_UNIXCP encoding. --- dlls/kernel32/computername.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/kernel32/computername.c b/dlls/kernel32/computername.c index 5e811f87551..7ddbac8ef0f 100644 --- a/dlls/kernel32/computername.c +++ b/dlls/kernel32/computername.c @@ -268,7 +268,7 @@ void COMPUTERNAME_Init (void) dot = strchr ( hbuf, '.' ); if ( dot ) *dot = 0; hlen = strlen ( hbuf ); - len = MultiByteToWideChar( CP_ACP, 0, hbuf, hlen + 1, computer_name, MAX_COMPUTERNAME_LENGTH + 1 ) + len = MultiByteToWideChar( CP_UNIXCP, 0, hbuf, hlen + 1, computer_name, MAX_COMPUTERNAME_LENGTH + 1 ) * sizeof( WCHAR ); if ( NtSetValueKey( hsubkey, &nameW, 0, REG_SZ, computer_name, len ) != STATUS_SUCCESS ) WARN ( "failed to set ComputerName\n" );