Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2008 Feb : SnmpExtensionInit problem

www.cryer.info
Managed Newsgroup Archive

SnmpExtensionInit problem

Subject:SnmpExtensionInit problem
Posted by:"Marcelo Grossi" (magros..@aralia.co.uk)
Date:8 Feb 2008 07:17:52

Hello,

I have a working SNMP Extension Agent DLL that is being loaded by my Windows SNMP Service but I think my SnmpExtensionInit function has a problem.

I'm definetly having memory allocation problems because when I allocate my initial Object Identifier (AsnObjectIdentifier) and pass it to Windows through the SnmpExtensionInit function it immediately calls my SnmpExtensionClose function and if I try to query my subtree through the SNMP service it doesn't work (I can query any other subtrees but my own).

To test against the other default SNMP Extension Agents that come with the Windows SNMP service (example: lmmib2.dll) I made a small App that loads their SnmpExtensionInit and Query functions and use that to pass my structures and see if they are compatible. If I use the Query function it responds to me perfeclty (I think this is because I'm the one doing the memory allocation here). But if I use the SnmpExtensionInit function on them  the structure (Pointer to an AsnObjectIdentifier) that it passes me back is on the very low range of the memory (the pointer addres is always $8 for this one - when my own allocations are on the $1xxxxx range) and thus when I try to read it I get an Access Violation.

I am using the recommended SnmpUtilMem***** functions of 'snmpapi.dll' to make all the memory allocations and deallocations of my DLL. How come the other Extension Agents use such a memory address on their allocations?

I don't have any replacements to the Delphi's Memory Manager (although I did try one to see if it works - but it didn't). Does anyone have any idea what I am doing wrong? I am using Windows XP and Delphi 7.

Thank you very much for your time,

Marcelo Grossi

Replies:

www.cryer.info
Managed Newsgroup Archive