mirror of
https://github.com/reactos/reactos.git
synced 2024-12-31 19:42:51 +00:00
[KERNEL32] Fix SetComputerNameExW (#1583)
Based on @Doug-Lyons's patch. CORE-16058
This commit is contained in:
parent
dbc20b6484
commit
2db0e159a4
1 changed files with 10 additions and 2 deletions
|
@ -592,6 +592,8 @@ WINAPI
|
|||
SetComputerNameExW(COMPUTER_NAME_FORMAT NameType,
|
||||
LPCWSTR lpBuffer)
|
||||
{
|
||||
BOOL ret1, ret2;
|
||||
|
||||
if (!IsValidComputerName(NameType, lpBuffer))
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
|
@ -607,11 +609,17 @@ SetComputerNameExW(COMPUTER_NAME_FORMAT NameType,
|
|||
lpBuffer);
|
||||
|
||||
case ComputerNamePhysicalDnsHostname:
|
||||
return SetComputerNameToRegistry(L"\\Registry\\Machine\\System\\CurrentControlSet"
|
||||
ret1 = SetComputerNameToRegistry(L"\\Registry\\Machine\\System\\CurrentControlSet"
|
||||
L"\\Services\\Tcpip\\Parameters",
|
||||
L"Hostname",
|
||||
L"NV Hostname",
|
||||
lpBuffer);
|
||||
|
||||
ret2 = SetComputerNameToRegistry(L"\\Registry\\Machine\\System\\CurrentControlSet"
|
||||
L"\\Control\\ComputerName\\ComputerName",
|
||||
L"ComputerName",
|
||||
lpBuffer);
|
||||
return (ret1 && ret2);
|
||||
|
||||
case ComputerNamePhysicalNetBIOS:
|
||||
return SetComputerNameToRegistry(L"\\Registry\\Machine\\System\\CurrentControlSet"
|
||||
L"\\Control\\ComputerName\\ComputerName",
|
||||
|
|
Loading…
Reference in a new issue