Based on @Doug-Lyons's patch. CORE-16058
SetComputerNameExW(COMPUTER_NAME_FORMAT NameType,
LPCWSTR lpBuffer)
{
SetComputerNameExW(COMPUTER_NAME_FORMAT NameType,
LPCWSTR lpBuffer)
{
if (!IsValidComputerName(NameType, lpBuffer))
{
SetLastError(ERROR_INVALID_PARAMETER);
if (!IsValidComputerName(NameType, lpBuffer))
{
SetLastError(ERROR_INVALID_PARAMETER);
lpBuffer);
case ComputerNamePhysicalDnsHostname:
lpBuffer);
case ComputerNamePhysicalDnsHostname:
- return SetComputerNameToRegistry(L"\\Registry\\Machine\\System\\CurrentControlSet"
+ ret1 = SetComputerNameToRegistry(L"\\Registry\\Machine\\System\\CurrentControlSet"
L"\\Services\\Tcpip\\Parameters",
L"\\Services\\Tcpip\\Parameters",
+ L"NV Hostname",
+ lpBuffer);
+
+ ret2 = SetComputerNameToRegistry(L"\\Registry\\Machine\\System\\CurrentControlSet"
+ L"\\Control\\ComputerName\\ComputerName",
+ L"ComputerName",
case ComputerNamePhysicalNetBIOS:
return SetComputerNameToRegistry(L"\\Registry\\Machine\\System\\CurrentControlSet"
case ComputerNamePhysicalNetBIOS:
return SetComputerNameToRegistry(L"\\Registry\\Machine\\System\\CurrentControlSet"