WinSNMP Common Error Codes

[This is preliminary documentation and subject to change.]

The SnmpGetLastError function can return a general error code after a WinSNMP function fails. The following table lists the WinSNMP common error codes.

Error code Meaning Recommended action
SNMPAPI_
NOT_INITIALIZED
The SnmpStartup function did not complete successfully either since program execution began, or since a call to the SnmpCleanup function completed successfully. The application should call SnmpGetLastError before it calls any other WinSNMP Manager API function when SnmpStartup fails. The SnmpGetLastError function returns extended error information about the failure of SnmpStartup.
SNMPAPI_
ALLOC_ERROR
An error occurred during memory allocation. The Microsoft WinSNMP implementation could not obtain sufficient resources to execute the request. The application should free resources, reduce resource requirements, or facilitate a graceful shutdown. A graceful shutdown includes multiple calls to the SnmpClose function, one for each open WinSNMP session. It also includes a call to the SnmpCleanup function.
SNMPAPI_
OTHER_ERROR
An unknown or undefined error occurred. The application should usually respond with a graceful shutdown. A graceful shutdown includes multiple calls to the SnmpClose function, one for each open WinSNMP session. It also includes a call to the SnmpCleanup function.

The WinSNMP errors that convey context-specific information are noted in each function's reference page.