Author: janderwald
Date: Fri Oct 17 13:20:00 2008
New Revision: 36794
URL:
http://svn.reactos.org/svn/reactos?rev=36794&view=rev
Log:
* Set AutoconfigEnabled if DNS is acquired by DHCP
* Fix a handle leak
Modified:
trunk/reactos/dll/win32/iphlpapi/iphlpapi_main.c
Modified: trunk/reactos/dll/win32/iphlpapi/iphlpapi_main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/iphlpapi/iphlpap…
==============================================================================
--- trunk/reactos/dll/win32/iphlpapi/iphlpapi_main.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/iphlpapi/iphlpapi_main.c [iso-8859-1] Fri Oct 17 13:20:00
2008
@@ -1504,6 +1504,7 @@
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 @@
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;
}