FIX: Setsockopt() for Winsock over Appletalk Returns Error

Last reviewed: October 29, 1997
Article ID: Q129062
3.50 WINDOWS NT kbnetwork kb3rdparty kbfixlist kbbuglist

The information in this article applies to

  • Microsoft Win32 Software Development Kit (SDK) version 3.5

SYMPTOMS

After you open a socket of type SOCK_STREAM by using the ATPROTO_ADSP protocol, and bind to a dynamic socket, the setsockopt() function fails under these conditions:

  • The setsockopt() function uses the zone name returned by getsockopt() (also found by looking at the control panel network entry) with the SO_LOOKUP_MYZONE option.
  • The zone name is supplied to setsockopt() with the SO_REGISTER_NAME option.

Error code 10022 (WSAINVAL :Invalid Argument) is returned on calling GetLastError().

RESOLUTION

Instead of passing the string returned by getsockopt() for the zone name, use the character "*" for the ZoneName member of the WSH_REGISTER_NAME struct. For example, use this:

   WSH_REGISTER_NAME regName;
   ........
   strcpy( regName.ZoneName, "*");

instead of this:

   strcpy( regName.ZoneName, "BLDG/1");

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem was corrected in Windows NT 3.51.

REFERENCES

Windows Sockets for Appletalk (SFMWSHAT.WRI version 1.2).


Additional reference words: 3.50
KBCategory: kbnetwork kbfixlist kbbuglist
KBSubcategory: NtwkWinsock
Solution Type : kbfix


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