SNMPAPI_CALLBACK

[This is preliminary documentation and subject to change.]

The Microsoft WinSNMP implementation calls the SNMPAPI_CALLBACK function to notify a WinSNMP session that an SNMP message or asynchronous event is available.

SNMPAPI_CALLBACK is a placeholder for an application- or library-defined callback function name.

SNMPAPI_STATUS CALLBACK SNMPAPI_CALLBACK(
  HSNMP_SESSION hSession,  // handle to the WinSNMP session
  HWND hWnd,               // handle to the notification window
  UINT wMsg,               // window notification message number
  WPARAM wParam,           // type of notification
  LPARAM lParam,           // request identifier of PDU
  LPVOID lpClientData      // optional application-defined data
);
 

Parameters

hSession
Handle to the WinSNMP session.
hWnd
Handle to a window of the WinSNMP manager application to notify when an asynchronous request completes, or when trap notification occurs. This parameter does not have significance for the WinSNMP session, but the implementation always passes the value to the callback function.
wMsg
Specifies an unsigned integer that identifies the notification message to send to the WinSNMP manager application window. This parameter does not have significance for the WinSNMP session, but the implementation always passes the value to the callback function.
wParam
Specifies an application-defined 32-bit value that identifies the type of notification. If this parameter is equal to zero, an SNMP message is available for the session. The manager application should call the SnmpRecvMsg function to retrieve the message. If this parameter is not equal to zero, it indicates an asynchronous event notification for the session. For additional information, see the following Remarks section.
lParam
Specifies an application-defined 32-bit value that specifies the request identifier of the PDU being processed.
lpClientData
If the lpClientData parameter was not NULL on the call to the SnmpCreateSession function for this session, this parameter is a pointer to application-defined data.

Return Values

The function must return SNMPAPI_SUCCESS to continue execution of the manager application. If the function returns any other value, the implementation responds as if the manager application called the SnmpClose function for the indicated session.

Remarks

When the implementation is executing the retransmission policy for the WinSNMP manager application and a transmission time-out occurs, the implementation informs the session of the error. In this situation the value of the wParam parameter would be SNMPAPI_TL_TIMEOUT. For a list of other transport layer errors, see the reference pages for the SnmpRegister, SnmpSendMsg, and SnmpRecvMsg functions.

QuickInfo

  Windows NT: Requires version 5.0 or later. Available as a redistributable for Windows NT 4.0.
  Windows: Unsupported.
  Windows CE: Unsupported.
  Header: Declared in winsnmp.h.
  Import Library: User-defined.

See Also

WinSNMP Manager API Overview, WinSNMP Functions, SnmpCreateSession, SnmpClose, SnmpOpen