Author: janderwald
Date: Thu Oct 30 14:27:58 2008
New Revision: 37106
URL:
http://svn.reactos.org/svn/reactos?rev=37106&view=rev
Log:
- Try fix GetNetworkParams api
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] Thu Oct 30 14:27:58
2008
@@ -1388,8 +1388,29 @@
CopyMemory(&pFixedInfo->DnsServerList, resInfo->DnsList,
sizeof(IP_ADDR_STRING));
if (resInfo->riCount > 1)
{
- pFixedInfo->DnsServerList.Next = (struct _IP_ADDR_STRING*)((char*)pFixedInfo +
sizeof(FIXED_INFO));
- CopyMemory(pFixedInfo->DnsServerList.Next, resInfo->DnsList->Next,
sizeof(IP_ADDR_STRING) * (resInfo->riCount-1));
+
+ IP_ADDR_STRING *pSrc = resInfo->DnsList->Next;
+ IP_ADDR_STRING *pTarget = (struct _IP_ADDR_STRING*)((char*)pFixedInfo +
sizeof(FIXED_INFO));
+
+ pFixedInfo->DnsServerList.Next = pTarget;
+
+ do
+ {
+ CopyMemory(pTarget, pSrc, sizeof(IP_ADDR_STRING));
+ resInfo->riCount--;
+ if (resInfo->riCount > 1)
+ {
+ pTarget->Next = (IP_ADDR_STRING*)((char*)pTarget + sizeof(IP_ADDR_STRING));
+ pTarget = pTarget->Next;
+ pSrc = pSrc->Next;
+ }
+ else
+ {
+ pTarget->Next = NULL;
+ break;
+ }
+ }
+ while(TRUE);
}
}