<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Channel 9</title>
    <atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Niners/jeff_dailey/Posts/RSS"></atom:link>
    <itunes:summary></itunes:summary>
    <itunes:author>Microsoft</itunes:author>
    <itunes:subtitle></itunes:subtitle>
    <image>
      <url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
      <title>Channel 9</title>
      <link>http://channel9.msdn.com/Niners/jeff_dailey/Posts</link>
    </image>
    <itunes:image href=""></itunes:image>
    <itunes:category text="Technology"></itunes:category>
    <description>Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with. From LINQ to SilverLight – Watch videos and hear about all the cool technologies coming and the people behind them.</description>
    <link>http://channel9.msdn.com/Niners/jeff_dailey/Posts</link>
    <language>en</language>
    <pubDate>Tue, 21 May 2013 19:59:21 GMT</pubDate>
    <lastBuildDate>Tue, 21 May 2013 19:59:21 GMT</lastBuildDate>
    <generator>Rev9</generator>
    <c9:totalResults>2</c9:totalResults>
    <c9:pageCount>1</c9:pageCount>
    <c9:pageSize>25</c9:pageSize>
  <item>
      <title>Understanding handle leaks and how to use !htrace to find them</title>
      <description><![CDATA[<font face="Calibri">
<p class="MsoNormal"><font size="3">Hello, my name is Jeff Dailey, I’m an <span>E</span>scalation
<span>E</span>ngineer for the Global Escalation Services <span>P</span>latforms team.&nbsp;&nbsp; I’d like to show you how to debug and find leaking handles within your application or other process.&nbsp; We can do this with the !htrace command in windbg .&nbsp; Windbg is the
 Microsoft <span>W</span>indows <span>D</span>ebugg<span>er</span> most of us use in GES/CPR&nbsp; for debugging.&nbsp;&nbsp;&nbsp;
</font></p>
<p class="MsoNormal"><font size="3">&nbsp;</font></p>
<p class="MsoNormal"><font size="3">Handles are a value we use in user mode<span>,</span> that when passed to a call that transitions to kernel<span>,</span> are used as an offset in your handle table to reference kernel mode objects.&nbsp; Kernel mode objects are
 generally allocated from pool.&nbsp;&nbsp; If you<span> are</span> having pool consumption problems and seeing errors like
<span><a href="http://blogs.msdn.com/ntdebugging/archive/2006/12/18/Understanding-Pool-Consumption-and-Event-ID_3A00_--2020-or-2019.aspx">2020 or 2019’s</a></span> reported there is a good chance you may have a handle leak associated with them.&nbsp; This is generally
 due to not doing a <span><a href="http://msdn2.microsoft.com/en-us/library/ms724211.aspx"><font color="#0000ff">CloseHandle()</font></a></span> on the handle when you have finished using it.</font></p>
<p class="MsoNormal"><span><font size="3">&nbsp;</font></span></p>
</font>
<p class="MsoNormal"><font face="Calibri" size="3">The following is the sample source for a handle leak that we will be debugging in our demo video.</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal"><span>// leakyhandles.cpp : Defines the entry point for the console application.</span></p>
<p class="MsoNormal"><span>//</span></p>
<p class="MsoNormal"><span>&nbsp;</span></p>
<p class="MsoNormal"><span>#include</span><span> </span><span>&quot;stdafx.h&quot;</span></p>
<p class="MsoNormal"><span>#include</span><span> </span><span>&lt;windows.h&gt;</span></p>
<p class="MsoNormal"><span>&nbsp;</span></p>
<p class="MsoNormal"><span>&nbsp;</span></p>
<p class="MsoNormal"><span>void </span><span>fun1</span><span>(void);</span></p>
<p class="MsoNormal"><span>void </span><span>fun2</span><span>(void);</span></p>
<p class="MsoNormal"><span>void </span><span>fun3</span><span>(void);</span></p>
<p class="MsoNormal"><span>void </span><span>fun4</span><span>(void);</span></p>
<p class="MsoNormal"><span>&nbsp;</span></p>
<p class="MsoNormal"><span>int </span><span>main</span><span>(int </span><span>argc</span><span>, char*
</span><span>argv</span><span>[])</span></p>
<p class="MsoNormal"><span>{</span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while(1)</span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>fun1</span><span>();</span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>fun2</span><span>();</span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>Sleep</span><span>(100);</span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 0;</span></p>
<p class="MsoNormal"><span>}</span></p>
<p class="MsoNormal"><span>&nbsp;</span></p>
<p class="MsoNormal"><span>void </span><span>fun1</span><span>(void)</span></p>
<p class="MsoNormal"><span>{</span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>fun3</span><span>();</span></p>
<p class="MsoNormal"><span>}</span></p>
<p class="MsoNormal"><span>&nbsp;</span></p>
<p class="MsoNormal"><span>void </span><span>fun2</span><span>(void)</span></p>
<p class="MsoNormal"><span>{</span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>fun4</span><span>();</span></p>
<p class="MsoNormal"><span>&nbsp;</span></p>
<p class="MsoNormal"><span>}</span></p>
<p class="MsoNormal"><span>void </span><span>fun3</span><span>(void)</span></p>
<p class="MsoNormal"><span>{</span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>HANDLE</span><span> </span><span>hEvent</span><span>;</span></p>
<p class="MsoNormal"><span>&nbsp;</span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>hEvent</span><span> = </span><span>CreateEvent</span><span>(</span><span>NULL</span><span>,</span><span>TRUE</span><span>,</span><span>TRUE</span><span>,</span><span>NULL</span><span>);</span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>CloseHandle</span><span>(</span><span>hEvent</span><span>);</span></p>
<p class="MsoNormal"><span>}</span></p>
<p class="MsoNormal"><span>void </span><span>fun4</span><span>(void)</span></p>
<p class="MsoNormal"><span>{</span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp; </span><span>HANDLE</span><span> </span><span>hEvent2</span><span>;</span></p>
<p class="MsoNormal"><span>&nbsp;</span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>hEvent2</span><span> = </span><span>CreateEvent</span><span>(</span><span>NULL</span><span>,</span><span>TRUE</span><span>,</span><span>TRUE</span><span>,</span><span>NULL</span><span>);</span></p>
<p class="MsoNormal"><span>}</span></p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">Thank you.<br>
</p>
<p class="MsoNormal"><b><span>Jeff Dailey</span></b></p>
<p class="MsoNormal"><i><span>Escalation Engineer (Platforms core team)</span></i><i><span></span></i></p>
<p class="MsoNormal"></font></p>
 <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Niners/jeff_dailey/Posts/RSS&WT.dl=0&WT.entryid=Entry:RSSView:a3ac0d8a707c4ead90099deb0189969a">]]></description>
      <comments>http://channel9.msdn.com/Blogs/jeff_dailey/Understanding-handle-leaks-and-how-to-use-htrace-to-find-them</comments>
      <itunes:summary>
Hello, my name is Jeff Dailey, I’m an Escalation
Engineer for the Global Escalation Services Platforms team.&amp;nbsp;&amp;nbsp; I’d like to show you how to debug and find leaking handles within your application or other process.&amp;nbsp; We can do this with the !htrace command in windbg .&amp;nbsp; Windbg is the
 Microsoft Windows Debugger most of us use in GES/CPR&amp;nbsp; for debugging.&amp;nbsp;&amp;nbsp;&amp;nbsp;
 
&amp;nbsp; 
Handles are a value we use in user mode, that when passed to a call that transitions to kernel, are used as an offset in your handle table to reference kernel mode objects.&amp;nbsp; Kernel mode objects are
 generally allocated from pool.&amp;nbsp;&amp;nbsp; If you are having pool consumption problems and seeing errors like
2020 or 2019’s reported there is a good chance you may have a handle leak associated with them.&amp;nbsp; This is generally
 due to not doing a CloseHandle() on the handle when you have finished using it. 
&amp;nbsp; 

The following is the sample source for a handle leak that we will be debugging in our demo video. 
&amp;nbsp; 
// leakyhandles.cpp : Defines the entry point for the console application. 
// 
&amp;nbsp; 
#include &amp;quot;stdafx.h&amp;quot; 
#include &amp;lt;windows.h&amp;gt; 
&amp;nbsp; 
&amp;nbsp; 
void fun1(void); 
void fun2(void); 
void fun3(void); 
void fun4(void); 
&amp;nbsp; 
int main(int argc, char*
argv[]) 
{ 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(1) 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fun1(); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fun2(); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sleep(100); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0; 
} 
&amp;nbsp; 
void fun1(void) 
{ 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fun3(); 
} 
&amp;nbsp; 
void fun2(void) 
{ 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fun4(); 
&amp;nbsp; 
} 
void fun3(void) 
{ 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HANDLE hEvent; 
&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nb</itunes:summary>
      <itunes:duration>536</itunes:duration>
      <link>http://channel9.msdn.com/Blogs/jeff_dailey/Understanding-handle-leaks-and-how-to-use-htrace-to-find-them</link>
      <pubDate>Fri, 14 Sep 2007 18:35:01 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/jeff_dailey/Understanding-handle-leaks-and-how-to-use-htrace-to-find-them</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/100/257621_100x75.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/220/257621_220x165.jpg" height="165" width="220"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/320/5cc4d2fd-2c99-43fb-8c57-16685547314c.jpg" height="53" width="270"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/85/e879f2e2-5c61-47fa-ab3d-03569f2f6aee.jpg" height="17" width="85"></media:thumbnail>
      <media:group>
        <media:content url="http://mschnlnine.vo.llnwd.net/d1/ch9/1/2/6/7/5/2/341851_leakyhandles.wmv" expression="full" duration="536" fileSize="1" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://mschnlnine.vo.llnwd.net/d1/ch9/1/2/6/7/5/2/341851_leakyhandles.wmv" length="0" type="video/x-ms-wmv"></enclosure>
      <dc:creator>jeff_dailey</dc:creator>
      <itunes:author>jeff_dailey</itunes:author>
      <slash:comments>8</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/jeff_dailey/Understanding-handle-leaks-and-how-to-use-htrace-to-find-them/RSS</wfw:commentRss>
    </item>
  <item>
      <title>ntdebugging blog talk about on desktop heap</title>
      <description><![CDATA[
<p class="MsoNormal"><span>Hi, This is Jeff Dailey, I’m an Escalation Engineer (EE) from the Microsoft GES (Global Escalation Services) Platforms team.&nbsp;<span>&nbsp;
</span>This is the first in an ongoing series of videos based on our advanced debugging and troubleshooting blog hosted on
<a href="http://blogs.msdn.com/ntdebugging">http://blogs.msdn.com/ntdebugging</a></span><span>.<span> In this video Matthew Justice (GES EE) , David Butler (GES EE) and I will discuss desktop heap architecture , and the types of things that go wrong and how
 to address them.<span>&nbsp;&nbsp; </span>Matthew is the author of “</span></span><span lang="EN">Desktop Heap Overview”</span><span> on
<a href="http://blogs.msdn.com/ntdebugging/archive/2007/01/04/desktop-heap-overview.aspx">
http://blogs.msdn.com/ntdebugging/archive/2007/01/04/desktop-heap-overview.aspx</a><span>&nbsp;
</span></span></p>
<p class="MsoNormal"><span><br>
The video is about 15 minutes long , as a side note this was recorded on our new Microsoft roundtable camera.
<span>&nbsp;</span><a href="http://www.microsoft.com/uc/products/roundtable.mspx">http://www.microsoft.com/uc/products/roundtable.mspx</a></span></p>
<p class="MsoNormal"><a name="_MailAutoSig"><span>&nbsp;</span></a></p>
<p class="MsoNormal"><span><span>Thank you and enjoy</span></span></p>
<p class="MsoNormal"><span><b><span>&nbsp;</span></b></span></p>
<p class="MsoNormal"><span><b><span>Jeff Dailey</span></b></span></p>
<p class="MsoNormal"><span><i><span>Escalation Engineer (Platforms core team)</span></i></span></p>
 <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Niners/jeff_dailey/Posts/RSS&WT.dl=0&WT.entryid=Entry:RSSView:3fc049a1601e4592be339deb01899cce">]]></description>
      <comments>http://channel9.msdn.com/Blogs/jeff_dailey/ntdebugging-blog-talk-about-on-desktop-heap</comments>
      <itunes:summary>
Hi, This is Jeff Dailey, I’m an Escalation Engineer (EE) from the Microsoft GES (Global Escalation Services) Platforms team.&amp;nbsp;&amp;nbsp;
This is the first in an ongoing series of videos based on our advanced debugging and troubleshooting blog hosted on
http://blogs.msdn.com/ntdebugging. In this video Matthew Justice (GES EE) , David Butler (GES EE) and I will discuss desktop heap architecture , and the types of things that go wrong and how
 to address them.&amp;nbsp;&amp;nbsp; Matthew is the author of “Desktop Heap Overview” on

http://blogs.msdn.com/ntdebugging/archive/2007/01/04/desktop-heap-overview.aspx&amp;nbsp;
 

The video is about 15 minutes long , as a side note this was recorded on our new Microsoft roundtable camera.
&amp;nbsp;http://www.microsoft.com/uc/products/roundtable.mspx 
&amp;nbsp; 
Thank you and enjoy 
&amp;nbsp; 
Jeff Dailey 
Escalation Engineer (Platforms core team) 
</itunes:summary>
      <link>http://channel9.msdn.com/Blogs/jeff_dailey/ntdebugging-blog-talk-about-on-desktop-heap</link>
      <pubDate>Thu, 13 Sep 2007 11:37:22 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/jeff_dailey/ntdebugging-blog-talk-about-on-desktop-heap</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/100/257587_100x75.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/220/257587_220x165.jpg" height="165" width="220"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/320/f2edd00d-494d-4f86-a041-18281f57db77.jpg" height="53" width="270"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/85/64b89de9-08b3-43e1-80e9-e481a493cdc4.jpg" height="17" width="85"></media:thumbnail>
      <media:group>
        <media:content url="http://mschnlnine.vo.llnwd.net/d1/ch9/7/8/5/7/5/2/341585_desktopheap.wmv" expression="full" fileSize="1" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://mschnlnine.vo.llnwd.net/d1/ch9/7/8/5/7/5/2/341585_desktopheap.wmv" length="0" type="video/x-ms-wmv"></enclosure>
      <dc:creator>jeff_dailey</dc:creator>
      <itunes:author>jeff_dailey</itunes:author>
      <slash:comments>2</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/jeff_dailey/ntdebugging-blog-talk-about-on-desktop-heap/RSS</wfw:commentRss>
    </item>    
</channel>
</rss>