kernel32: gethostname returns string in CP_UNIXCP encoding.

This commit is contained in:
Vitaly Lipatov 2008-11-28 16:27:04 +03:00 committed by Alexandre Julliard
parent d2bd90f997
commit aa5358fdae
1 changed files with 1 additions and 1 deletions

View File

@ -268,7 +268,7 @@ void COMPUTERNAME_Init (void)
dot = strchr ( hbuf, '.' ); dot = strchr ( hbuf, '.' );
if ( dot ) *dot = 0; if ( dot ) *dot = 0;
hlen = strlen ( hbuf ); 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 ); * sizeof( WCHAR );
if ( NtSetValueKey( hsubkey, &nameW, 0, REG_SZ, computer_name, len ) != STATUS_SUCCESS ) if ( NtSetValueKey( hsubkey, &nameW, 0, REG_SZ, computer_name, len ) != STATUS_SUCCESS )
WARN ( "failed to set ComputerName\n" ); WARN ( "failed to set ComputerName\n" );