the error code it is giving it as 40 which is not mentioned in the SNMP ERROR code list for winapi
If SnmpMgrRequest()
is returning 0 and GetLastError()
is returning 40, then that is SNMP_MGMTAPI_TIMEOUT
, which is defined in Mgmtapi.h:
#define SNMP_MGMTAPI_TIMEOUT 40
SNMP_MGMTAPI_TIMEOUT
is documented as a possible error code from SnmpMgrRequest()
:
If the function fails, the return value is NULL. To get extended error information, call GetLastError, which may return one of the following error codes.
SNMP_MGMTAPI_TIMEOUT The request timed-out.