Newsgroups : Microsoft : microsoft.public.inetsdk.programming.wininet : 2005 Mar : InternetQueryOption crashes my application

www.cryer.info
Managed Newsgroup Archive

InternetQueryOption crashes my application

Subject:InternetQueryOption crashes my application
Posted by:"John" (johnli19..@hotmail.com)
Date:Fri, 4 Mar 2005 20:51:50 GMT

Hey,

I am experiencing difficulty in using InternetQueryOption() in one of my
applications.
Here is the code snippet:

     INTERNET_PROXY_INFO* po;
        DWORD size=0;
   if (!InternetQueryOption(NULL,INTERNET_OPTION_PROXY, NULL, &size))
  {
            po = (INTERNET_PROXY_INFO *) malloc(size);
            if (!InternetQueryOption(NULL,INTERNET_OPTION_PROXY, po, &size))
            {

            }
            free(po);
  }

If I put this code in ANY threads, when application exits, it will crash.
But I can use the same funciton in other applications without any problems.

I am not the original author for this application. And I am wondering what
kind of things could prevent wininet queryOption usage?

Someone has the similar experience and could share your solutions?

Thanks very much!

John

Replies:

www.cryer.info
Managed Newsgroup Archive