PRB: SnmpMgrStrToOid Assumes Oid Is in Mgmt Subtree

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

SYMPTOMS

When using the SNMP Manager API SnmpMgrStrToOid() and passing it a valid Oid, the application is unable to get the requested variables.

CAUSE

The SNMP Manager API SnmpMgrStrToOid assumes that the Oid that is supplied to it is under the internet MIB of the mgmt subtree (1.3.6.1.2.1.x).

RESOLUTION

To get variables that are not under the mgmt subtree, the Oid must be preceeded by a period (.). For example, say an application is trying to get the system group and the Oid passed to SnmpMgrStrToOid is this:

   1.3.6.1.2.1.1

Then the application will try to get the following, which does not exist:

   iso.org.dod.internet.mgmt.1.1.3.6.1.2.1.1

The correct way to get the system group is to pass this:

   .1.3.6.1.2.1.1

STATUS

This behavior is by design.

REFERENCES

Microsoft Windows/NT SNMP Programmer's Reference (PROGREF.RTF).


Additional reference words: 3.10 3.50
KBCategory: kbnetwork kbprb kbdocerr
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.