* Set AutoconfigEnabled if DNS is acquired by DHCP

* Fix a handle leak

svn path=/trunk/; revision=36794
This commit is contained in:
Johannes Anderwald 2008-10-17 18:20:00 +00:00
parent 521eec8b76
commit 905c093675

View file

@ -1504,6 +1504,7 @@ static void CreateNameServerListEnumNamesFunc( PWCHAR Interface, PWCHAR Server,
DWORD WINAPI GetPerAdapterInfo(ULONG IfIndex, PIP_PER_ADAPTER_INFO pPerAdapterInfo, PULONG pOutBufLen)
{
HKEY hkey;
DWORD dwSize = 0;
const char *ifName;
NAME_SERVER_LIST_CONTEXT Context;
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)
{
*pOutBufLen = Context.uSizeRequired;
RegCloseKey(hkey);
return ERROR_BUFFER_OVERFLOW;
}
if(RegQueryValueExW(hkey, L"DHCPNameServer", NULL, NULL, NULL, &dwSize) == ERROR_SUCCESS)
{
pPerAdapterInfo->AutoconfigEnabled = TRUE;
}
RegCloseKey(hkey);
return NOERROR;
}