- Fix to allow characters for computer name as specified in MSDN, even '-'
authorMatthias Kupfer <mkupfer@reactos.org>
Thu, 3 Jul 2008 07:09:05 +0000 (07:09 +0000)
committerMatthias Kupfer <mkupfer@reactos.org>
Thu, 3 Jul 2008 07:09:05 +0000 (07:09 +0000)
- See issue #3304 for more details.

svn path=/trunk/; revision=34275

reactos/dll/win32/kernel32/misc/computername.c

index c0a0f7f..f0bb6c8 100644 (file)
@@ -298,22 +298,10 @@ IsValidComputerName (
   p = (PWCHAR)lpComputerName;
   while (*p != 0)
     {
-      if ((!iswctype (*p, _ALPHA) && !iswctype (*p, _DIGIT)) ||
-           *p == L'!' ||
-           *p == L'@' ||
-           *p == L'#' ||
-           *p == L'$' ||
-           *p == L'%' ||
-           *p == L'^' ||
-           *p == L'&' ||
-           *p == L'\'' ||
-           *p == L')' ||
-           *p == L'(' ||
-           *p == L'.' ||
-           *p == L'_' ||
-           *p == L'{' ||
-           *p == L'}' ||
-           *p == L'~')
+      if (!(iswalnum(*p) || *p == L'!' || *p == L'@' || *p == L'#' ||
+       *p == L'$' || *p == L'%' || *p == L'^' || *p == L'&' || *p == L'\'' ||
+       *p == L')' || *p == L'(' || *p == L'.' || *p == L'-' || *p == L'_' ||
+       *p == L'{' || *p == L'}' || *p == L'~'))
        return FALSE;
 
       Length++;