Microsoft KB Archive/838098

= FIX: Your application leaks two event handles every time that the application makes an HTTP request =

Article ID: 838098

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 for every 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 has been replaced by the WinHTTP.dll file in Windows 2000 Service Pack 3 (SP3) and in Windows XP Service Pack 2 (SP2). Support for the WinHTTP5.dll file expired October 1, 2004. Therefore, you should use the WinHTTP.dll file instead of the WinHTTP5.dll file. 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 or when you installed Windows XP SP2, 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 installed Windows 2000 SP3 or a later service pack, or if you 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 and in Windows XP Service Pack 2.

<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 the 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 additional 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 kbwinxpsp2fix kbwinxpsp1fix kbwinxppresp2fix KB838098

-

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

© Microsoft Corporation. All rights reserved.