Access Violation in Wininet.dll When a Programs Calls InternetSetOption

Article translations Article translations
Article ID: 315466 - View products that this article applies to.
This article was previously published under Q315466
Expand all | Collapse all

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:
http://msdn.microsoft.com/en-us/library/aa918735.aspx
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);
}
				

Properties

Article ID: 315466 - Last Review: January 31, 2007 - Revision: 4.9
APPLIES TO
  • Microsoft Internet Explorer 6.0, when used with:
    • Microsoft Windows XP Home Edition
    • Microsoft Windows XP Professional
    • Microsoft Windows XP Media Center Edition
    • Microsoft Windows XP Tablet PC Edition
    • Microsoft Windows 2000 Advanced Server
    • Microsoft Windows 2000 Datacenter Server
    • Microsoft Windows 2000 Professional Edition
    • Microsoft Windows 2000 Server
    • Microsoft Windows NT Server 4.0 Standard Edition
    • Microsoft Windows NT Server 4.0, Terminal Server Edition
    • Microsoft Windows NT Workstation 4.0 Developer Edition
    • Microsoft Windows 98 Second Edition
    • Microsoft Windows 98 Standard Edition
Keywords: 
kbbug kberrmsg kbfix kbie600presp1fix kbie600sp1fix KB315466

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com