mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 19:55:41 +00:00
* Set AutoconfigEnabled if DNS is acquired by DHCP
* Fix a handle leak svn path=/trunk/; revision=36794
This commit is contained in:
parent
521eec8b76
commit
905c093675
1 changed files with 8 additions and 0 deletions
|
@ -1504,6 +1504,7 @@ static void CreateNameServerListEnumNamesFunc( PWCHAR Interface, PWCHAR Server,
|
||||||
DWORD WINAPI GetPerAdapterInfo(ULONG IfIndex, PIP_PER_ADAPTER_INFO pPerAdapterInfo, PULONG pOutBufLen)
|
DWORD WINAPI GetPerAdapterInfo(ULONG IfIndex, PIP_PER_ADAPTER_INFO pPerAdapterInfo, PULONG pOutBufLen)
|
||||||
{
|
{
|
||||||
HKEY hkey;
|
HKEY hkey;
|
||||||
|
DWORD dwSize = 0;
|
||||||
const char *ifName;
|
const char *ifName;
|
||||||
NAME_SERVER_LIST_CONTEXT Context;
|
NAME_SERVER_LIST_CONTEXT Context;
|
||||||
WCHAR keyname[200] = L"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\";
|
WCHAR keyname[200] = L"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\";
|
||||||
|
@ -1535,9 +1536,16 @@ DWORD WINAPI GetPerAdapterInfo(ULONG IfIndex, PIP_PER_ADAPTER_INFO pPerAdapterIn
|
||||||
if (Context.uSizeRequired > Context.uSizeAvailable)
|
if (Context.uSizeRequired > Context.uSizeAvailable)
|
||||||
{
|
{
|
||||||
*pOutBufLen = Context.uSizeRequired;
|
*pOutBufLen = Context.uSizeRequired;
|
||||||
|
RegCloseKey(hkey);
|
||||||
return ERROR_BUFFER_OVERFLOW;
|
return ERROR_BUFFER_OVERFLOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(RegQueryValueExW(hkey, L"DHCPNameServer", NULL, NULL, NULL, &dwSize) == ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
pPerAdapterInfo->AutoconfigEnabled = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
RegCloseKey(hkey);
|
||||||
return NOERROR;
|
return NOERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue