FIX: Your application leaks two event handles every time that the application makes an HTTP request on Windows XP and on Windows 2000 SP3 (838099)



The information in this article applies to:

  • Microsoft Windows HTTP Services (WinHTTP) 5.0, when used with:
    • Microsoft Windows XP Service Pack 1
    • Microsoft Windows 2000 Advanced Server
    • Microsoft Windows 2000 Datacenter Server
    • Microsoft Windows 2000 Professional
    • Microsoft Windows 2000 Server

SYMPTOMS

The SetProxy method sets the proxy server for an HTTP request. When you create an application that uses the WinHttpRequest object, if you call the Open method before you call the SetProxy method, your application may leak two event handles every time that the application makes an HTTP request.

RESOLUTION

Service pack information

To resolve this problem, obtain the latest service pack for Microsoft Windows XP or for Microsoft Windows 2000. For more information, click the following article numbers to view the articles in the Microsoft Knowledge Base:

322389 How to obtain the latest Windows XP service pack

260910 How to obtain the latest Windows 2000 service pack

The WinHTTP5.dll hotfix file has been replaced by the WinHTTP.dll file that is included in Windows 2000 Service Pack 3 (SP3) and in Windows XP Service Pack 2 (SP2). Use the WinHTTP.dll file instead of the WinHTTP5.dll file. Support for the WinHTTP5.dll file expired October 1, 2004. For more information, visit the following Microsoft Developer Network (MSDN) Web site: If the original WinHTTP5.dll file was not unregistered when you installed Windows 2000 SP3 or a later service pack, the server will continue to use the original WinHTTP5.dll file. If this behavior occurs, you will experience the known issues that were addressed in the hotfix. If you have already installed Windows 2000 SP3 or a later service pack, or you have installed Windows XP SP2, search for the WinHTTP.dll file. If the WinHTTP.dll file is in the same folder as the WinHTTP5.dll file, follow these steps:
  1. Use the following command to unregister the WinHTTP5.dll file:

    regsvr32 C:\WINNT\system32\winhttp5.dll /u

  2. Use the following command to register the WinHTTP.dll file:

    regsvr32 C:\WINNT\system32\winhttp.dll

Hotfix information

The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
   Date         Time   Version        Size     File name
   --------------------------------------------------------
   08-Mar-2004  17:22  5.0.2613.1004  298,936  Winhttp5.dll

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. This problem was first corrected in Windows 2000 Service Pack 3.

MORE INFORMATION

To verify that your application has a handle leak, monitor the Handle count in Microsoft Windows Task Manager. In Task Manager, verify that your application is leaking two handles every time that your application makes a new request. Also, verify that the handles are not released for a long time.

For more information about the terminology that is used to describe Microsoft product updates, click the following article number to view the article in the Microsoft Knowledge Base:

824684 Description of the standard terminology that is used to describe Microsoft software updates


Modification Type:MajorLast Reviewed:4/20/2005
Keywords:kbWin2000preSP5fix kbWin2000sp3fix kbfix kbBug kbQFE KB838099 kbAudDeveloper