[NETCFGX] The IPAddress, SubnetMas and DefaultGateway values must be of type REG_MULTI_SZ

This commit is contained in:
Eric Kohl
2026-04-05 12:46:47 +02:00
parent 2a40a01d4a
commit 68d1570859
+3 -3
View File
@@ -271,21 +271,21 @@ InstallNetDevice(
goto cleanup;
}
rc = RegSetValueExW(hInterfaceKey, L"DefaultGateway", 0, REG_SZ, (const BYTE*)L"0.0.0.0", (wcslen(L"0.0.0.0") + 1) * sizeof(WCHAR));
rc = RegSetValueExW(hInterfaceKey, L"DefaultGateway", 0, REG_MULTI_SZ, (const BYTE*)L"0.0.0.0\0", (wcslen(L"0.0.0.0") + 2) * sizeof(WCHAR));
if (rc != ERROR_SUCCESS)
{
ERR("RegSetValueExW() failed with error 0x%lx\n", rc);
goto cleanup;
}
rc = RegSetValueExW(hInterfaceKey, L"IPAddress", 0, REG_SZ, (const BYTE*)L"0.0.0.0", (wcslen(L"0.0.0.0") + 1) * sizeof(WCHAR));
rc = RegSetValueExW(hInterfaceKey, L"IPAddress", 0, REG_MULTI_SZ, (const BYTE*)L"0.0.0.0\0", (wcslen(L"0.0.0.0") + 2) * sizeof(WCHAR));
if (rc != ERROR_SUCCESS)
{
ERR("RegSetValueExW() failed with error 0x%lx\n", rc);
goto cleanup;
}
rc = RegSetValueExW(hInterfaceKey, L"SubnetMask", 0, REG_SZ, (const BYTE*)L"0.0.0.0", (wcslen(L"0.0.0.0") + 1) * sizeof(WCHAR));
rc = RegSetValueExW(hInterfaceKey, L"SubnetMask", 0, REG_MULTI_SZ, (const BYTE*)L"0.0.0.0\0", (wcslen(L"0.0.0.0") + 2) * sizeof(WCHAR));
if (rc != ERROR_SUCCESS)
{
ERR("RegSetValueExW() failed with error 0x%lx\n", rc);