PRB: SNMP Extension Agent Gives Exception on Windows NT 3.51

Last reviewed: September 29, 1995
Article ID: Q130562
The information in this article applies to:
  • Microsoft Win32 Software Development Kit (SDK) for Windows NT versions 3.5 and 3.51

SYMPTOMS

An SNMP extension agent built using Windows NT version 3.5 SDK headers and libraries generates an exception when run under Windows NT version 3.51.

For example, the SDK toaster sample (\MSTOOLS\SAMPLES\WIN32\SNMP\TESTDLL) works under Windows NT version 3.5 but generates an exception under Windows NT version 3.51.

CAUSE

The SNMP.LIB SDK library has changed between the release of Windows NT version 3.5 and the release of Windows NT version 3.51. Memory is now allocated dynamically with the Win32 API GlobalAlloc() rather than the c-runtime malloc(). See the SNMP.H SDK header file for details.

An SNMP application that is allocating (or freeing) memory that is passed to a function in SNMP.LIB should use SNMP_malloc() (or SNMP_free()). The sample code for the extension DLL provided with the Windows NT version 3.51 beta SDK incorrectly uses malloc().

RESOLUTION

Rebuild the extension agent with the Win32 SDK headers and libraries for Windows NT version 3.51. Please make sure that the Win32 SDK headers and libraries are used before Visual C++ headers and libraries.

Also, to allocate and free any memory, use the SNMP_malloc() and SNMP_free() macros. Both are defined in SNMP.H.

NOTE: If you are using a beta version of Windows NT version 3.51, please change all references to malloc() and free() in the samples to SNMP_malloc() and SNMP_free(). This is a known problem with the testdll sample (MSTOOLS\SAMPLES\WIN32\WINNT\SNMP\TESTDLL).

STATUS

This behavior is by design.

REFERENCES

For more information, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q124961
   TITLE     : BUG: SNMP Sample Generates an Application Error


Additional reference words: 3.50
KBCategory: kbnetwork kbprb
KBSubcategory: NtwkSnmp


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 29, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.