SnmpFreeDescriptor

[This is preliminary documentation and subject to change.]

The WinSNMP manager application uses the SnmpFreeDescriptor function to inform the Microsoft WinSNMP implementation that it no longer requires access to a descriptor object. This WinSNMP function signals the implementation to free the memory it allocated for the descriptor object.

SNMPAPI_STATUS SnmpFreeDescriptor(
  smiUINT32 syntax,       // data type of target descriptor object
  smiLPOPAQUE descriptor  // pointer to the target descriptor object
);
 

Parameters

syntax
Specifies the syntax data type of the target descriptor object.
descriptor
Pointer to an smiOPAQUE structure that contains the target descriptor object to release.

Return Values

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. The SnmpGetLastError function can return one of the following errors.

Error code Description
SNMPAPI_NOT_INITIALIZED The SnmpStartup function did not complete successfully.
SNMPAPI_ALLOC_ERROR An error occurred during memory allocation.
SNMPAPI_SYNTAX_INVALID The syntax parameter is invalid.
SNMPAPI_OPERATION_INVALID The descriptor parameter is invalid. For additional information, see the following Remarks section.
SNMPAPI_OTHER_ERROR An unknown or undefined error occurred.

Remarks

The implementation allocates and deallocates memory for output descriptor objects with variable lengths. This memory allocation and deallocation are restricted to the implementation, except for the interface that the SnmpFreeDescriptor function provides. For additional information, see Freeing WinSNMP Descriptors.

The implementation returns the SNMPAPI_OPERATION_INVALID error code if the descriptor parameter specifies a memory allocation that the implementation released in a prior call to SnmpFreeDescriptor. The function returns the same error code if the descriptor parameter specifies a memory allocation that the implementation did not make for the calling WinSNMP manager application.

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: Use wsnmp32.lib.

See Also

WinSNMP Manager API Overview, WinSNMP Functions, SnmpStrToOid, SnmpOidCopy, SnmpEncodeMsg