locked
socket error Error: 10014 RRS feed

  • Question

  • Hi,

     In my hook application ,while i am trying to connect throgh myconnect function i am getting the error Error: 183,Error: 10014..

    I am redirecting the connect through proxy..

     my connect call is

    sockaddr_in *inName = (sockaddr_in *)(name);

     

    inName->sin_family = AF_INET; 

     inName->sin_addr.s_addr = inet_addr("192.168.1.5"); 

     inName->sin_port = htons(80); 

     

    int iResult = orig_connect(s, (struct sockaddr*)&inName, sizeof(inName)); 

     

    Pls help me to solve this problem.


    vkg
    • Moved by Rob Pan Monday, August 29, 2011 8:35 AM (From:Visual C++ General)
    Tuesday, August 23, 2011 5:32 AM

All replies

  • Use tools Error lookup : 10014 -> The system detected an invalid pointer address in attempting to use a pointer argument in a call.

    Your inName pointer points to name, but you don't show where that is defined.

    Rob
    www.robtso.nl

    Tuesday, August 23, 2011 10:25 AM
  • vkgktm wrote:

    my connect call is

    sockaddr_in *inName = (sockaddr_in *)(name);

    What's 'name'? How is it defined?

    inName->sin_family = AF_INET;
    inName->sin_addr.s_addr = inet_addr("192.168.1.5");
    inName->sin_port = htons(80);
    int iResult = orig_connect(s, (struct sockaddr*)&inName,  sizeof(inName));

    inName is of type sockaddr_in* already. &inName is sockaddr_in**  (pointer to pointer to sockaddr_in), which you then improperly cast to  sockaddr_in*. If orig_connect is anything like connect(), you want

    int iResult = orig_connect(s, inName, sizeof(*inName));


    Igor Tandetnik

    Tuesday, August 23, 2011 11:59 AM
  • this is  my fuction call to hook the connect... I am trying to hook the connect and redirect through my proxy...
    int WINAPI my_connect(SOCKET s, const struct sockaddr *name, int namelen) 
           OutputDebugString("in my connect");
         
      sockaddr_in *inName = (sockaddr_in *)name; 
      char* ip = inet_ntoa(inName->sin_addr); 
      u_short port = ntohs(inName->sin_port); 
      log_to_file("%s%s%s%i\n","Connect to: ",ip,":",port); 
               
    inName->sin_family = AF_INET; 
               inName->sin_addr.s_addr = inet_addr("192.168.1.5"); 
       inName->sin_port = htons(80); 
      ip = inet_ntoa(inName->sin_addr); 
       port = ntohs(inName->sin_port); 
      log_to_file("%s%s%s%i\n","Redirect to: ",ip,":",port); 
            int iResult = orig_connect(s,( const sockaddr *)inName, sizeof(*inName));
    .....
    .....
    .......
    }

    vkg
    Tuesday, August 23, 2011 12:15 PM
  • vkgktm wrote:

    this is my fuction call to hook the connect... I am trying to hook the  connect and redirect through my proxy...

    int iResult = orig_connect(s,( const sockaddr *)inName,  sizeof(*inName));

    So, with this change, is there still a problem?


    Igor Tandetnik

    Tuesday, August 23, 2011 12:44 PM
  • Now the 10014 error gone and i am able to connect to the proxy, but from the proxy i am getting the message request denied..what does it means
    vkg
    Tuesday, August 23, 2011 12:56 PM
  • vkgktm wrote:

    Now the 10014 error gone and i am able to connect to the proxy, but  from the proxy i am getting the message request denied..what
    does it means

    It means that your request was denied, I suppose.


    Igor Tandetnik

    Tuesday, August 23, 2011 1:46 PM
  • Hi vkgktm,

     

    According to your description, it seems that your thread is about Windows Network. So I suggest you can send you issue to the website below for better support: http://social.msdn.microsoft.com/Forums/en-US/category/windevnetworking

    Thanks for your understanding.

     

    Best Regards,

    Rob


    Rob Pan [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, August 29, 2011 8:34 AM