* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#define WIN32_NO_STATUS
-
-#include <config.h>
#include <assert.h>
#include <stdarg.h>
#include <stdlib.h>
-//#include <limits.h>
+#include <limits.h>
#define NONAMELESSUNION
-#include <windef.h>
-#include <winbase.h>
-#include <snmp.h>
-#include <iphlpapi.h>
-#include <wine/debug.h>
+#include "windef.h"
+#include "winbase.h"
+#include "snmp.h"
+#include "iphlpapi.h"
+#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(inetmib1);
}
typedef void (*oidToKeyFunc)(AsnObjectIdentifier *oid, void *dst);
-typedef int (*compareFunc)(const void *key, const void *value);
+typedef int (__cdecl *compareFunc)(const void *key, const void *value);
/* Finds the first value in the table that matches key. Returns its 1-based
* index if found, or 0 if not found.
}
static struct structToAsnValue mib2IpMap[] = {
- { FIELD_OFFSET(MIB_IPSTATS, dwForwarding), copyInt }, /* 1 */
+ { FIELD_OFFSET(MIB_IPSTATS, u.dwForwarding), copyInt }, /* 1 */
{ FIELD_OFFSET(MIB_IPSTATS, dwDefaultTTL), copyInt }, /* 2 */
{ FIELD_OFFSET(MIB_IPSTATS, dwInReceives), copyInt }, /* 3 */
{ FIELD_OFFSET(MIB_IPSTATS, dwInHdrErrors), copyInt }, /* 4 */
row->dwAddr = oidToIpAddr(oid);
}
-static int compareIpAddrRow(const void *a, const void *b)
+static int __cdecl compareIpAddrRow(const void *a, const void *b)
{
const MIB_IPADDRROW *key = a, *value = b;
{ FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardMetric3), copyInt },
{ FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardMetric4), copyInt },
{ FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardNextHop), copyIpAddr },
- { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardType), copyInt },
- { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardProto), copyInt },
+ { FIELD_OFFSET(MIB_IPFORWARDROW, u1.dwForwardType), copyInt },
+ { FIELD_OFFSET(MIB_IPFORWARDROW, u2.dwForwardProto), copyInt },
{ FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardAge), copyInt },
{ FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardMask), copyIpAddr },
{ FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardMetric5), copyInt },
row->dwForwardDest = oidToIpAddr(oid);
}
-static int compareIpForwardRow(const void *a, const void *b)
+static int __cdecl compareIpForwardRow(const void *a, const void *b)
{
const MIB_IPFORWARDROW *key = a, *value = b;
{ FIELD_OFFSET(MIB_IPNETROW, dwIndex), copyInt },
{ FIELD_OFFSET(MIB_IPNETROW, dwPhysAddrLen), copyIpNetPhysAddr },
{ FIELD_OFFSET(MIB_IPNETROW, dwAddr), copyIpAddr },
- { FIELD_OFFSET(MIB_IPNETROW, dwType), copyInt },
+ { FIELD_OFFSET(MIB_IPNETROW, u.dwType), copyInt },
};
static void mib2IpNetInit(void)
}
static struct structToAsnValue mib2TcpMap[] = {
- { FIELD_OFFSET(MIB_TCPSTATS, dwRtoAlgorithm), copyInt },
+ { FIELD_OFFSET(MIB_TCPSTATS, u.dwRtoAlgorithm), copyInt },
{ FIELD_OFFSET(MIB_TCPSTATS, dwRtoMin), copyInt },
{ FIELD_OFFSET(MIB_TCPSTATS, dwRtoMax), copyInt },
{ FIELD_OFFSET(MIB_TCPSTATS, dwMaxConn), copyInt },
row->dwLocalPort = oid->ids[4];
}
-static int compareUdpRow(const void *a, const void *b)
+static int __cdecl compareUdpRow(const void *a, const void *b)
{
const MIB_UDPROW *key = a, *value = b;
int ret;
pFirstSupportedRegion);
minSupportedIDLength = UINT_MAX;
- for (i = 0; i < sizeof(supportedIDs) / sizeof(supportedIDs[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(supportedIDs); i++)
{
if (supportedIDs[i].init)
supportedIDs[i].init();
{
UINT i;
- for (i = 0; i < sizeof(supportedIDs) / sizeof(supportedIDs[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(supportedIDs); i++)
if (supportedIDs[i].cleanup)
supportedIDs[i].cleanup();
}