???? ID: 822334 - ????? ???????: 05 ?????? 2010 - ??????: 2.0

BUG: ????????? ????????? ????? FreeAddrInfoW ?? ???? ???? ?? ?? ?? ???? ????????? ?? Windows XP ?? Windows Server 2003 ??

?????? ??????This article applies to a different operating system than the one you are using. Article content that may not be relevant to you is disabled.
???:Microsoft Visual C++ .NET 2002 ?? Microsoft Visual C++ .NET 2003 Microsoft .NET Framework ?????? ??? ?? ??? ?? ???????? ???? ?? ????????? ??? Microsoft Windows ??? ???? ?? ??? ??????? ?? ???? ??? ?? ?? ??????? ???? ????????? ????? C++ ??? ?? ??? ???? ???? ???

?? ????? ??

??? ?? ??????? ???? | ??? ?? ??????? ????

?????

?? ?? ?? ???????-????? ????????? ????? ?? ????? ???? ??FreeAddrInfoWindows ??????? ??????, ?? ???? ????? ????? ???? ????ATL::CSocketAddr???????? ?? Microsoft Windows Server 2003 ?? Microsoft Windows XP ??? ??? ??, ?? ???? ????? ?????? ????? ??? ???? ??:
????????? ????????? ????? FreeAddrInfoW WS2_32.dll ???????? ???? ????????? ??? ???? ????? ?? ????

????

Ws2_32.dll ????????? ?? ??????? ?? ??????? ??????? ?? ????? ???? ?? ??? ???? ????? ?? FreeAddrInfoW ?????? ????FreeAddrInfo?????? ?? ??? ???? ???..

????????

?? ?????? ?? ?? ???? ?? ???, ????? ????? ?? ???? ????::
  1. ???? ?????????? ?? ????? ???? ????? ??? ?? Atlsocket.h ????? ?? ????????? ?????? ?? ????? ?? ????? ?????????? ??? ????? ??:
    Files\Microsoft Visual Studio .NET ????????? 2003\Vc7\atlmfc\include
  2. ??? 1 ??? ???? ?????? ???? ?? Atlsocket.h ????? ?? ????????? ????? ?? ??? ??? ?? ????? ??? ???????
    //Atlsocket.h
    #pragma comment(lib, "ws2_32.lib")
    #pragma comment(lib, "mswsock.lib")
    //Start of Addition
    #if _WIN32_WINNT < 0x0502
      #define ADDRINFOT addrinfo
      #define GetAddrInfo getaddrinfo
      #define FreeAddrInfo freeaddrinfo
    #endif
    //End of Addition namespace ATL
  3. Microsoft Visual C++ ??????? ?????
  4. ????? ????????????? ??,??????. ?? ???? ??? ?????????????? ????? ???, ??????? ??????????????? ????-????? ????, ?? ???? ???VC ++ ????????????.

    ???:??? ?? Visual C++ ????????? ??????? ?? ????? ?? ??? ???, ???? ??????? ????????????? ?? ???????? ???? ??? ?????????????? ????? ??? ??? ????? ?? ???? ????, ?? ???? ???VC ++ ????????????.
  5. ?? ????????? ??? ?????????? ?? ??????????? ????,??????? ????? ????. ???, ???? Atlsocket.h ????? ?? ??????? ??????? ?? ???? ?? ????? ?? ????? ?? ?????????? ???????
  6. ?? ????????? ??? ??

??????

Microsoft ?? ?????? ?? ?? ?? "?? ?? ????" ???? ??? ???????? Microsoft ???????? ??? ?? ?? ??? ??..

???? ???????

