Commit f28cd51d authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

inetmib1: Add initialization function for getting the MIB2 number of interfaces.

parent 709a0a46
......@@ -4,6 +4,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = inetmib1.dll
IMPORTS = snmpapi kernel32
DELAYIMPORTS = iphlpapi
C_SRCS = \
main.c
......
......@@ -23,6 +23,7 @@
#include "windef.h"
#include "winbase.h"
#include "snmp.h"
#include "iphlpapi.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(inetmib1);
......@@ -56,7 +57,23 @@ struct mibImplementation
void (*init)(void);
};
static UINT mib2IfNumber[] = { 1,3,6,1,2,1,2,1 };
static PMIB_IFTABLE ifTable;
static void mib2IfNumberInit(void)
{
DWORD size = 0, ret = GetIfTable(NULL, &size, FALSE);
if (ret == ERROR_INSUFFICIENT_BUFFER)
{
ifTable = HeapAlloc(GetProcessHeap(), 0, size);
if (ifTable)
GetIfTable(ifTable, &size, FALSE);
}
}
static struct mibImplementation supportedIDs[] = {
{ DEFINE_OID(mib2IfNumber), mib2IfNumberInit },
};
BOOL WINAPI SnmpExtensionInit(DWORD dwUptimeReference,
......
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