From 905c0936754c29d923f872c2fc9e480e17233f55 Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Fri, 17 Oct 2008 18:20:00 +0000 Subject: [PATCH] * Set AutoconfigEnabled if DNS is acquired by DHCP * Fix a handle leak svn path=/trunk/; revision=36794 --- reactos/dll/win32/iphlpapi/iphlpapi_main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/reactos/dll/win32/iphlpapi/iphlpapi_main.c b/reactos/dll/win32/iphlpapi/iphlpapi_main.c index a287f9f735c..92699740346 100644 --- a/reactos/dll/win32/iphlpapi/iphlpapi_main.c +++ b/reactos/dll/win32/iphlpapi/iphlpapi_main.c @@ -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; }