Commit 80969f53 authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

iphlpapi: For platforms that do not implement /proc, return Unimplemented for…

iphlpapi: For platforms that do not implement /proc, return Unimplemented for the functions trying to read from there.
parent 826a6d09
...@@ -852,8 +852,8 @@ DWORD WINAPI GetBestRoute(DWORD dwDestAddr, DWORD dwSourceAddr, PMIB_IPFORWARDRO ...@@ -852,8 +852,8 @@ DWORD WINAPI GetBestRoute(DWORD dwDestAddr, DWORD dwSourceAddr, PMIB_IPFORWARDRO
if (!pBestRoute) if (!pBestRoute)
return ERROR_INVALID_PARAMETER; return ERROR_INVALID_PARAMETER;
AllocateAndGetIpForwardTableFromStack(&table, FALSE, GetProcessHeap(), 0); ret = AllocateAndGetIpForwardTableFromStack(&table, FALSE, GetProcessHeap(), 0);
if (table) { if (table && !ret) {
DWORD ndx, matchedBits, matchedNdx = 0; DWORD ndx, matchedBits, matchedNdx = 0;
for (ndx = 0, matchedBits = 0; ndx < table->dwNumEntries; ndx++) { for (ndx = 0, matchedBits = 0; ndx < table->dwNumEntries; ndx++) {
...@@ -881,7 +881,7 @@ DWORD WINAPI GetBestRoute(DWORD dwDestAddr, DWORD dwSourceAddr, PMIB_IPFORWARDRO ...@@ -881,7 +881,7 @@ DWORD WINAPI GetBestRoute(DWORD dwDestAddr, DWORD dwSourceAddr, PMIB_IPFORWARDRO
} }
HeapFree(GetProcessHeap(), 0, table); HeapFree(GetProcessHeap(), 0, table);
} }
else else if (!ret)
ret = ERROR_OUTOFMEMORY; ret = ERROR_OUTOFMEMORY;
TRACE("returning %d\n", ret); TRACE("returning %d\n", ret);
return ret; return ret;
......
...@@ -182,7 +182,10 @@ DWORD getInterfaceStatsByName(const char *name, PMIB_IFROW entry) ...@@ -182,7 +182,10 @@ DWORD getInterfaceStatsByName(const char *name, PMIB_IFROW entry)
fclose(fp); fclose(fp);
} }
else else
{
ERR ("unimplemented!\n"); ERR ("unimplemented!\n");
return ERROR_NOT_SUPPORTED;
}
return NO_ERROR; return NO_ERROR;
} }
...@@ -312,7 +315,10 @@ DWORD getICMPStats(MIB_ICMP *stats) ...@@ -312,7 +315,10 @@ DWORD getICMPStats(MIB_ICMP *stats)
fclose(fp); fclose(fp);
} }
else else
{
ERR ("unimplemented!\n"); ERR ("unimplemented!\n");
return ERROR_NOT_SUPPORTED;
}
return NO_ERROR; return NO_ERROR;
} }
...@@ -426,7 +432,10 @@ DWORD getIPStats(PMIB_IPSTATS stats) ...@@ -426,7 +432,10 @@ DWORD getIPStats(PMIB_IPSTATS stats)
fclose(fp); fclose(fp);
} }
else else
{
ERR ("unimplemented!\n"); ERR ("unimplemented!\n");
return ERROR_NOT_SUPPORTED;
}
return NO_ERROR; return NO_ERROR;
} }
...@@ -519,7 +528,10 @@ DWORD getTCPStats(MIB_TCPSTATS *stats) ...@@ -519,7 +528,10 @@ DWORD getTCPStats(MIB_TCPSTATS *stats)
fclose(fp); fclose(fp);
} }
else else
{
ERR ("unimplemented!\n"); ERR ("unimplemented!\n");
return ERROR_NOT_SUPPORTED;
}
return NO_ERROR; return NO_ERROR;
} }
...@@ -575,7 +587,10 @@ DWORD getUDPStats(MIB_UDPSTATS *stats) ...@@ -575,7 +587,10 @@ DWORD getUDPStats(MIB_UDPSTATS *stats)
fclose(fp); fclose(fp);
} }
else else
{
ERR ("unimplemented!\n"); ERR ("unimplemented!\n");
return ERROR_NOT_SUPPORTED;
}
return NO_ERROR; return NO_ERROR;
} }
...@@ -963,7 +978,7 @@ DWORD getRouteTable(PMIB_IPFORWARDTABLE *ppIpForwardTable, HANDLE heap, ...@@ -963,7 +978,7 @@ DWORD getRouteTable(PMIB_IPFORWARDTABLE *ppIpForwardTable, HANDLE heap,
else else
{ {
ERR ("unimplemented!\n"); ERR ("unimplemented!\n");
return ERROR_INVALID_PARAMETER; return ERROR_NOT_SUPPORTED;
} }
#endif #endif
} }
...@@ -984,7 +999,7 @@ DWORD getArpTable(PMIB_IPNETTABLE *ppIpNetTable, HANDLE heap, DWORD flags) ...@@ -984,7 +999,7 @@ DWORD getArpTable(PMIB_IPNETTABLE *ppIpNetTable, HANDLE heap, DWORD flags)
#if defined(HAVE_SYS_SYSCTL_H) && defined(NET_RT_DUMP) #if defined(HAVE_SYS_SYSCTL_H) && defined(NET_RT_DUMP)
ERR ("unimplemented!\n"); ERR ("unimplemented!\n");
return ERROR_INVALID_PARAMETER; return ERROR_NOT_SUPPORTED;
#endif #endif
if (!ppIpNetTable) if (!ppIpNetTable)
...@@ -1064,6 +1079,8 @@ DWORD getArpTable(PMIB_IPNETTABLE *ppIpNetTable, HANDLE heap, DWORD flags) ...@@ -1064,6 +1079,8 @@ DWORD getArpTable(PMIB_IPNETTABLE *ppIpNetTable, HANDLE heap, DWORD flags)
} }
fclose(fp); fclose(fp);
} }
else
ret = ERROR_NOT_SUPPORTED;
} }
else else
ret = ERROR_OUTOFMEMORY; ret = ERROR_OUTOFMEMORY;
...@@ -1082,7 +1099,7 @@ DWORD getUdpTable(PMIB_UDPTABLE *ppUdpTable, HANDLE heap, DWORD flags) ...@@ -1082,7 +1099,7 @@ DWORD getUdpTable(PMIB_UDPTABLE *ppUdpTable, HANDLE heap, DWORD flags)
#if defined(HAVE_SYS_SYSCTL_H) && defined(NET_RT_DUMP) #if defined(HAVE_SYS_SYSCTL_H) && defined(NET_RT_DUMP)
ERR ("unimplemented!\n"); ERR ("unimplemented!\n");
return ERROR_INVALID_PARAMETER; return ERROR_NOT_SUPPORTED;
#endif #endif
if (!ppUdpTable) if (!ppUdpTable)
...@@ -1132,6 +1149,8 @@ DWORD getUdpTable(PMIB_UDPTABLE *ppUdpTable, HANDLE heap, DWORD flags) ...@@ -1132,6 +1149,8 @@ DWORD getUdpTable(PMIB_UDPTABLE *ppUdpTable, HANDLE heap, DWORD flags)
} }
fclose(fp); fclose(fp);
} }
else
ret = ERROR_NOT_SUPPORTED;
} }
else else
ret = ERROR_OUTOFMEMORY; ret = ERROR_OUTOFMEMORY;
...@@ -1294,7 +1313,7 @@ DWORD getTcpTable(PMIB_TCPTABLE *ppTcpTable, DWORD maxEntries, HANDLE heap, ...@@ -1294,7 +1313,7 @@ DWORD getTcpTable(PMIB_TCPTABLE *ppTcpTable, DWORD maxEntries, HANDLE heap,
/* get from /proc/net/tcp, no error if can't */ /* get from /proc/net/tcp, no error if can't */
fp = fopen("/proc/net/tcp", "r"); fp = fopen("/proc/net/tcp", "r");
if (!fp) if (!fp)
return NO_ERROR; return ERROR_NOT_SUPPORTED;
/* skip header line */ /* skip header line */
ptr = fgets(buf, sizeof(buf), fp); ptr = fgets(buf, sizeof(buf), fp);
......
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