diff --git a/dll/win32/syssetup/wizard.c b/dll/win32/syssetup/wizard.c index 1e541da3f1..7933d6bd3b 100644 --- a/dll/win32/syssetup/wizard.c +++ b/dll/win32/syssetup/wizard.c @@ -534,6 +534,8 @@ WriteComputerSettings(WCHAR * ComputerName, HWND hwndDlg) { WCHAR Title[64]; WCHAR ErrorComputerName[256]; + LONG lError; + HKEY hKey = NULL; if (!SetComputerNameW(ComputerName)) { @@ -560,6 +562,34 @@ WriteComputerSettings(WCHAR * ComputerName, HWND hwndDlg) /* Set the accounts domain name */ SetAccountsDomainSid(NULL, ComputerName); + /* Now we need to set the Hostname */ + lError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters", + 0, + KEY_SET_VALUE, + &hKey); + if (lError != ERROR_SUCCESS) + { + DPRINT1("RegOpenKeyExW(\"HKLM\\System\\CurrentControlSet\\Services\\Tcpip\\Parameters\") failed!\n"); + RegCloseKey(hKey); + return TRUE; + } + + lError = RegSetValueEx(hKey, + L"Hostname", + 0, + REG_SZ, + (LPBYTE)ComputerName, + (wcslen(ComputerName)+ 1) * sizeof(WCHAR)); + if (lError != ERROR_SUCCESS) + { + DPRINT1("RegSetValueEx(\"Hostname\") failed!\n"); + RegCloseKey(hKey); + return TRUE; + } + + RegCloseKey(hKey); + return TRUE; }