Commit 084bcaa7 authored by Bruno Jesus's avatar Bruno Jesus Committed by Alexandre Julliard

iphlpapi: Set MIB_IPADDR_PRIMARY as wType for GetIpAddrTable entries.

parent e0fa7ff4
...@@ -807,7 +807,11 @@ static DWORD getIPAddrRowByName(PMIB_IPADDRROW ipAddrRow, const char *ifName, ...@@ -807,7 +807,11 @@ static DWORD getIPAddrRowByName(PMIB_IPADDRROW ipAddrRow, const char *ifName,
/* FIXME: hardcoded reasm size, not sure where to get it */ /* FIXME: hardcoded reasm size, not sure where to get it */
ipAddrRow->dwReasmSize = 65535; ipAddrRow->dwReasmSize = 65535;
ipAddrRow->unused1 = 0; ipAddrRow->unused1 = 0;
ipAddrRow->wType = 0; /* wType is a bit field composed of MIB_IPADDR_* flags. Windows <= XP seems
* to like returning undocumented values 0x20 + 0x02 but for our current
* needs returning MIB_IPADDR_PRIMARY is enough.
*/
ipAddrRow->wType = MIB_IPADDR_PRIMARY;
return ret; return ret;
} }
......
...@@ -226,7 +226,16 @@ static void testGetIpAddrTable(void) ...@@ -226,7 +226,16 @@ static void testGetIpAddrTable(void)
"GetIpAddrTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n", "GetIpAddrTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n",
apiReturn); apiReturn);
if (apiReturn == NO_ERROR && buf->dwNumEntries) if (apiReturn == NO_ERROR && buf->dwNumEntries)
{
int i;
testGetIfEntry(buf->table[0].dwIndex); testGetIfEntry(buf->table[0].dwIndex);
for (i = 0; i < buf->dwNumEntries; i++)
{
ok (buf->table[i].wType != 0, "Test[%d]: expected wType > 0\n", i);
trace("Entry[%d]: addr %s, dwIndex %u, wType 0x%x\n", i,
ntoa(buf->table[i].dwAddr), buf->table[i].dwIndex, buf->table[i].wType);
}
}
HeapFree(GetProcessHeap(), 0, buf); HeapFree(GetProcessHeap(), 0, buf);
} }
} }
......
...@@ -21,6 +21,13 @@ ...@@ -21,6 +21,13 @@
#include <ifmib.h> #include <ifmib.h>
#include <nldef.h> #include <nldef.h>
/* Flags used in the wType field from MIB_IPADDRROW */
#define MIB_IPADDR_PRIMARY 0x0001
#define MIB_IPADDR_DYNAMIC 0x0004
#define MIB_IPADDR_DISCONNECTED 0x0008
#define MIB_IPADDR_DELETED 0x0040
#define MIB_IPADDR_TRANSIENT 0x0080
/* IPADDR table */ /* IPADDR table */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment