SnmpFreeEntity function (winsnmp.h)

[SNMP is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. Instead, use Windows Remote Management, which is the Microsoft implementation of WS-Man.]

The WinSNMP SnmpFreeEntity function releases resources associated with an SNMP management entity.

Syntax

SNMPAPI_STATUS SNMPAPI_CALL SnmpFreeEntity(
  [in] HSNMP_ENTITY entity
);

Parameters

[in] entity

Handle to the SNMP management entity that will have its resources released.

Return value

If the function succeeds, the return value is SNMPAPI_SUCCESS.

If the function fails, the return value is SNMPAPI_FAILURE. To get extended error information, call SnmpGetLastError specifying a NULL value in its session parameter. The SnmpGetLastError function can return one of the following errors.

Return code Description
SNMPAPI_NOT_INITIALIZED
The SnmpStartup function did not complete successfully.
SNMPAPI_ALLOC_ERROR
An error occurred during memory allocation.
SNMPAPI_ENTITY_INVALID
The entity parameter is invalid.
SNMPAPI_OTHER_ERROR
An unknown or undefined error occurred.

Remarks

When the WinSNMP application calls the SnmpClose function or the SnmpCleanup function, the Microsoft WinSNMP implementation frees all resources it allocated for the WinSNMP session. However, it is recommended that the WinSNMP application free individual resources by using the WinSNMP function that corresponds to the resource. For example, applications should call the SnmpFreeEntity function to release resources allocated by a call to the SnmpStrToEntity function. This reduces the implementation's work load, and should enhance the implementation's service to all applications.

For additional information, see WinSNMP Data Management Concepts.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winsnmp.h
Library Wsnmp32.lib
DLL Wsnmp32.dll

See also

SnmpCleanup

SnmpClose

SnmpStrToEntity

WinSNMP Functions

WinSNMP API Overview