InternetQueryOption crashes my application

Giganews Newsgroups
Subject: InternetQueryOption crashes my application
Posted by:  John (johnli19…@hotmail.com)
Date: Fri, 04 Mar 2005

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