Access Violation in Wininet.dll When a Programs Calls InternetSetOption (315466)



The information in this article applies to:

  • Microsoft Internet Explorer version 6 for Windows XP
  • Microsoft Internet Explorer version 6 for Windows 2000
  • Microsoft Internet Explorer version 6 for Windows 98
  • Microsoft Internet Explorer version 6 for Windows 98 Second Edition
  • Microsoft Internet Explorer version 6 for Windows NT 4.0

This article was previously published under Q315466

SYMPTOMS

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.

CAUSE

The problem occurs if the InternetSetOption function is called after another function is called.

RESOLUTION

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 the Microsoft Knowledge Base:

328548 How to Obtain the Latest Internet Explorer 6 Service Pack

STATUS

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.

MORE INFORMATION

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);
}
				

Modification Type:MinorLast Reviewed:4/4/2005
Keywords:kbbug kberrmsg kbfix kbIE600preSP1fix kbIE600sp1fix KB315466