diff --git a/dll/win32/kernel32/client/compname.c b/dll/win32/kernel32/client/compname.c index c2efa30b929..46d05e78d32 100644 --- a/dll/win32/kernel32/client/compname.c +++ b/dll/win32/kernel32/client/compname.c @@ -335,21 +335,24 @@ GetComputerNameExW(COMPUTER_NAME_FORMAT NameType, case ComputerNamePhysicalDnsDomain: return GetComputerNameFromRegistry(L"\\Registry\\Machine\\System\\CurrentControlSet" L"\\Services\\Tcpip\\Parameters", - L"Domain", + L"NV Domain", lpBuffer, nSize); - /* XXX Redo these */ + /* XXX Redo this */ case ComputerNamePhysicalDnsFullyQualified: return GetComputerNameExW(ComputerNameDnsFullyQualified, lpBuffer, nSize); case ComputerNamePhysicalDnsHostname: - return GetComputerNameExW(ComputerNameDnsHostname, - lpBuffer, - nSize); + return GetComputerNameFromRegistry(L"\\Registry\\Machine\\System\\CurrentControlSet" + L"\\Services\\Tcpip\\Parameters", + L"NV Hostname", + lpBuffer, + nSize); + /* XXX Redo this */ case ComputerNamePhysicalNetBIOS: return GetComputerNameExW(ComputerNameNetBIOS, lpBuffer, @@ -477,7 +480,14 @@ IsValidComputerName(COMPUTER_NAME_FORMAT NameType, p++; } - if (Length == 0 || Length > MAX_COMPUTERNAME_LENGTH) + if (NameType == ComputerNamePhysicalDnsDomain) + return TRUE; + + if (Length == 0) + return FALSE; + + if (NameType == ComputerNamePhysicalNetBIOS && + Length > MAX_COMPUTERNAME_LENGTH) return FALSE; return TRUE; @@ -600,12 +610,12 @@ SetComputerNameExW(COMPUTER_NAME_FORMAT NameType, return FALSE; } - switch( NameType ) + switch (NameType) { case ComputerNamePhysicalDnsDomain: return SetComputerNameToRegistry(L"\\Registry\\Machine\\System\\CurrentControlSet" L"\\Services\\Tcpip\\Parameters", - L"Domain", + L"NV Domain", lpBuffer); case ComputerNamePhysicalDnsHostname: