From 7bfdc5ceb794838986cba7be4cd8f2d0bcb8e563 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Sun, 24 Sep 2006 06:25:49 +0000 Subject: [PATCH] Allow digits in computer name. http://www.reactos.org/bugzilla/show_bug.cgi?id=1806#c2 still needs to be checked See issue #1806 for more details. svn path=/trunk/; revision=24243 --- reactos/dll/win32/kernel32/misc/computername.c | 4 ++-- reactos/dll/win32/syssetup/wizard.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/reactos/dll/win32/kernel32/misc/computername.c b/reactos/dll/win32/kernel32/misc/computername.c index be065b96568..11351b91c37 100644 --- a/reactos/dll/win32/kernel32/misc/computername.c +++ b/reactos/dll/win32/kernel32/misc/computername.c @@ -298,7 +298,7 @@ IsValidComputerName ( p = (PWCHAR)lpComputerName; while (*p != 0) { - if (!(iswctype (*p, _ALPHA || _DIGIT) || + if ((!iswctype (*p, _ALPHA) && !iswctype (*p, _DIGIT)) || *p == L'!' || *p == L'@' || *p == L'#' || @@ -314,7 +314,7 @@ IsValidComputerName ( *p == L'_' || *p == L'{' || *p == L'}' || - *p == L'~')) + *p == L'~') return FALSE; Length++; diff --git a/reactos/dll/win32/syssetup/wizard.c b/reactos/dll/win32/syssetup/wizard.c index 4019a2870e6..fd72f546cc6 100644 --- a/reactos/dll/win32/syssetup/wizard.c +++ b/reactos/dll/win32/syssetup/wizard.c @@ -537,7 +537,7 @@ WriteComputerSettings(TCHAR * ComputerName, HWND hwndDlg) return FALSE; } - /* Try to also set DNS hostname */ + /* Try to also set DNS hostname */ SetComputerNameEx(ComputerNamePhysicalDnsHostname, ComputerName); return TRUE; @@ -612,7 +612,8 @@ ComputerPageDlgProc(HWND hwndDlg, return TRUE; } - /* FIXME: check computer name for invalid characters */ + /* No need to check computer name for invalid characters, + * SetComputerName() will do it for us */ if (!WriteComputerSettings(ComputerName, hwndDlg)) {