救教各位大虾,我在WIN98中使用WSAIoctl函数可以正常运行,但是同样的代码到了WIN2000下就报错,WINSOCK错误号是10038,这是为什么?是引用的链接库不对吗?

解决方案 »

  1.   

    WSAIoctl
    The Windows Sockets WSAIoctl function controls the mode of a socket.int WSAIoctl (
      SOCKET s,                                               
      DWORD dwIoControlCode,                                  
      LPVOID lpvInBuffer,                                     
      DWORD cbInBuffer,                                       
      LPVOID lpvOUTBuffer,                                    
      DWORD cbOUTBuffer,                                      
      LPDWORD lpcbBytesReturned,                              
      LPWSAOVERLAPPED lpOverlapped,                           
      LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionROUTINE  
    );
     
    Parameters

    [in] A descriptor identifying a socket. 
    dwIoControlCode 
    [in] The control code of operation to perform. 
    lpvInBuffer 
    [in] A pointer to the input buffer. 
    cbInBuffer 
    [in] A number indicating the size of the input buffer. 
    lpvOutBuffer 
    [out] A pointer to the output buffer. 
    cbOutBuffer 
    [in] A number indicating the size of the output buffer. 
    lpcbBytesReturned 
    [out] A pointer to actual number of bytes of output. 
    lpOverlapped 
    [in] A pointer to a WSAOVERLAPPED structure (ignored for non-overlapped sockets). 
    lpCompletionRoutine 
    [in] A pointer to the completion routine called when the operation has been completed (ignored for non-overlapped sockets). QuickInfo
      Windows NT: Yes
      Windows: Yes
      Windows CE: Unsupported.
      Header: Declared in winsock2.h.
      Import Library: Link with ws2_32.lib.
    2000也是nt,把报的错贴上sckNotSocket 10038 描述符不是套接字。