kernel32: gethostname returns string in CP_UNIXCP encoding.
This commit is contained in:
parent
d2bd90f997
commit
aa5358fdae
|
@ -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" );
|
||||||
|
|
Loading…
Reference in New Issue