Microsoft KB Archive/838099

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

Article ID: 838099

Article Last Modified on 1/5/2007

-

APPLIES TO

 Microsoft Windows HTTP Services 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 Edition</li></ul>

 Microsoft Windows 2000 Server</li></ul> </li></ul>

-

<div class="notice_section">

<div class="symptoms_section">

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.

<div class="resolution_section">

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:

http://msdn2.microsoft.com/en-us/library/aa384276.aspx

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: <ol> Use the following command to unregister the WinHTTP5.dll file:

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

</li> Use the following command to register the WinHTTP.dll file:

regsvr32 C:\WINNT\system32\winhttp.dll

</li></ol>

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. <pre class="fixed_text">  Date         Time   Version        Size     File name 08-Mar-2004 17:22  5.0.2613.1004  298,936  Winhttp5.dll

<div class="status_section">

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

<div class="moreinformation_section">

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

Keywords: kbbug kbfix kbqfe kbwin2000sp3fix kbwin2000presp5fix KB838099

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.