BUG: WSAIoctl SIO_GET_INTERFACE_LIST Option Problem

Last reviewed: February 20, 1998
Article ID: Q181520
The information in this article applies to:
  • Microsoft Windows NT 4.0

SYMPTOMS

The Winsock 2 WSAIoctl() SIO_GET_INTERFACE_LIST API option fails to retrieve valid IP interface information on Windows NT 4.0 when it is compiled with include files from the latest Platform SDK release (Oct 97 and later).

CAUSE

The INTERFACE_INFO typedef in WS2TCPIP.H is incompatible with Winsock 2 on Windows NT 4.0. This header file takes future IPV6 capabilities into consideration, which causes the INTERFACE_INFO type to be too large for IP data retrieved from WSAIoctl().

RESOLUTION

To work around this, you can define and use the original prototype of INTERFACE_INFO in WSAIoctl() calls in your application as a new type definition. The original type is referenced as normal. However, by adding a C preprocessor define to replace all occurrences of the original type with the type just defined, the process is practically transparent to the programmer. Notice in the following section of code, the correctly sized structure is defined as OLD_INTERFACE_INFO followed by a preprocessor define that replaces all occurrences of the incorrect INTERFACE_INFO with OLD_INTERFACE_INFO.

Sample Code

   typedef struct _OLD_INTERFACE_INFO
   {
      u_long      iiFlags;      /* Interface flags */
      sockaddr   iiAddress;      /* Interface address */
      sockaddr   iiBroadcastAddress;    /* Broadcast address */
      sockaddr   iiNetmask;      /* Network mask */
   } OLD_INTERFACE_INFO;
   
   #define INTERFACE_INFO OLD_INTERFACE_INFO

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.

Keywords          : NtwkWinsock
Version           : WINNT:4.0
Platform          : winnt
Issue type        : kbbug


================================================================================


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: February 20, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.