coder1024
2006-03-13 12:41:27 UTC
My application is periodically (twice per minute) using HTTP to submit
information to a web server and to download information from it using the
WinINet APIs.
After running overnight, I noticed in Task Manager that the #of handles had
grown rather large. Using WinDbg and the handle utility from the
sysinternals web site, I was able to discover that the handle growth was all
registry key handles and that it was the same key over and over (over a
thousand of these so far). The key being leaked is shown below.
HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap
My sequence of calls is shown below.
InternetOpen <at initialization>
--- for each request ---
InternetCrackUrl
InternetConnect
InternetSetOption
HttpOpenRequest
HttpAddRequestHeaders
HttpSendRequest
HttpQueryInfo
InternetReadFile
InternetClose <at shutdown>
I've gone through my code and it appears I'm releasing any handle I'm given,
so it seems like the leak is internal. Is there any workaround for this?
information to a web server and to download information from it using the
WinINet APIs.
After running overnight, I noticed in Task Manager that the #of handles had
grown rather large. Using WinDbg and the handle utility from the
sysinternals web site, I was able to discover that the handle growth was all
registry key handles and that it was the same key over and over (over a
thousand of these so far). The key being leaked is shown below.
HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap
My sequence of calls is shown below.
InternetOpen <at initialization>
--- for each request ---
InternetCrackUrl
InternetConnect
InternetSetOption
HttpOpenRequest
HttpAddRequestHeaders
HttpSendRequest
HttpQueryInfo
InternetReadFile
InternetClose <at shutdown>
I've gone through my code and it appears I'm releasing any handle I'm given,
so it seems like the leak is internal. Is there any workaround for this?