?????? ?? ???: ??????? ???? ?? ??? ???

  1. Microsoft Visual Studio .NET 2003 ?? ??????? ?????
  2. ????? ???????????? ??,????? ????-????? ????, ?? ???? ????????????.
  3. ????? ????,????? C++ ??????????? ???????????????? ??????. ???? ???, ????? ????Win32 ????? ??????????? ???????????????.
  4. ????????????? ???,??????? ????-????? ????, ?? ???? ???OK.
  5. ?????Win32 ????????? ???????????? ????? ???,ATL???? ??? ?????? ????????? ????? ?? ???????????????? ?????????? ????-????? ????, ?? ???? ?????????.
  6. Sample.cpp ????? ??? ????? ??? ?? ??? ?????? ??????? ??? ?? ??????
    #include "stdafx.h"
    #include <atlsocket.h>
    
    void _tmain()
    {
    	CSocketAddr aSocketAddr;
    }
  7. ?????? Explorer ???, ????????? ??? ?? ????-????? ????, ?? ???? ??? ????? ???????.
  8. ????????? ?????? ?????????? ????? ???, ????? ????????????? ?????????????????? ???????? ????.. ???? ??? ??? ??? ???????? ??????? ?? ??? ?????????? ???? ??? ?? ????? ????. ????? ????,OK.
  9. ????? ????????????? ??,??????? ??????????????? ????? ??? ?? ????? ?? ???? ?? ?? ??? compilation ????????? ?? ???? ????????? ????? ????????? ?? ????? ???
  10. ????? ???????? ???????? ??,??????? ???? ???????. ?? "?????" ??? ??? ?????? ?????? ????? ??????? ????? ?? ???? ???
Windows Server 2003 ??? ?? Windows XP ???, ?? Windows ??????? ??????? ???? ?? ??? Windows ????? API ????? ???? ????GetAddrInfo, ??FreeAddrInfoare the two new Windows Sockets functions that are added for dealing with both Internet Protocol version 6 (IPv6) and Internet Protocol version 4 (IPv4) addresses. The Active Template Library (ATL) 7.1CSocketAddrclass uses these new Windows Socket functions to provide support for IPv6. Other ATL and Microsoft Foundation Classes (MFC) classes also use theCSocketAddrclass to provide IPv6 support. ?????? ?? ???,CAsyncSocket???? ??CSMTPConnectionclass use theCSocketAddr?????

???:TheCAsyncSocketclass is an MFC class. TheCSMTPConnectionclass is an ATL class.

?????? ?? ????? ???? ??? ?? ?? ??? "?????" ??? ??? ??? ?? ??????? ????? ???? ???? ?? ????????? ?? ????? ???? ??FreeAddrInfoWindows ????? Windows Server 2003 ?? Windows XP ??? ??? ???????? ???????? ??????? ATLCSocketAddr????? ????FreeAddrInfo?????? ?? ???, ?? ?? ?? ??? ?????? ??? ?? ATL 7.1? ATL 7.1 ?? MFC 7.1 ?? ????? ???? ?? ?? ???? ?? ????CSocketAddrIPv6 ?? ?????? ?? ????? ???? ?? ??? ???? ?? ??????? ?? ??????????? ???? ??? ?????? ?? ???,CAsyncSocket???? ??CSMTPConnection????? ????CSocketAddr?????

???? ATL ????? ????CAtlHttpClient, ??CSoapSocketClientT?? ????? ????ZEvtSyncSocket????, ?? ???????? ?? ?? ??????? ?? ??????? ?? ???? ?? ???????ZEvtSyncSocketinternal class uses theCSocketAddrclass in its implementation.

???:TheCAtlHttpClientclass provides HTTP client support. TheCSoapSocketClientTclass provides XML Web services client support.

??????

For more information about changes that have been made to ATL, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn2.microsoft.com/en-us/library/aa983525(VS.71).aspx (http://msdn2.microsoft.com/en-us/library/aa983525(VS.71).aspx)
For more information about new Windows Socket functions that have been added to the Windows Socket API, visit the following MSDN Web site:
http://msdn2.microsoft.com/en-us/library/ms740642.aspx (http://msdn2.microsoft.com/en-us/library/ms740642.aspx)

???? ???? ???? ??:
  • Microsoft Visual C++ .NET 2003 Standard Edition
  • Microsoft Visual C++ .NET 2002 Standard Edition, ?? ???? ??? ?????? ???? ???:
    • Microsoft Windows Server 2003, Datacenter Edition (32-bit x86)
    • Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
    • Microsoft Windows Server 2003, Standard Edition (32-bit x86)
    • Microsoft Windows Server 2003, Web Edition
    • Microsoft Windows XP Professional
    • Microsoft Windows XP Home Edition
??????: 
kbwinsock kbapi kbappdev kbmt KB822334 KbMthi
???? ?????? ???????????? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:822334  (http://support.microsoft.com/kb/822334/en-us/ )