Microsoft KB Archive/129062

{|
 * width="100%"|

FIX: Setsockopt for Winsock over Appletalk Returns Error

 * }

Q129062

-

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.