Access Violation in Wininet.dll When a Programs Calls InternetSetOption

This article was previously published under Q315466
This article has been archived. It is offered "as is" and will no longer be updated.
When another program calls the Wininet InternetSetOption function with INTERNET_OPTION_PER_CONNECTION_OPTION and a handle that is not null, you may receive an access violation error message in Wininet.dll.
The problem occurs if the InternetSetOption function is called after another function is called.
To resolve this problem, obtain the latest service pack for Internet Explorer 6. For additional information, click the following article number to view the article in theMicrosoft Knowledge Base:
328548 How to Obtain the Latest Internet Explorer 6 Service Pack
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Internet Explorer 6 Service Pack 1.
The Wininet InternetSetOption function can be used by another program to set an Internet option, such as proxy settings. For additional information about the Wininet InternetSetOption function, see the following Microsoft Web site:The following code reproduces the access violation error message:
void f1(){   return;}void main (){   HINTERNET hInternetOpen;   INTERNET_PER_CONN_OPTION_LIST List;   INTERNET_PER_CONN_OPTION Option[OPTIONS];   unsigned long nSize = sizeof(INTERNET_PER_CONN_OPTION_LIST);   Option[0].dwOption = INTERNET_PER_CONN_PROXY_SERVER;   Option[1].dwOption = INTERNET_PER_CONN_FLAGS;   List.dwSize = sizeof(INTERNET_PER_CONN_OPTION_LIST);   List.pszConnection = NULL;   List.dwOptionCount = OPTIONS;   List.dwOptionError = 0;   List.pOptions = Option;   hInternetOpen=InternetOpen("MyRequester",      INTERNET_OPEN_TYPE_PRECONFIG,NULL,NULL,0);   f1();	   Option[0].Value.pszValue = "http://MyProxy";   Option[1].Value.dwValue = PROXY_TYPE_PROXY;   InternetSetOption(hInternetOpen,       INTERNET_OPTION_PER_CONNECTION_OPTION, &List, nSize);	    InternetCloseHandle(hInternetOpen);}				

Article ID: 315466 - Last Review: 01/12/2015 19:34:15 - Revision: 4.9

  • Microsoft Internet Explorer 6.0
  • kbnosurvey kbarchive kbbug kberrmsg kbfix kbie600presp1fix kbie600sp1fix KB315466