- Fix to allow characters for computer name as specified in MSDN, even '-'

- See issue #3304 for more details.

svn path=/trunk/; revision=34275
This commit is contained in:
Matthias Kupfer 2008-07-03 07:09:05 +00:00
parent 8e5bf80622
commit 0dd1a22450

View 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++;