<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Ntdebugging Blog</title><link>http://blogs.msdn.com/b/ntdebugging/</link><description>Microsoft Advanced Windows Debugging and Troubleshooting - Contributions to this blog are made by the Microsoft Platforms Global Escalation Team</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>Remoting Your Debug Crash Cart With KDNET</title><link>http://blogs.msdn.com/b/ntdebugging/archive/2013/05/09/remoting-your-debug-crash-cart.aspx</link><pubDate>Fri, 10 May 2013 00:58:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10417496</guid><dc:creator>ntdebug</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/ntdebugging/rsscomments.aspx?WeblogPostID=10417496</wfw:commentRss><comments>http://blogs.msdn.com/b/ntdebugging/archive/2013/05/09/remoting-your-debug-crash-cart.aspx#comments</comments><description>&lt;p class="Text"&gt;This is Christian Sträßner from the Global Escalation Services team based in Munich, Germany.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Back in January, my colleague Ron Stock posted an interesting article about Kernel Debugging using a serial cable: &lt;a href="http://blogs.msdn.com/b/ntdebugging/archive/2013/01/31/how-to-setup-a-debug-crash-cart-to-prevent-your-server-from-flat-lining.aspx"&gt;How to Setup a Debug Crash Cart to Prevent Your Server from Flat Lining&lt;/a&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Today we look at a new kernel debugging transport introduced in Windows 8 and Windows Server 2012 that makes the cabling much easier, now a network cable can be used as a debug cable. The new KDNET transport utilizes a PCI Ethernet network card in the Target. Most major NIC Vendors have compatible NICs. You can find a list of supported NICs here:&lt;/p&gt;  &lt;p class="Text"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/windows/hardware/hh830880.aspx"&gt;http://msdn.microsoft.com/en-us/library/windows/hardware/hh830880.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Note that this will not work with Wireless or USB attached NICs in the Target.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;In the example below, we utilized an Acer AC 100 Server as the Target. It ships with an onboard Intel 82579LM Gigabit NIC:&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;img title="Network Adapters" style="border: 0px currentcolor; display: inline; background-image: none;" border="0" alt="Network Adapters" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-00-metablogapi/5707.image001_5F00_25772EF4.png" width="393" height="404" /&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;The great thing about KDNET is that the NIC can still be used for normal network activity. The “Microsoft Kernel Debug Network Adapter” driver is the magic behind this. When KDNET.DLL is active, the NIC’s driver will be “banged out” and KDNET takes control of the NIC.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;b&gt;BCD Configuration&lt;/b&gt;&lt;/p&gt;  &lt;p class="Text"&gt;To configure KDNET, you first need to determine the IPv4 Address of the machine with the debugger. In our example, ipconfig.exe tells us that it is 192.168.1.35:&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;img title="ipconfig" style="border: 0px currentcolor; display: inline; background-image: none;" border="0" alt="ipconfig" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-00-metablogapi/3568.image002_5F00_605E61BD.jpg" width="458" height="163" /&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Next go to your Target machine.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;The kernel debug settings used to configure KDNET are stored globally in the BCD Store in the {dbgsettings} area. The kernel debug settings apply to all boot entries.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Use &lt;b&gt;bcdedit.exe /dbgsettings net hostip:&amp;lt;addr&amp;gt;port:&amp;lt;port&amp;gt;&lt;/b&gt; to set the transport to KDNET, the IP Address of the debugger and the port. You can connect multiple targets to the same debug host by using a different port for each target. &lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;BCD will generate a cryptographic key for you automatically the first time. You can generate a new cryptographic key by appending the ‘newkey’ keyword. Copy the ‘Key’ to a secure location - you will need it in the debugger.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;You can display the debug settings using: &lt;b&gt;bcdedit /dbgsettings&lt;/b&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Next, for safety, copy the {current} entry to a new entry (&lt;b&gt;bcdedit /copy {current} /d &amp;lt;description&amp;gt;&lt;/b&gt;).&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Then enable kernel debugging on the copy (&lt;b&gt;bcdedit.exe /debug {new-guid} on&lt;/b&gt;).&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;If required, also use this (new) entry to enable the checked kernel (&lt;b&gt;bcdedit /set {new-guid} hal &amp;lt;path&amp;gt;&lt;/b&gt; and &lt;b&gt;bcdedit.exe /set {new-guid} kernel &amp;lt;path&amp;gt;&lt;/b&gt;). &lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;img title="bcdedit" style="border: 0px currentcolor; display: inline; background-image: none;" border="0" alt="bcdedit" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-00-metablogapi/7823.image003_5F00_14928B04.jpg" width="605" height="239" /&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;b&gt;Debugger&lt;/b&gt;&lt;/p&gt;  &lt;p class="Text"&gt;On your Debugger Machine open &lt;b&gt;WinDbg-&amp;gt;File-&amp;gt;Kernel Debugging &lt;/b&gt;(Ctrl-K) and choose the NET tab:&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Copy and paste the ‘Key’ here and set the port to the value specified on the Target (the default is 50000):&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;img title="Kernel Debugging" style="border: 0px currentcolor; display: inline; background-image: none;" border="0" alt="Kernel Debugging" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-00-metablogapi/2045.image004_5F00_4B6F6FFB.png" width="542" height="356" /&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Next a dialog from Windows Firewall might pop up (depending on your configuration). You want to allow access at this point. &lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;img title="Windows Firewall" style="border: 0px currentcolor; display: inline; background-image: none;" border="0" alt="Windows Firewall" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-00-metablogapi/4201.image005_5F00_3F6D7FC7.jpg" width="315" height="238" /&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;You need to make sure that your debug host machine allows inbound UDP traffic on the configured port (50000 in this example, and by default) for the network type in use.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;If your company has implemented IPSec Policies, make sure you have exceptions in place that allow unsecured communication on the port used (KDNET does not talk IPSec).&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;The Debugger Window will now look like this:&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;img title="windbg waiting to reconnect" style="border: 0px currentcolor; display: inline; background-image: none;" border="0" alt="windbg waiting to reconnect" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-00-metablogapi/1423.image006_5F00_4F7C4E7E.jpg" width="418" height="270" /&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;The Debugger is now set up and ready to go.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Reboot the target system now.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;When the target comes back online, it will try to connect to the IP Address and Port that was configured with the bcdedit.exe command. The Debugger Command Window will look something like the screenshot below.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;img title="windbg connected" style="border: 0px currentcolor; display: inline; background-image: none;" border="0" alt="windbg connected" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-00-metablogapi/7612.image007_5F00_319DCA7D.jpg" width="605" height="208" /&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;You now can break in as usual. This is a good time to fix your symbol setup if you have not done it yet.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;b&gt;Operation&lt;/b&gt;&lt;/p&gt;  &lt;p class="Text"&gt;You still can communicate normally over the NIC and IP that you use on the target. You do not need an additional NIC in the target to use KDNET. When debugging production servers with heavy traffic, we recommend using a dedicated NIC for debugging (note, 10GigE NICs are currently not supported).&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;If you don’t want the NIC to be used by the OS as well, it can be disabled via: &lt;b&gt;bcdedit.exe -set loadoptions NO_KDNIC&lt;/b&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;img title="Normal Network IO" style="border: 0px currentcolor; display: inline; background-image: none;" border="0" alt="Normal Network IO" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-00-metablogapi/0876.image008_5F00_3E97AA8E.jpg" width="485" height="161" /&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Although you can use KDNET to debug power state transitions (in particular Connected Standby), it is best avoided. The KDNET protocol polls on a regular basis and as such, many systems will not drop to a lower power state. Instead, use USB, 1394, or serial.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Disconnecting the NIC from media (unplugging the NIC in the target machine) is not supported and will most likely blue screen the target machine.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Note 1:&lt;/p&gt;  &lt;p class="Text"&gt;If you have more than one NIC in your target, please read the following (copied from the debugger help):&lt;/p&gt;  &lt;p class="Text"&gt;&lt;i&gt;If there is more than one network adapter in the target computer, use Device Manager to determine the PCI bus, device, and function numbers for the adapter you want to use for debugging. Then in an elevated Command Prompt window, enter the following command, where b, d, and f are the bus number, device number, and function number of the adapter:&lt;/i&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;i&gt;bcdedit /set {dbgsettings} busparams b.d.f&lt;/i&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Note 2:&lt;/p&gt;  &lt;p class="Text"&gt;If you use the Windows NIC Teaming (LBFO) in Server 2012: KDNET is not compatible with NIC Teaming as indicated by the Whitepaper:&lt;/p&gt;  &lt;p class="Text"&gt;&lt;a href="http://download.microsoft.com/download/F/6/5/F65196AA-2AB8-49A6-A427-373647880534/%5bWindows%20Server%202012%20NIC%20Teaming%20(LBFO)%20Deployment%20and%20Management%5d.docx"&gt;http://download.microsoft.com/download/F/6/5/F65196AA-2AB8-49A6-A427-373647880534/[Windows%20Server%202012%20NIC%20Teaming%20(LBFO)%20Deployment%20and%20Management].docx&lt;/a&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;b&gt;How does it look on the network?&lt;/b&gt;&lt;/p&gt;  &lt;p class="Text"&gt;This is a packet sent from the target to the debug host machine.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;img title="Network Packet" style="border: 0px currentcolor; display: inline; background-image: none;" border="0" alt="Network Packet" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-00-metablogapi/1374.image009_5F00_35AAA900.jpg" width="605" height="233" /&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;The TTL of the packets sent from the target to the debug host is currently set to 16 (this is not configurable).&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;This screenshot shows that your connection can only run over 16 IP hops max. This is a theoretical limitation, but it highlights some important facts. Your host is not talking to the Windows IP stack on the target, instead it talks to a basic IPv4/UDP implementation in KDNET. The transport is UDP/IPv4 based, so there is not much tolerance for poor network conditions aside from retry operations at the Debugger Transport Protocol Level.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;b&gt;A few words on performance.&lt;/b&gt;&lt;/p&gt;  &lt;p class="Text"&gt;The performance is generally limited by the latency of the link between the host and target. Therefore, even with a LAN like latency (&amp;lt;=1ms), you will not be able to get even close to wire speed of a 1GigE Connection. Expect to see speeds between 1.5 – 2.5Mbytes/s.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Keep this in mind when you plan to pull large portions of memory from the target over KDNET (like the .dump command). This screenshot was taken while executing the .dump /f command (Full Kernel Dump):&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;img title="Network Activity" style="border: 0px currentcolor; display: inline; background-image: none;" border="0" alt="Network Activity" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-00-metablogapi/5444.image010_5F00_098DAC0F.jpg" width="605" height="100" /&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Even with the performance restrictions mentioned, KDNET is a valuable extension of the existing debugging methods.&amp;#160; It allows you to debug a Windows machine without the need for special hardware (1394) or legacy ports (serial) that not every machine has today (especially tablets and notebooks).&amp;#160; It also saves you from using USB2 debugging - which requires special cables and a good amount of hope that the machine’s vendor has attached the single debug capable USB port to an external port on the chassis.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Also, there is no need for you to physically enter the Datacenter where the target is located.&amp;#160; You can do all these steps from your convenient office chair. &lt;span style="font-family: wingdings;"&gt;J&lt;/span&gt; &lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;To see network kernel debugging in action, watch &lt;a href="http://channel9.msdn.com/Shows/Defrag-Tools/Defrag-Tools-27-WinDbg-Configure-Kernel-Debugging"&gt;Episode #27&lt;/a&gt; of &lt;a href="http://channel9.msdn.com/Shows/Defrag-Tools"&gt;Defrag Tools&lt;/a&gt; on &lt;a href="http://channel9.msdn.com/"&gt;Channel 9&lt;/a&gt;.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Thanks to Andrew Richards and Joe Ballantyne for their help in writing this article.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10417496" width="1" height="1"&gt;</description></item><item><title>Our Bangalore Team is Hiring - Windows Server Escalation Engineer</title><link>http://blogs.msdn.com/b/ntdebugging/archive/2013/05/09/our-bangalore-team-is-hiring-windows-server-escalation-engineer.aspx</link><pubDate>Thu, 09 May 2013 22:32:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10417470</guid><dc:creator>ntdebug</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/ntdebugging/rsscomments.aspx?WeblogPostID=10417470</wfw:commentRss><comments>http://blogs.msdn.com/b/ntdebugging/archive/2013/05/09/our-bangalore-team-is-hiring-windows-server-escalation-engineer.aspx#comments</comments><description>&lt;p class="Text"&gt;Would you like to join the world’s best and most elite debuggers to enable the success of Microsoft solutions?&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;As a trusted advisor to our top customers you will be working with to the most experienced IT professionals and developers in the industry. You will influence our product teams in sustained engineering efforts to drive improvements in our products.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;This role involves deep analysis of product source code and debugging to solve problems in multi-million dollar configurations and will give you an opportunity to stretch your critical thinking skills. During the course of debugging, you will uncover opportunities to improve the customer experience while influencing the current and future design of our products.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;In addition to providing support to customers while being the primary interface to our sustained engineering teams, you will also have the opportunity to work with new technologies and unreleased software. Through our continuous investment in depth training and hands-on experience with tough customer challenges you will become the world’s best in this area. Expect to partner with many various roles at Microsoft launching a very successful career!&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;This position is located is at the Microsoft Global Technical Support Center in Bangalore, India.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Learn more about what an Escalation Engineer does at:&lt;/p&gt;  &lt;p class="Text"&gt;&lt;a href="http://blogs.msdn.com/b/peoplefirst/archive/2010/08/19/profile-ron-stock-cts-escalation-engineer.aspx"&gt;Profile: Ron Stock, CTS Escalation Engineer - Microsoft Customer Service &amp;amp; Support - What is CSS?&lt;/a&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-00-JobCasts/4135.Life_2D00_As_2D00_An_2D00_EE_2D00_Jobcast_2D00_JeffDailey.wma" target="_blank"&gt;Microsoft JobsBlog JobCast with Escalation Engineer Jeff Dailey&lt;/a&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-00-JobCasts/1460.Life_2D00_As_2D00_An_2D00_EE_2D00_Jobcast_2D00_ScottOseychik.wma" target="_blank"&gt;Microsoft JobsBlog JobCast with Escalation Engineer Scott Oseychik&lt;/a&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Apply here:&lt;/p&gt;  &lt;p class="Text"&gt;&lt;a href="https://careers.microsoft.com/jobdetails.aspx?ss=&amp;amp;pg=0&amp;amp;so=&amp;amp;rw=1&amp;amp;jid=109989&amp;amp;jlang=en&amp;amp;pp=ss"&gt;https://careers.microsoft.com/jobdetails.aspx?ss=&amp;amp;pg=0&amp;amp;so=&amp;amp;rw=1&amp;amp;jid=109989&amp;amp;jlang=en&amp;amp;pp=ss&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10417470" width="1" height="1"&gt;</description></item><item><title>Interpreting Event 153 Errors</title><link>http://blogs.msdn.com/b/ntdebugging/archive/2013/04/30/interpreting-event-153-errors.aspx</link><pubDate>Tue, 30 Apr 2013 22:55:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10415240</guid><dc:creator>ntdebug</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/ntdebugging/rsscomments.aspx?WeblogPostID=10415240</wfw:commentRss><comments>http://blogs.msdn.com/b/ntdebugging/archive/2013/04/30/interpreting-event-153-errors.aspx#comments</comments><description>&lt;p class="Text"&gt;Hello my name is Bob Golding and I would like to share with you a new event that you may see in the system event log.&amp;#160; Event ID 153 is an error associated with the storage subsystem. This event was new in Windows 8 and Windows Server 2012 and was added to Windows 7 and Windows Server 2008 R2 starting with hot fix &lt;a href="http://support.microsoft.com/kb/2819485"&gt;KB2819485&lt;/a&gt;.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;An event 153 is similar to an event 129.&amp;#160; An event 129 is logged when the &lt;a href="http://msdn.microsoft.com/en-us/library/ff567541.aspx"&gt;storport driver&lt;/a&gt; times out a request to the disk; I described event 129 messages in a &lt;a href="http://blogs.msdn.com/b/ntdebugging/archive/2011/05/06/understanding-storage-timeouts-and-event-129-errors.aspx"&gt;previous article&lt;/a&gt;.&amp;#160; The difference between a 153 and a 129 is that a 129 is logged when storport times out a request, a 153 is logged when the storport &lt;a href="http://msdn.microsoft.com/en-us/library/ff567562.aspx"&gt;miniport driver&lt;/a&gt; times out a request.&amp;#160; The miniport driver may also be referred to as an adapter driver or HBA driver, this driver is typically written the hardware vendor.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Because the miniport driver has a better knowledge of the request execution environment, some miniport drivers time the request themselves instead of letting storport handle request timing.&amp;#160; This is because the miniport driver can abort the individual request and return an error rather than storport resetting the drive after a timeout.&amp;#160; Resetting the drive is disruptive to the I/O subsystem and may not be necessary if only one request has timed out.&amp;#160; The error returned from the miniport driver is bubbled up to the class driver who can log an event 153 and retry the request.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Below is an example event 153:&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;img title="Event 153 Example" style="border: 0px currentcolor; display: inline; background-image: none;" border="0" alt="Event 153 Example" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-00-metablogapi/3857.image001_5F00_4F49E216.png" width="640" height="445" /&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;This error means that a request failed and was retried by the class driver.&amp;#160; In the past no message would be logged in this situation because storport did not timeout the request.&amp;#160; The lack of messages resulted in confusion when troubleshooting disk errors because timeouts would occur but there would be no evidence of the error.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;The details section of the event the log record will present what error caused the retry and whether the request was a read or write. Below is the details output:&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;img title="Event 153 Details" style="border: 0px currentcolor; display: inline; background-image: none;" border="0" alt="Event 153 Details" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-00-metablogapi/2352.image002_5F00_354C0864.png" width="640" height="445" /&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;In the example above at byte offset 29 is the SCSI status, at offset 30 is the SRB status that caused the retry, and at offset 31 is the SCSI command that is being retried.&amp;#160; In this case the SCSI status was &lt;font style="background-color: rgb(0, 255, 0);"&gt;00&lt;/font&gt; (SCSISTAT_GOOD), the SRB status was &lt;font style="background-color: rgb(255, 0, 0);"&gt;09&lt;/font&gt; (SRB_STATUS_TIMEOUT), and the command was &lt;font style="background-color: rgb(75, 172, 198);"&gt;28&lt;/font&gt; (SCSIOP_READ).&amp;#160; &lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;The most common SCSI commands are:&lt;/p&gt;  &lt;p class="Text"&gt;SCSIOP_READ - 0x28&lt;/p&gt;  &lt;p class="Text"&gt;SCSIOP_WRITE - 0x2A&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;The most common SRB statuses are below:&lt;/p&gt;  &lt;p class="Text"&gt;SRB_STATUS_TIMEOUT - 0x09&lt;/p&gt;  &lt;p class="Text"&gt;SRB_STATUS_BUS_RESET - 0x0E&lt;/p&gt;  &lt;p class="Text"&gt;SRB_STATUS_COMMAND_TIMEOUT - 0x0B&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;A complete list of SCSI operations and statuses can be found in scsi.h in the WDK.&amp;#160; A list of SRB statuses can be found in srb.h.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;The timeout errors (SRB_STATUS_TIMEOUT and SRB_STATUS_COMMAND_TIMEOUT) indicate a request timed out in the adapter. In other words a request was sent to the drive and there was no response within the timeout period.&amp;#160; The bus reset error (SRB_STATUS_BUS_RESET) indicates that the device was reset and that the request is being retried due to the reset since all outstanding requests are aborted when a drive receives a reset.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;A system administrator who encounters event 153 errors should investigate the health of the computer’s disk subsystem.&amp;#160; Although an occasional timeout may be part of the normal operation of a system, the frequent need to retry requests indicates a performance issue with the storage that should be corrected.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10415240" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/i_2F00_o/">i/o</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/hardware/">hardware</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/Bob/">Bob</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/internals/">internals</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/timeout/">timeout</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/storport/">storport</category></item><item><title>Commitment Failures, Not Just a Failed Love Story</title><link>http://blogs.msdn.com/b/ntdebugging/archive/2013/04/16/commitment-failures-not-just-a-failed-love-story.aspx</link><pubDate>Tue, 16 Apr 2013 20:21:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10411614</guid><dc:creator>ntdebug</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/ntdebugging/rsscomments.aspx?WeblogPostID=10411614</wfw:commentRss><comments>http://blogs.msdn.com/b/ntdebugging/archive/2013/04/16/commitment-failures-not-just-a-failed-love-story.aspx#comments</comments><description>&lt;p class="Text"&gt;I was working on a debug the other day when I ran the “!vm” command and saw that the system had some 48,000 commit requests that failed. This was strange as the system was not out of memory and the page file was not full. I was left scratching my head and thinking “I wish I knew where !vm got that information from.” So I went on a quest to find out, here is what I found.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;13: kd&amp;gt; !vm 1&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;*** Virtual Memory Usage ***&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Physical Memory:&amp;#160;&amp;#160;&amp;#160; 12580300 (&amp;#160; 50321200 Kb)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Page File: \??\C:\pagefile.sys&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Current:&amp;#160; 50331648 Kb&amp;#160; Free Space:&amp;#160; 50306732 Kb&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Minimum:&amp;#160; 50331648 Kb&amp;#160; Maximum:&amp;#160;&amp;#160;&amp;#160;&amp;#160; 50331648 Kb&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Available Pages:&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4606721 (&amp;#160; 18426884 Kb)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ResAvail Pages:&amp;#160;&amp;#160;&amp;#160;&amp;#160; 12189247 (&amp;#160; 48756988 Kb)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Locked IO Pages:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0 (&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0 Kb)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Free System PTEs:&amp;#160;&amp;#160; 33460257 ( 133841028 Kb)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Modified Pages:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 20299 (&amp;#160;&amp;#160;&amp;#160;&amp;#160; 81196 Kb)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Modified PF Pages:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 6154 (&amp;#160;&amp;#160;&amp;#160;&amp;#160; 24616 Kb)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; NonPagedPool 0 Used:&amp;#160;&amp;#160; 19544 (&amp;#160;&amp;#160;&amp;#160;&amp;#160; 78176 Kb)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; NonPagedPool 1 Used:&amp;#160;&amp;#160; 22308 (&amp;#160;&amp;#160;&amp;#160;&amp;#160; 89232 Kb)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; NonPagedPool Usage:&amp;#160;&amp;#160;&amp;#160; 53108 (&amp;#160;&amp;#160;&amp;#160; 212432 Kb)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; NonPagedPool Max:&amp;#160;&amp;#160;&amp;#160; 9408956 (&amp;#160; 37635824 Kb)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PagedPool 0 Usage:&amp;#160;&amp;#160;&amp;#160; 168921 (&amp;#160;&amp;#160;&amp;#160; 675684 Kb)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PagedPool 1 Usage:&amp;#160;&amp;#160; 4149241 (&amp;#160; 16596964 Kb)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PagedPool 2 Usage:&amp;#160;&amp;#160;&amp;#160;&amp;#160; 17908 (&amp;#160;&amp;#160;&amp;#160;&amp;#160; 71632 Kb)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PagedPool Usage:&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4336070 (&amp;#160; 17344280 Kb)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PagedPool Maximum:&amp;#160; 33554432 ( 134217728 Kb)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Session Commit:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3438 (&amp;#160;&amp;#160;&amp;#160;&amp;#160; 13752 Kb)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Shared Commit:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 6522 (&amp;#160;&amp;#160;&amp;#160;&amp;#160; 26088 Kb)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Special Pool:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0 (&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0 Kb)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Shared Process:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 53597 (&amp;#160;&amp;#160;&amp;#160; 214388 Kb)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PagedPool Commit:&amp;#160;&amp;#160;&amp;#160; 4336140 (&amp;#160; 17344560 Kb)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Driver Commit:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 5691 (&amp;#160;&amp;#160;&amp;#160;&amp;#160; 22764 Kb)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Committed pages:&amp;#160;&amp;#160;&amp;#160;&amp;#160; 5565215 (&amp;#160; 22260860 Kb)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Commit limit:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 25162749 ( 100650996 Kb)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ********** 48440 commit requests have failed&amp;#160; **********&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;It turns out that this calculation is from a global ULONG array named “nt!MiChargeCommitmentFailures”.&amp;#160; The array has 4 members and they are used to trace the types of commit failures that have taken place. This is done by first calculating the new commit size NewCommitValue = CurrentCommitValue + SystemReservedMemory. Based on this calculation commit errors are tracked in a few different ways, which are listed below with the corresponding member in the array that is incremented. &lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;MiChargeCommitmentFailures[0] - If the system failed a commit request and an expansion of the pagefile has failed.&lt;/p&gt;  &lt;p class="Text"&gt;MiChargeCommitmentFailures[1] - If the system failed a commit and we have already reached the maximum pagefile size.&lt;/p&gt;  &lt;p class="Text"&gt;MiChargeCommitmentFailures[2] - If the system failed a commit while the pagefile lock is held.&lt;/p&gt;  &lt;p class="Text"&gt;MiChargeCommitmentFailures[3] - If the system failed a commit and the NewCommitValue is less than or equal to CurrentCommitValue.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;In order to calculate the count of failures, &amp;quot;!vm&amp;quot; adds up the values stored in each array member of the array. Members 0 and 1 are always counted, member 2 is counted if the OS version is Windows 2003/XP and member 3 is counted if the build version is newer than Windows 2003/XP.&amp;#160; &lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Let's look at the array in the dump I was debugging:&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;13: kd&amp;gt; dc nt!MiChargeCommitmentFailures L4&lt;/p&gt;  &lt;p class="Debug"&gt;fffff800`01e45ce0&amp;#160; 00000000 &lt;span style="background: aqua;"&gt;0000bd38&lt;/span&gt; 00000000 00000000&amp;#160; ....8...........&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Converting this to decimal we find the 48000+ commit failures I was seeing the in output of !VM.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;13: kd&amp;gt; ?&lt;span style="background: aqua;"&gt;0000bd38&lt;/span&gt; &lt;/p&gt;  &lt;p class="Debug"&gt;Evaluate expression: &lt;span style="background: aqua;"&gt;48440&lt;/span&gt; = 00000000`0000bd38&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Since I now had my answer, “where does the number come from?”, I was left wanting to know a bit more about the overall flow of why a &lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa366887(v=vs.85).aspx"&gt;VirtualAlloc&lt;/a&gt; fails to commit.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;When memory is allocated by &lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa366887(v=vs.85).aspx"&gt;VirtualAlloc&lt;/a&gt; the newly allocated memory is not committed to physical memory. Only when the memory is accessed by a read or write is it backed by physical memory.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;When this newly allocated memory is accessed for the first time it will need to be backed by commit space. Under normal conditions this is a smooth process, however when the system hits what’s called the commit limit and can’t expand this limit we see commit failures. &lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;So how is the commit limit calculated? Let’s say we have a system with 4GB of physical memory and a pagefile that is 6GB in size. To determine the commit limit we add physical memory and the pagefile size together - in this example the commit limit would be 10GB. Since memory manger will not let any user mode allocation consume every last morsel of commit space it keeps a small amount of the commit space for the system to avoid hangs. When the limit is reached the system tries to grow the page file. If there is no more room to grow the pagefile or the pagefile has reached its configured maximum size, the system will try and free some committed memory to make room for more requests. If expansion of the page file or the attempt to free memory do not allow the allocation to complete, the allocation fails and MiChargeCommitmentFailures is incremented. &lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;img title="" style="border: 0px currentcolor; display: inline; background-image: none;" border="0" alt="" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-00-metablogapi/5543.image001_5F00_546EC53E.png" width="170" height="142" /&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;To sum it all up, commit limit is RAM + pagefile, commit failures happen when we hit the commit limit and the system is unable to grow the pagefile because it is already at its max.&amp;#160; It’s that simple, well almost.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;For those that will want to know more about how memory manger works please see the post from Somak: &lt;a href="http://blogs.msdn.com/b/ntdebugging/archive/2007/10/10/the-memory-shell-game.aspx"&gt;The Memory Shell Game&lt;/a&gt;.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Randy Monteleone&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10411614" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/windows/">windows</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/debug/">debug</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/Randy/">Randy</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/Memory/">Memory</category></item><item><title>Debugging a Network Connectivity Issue - TrackNblOwner to the Rescue</title><link>http://blogs.msdn.com/b/ntdebugging/archive/2013/03/29/debugging-a-network-connectivity-issue-tracknblowner-to-the-rescue.aspx</link><pubDate>Fri, 29 Mar 2013 21:59:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10406420</guid><dc:creator>ntdebug</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/ntdebugging/rsscomments.aspx?WeblogPostID=10406420</wfw:commentRss><comments>http://blogs.msdn.com/b/ntdebugging/archive/2013/03/29/debugging-a-network-connectivity-issue-tracknblowner-to-the-rescue.aspx#comments</comments><description>&lt;p class="Text"&gt;Hello Debug community this is Karim Elsaid again.&amp;#160; Today I’m going to discuss a recent interesting case where intermittently the server is losing access to the network.&amp;#160; No communication (even pings) can be done from / to the server when the issue hits.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;We went through the normal exercise and asked the customer to obtain a Kernel memory dump from the machine while it was in the problematic state, hoping that we will find some data to help us to demystify the issue.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;One of the very first commands we run upon receiving a hang dump is the very famous “!locks” command.&amp;#160; This yielded the following:&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;8: kd&amp;gt; !locks&lt;/p&gt;  &lt;p class="Debug"&gt;**** DUMP OF ALL RESOURCE OBJECTS ****&lt;/p&gt;  &lt;p class="Debug"&gt;KD: Scanning for held locks..&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;Resource @ nt!IopDeviceTreeLock (0xfffff80001a81c80)&amp;#160;&amp;#160;&amp;#160; Shared 1 owning threads&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Threads: fffffa800cd8a040-01&amp;lt;*&amp;gt; &lt;/p&gt;  &lt;p class="Debug"&gt;KD: Scanning for held locks.&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;Resource @ nt!PiEngineLock (0xfffff80001a81b80)&amp;#160;&amp;#160;&amp;#160; Exclusively owned&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; Contention Count = 6&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Threads: fffffa800cd8a040-01&amp;lt;*&amp;gt; &lt;/p&gt;  &lt;p class="Debug"&gt;KD: Scanning for held locks&lt;/p&gt;  &lt;p class="Debug"&gt;84372 total locks, 2 locks currently held&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;What I’m looking for is Locks with exclusive owners and waiters.&amp;#160; From the above output we can see that thread fffffa800cd8a040 exclusively owns a Plug and Play (Pi prefix) lock and shared owns an I/O Manager (Io prefix) device tree lock.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;There are no waiters for the exclusive lock, however PnP locks always worth investigating.&amp;#160; While debugging I always treat everything a possible suspect unless proven otherwise, so let’s dump this thread:&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;8: kd&amp;gt; !thread fffffa800cd8a040 e&lt;/p&gt;  &lt;p class="Debug"&gt;THREAD fffffa800cd8a040&amp;#160; Cid 0004.005c&amp;#160; Teb: 0000000000000000 Win32Thread: 0000000000000000 WAIT: (Executive) KernelMode Non-Alertable&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; fffff88002b0f118&amp;#160; SynchronizationEvent&lt;/p&gt;  &lt;p class="Debug"&gt;IRP List:&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; fffffa8016527510: (0006,0310) Flags: 00000000&amp;#160; Mdl: 00000000&lt;/p&gt;  &lt;p class="Debug"&gt;Not impersonating&lt;/p&gt;  &lt;p class="Debug"&gt;DeviceMap&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; fffff8a000006100&lt;/p&gt;  &lt;p class="Debug"&gt;Owning Process&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; fffffa800cd56040&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Image:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System&lt;/p&gt;  &lt;p class="Debug"&gt;Attached Process&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; N/A&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Image:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; N/A&lt;/p&gt;  &lt;p class="Debug"&gt;Wait Start TickCount&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 14791337&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Ticks: 15577 (&lt;span style="background: yellow;"&gt;0:00:04:03.002&lt;/span&gt;)&lt;/p&gt;  &lt;p class="Debug"&gt;Context Switch Count&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 835317&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; IdealProcessor: 2&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p class="Debug"&gt;UserTime&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 00:00:00.000&lt;/p&gt;  &lt;p class="Debug"&gt;KernelTime&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 00:00:26.863&lt;/p&gt;  &lt;p class="Debug"&gt;Win32 Start Address nt!ExpWorkerThread (0xfffff8000188f530)&lt;/p&gt;  &lt;p class="Debug"&gt;Stack Init fffff88002b0fc70 Current fffff88002b0ee30&lt;/p&gt;  &lt;p class="Debug"&gt;Base fffff88002b10000 Limit fffff88002b0a000 Call 0&lt;/p&gt;  &lt;p class="Debug"&gt;Priority 12 BasePriority 12 UnusualBoost 0 ForegroundBoost 0 IoPriority 2 PagePriority 5&lt;/p&gt;  &lt;p class="Debug"&gt;*** ERROR: Module load completed but symbols could not be loaded for myfault.sys&lt;/p&gt;  &lt;p class="Debug"&gt;Child-SP&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; RetAddr&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Call Site&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`02b0ee70 fffff800`0187ba32 nt!KiSwapContext+0x7a&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`02b0efb0 fffff800`0188cd8f nt!KiCommitThreadWait+0x1d2&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`02b0f040 &lt;span style="color: rgb(0, 176, 240);"&gt;&lt;font color="#00ff00"&gt;fffff800`018e1816&lt;/font&gt; &lt;/span&gt;nt!KeWaitForSingleObject+0x19f&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`02b0f0e0 fffff880`01618fcd nt! ??::FNODOBFM::`string'+0x12ff6&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`02b0f150 fffff880`0173f54e tcpip!FlPnpEvent+0x17d&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`02b0f1c0 fffff880`00f87b2f tcpip!Fl48PnpEvent+0xe&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`02b0f1f0 fffff880`00f884b7 NDIS!ndisPnPNotifyBinding+0xbf&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`02b0f280 fffff880`00fa1911 NDIS!ndisPnPNotifyAllTransports+0x377&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`02b0f3f0 fffff880`00fa2c5b NDIS!ndisCloseMiniportBindings+0x111&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`02b0f500 fffff880`00f3bbc2 NDIS!ndisPnPRemoveDevice+0x25b&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`02b0f6a0 fffff880`00fa5b69 NDIS!ndisPnPRemoveDeviceEx+0xa2&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`02b0f6e0 fffff800`01aec8d9 NDIS!ndisPnPDispatch+0x609&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`02b0f780 fffff800`01c6c1e1 nt!IopSynchronousCall+0xc5&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`02b0f7f0 fffff800`0197f733 nt!IopRemoveDevice+0x101&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`02b0f8b0 fffff800`01c6bd34 nt!PnpRemoveLockedDeviceNode+0x1a3&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`02b0f900 fffff800`01c6be40 nt!PnpDeleteLockedDeviceNode+0x44&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`02b0f930 fffff800`01cfcd04 nt!PnpDeleteLockedDeviceNodes+0xa0&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`02b0f9a0 fffff800`01cfd35c nt!PnpProcessQueryRemoveAndEject+0xc34&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`02b0fae0 fffff800`01be65ce nt!PnpProcessTargetDeviceEvent+0x4c&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`02b0fb10 fffff800`0188f641 nt! ?? ::NNGAKEGL::`string'+0x5ab9b&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`02b0fb70 fffff800`01b1ce5a nt!ExpWorkerThread+0x111&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`02b0fc00 fffff800`01876d26 nt!PspSystemThreadStartup+0x5a&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`02b0fc40 00000000`00000000 nt!KiStartSystemThread+0x16&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Interesting, by looking at the stack above we can see that thread is doing some NDIS PnP stuff.&amp;#160; This thread has been waiting for more than 4 minutes, but hold on,&amp;#160; what is “ nt! ?? ::FNODOBFM::`string”?&amp;#160; This doesn’t seem to be a useful function name, no its not!&amp;#160; This is a side effect of Basic Block Tools optimization (&lt;a href="http://www.microsoft.com/windows/cse/bit_projects.mspx"&gt;BBT&lt;/a&gt;).&amp;#160; Using public symbols the debugger will find it hard to get to the right symbol, there is a nice a trick you can use in order to get to the right function.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;P.S for a nice x64 Deep Dive please refer to &lt;a href="http://blogs.msdn.com/b/ntdebugging/archive/2010/02/19/2010-global-engineering-conference-gec.aspx"&gt;our archive&lt;/a&gt;.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Let’s display the function data for the return address &lt;span style="color: rgb(0, 176, 240);"&gt;&lt;font color="#00ff00"&gt;fffff800`018e1816&lt;/font&gt;&lt;/span&gt;:&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;8: kd&amp;gt; .fnent &lt;span style="color: rgb(0, 176, 240);"&gt;&lt;font color="#00ff00"&gt;fffff800`018e1816&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="Debug"&gt;Debugger function entry 000000e8`f28f14f8 for:&lt;/p&gt;  &lt;p class="Debug"&gt;(fffff800`018c4790)&amp;#160;&amp;#160; nt! ?? ::FNODOBFM::`string'+0x12ff6&amp;#160;&amp;#160; |&amp;#160; (fffff800`018c47c8)&amp;#160;&amp;#160; nt!vDbgPrintExWithPrefixInternal&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;BeginAddress&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; = 00000000`000da7d0&lt;/p&gt;  &lt;p class="Debug"&gt;EndAddress&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; = 00000000`000da81c&lt;/p&gt;  &lt;p class="Debug"&gt;UnwindInfoAddress = 00000000`001c8a54&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;Unwind info at fffff800`019cfa54, 10 bytes&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160; version 1, flags 4, prolog 0, codes 0&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;Chained info:&lt;/p&gt;  &lt;p class="Debug"&gt;&lt;span style="background: yellow;"&gt;BeginAddress&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; = 00000000`000182f0&lt;/span&gt;&lt;/p&gt;  &lt;p class="Debug"&gt;EndAddress&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; = 00000000`00018358&lt;/p&gt;  &lt;p class="Debug"&gt;UnwindInfoAddress = 00000000`001bf910&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;Unwind info at fffff800`019c6910, 6 bytes&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160; version 1, flags 0, prolog 4, codes 1&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160; 00: offs 4, unwind op 2, op info c&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; UWOP_ALLOC_SMALL.&amp;#160; &lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;For optimized binaries, you will find a section “Chained Info”.&amp;#160; Add the BeginAddress to the start address of the module and you should hit the correct function so:&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;8: kd&amp;gt; ln nt+000182f0&lt;/p&gt;  &lt;p class="Debug"&gt;(fffff800`0181f2f0)&amp;#160;&amp;#160; nt!ExWaitForRundownProtectionReleaseCacheAware&amp;#160; |&amp;#160; (fffff800`0181f358)&amp;#160;&amp;#160; nt!KeGetRecommendedSharedDataAlignment&lt;/p&gt;  &lt;p class="Debug"&gt;Exact matches:&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background: yellow;"&gt;nt!ExWaitForRundownProtectionReleaseCacheAware&lt;/span&gt; (&amp;lt;no parameter info&amp;gt;)&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Bingo!&amp;#160; You got the function.&amp;#160; So tcpip!FlPnpEvent was calling ExWaitForRundownProtectionReleaseCacheAware.&amp;#160; This function will basically wait for the rundown protection to drop down to 0.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;A thread can call &lt;a href="http://msdn.microsoft.com/en-us/library/windows/hardware/jj569372(v=vs.85).aspx"&gt;ExAcquireRundownProtectionEx&lt;/a&gt; against a shared object for safe access.&amp;#160; &lt;a href="http://msdn.microsoft.com/en-us/library/windows/hardware/jj569382(v=vs.85).aspx"&gt;Rundown Protection&lt;/a&gt; provides a way to protect an object from being deleted unless all outstanding access has been finished (Run Down).&amp;#160; The “ExWaitForRundownProtectionReleaseCacheAware” will do exactly the same; it will wait for all rundown protection calls to be completed.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;The question is which structure are we waiting for its rundown to drain, that will depend on what we are dealing with.&amp;#160; Because of code optimization the debugger is not showing you the full picture.&amp;#160; Through code review I found that in this particular dump there is an inline call to function “FlpUninitializePacketProviderInterface”.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;So the stack in reality should look like this:&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;Child-SP&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; RetAddr&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Call Site&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`02b0ee70 fffff800`0187ba32 nt!KiSwapContext+0x7a&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`02b0efb0 fffff800`0188cd8f nt!KiCommitThreadWait+0x1d2&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`02b0f040 fffff800`018e1816 nt!KeWaitForSingleObject+0x19f&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`02b0f0e0 fffff880`01618fcd nt!ExWaitForRundownProtectionReleaseCacheAware&lt;/p&gt;  &lt;p class="Debug"&gt;----inline function----&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; tcpip!FlpUninitializePacketProviderInterface&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`02b0f150 fffff880`0173f54e tcpip!FlPnpEvent+0x17d&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`02b0f1c0 fffff880`00f87b2f tcpip!Fl48PnpEvent+0xe&lt;/p&gt;  &lt;p class="Debug"&gt;…&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;So we need to un-initialize a network interface but before doing that we need to make sure that there are no outstanding references to packets and that there are no outstanding packets pending.&amp;#160; When we say packets, starting in NDIS 6 we basically mean “&lt;a href="http://msdn.microsoft.com/en-gb/library/windows/hardware/ff568376(v=vs.85).aspx"&gt;NET_BUFFER&lt;/a&gt;” and “&lt;a href="http://msdn.microsoft.com/en-gb/library/windows/hardware/ff568388(v=vs.85).aspx"&gt;Net_Buffer_List&lt;/a&gt;” structures.&amp;#160; So we need to check for any outstanding Net_Buffer_Lists (NBLs) that are pending, one reference will correspond to one pending NBL.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;To the rescue, the “NDISKD” debugger extension has a very nice and handy command to display all pending NBLS and their owners, it is “!pendingnbls”.&amp;#160; For the command to work it you must first enable “TrackNblOwner” through the registry.&amp;#160; By default, this registry key is not enabled on server SKUs as it may cause a performance hit.&amp;#160; On client SKUs this is enabled by default.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;When you run !pendingnbls on a clean Windows 2008 R2 install you get:&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;8: kd&amp;gt; !ndiskd.pendingnbls&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; This command requires NBL tracking to be enabled on the debugee target&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; machine.&amp;#160; (By default, client operating systems have level 1, and servers&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; have level 0).&amp;#160; To enable, set this REG_DWORD value to a nonzero value on&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; the target machine and reboot the target machine:&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; HKLM\SYSTEM\CurrentControlSet\Services\NDIS\Parameters ! TrackNblOwner&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; Possible Values (features are cumulative)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; * 0:&amp;#160; Disable all tracking.&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; * 1:&amp;#160; Track the most recent owner of each NBL (enables !ndiskd.pendingnbls)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; Show me all allocated NBLs so I can manually find the one I want&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;You can find all allocated NBLs with the command “!ndiskd.nblpool -force -find ((@$extin.Flags)&amp;amp;0x108)==0x100)”, but still you don’t get any owner.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;So I asked the customer to turn on “TrackNblOwner” and reboot, wait for the next occurrence of the issue and get a new memory dump.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Two days later we received the memory dump file.&amp;#160; I verified that they are having the same issue I found in the last dump and that TrackNblOwner is configured correctly:&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;23: kd&amp;gt; dp NDIS!ndisTrackNblOwner L1&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`00ef1a30&amp;#160; &lt;span style="background: lime;"&gt;00000000`00000001&lt;/span&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Then I immediately checked all pending NBLs to claim the prize, and it was not surprising to see why the NIC card was not un-initializing:&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;23: kd&amp;gt; !ndiskd.pendingnbls&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;PHASE 1/3: Found 20 NBL pool(s).&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p class="Debug"&gt;PHASE 2/3: Found 550 freed NBL(s).&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; Pending Nbl&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Currently held by&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; fffffa801dc559f0&amp;#160;&amp;#160; fffffa80142d31a0 - My Ethernet 1Gb 4-port Adapter&amp;#160; [Miniport]&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; fffffa801dc81680&amp;#160;&amp;#160; fffffa80142d31a0 - My Ethernet 1Gb 4-port Adapter&amp;#160; [Miniport]&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; fffffa80131d2aa0&amp;#160;&amp;#160; fffffa80142d31a0 - My Ethernet 1Gb 4-port Adapter&amp;#160; [Miniport]&lt;/p&gt;  &lt;p class="Debug"&gt;……………………………….&lt;/p&gt;  &lt;p class="Debug"&gt;Ret of the repeated output omitted&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;PHASE 3/3: Found 1854 pending NBL(s) of 3005 total NBL(s).&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p class="Debug"&gt;Search complete.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;So we currently have 1854 NBLs pending on the NIC miniport driver “fffffa80142d31a0”.&amp;#160; This is the Miniport that currently holding all NBLs:&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;23: kd&amp;gt; !ndiskd.miniport fffffa80142d31a0&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;MINIPORT&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; My Ethernet 1Gb 4-port Adapter&amp;#160; &lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; Ndis handle&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; fffffa80142d31a0&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; Ndis API version&amp;#160;&amp;#160; v6.20&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; Adapter context&amp;#160;&amp;#160;&amp;#160; fffffa80138cc000&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; Miniport driver&amp;#160;&amp;#160;&amp;#160; fffffa800d4f7530 - MyMiniPortDriver&amp;#160; v1.0&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; Network interface&amp;#160; fffffa800d25e870&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; Media type&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 802.3&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; Device instance&amp;#160;&amp;#160;&amp;#160; PCI\VEN_1111&amp;amp;DEV_1111&amp;amp;SUBSYS_169D103C&amp;amp;REV_01\4&amp;amp;2263a140&amp;amp;0&amp;amp;0010&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; Device object&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; fffffa80142d3050&amp;#160;&amp;#160;&amp;#160; More information&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; MAC address&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; xx-xx-xx-xx-xx-xx&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;STATE&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; Miniport&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Running&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background: yellow;"&gt;Device PnP&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; QUERY_REMOVED&lt;/span&gt;&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; Datapath&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Normal&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; Operational status DORMANT&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background: yellow;"&gt;Operational flags&amp;#160; DORMANT_PAUSED&lt;/span&gt;&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; Admin status&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ADMIN_UP&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; Media&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Connected&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; Power&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; D0&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; References&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 9&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; Total resets&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; Pending OID&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; None&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; Flags&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; BUS_MASTER, 64BIT_DMA, SG_DMA, DEFAULT_PORT_ACTIVATED,&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SUPPORTS_MEDIA_SENSE, DOES_NOT_DO_LOOPBACK,&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; MEDIA_CONNECTED&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; PnP flags&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PM_SUPPORTED, DEVICE_POWER_ENABLED, RECEIVED_START,&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; HARDWARE_DEVICE&lt;/p&gt;  &lt;p class="Debug"&gt;…&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;What you notice from the above that the device received a “Query_Removed” PNP and is currently in a Dormant_Paused state.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;From: &lt;a href="http://msdn.microsoft.com/en-us/library/ff566737.aspx"&gt;http://msdn.microsoft.com/en-us/library/ff566737.aspx&lt;/a&gt;:&lt;/p&gt;  &lt;p class="Text"&gt;NET_IF_OPER_STATUS_DORMANT_PAUSED &lt;/p&gt;  &lt;p class="Text"&gt;The operational status is set to NET_IF_OPER_STATUS_DORMANT because the miniport adapter is in the paused or pausing state. &lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;NDIS 6.0 and up allow miniport adapters to be paused and the documentation &lt;a href="http://msdn.microsoft.com/en-gb/library/windows/hardware/gg463288.aspx"&gt;here&lt;/a&gt; shows what the miniport driver should do when it receives a pause request.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Because the adapter was in a pause state, basic network commads like “ping” ceased to work as described earlier in the symptoms.&amp;#160; The next action is definitely to involve the miniport adapter vendor to trace this further and find out why all these pending NBLs were not completed.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Until a next adventure!&lt;/p&gt;  &lt;p class="Text"&gt;Best Regards,&lt;/p&gt;  &lt;p class="Text"&gt;Karim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10406420" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/Debugging/">Debugging</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/windows/">windows</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/x64/">x64</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/windbg/">windbg</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/kernel/">kernel</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/Network/">Network</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/Karim+Elsaid/">Karim Elsaid</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/Networking/">Networking</category></item><item><title>Understanding File System Minifilter and Legacy Filter Load Order</title><link>http://blogs.msdn.com/b/ntdebugging/archive/2013/03/25/understanding-file-system-minifilter-and-legacy-filter-load-order.aspx</link><pubDate>Mon, 25 Mar 2013 23:39:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10405253</guid><dc:creator>ntdebug</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/ntdebugging/rsscomments.aspx?WeblogPostID=10405253</wfw:commentRss><comments>http://blogs.msdn.com/b/ntdebugging/archive/2013/03/25/understanding-file-system-minifilter-and-legacy-filter-load-order.aspx#comments</comments><description>&lt;p class="Text"&gt;Hello, my name is Fred Jeng from the Global Escalation Services team. For today’s post, I want to go over how Windows 7 and Windows Server 2008 R2 load file system mini-filters in a mixed environment when legacy filters are also present. I recently came across an issue where the filters were being loaded out of order based on their altitudes. This can cause all sorts of problems with a filter driver’s functionality if they are incorrectly positioned on the stack.&amp;#160; Take for example the following filter stack, obtained using the fltmc command from the cmd prompt:&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;C:\Windows\system32&amp;gt;fltmc&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;Filter Name&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Num Instances&amp;#160;&amp;#160;&amp;#160; Altitude&amp;#160;&amp;#160;&amp;#160; Frame&lt;/p&gt;  &lt;p class="Debug"&gt;------------------------------&amp;#160; -------------&amp;#160; ------------ -----&lt;/p&gt;  &lt;p class="Debug"&gt;AVLegacy&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 389998.99&amp;#160;&amp;#160; &amp;lt;Legacy&amp;gt;&lt;/p&gt;  &lt;p class="Debug"&gt;EncryptionLegacy&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 149998.99&amp;#160;&amp;#160; &amp;lt;Legacy&amp;gt;&lt;/p&gt;  &lt;p class="Debug"&gt;AVMiniFilter&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 328000&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&lt;/p&gt;  &lt;p class="Debug"&gt;luafv&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 135000&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&lt;/p&gt;  &lt;p class="Debug"&gt;FileInfo&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 13&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 45000&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;At first glance it looks like there is a problem causing the legacy encryption filter to be loaded above the antivirus minifilter, which has a higher altitude. This may cause issues with AVMiniFilter as the IOs that it receives are still encrypted. Due to limitations in how the filter drivers attach to the driver stack, this is actually the intended behavior. However, there is a solution to manipulate the load order to load the legacy filters correctly based on their altitude.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt; &lt;strong&gt;&lt;/strong&gt;  &lt;p class="Text"&gt;&lt;strong&gt;First some background information regarding legacy filters and minifilters.&lt;/strong&gt;&lt;/p&gt;  &lt;p class="Text"&gt;In the old days before minifilters, legacy drivers can only attach at the top of the driver stack so the load order also controlled the attachment order. The earlier a legacy driver loads, the lower it can attach on the file system stack. Minifilters on the other hand can load at any time, but their positions relative to other minifilters are controlled by their altitude. When a minifilter loads, it needs to register with an appropriate frame created by fltmgr. Each frame is a fltmgr device object and represents a range of altitudes. There can be more than one frame on the file system stack but the range of altitudes that each frame represents cannot overlap with the altitude range of another frame. For interoperability with legacy drivers, minifilters must still maintain a load order group. The frames are created and managed by fltmgr, which itself is a legacy driver. The ramification of this is that fltmgr must follow the old legacy filter driver rules and attach only at the top of the stack. &lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;From the above example, let’s walk through how the legacy and minifilters above are loaded to get us into the state such that the altitude appears to be out of order.&lt;/p&gt;  &lt;p class="Text"&gt;First, here are the details for the 5 drivers.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;table style="background: white; border-collapse: collapse;" class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td style="padding: 0in 5.4pt; border: 1pt solid windowtext; width: 95.75pt;" valign="top" width="128"&gt;         &lt;p class="Text"&gt;Driver Name&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: 1pt 1pt 1pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 95.75pt;" valign="top" width="128"&gt;         &lt;p class="Text"&gt;Type&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: 1pt 1pt 1pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 123.1pt;" valign="top" width="164"&gt;         &lt;p class="Text"&gt;Load Order&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: 1pt 1pt 1pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 225pt;" valign="top" width="300"&gt;         &lt;p class="Text"&gt;Start Type&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: 1pt 1pt 1pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 225pt;" valign="top" width="300"&gt;         &lt;p class="Text"&gt;Altitude&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td style="border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentcolor windowtext windowtext; padding: 0in 5.4pt; width: 95.75pt;" valign="top" width="128"&gt;         &lt;p class="Text"&gt;AVLegacy&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 95.75pt;" valign="top" width="128"&gt;         &lt;p class="Text"&gt;Legacy&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 123.1pt;" valign="top" width="164"&gt;         &lt;p class="Text"&gt;FsFilter Anti-Virus&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 225pt;" valign="top" width="300"&gt;         &lt;p class="Text"&gt;SERVICE_BOOT_START&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 225pt;" valign="top" width="300"&gt;         &lt;p class="Text"&gt;329998.99&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td style="border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentcolor windowtext windowtext; padding: 0in 5.4pt; width: 95.75pt;" valign="top" width="128"&gt;         &lt;p class="Text"&gt;AVMiniFilter&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 95.75pt;" valign="top" width="128"&gt;         &lt;p class="Text"&gt;Minifilter&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 123.1pt;" valign="top" width="164"&gt;         &lt;p class="Text"&gt;FsFilter Anti-Virus&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 225pt;" valign="top" width="300"&gt;         &lt;p class="Text"&gt;SERVICE_BOOT_START&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 225pt;" valign="top" width="300"&gt;         &lt;p class="Text"&gt;328000&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td style="border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentcolor windowtext windowtext; padding: 0in 5.4pt; width: 95.75pt;" valign="top" width="128"&gt;         &lt;p class="Text"&gt;EncryptionLegacy&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 95.75pt;" valign="top" width="128"&gt;         &lt;p class="Text"&gt;Legacy&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 123.1pt;" valign="top" width="164"&gt;         &lt;p class="Text"&gt;FsFilter Encryption&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 225pt;" valign="top" width="300"&gt;         &lt;p class="Text"&gt;SERVICE_BOOT_START&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 225pt;" valign="top" width="300"&gt;         &lt;p class="Text"&gt;149998.99&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td style="border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentcolor windowtext windowtext; padding: 0in 5.4pt; width: 95.75pt;" valign="top" width="128"&gt;         &lt;p class="Text"&gt;Luafv&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 95.75pt;" valign="top" width="128"&gt;         &lt;p class="Text"&gt;Minifilter&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 123.1pt;" valign="top" width="164"&gt;         &lt;p class="Text"&gt;FsFilter Virtualization&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 225pt;" valign="top" width="300"&gt;         &lt;p class="Text"&gt;SERVICE_AUTO_START&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 225pt;" valign="top" width="300"&gt;         &lt;p class="Text"&gt;135000&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td style="border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentcolor windowtext windowtext; padding: 0in 5.4pt; width: 95.75pt;" valign="top" width="128"&gt;         &lt;p class="Text"&gt;FileInfo&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 95.75pt;" valign="top" width="128"&gt;         &lt;p class="Text"&gt;Minifilter&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 123.1pt;" valign="top" width="164"&gt;         &lt;p class="Text"&gt;FSFilter Bottom&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 225pt;" valign="top" width="300"&gt;         &lt;p class="Text"&gt;SERVICE_BOOT_START&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 225pt;" valign="top" width="300"&gt;         &lt;p class="Text"&gt;45000&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;MSDN has an article that describes load order groups and altitudes for minifilters: &lt;a href="http://msdn.microsoft.com/en-us/library/windows/hardware/ff549689%28v=vs.85%29.aspx"&gt;http://msdn.microsoft.com/en-us/library/windows/hardware/ff549689%28v=vs.85%29.aspx&lt;/a&gt;.&lt;/p&gt;  &lt;p class="Text"&gt;Referencing this article regarding load order groups and altitudes for minifilter drivers, we can determine that our filters will load in the following order.&lt;/p&gt;  &lt;p class="Text"&gt;FileInfo&lt;/p&gt;  &lt;p class="Text"&gt;EncryptionLegacy&lt;/p&gt;  &lt;p class="Text"&gt;AVLegacy&lt;/p&gt;  &lt;p class="Text"&gt;AVMiniFilter&lt;/p&gt;  &lt;p class="Text"&gt;luafv&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;On system bootup, when fltmgr.sys loads it will create Frame 0 with a default altitude range of 0 to 49999. When FileInfo loads with an altitude of 45000, it will fit into the default Frame 0. Next to load is EncryptionLegacy. Since this is a legacy driver, it will attach on top of the legacy driver fltmgr.sys. So this is how our file system stack looks right now.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;img style="border: 0px currentcolor; display: inline; background-image: none;" title="image001" border="0" alt="image001" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-00-metablogapi/0624.image001_5F00_1B836C80.png" width="509" height="239" /&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Next up is the AVLegacy driver.&amp;#160; This is a legacy driver, so it has to attach above EncryptionLegacy.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;img style="border: 0px currentcolor; display: inline; background-image: none;" title="image002" border="0" alt="image002" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-00-metablogapi/1682.image002_5F00_6CBDB3DD.png" width="509" height="387" /&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Now the AVMinifilter will load with an altitude of 328000. The OS will check if it will fit in the Frame 0 Fltmgr, but this frame only supports an altitude of 0-45000. Before deciding to create a new fltmgr Frame instance, it will check if there are any legacy filters attached above Frame 0 and adjust Frame 0’s altitude if there are. So in our case, we do have legacy filters on the file system stack at this point and so we go up the list of legacy drivers. First we see EncryptionLegacy with an altitude of 149998.99 so we adjust Frame 0 to cover from 0 to 149998.99. We continue up the list and see AVLegacy with an altitude of 329998.99 so we again adjust the altitude of Frame 0 to now cover 0-329998.99. The reason we do this is because Frame 0 now must handle all minifilters below 329998.99. Since we can only attach legacy filters to the top of the stack, if we add an additional FltMgr frame instance, it has to sit above AVLegacy and can only support minifilters with altitude of 329998.99 or higher. Now that Frame 0 supports 0-329998.99, we can register AVMinifilter with Frame 0.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;&amp;#160;&lt;img style="border: 0px currentcolor; display: inline; background-image: none;" title="image003" border="0" alt="image003" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-00-metablogapi/3348.image003_5F00_73048A6B.png" width="473" height="419" /&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;At this point, you can already see that AVMinifilter which has a higher altitude then EncryptionLegacy will be loaded below EncryptionLegacy. The last driver to load is the luafv minifilter, and it will fit into Frame 0.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;img style="border: 0px currentcolor; display: inline; background-image: none;" title="image004" border="0" alt="image004" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-00-metablogapi/3817.image004_5F00_794B60F9.png" width="473" height="463" /&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;strong&gt;A couple of things to point out. &lt;/strong&gt;&lt;/p&gt;  &lt;p class="Text"&gt;Why can’t we insert a Frame between AVLegacy and EncryptionLegacy when ACMinifilter loads?&lt;/p&gt;  &lt;p class="Text"&gt;This is due to how the file system stack is constructed with legacy drivers only being able to attach to the top of the stack. Since FltMgr is a legacy driver, it has to conform to these rules.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Why do we adjust the altitude in Frame 0 to cover 0-329998.99? Why not stop at 149998.99?&lt;/p&gt;  &lt;p class="Text"&gt;If Frame 0 only adjusts its altitude to the legacy filter directly attached above it and not all the way to the highest attached legacy filter, we won’t be able to handle some range of mini-filters. For example, assume we only adjust Frame 0 to cover 0-149998.99, then when the AVMinifilter with an altitude of 328000 comes along, it won’t fit in Frame 0, and we’re unable to insert a Frame between AVLegacy (329998.99) and EncryptionLegacy(149998.99) so we would either be unable to load AVMinifilter, or we would have to create Frame 1 above AVLegacy and load AVMinifilter there. In which case we would again be faced with the altitude disordering issue.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;If this is the expected behavior, how do we resolve the problem of EncryptionLegacy being loaded above AVMinifilter? The solution is to inject a dummy minifilter that loads at the appropriate time to force fltmgr to create a Frame between the legacy filters. For our case above, I used the DDK to create the NullFilter minifilter driver and changed the load order to FSFilter Compression and gave it an altitude of 160030 which is within the assigned altitude for FSFilterCompression and set the start type to SERVICE_BOOT_START.&amp;#160; Please note that I only used this driver in a test environment, production minfilter drivers must use an &lt;a href="https://connect.microsoft.com/site882/content/content.aspx?ContentID=26481"&gt;altitude assigned by Microsoft&lt;/a&gt;.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;For information on minifilter load order groups and altitude, reference &lt;a href="http://msdn.microsoft.com/en-us/windows/hardware/gg462963.aspx"&gt;http://msdn.microsoft.com/en-us/windows/hardware/gg462963.aspx&lt;/a&gt;.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt; Our list of filters are as follows: &lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;table style="background: white; border-collapse: collapse;" class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td style="padding: 0in 5.4pt; border: 1pt solid windowtext; width: 95.75pt;" valign="top" width="128"&gt;         &lt;p class="Text"&gt;Driver Name&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: 1pt 1pt 1pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 95.75pt;" valign="top" width="128"&gt;         &lt;p class="Text"&gt;Type&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: 1pt 1pt 1pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 123.1pt;" valign="top" width="164"&gt;         &lt;p class="Text"&gt;Load Order&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: 1pt 1pt 1pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 225pt;" valign="top" width="300"&gt;         &lt;p class="Text"&gt;Start Type&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: 1pt 1pt 1pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 225pt;" valign="top" width="300"&gt;         &lt;p class="Text"&gt;Altitude&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td style="border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentcolor windowtext windowtext; padding: 0in 5.4pt; width: 95.75pt;" valign="top" width="128"&gt;         &lt;p class="Text"&gt;AVLegacy&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 95.75pt;" valign="top" width="128"&gt;         &lt;p class="Text"&gt;Legacy&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 123.1pt;" valign="top" width="164"&gt;         &lt;p class="Text"&gt;FsFilter Anti-Virus&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 225pt;" valign="top" width="300"&gt;         &lt;p class="Text"&gt;SERVICE_BOOT_START&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 225pt;" valign="top" width="300"&gt;         &lt;p class="Text"&gt;329998.99&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td style="border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentcolor windowtext windowtext; padding: 0in 5.4pt; width: 95.75pt;" valign="top" width="128"&gt;         &lt;p class="Text"&gt;AVMiniFilter&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 95.75pt;" valign="top" width="128"&gt;         &lt;p class="Text"&gt;Minifilter&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 123.1pt;" valign="top" width="164"&gt;         &lt;p class="Text"&gt;FsFilter Anti-Virus&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 225pt;" valign="top" width="300"&gt;         &lt;p class="Text"&gt;SERVICE_BOOT_START&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 225pt;" valign="top" width="300"&gt;         &lt;p class="Text"&gt;328000&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td style="border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentcolor windowtext windowtext; padding: 0in 5.4pt; width: 95.75pt;" valign="top" width="128"&gt;         &lt;p class="Text"&gt;EncryptionLegacy&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 95.75pt;" valign="top" width="128"&gt;         &lt;p class="Text"&gt;Legacy&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 123.1pt;" valign="top" width="164"&gt;         &lt;p class="Text"&gt;FsFilter Encryption&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 225pt;" valign="top" width="300"&gt;         &lt;p class="Text"&gt;SERVICE_BOOT_START&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 225pt;" valign="top" width="300"&gt;         &lt;p class="Text"&gt;149998.99&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td style="border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentcolor windowtext windowtext; padding: 0in 5.4pt; width: 95.75pt;" valign="top" width="128"&gt;         &lt;p class="Text"&gt;Luafv&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 95.75pt;" valign="top" width="128"&gt;         &lt;p class="Text"&gt;Minifilter&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 123.1pt;" valign="top" width="164"&gt;         &lt;p class="Text"&gt;FsFilter Virtualization&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 225pt;" valign="top" width="300"&gt;         &lt;p class="Text"&gt;SERVICE_AUTO_START&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 225pt;" valign="top" width="300"&gt;         &lt;p class="Text"&gt;135000&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td style="border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentcolor windowtext windowtext; padding: 0in 5.4pt; width: 95.75pt;" valign="top" width="128"&gt;         &lt;p class="Text"&gt;FileInfo&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 95.75pt;" valign="top" width="128"&gt;         &lt;p class="Text"&gt;Minifilter&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 123.1pt;" valign="top" width="164"&gt;         &lt;p class="Text"&gt;FSFilter Bottom&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 225pt;" valign="top" width="300"&gt;         &lt;p class="Text"&gt;SERVICE_BOOT_START&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 225pt;" valign="top" width="300"&gt;         &lt;p class="Text"&gt;45000&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td style="background: yellow; border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentcolor windowtext windowtext; padding: 0in 5.4pt; width: 95.75pt;" valign="top" width="128"&gt;         &lt;p class="Text"&gt;NullFilter&lt;/p&gt;       &lt;/td&gt;        &lt;td style="background: yellow; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 95.75pt;" valign="top" width="128"&gt;         &lt;p class="Text"&gt;Minifilter&lt;/p&gt;       &lt;/td&gt;        &lt;td style="background: yellow; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 123.1pt;" valign="top" width="164"&gt;         &lt;p class="Text"&gt;FSFilter Compression&lt;/p&gt;       &lt;/td&gt;        &lt;td style="background: yellow; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 225pt;" valign="top" width="300"&gt;         &lt;p class="Text"&gt;SERVICE_BOOT_START&lt;/p&gt;       &lt;/td&gt;        &lt;td style="background: yellow; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentcolor windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 225pt;" valign="top" width="300"&gt;         &lt;p class="Text"&gt;160030&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;So with the new NullFilter dummy driver, our filter load order should be as follows:&lt;/p&gt;  &lt;p class="Text"&gt;FileInfo&lt;/p&gt;  &lt;p class="Text"&gt;EncryptionLegacy&lt;/p&gt;  &lt;p class="Text"&gt;NullFilter&lt;/p&gt;  &lt;p class="Text"&gt;AVLegacy&lt;/p&gt;  &lt;p class="Text"&gt;AVMiniFilter&lt;/p&gt;  &lt;p class="Text"&gt;luafv&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;After FileInfo and EncryptionLegacy loads, the stack is the same as what we had earlier.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;img style="border: 0px currentcolor; display: inline; background-image: none;" title="image001" border="0" alt="image001" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-00-metablogapi/0513.image001_5F00_5138B1DA.png" width="509" height="239" /&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Now when the NullFilter minifilter loads with an altitude of 160030, we see that it doesn’t fit in Frame 0. As before, we check for any attached legacy filter drivers and see EncryptionLegacy so we adjust Frame 0 to cover 0-149998.99. Since NullFilter still does not fit in Frame 0, we will create a new Frame and attach it above the EncryptionLegacy driver.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;img style="border: 0px currentcolor; display: inline; background-image: none;" title="image005" border="0" alt="image005" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-00-metablogapi/3817.image005_5F00_577F8868.png" width="473" height="344" /&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" align="left"&gt;&lt;tbody&gt;     &lt;tr style="height: 45pt;"&gt;       &lt;td style="padding: 0in; height: 45pt;"&gt;&amp;#160;&lt;/td&gt;        &lt;td style="padding: 0in; height: 45pt;" valign="top" rowspan="2"&gt;&amp;#160;&lt;/td&gt;        &lt;td style="padding: 0in; height: 45pt;"&gt;&amp;#160;&lt;/td&gt;        &lt;td style="padding: 0in; height: 45pt;"&gt;&amp;#160;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td style="padding: 0in;"&gt;&amp;#160;&lt;/td&gt;        &lt;td style="padding: 0in;"&gt;&amp;#160;&lt;/td&gt;        &lt;td style="padding: 0in;"&gt;&amp;#160;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="Text"&gt; The AVLegacy driver will load next, and since it is a legacy driver, it will attach above the Frame 1 instance of FltMgr.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;&lt;img style="border: 0px currentcolor; display: inline; background-image: none;" title="image006" border="0" alt="image006" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-00-metablogapi/2235.image006_5F00_16DD3BF9.png" width="473" height="467" /&gt;&amp;#160;&lt;/span&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;The last two minifilters to load are AVMiniFilter and luafv. When AVMinifilter loads into Frame 1 with an altitude of 328000, it will see that Frame 1 at the time only supports 149998.99-160030. It follows the same algorithm to check if there are any legacy filters attached above the frame. In this case, we have AVLegacy attached above Frame 1 so we adjust Frame 1 to cover 149998.99-329998.99 before inserting AVMinifilter into Frame 1.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;img style="border: 0px currentcolor; display: inline; background-image: none;" title="image007" border="0" alt="image007" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-00-metablogapi/5140.image007_5F00_5CEDF90C.png" width="473" height="546" /&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;By strategically injecting a dummy minifilter driver, we can get the legacy and minifilter drivers to all load at the correct altitude.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10405253" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/windows/">windows</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/internals/">internals</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/windows+internals/">windows internals</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/NTFS/">NTFS</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/Fred/">Fred</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/filter+driver/">filter driver</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/fltmgr/">fltmgr</category></item><item><title>Don't Believe Everything You Read</title><link>http://blogs.msdn.com/b/ntdebugging/archive/2013/03/06/don-t-believe-everything-you-read.aspx</link><pubDate>Wed, 06 Mar 2013 23:08:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10400063</guid><dc:creator>ntdebug</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/ntdebugging/rsscomments.aspx?WeblogPostID=10400063</wfw:commentRss><comments>http://blogs.msdn.com/b/ntdebugging/archive/2013/03/06/don-t-believe-everything-you-read.aspx#comments</comments><description>&lt;p class="Text"&gt;Recently, I was contacted by a customer who was advised by an ISV to set a registry value under one of the sub keys in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\.&amp;#160; Let's call it UseQuantumComputing = 1 (value name has been changed to protect the ISV).&amp;#160; The customer wanted to know what this value actually did and no one could find any documentation explaining it.&amp;#160; These issues often come to our team because we have access to the Windows source code. I did a bit of code review to find out what this value does.&amp;#160; As it turns out, nowhere in Windows source code between Windows 2000 and Windows Server 2012 do we ever check for or set UseQuantumComputing.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;I can think of a few reasons the ISV would suggest setting this value.&amp;#160; Perhaps they were under the impression this did something but got confused about the value name.&amp;#160; It's possible they hoped making a registry change would have a placebo effect.&amp;#160; Or, perhaps their software actually checks this value, not Windows.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;The latter of these possibilities is probably the worst case scenario. An ISV should not create a registry value inside of keys used for Windows’ own internal use. Why? The first reason is that there's no guarantee that Microsoft won't end up coincidentally using that same value name later. This would cause a conflict between the two users of the value.&amp;#160; Second, we have to consider the scenario where two different ISVs both decide to use the same value. That would be bad too.&amp;#160; Lastly, there's no guarantee that the key in use will still exist in later versions, or that it will be writeable or readable by the ISV due to permission changes.&amp;#160; In addition to all these reasons, there is the common sense issue that it is just confusing. Now the ISV's software and uninstaller needs to look all over the registry, not just in their own keys.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;On a similar note, I also recently had a case where a &amp;quot;Windows Tips&amp;quot; blog (not created, endorsed, or run by Microsoft) suggested using a registry value that was implemented in Windows but was not documented by Microsoft.&amp;#160; It turns out this value wasn't thoroughly tested (because it was undocumented and wasn't intended to be used in production), and using it would cause server hangs under certain conditions.&amp;#160; These hangs were only discovered after a large customer decided to implement the undocumented value across their enterprise.&amp;#160; &lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Here are a few tips for IT Pros, developers, and users alike:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div class="Text"&gt;Don't implement random registry settings if you can't find documentation for that setting on an official Microsoft site, like MSDN, TechNet, or support.microsoft.com(information on forums or answer boards (e.g. social.*.microsoft.com or answers.*.microsoft.com) is not official documentation).&amp;#160; At best these unknown registry settings they will do nothing, at worst they will cause you headaches later.&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div class="Text"&gt;If a key/value isn't documented, changes to it likely are not tested, and could put your machine in a state that makes it difficult or impossible to support.&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div class="Text"&gt;If you are a developer, keep any of your registry settings in your own key. Don't pollute in others' keys.&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div class="Text"&gt;If an ISV or Microsoft suggests you implement a setting, make sure you understand the implications of that setting.&lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;I'll leave you with the warning displayed in many of our KBs - it's there for a reason!&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;b&gt;WARNING:&lt;/b&gt; If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;-Matt&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10400063" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/windows/">windows</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/windows+internals/">windows internals</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/Burrough/">Burrough</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/registry/">registry</category></item><item><title>Leaving the Do Not Disturb Sign on the Door Will Cause the KERNEL_APC_PENDING_DURING_EXIT Bugcheck</title><link>http://blogs.msdn.com/b/ntdebugging/archive/2013/02/28/leaving-the-do-not-disturb-sign-on-the-door-will-cause-the-kernel-apc-pending-during-exit-bugcheck.aspx</link><pubDate>Fri, 01 Mar 2013 01:12:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10398375</guid><dc:creator>ntdebug</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/ntdebugging/rsscomments.aspx?WeblogPostID=10398375</wfw:commentRss><comments>http://blogs.msdn.com/b/ntdebugging/archive/2013/02/28/leaving-the-do-not-disturb-sign-on-the-door-will-cause-the-kernel-apc-pending-during-exit-bugcheck.aspx#comments</comments><description>&lt;p class="Text"&gt;This is Ron Stock from the Global Escalation Services team and I recently worked with a customer to determine which misbehaving driver was crashing their critical server. This particular crash was a STOP 0x00000020 which maps to KERNEL_APC_PENDING_DURING_EXIT. &lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;The KERNEL_APC_PENDING_DURING_EXIT bugcheck type indicates the APC disable count for a thread was not equal to zero when the thread exited. The APC disable count is a field in the _KTHREAD structure and it is decremented when drivers disable APCs by calling functions such as KeEnterCriticalRegion, FsRtlEnterFileSystem or by acquiring a mutex. Disabling APC delivery to a thread is the equivalent of hanging the “Do Not Disturb” sign on your door. When drivers need to perform a critical operation they ‘hang the sign on the door’ to prevent interruption from APCs. When the same driver fails to ‘take the sign off the door’ by calling KeLeaveCriticalRegion, FsRtlExitFileSystem or KeReleaseMutex, the APC disable count is never incremented back to its original value. This forgetful behavior causes a bugcheck because the APC disable count is checked when the thread is exiting. The OS expects this value to be zero on thread exit.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;In my case the value was &lt;span style="background: yellow;"&gt;0xffff&lt;/span&gt; (negative 1) indicating a driver had forgot to remove the ‘Do Not Disturb’ sign.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;kd&amp;gt; !analyze –v&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;KERNEL_APC_PENDING_DURING_EXIT (20)&lt;/p&gt;  &lt;p class="Debug"&gt;The key data item is the thread's APC disable count.&lt;/p&gt;  &lt;p class="Debug"&gt;If this is non-zero, then this is the source of the problem.&lt;/p&gt;  &lt;p class="Debug"&gt;Arguments:&lt;/p&gt;  &lt;p class="Debug"&gt;Arg1: 0000000000000000, The address of the APC found pending during exit.&lt;/p&gt;  &lt;p class="Debug"&gt;Arg2: 000000000000&lt;span style="background: yellow;"&gt;ffff&lt;/span&gt;, &lt;b&gt;&lt;span style="background: lime;"&gt;The thread's APC disable count&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="Debug"&gt;Arg3: 0000000000000000, The current IRQL&lt;/p&gt;  &lt;p class="Debug"&gt;Arg4: 0000000000000001&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Because the value is decremented earlier in time the current call stack is not particularly useful. It merely shows the thread exiting under normal conditions.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;0: kd&amp;gt; !thread -1 e&lt;/p&gt;  &lt;p class="Debug"&gt;THREAD fffffa8049f04b50&amp;#160; Cid 0004.0998&amp;#160; Teb: 0000000000000000 Win32Thread: 0000000000000000 RUNNING on processor 0&lt;/p&gt;  &lt;p class="Debug"&gt;Not impersonating&lt;/p&gt;  &lt;p class="Debug"&gt;DeviceMap&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; fffff8a000007ee0&lt;/p&gt;  &lt;p class="Debug"&gt;Owning Process&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; fffffa8048cad9e0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Image:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System&lt;/p&gt;  &lt;p class="Debug"&gt;Attached Process&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; N/A&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Image:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; N/A&lt;/p&gt;  &lt;p class="Debug"&gt;Wait Start TickCount&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 11503325&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Ticks: 0&lt;/p&gt;  &lt;p class="Debug"&gt;Context Switch Count&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 185715&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; IdealProcessor: 0&lt;/p&gt;  &lt;p class="Debug"&gt;UserTime&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 00:00:00.000&lt;/p&gt;  &lt;p class="Debug"&gt;KernelTime&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 00:00:06.078&lt;/p&gt;  &lt;p class="Debug"&gt;Win32 Start Address srv2!SrvProcWorkerThread(0xfffff88003c4b400)&lt;/p&gt;  &lt;p class="Debug"&gt;Stack Init fffff88005078db0 Current fffff880050789b0&lt;/p&gt;  &lt;p class="Debug"&gt;Base fffff88005079000 Limit fffff88005073000 Call 0&lt;/p&gt;  &lt;p class="Debug"&gt;Priority 15 BasePriority 15 UnusualBoost 0 ForegroundBoost 0 IoPriority 2 PagePriority 5&lt;/p&gt;  &lt;p class="Debug"&gt;Child-SP&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; RetAddr&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Call Site&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`05078b08 fffff800`01984bd9 nt!KeBugCheckEx&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`05078b10 fffff800`019a1a3d nt!PspExitThread+0xffffffff`fffe3ae9&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`05078c10 fffff800`0195bc8a nt!PspTerminateThreadByPointer+0x4d&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`05078c60 fffff880`03c56769 nt!PsTerminateSystemThread+0x22&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`05078c90 fffff880`03c4b5b6 srv2!SrvProcTerminateWorkerThreadInternal+0x99&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`05078cc0 fffff800`01966e5a srv2!SrvProcWorkerThread+0x1b6&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`05078d40 fffff800`016c0d26 nt!PspSystemThreadStartup+0x5a&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`05078d80 00000000`00000000 nt!KxStartSystemThread+0x16&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Driver Verifier is the ideal tool for this type of bugcheck. It has a feature called Critical Region logging which tracks the call stack and KTRHEAD value for each call to either KeEnterCriticalRegion() and KeLeaveCriticalRegion(). I had the customer enable this logging by selecting the “Miscellaneous checks” option in Driver Verifier using these steps-&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div class="Text"&gt;Run Verifier.exe&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div class="Text"&gt;Select “Create custom settings (For code developers)”&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div class="Text"&gt;Select individual settings from a full list&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div class="Text"&gt;Select Miscellaneous checks&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div class="Text"&gt;Select Driver Names from a list&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div class="Text"&gt;Manually choose all of the third-party drivers.&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div class="Text"&gt;Reboot after making the changes.&amp;#160; &lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;After running through the steps above, we gathered another STOP 0x00000020 dump. I confirmed the “Miscellaneous checks” option was enabled by using the &lt;b&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/windows/hardware/ff565591.aspx"&gt;!verifier&lt;/a&gt;&lt;/b&gt; command&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;0: kd&amp;gt; !verifier&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;Verify Level 800 ... enabled options are:&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;b&gt;Miscellaneous checks enabled&lt;/b&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;The stack in this new dump was in the same SrvProcWorkerThread thread exit path so we had a consistent pattern. The thread with the negative APC Disable count was &lt;span style="background: lime;"&gt;fffffa804b5be040&lt;/span&gt;.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;0: kd&amp;gt; !thread -1 e&lt;/p&gt;  &lt;p class="Debug"&gt;THREAD &lt;span style="background: lime;"&gt;fffffa804b5be040&lt;/span&gt; Cid 0004.082c&amp;#160; Teb: 0000000000000000 Win32Thread: 0000000000000000 RUNNING on processor 0&lt;/p&gt;  &lt;p class="Debug"&gt;Not impersonating&lt;/p&gt;  &lt;p class="Debug"&gt;DeviceMap&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; fffff8a000007ee0&lt;/p&gt;  &lt;p class="Debug"&gt;Owning Process&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; fffffa8048cad9e0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Image:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System&lt;/p&gt;  &lt;p class="Debug"&gt;Attached Process&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; N/A&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Image:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; N/A&lt;/p&gt;  &lt;p class="Debug"&gt;Wait Start TickCount&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4458237&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Ticks: 0&lt;/p&gt;  &lt;p class="Debug"&gt;Context Switch Count&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 36067&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; IdealProcessor: 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p class="Debug"&gt;UserTime&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 00:00:00.000&lt;/p&gt;  &lt;p class="Debug"&gt;KernelTime&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 00:00:01.218&lt;/p&gt;  &lt;p class="Debug"&gt;Win32 Start Address srv2!SrvProcWorkerThread(0xfffff88004827400)&lt;/p&gt;  &lt;p class="Debug"&gt;Stack Init fffff88005cc6db0 Current fffff88005cc69b0&lt;/p&gt;  &lt;p class="Debug"&gt;Base fffff88005cc7000 Limit fffff88005cc1000 Call 0&lt;/p&gt;  &lt;p class="Debug"&gt;Priority 15 BasePriority 15 UnusualBoost 0 ForegroundBoost 0 IoPriority 2 PagePriority 5&lt;/p&gt;  &lt;p class="Debug"&gt;Child-SP&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; RetAddr&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Call Site&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`05cc6b08 fffff800`0198dbd9 nt!KeBugCheckEx&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`05cc6b10 fffff800`019aaa3d nt!PspExitThread+0xffffffff`fffe3ae9&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`05cc6c10 fffff800`01964c8a nt!PspTerminateThreadByPointer+0x4d&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`05cc6c60 fffff880`048326d9 nt!PsTerminateSystemThread+0x22&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`05cc6c90 fffff880`048275b6 srv2!SrvProcTerminateWorkerThreadInternal+0x99&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`05cc6cc0 fffff800`0196fe5a srv2!SrvProcWorkerThread+0x1b6&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`05cc6d40 fffff800`016c9d26 nt!PspSystemThreadStartup+0x5a&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880`05cc6d80 00000000`00000000 nt!KxStartSystemThread+0x16&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;I dumped the Critical Region log by using the &lt;b&gt;!verifier 200 &lt;/b&gt;command. The Critical Region log has enough room for 128 stacks. After dumping the log, the first thing to do is to find the KTHREAD value of the thread with the non-zero APC disable count. Unfortunately in my case thread &lt;span style="background: lime;"&gt;fffffa804b5be040&lt;/span&gt; didn’t appear in the log. In fact all 128 stacks had a driver named Suspect.sys calling KeEnterCriticalRegion or KeLeaveCriticalRegion.&amp;#160; &lt;b&gt;Note:&lt;/b&gt; &lt;span lang="EN"&gt;To protect our vendor friends, I renamed the actual sys file in this article to suspect.sys.&lt;/span&gt;&lt;span lang="EN"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;The customer disabled the suspect.sys driver hoping this was the driver forgetting to re-enable APCs. If nothing else, this would perhaps remove the noisy suspect.sys from the log in the next dump. &lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;0: kd&amp;gt; !verifier 200&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;Enter/Leave Critical Region log:&lt;/p&gt;  &lt;p class="Debug"&gt;There are up to 0x80 entries in the log.&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;Displaying all the log entries.&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;======================================================================&lt;/p&gt;  &lt;p class="Debug"&gt;Thread fffffa8048ce4b50&lt;/p&gt;  &lt;p class="Debug"&gt;fffff80001b74293 nt!VerifierKeLeaveCriticalRegion+0xc3&lt;/p&gt;  &lt;p class="Debug"&gt;fffff8800100aafa &lt;span style="background: yellow;"&gt;Suspect.sys&lt;/span&gt;+0xaafa&lt;/p&gt;  &lt;p class="Debug"&gt;fffff88001001e30 &lt;span style="background: yellow;"&gt;Suspect.sys&lt;/span&gt;+0x1e30&lt;/p&gt;  &lt;p class="Debug"&gt;fffff80001abc68c nt!IopLoadUnloadDriver+0x1c&lt;/p&gt;  &lt;p class="Debug"&gt;fffff800016e1641 nt!ExpWorkerThread+0x111&lt;/p&gt;  &lt;p class="Debug"&gt;fffff8000196ee5a nt!PspSystemThreadStartup+0x5a&lt;/p&gt;  &lt;p class="Debug"&gt;fffff800016c8d26 nt!KiStartSystemThread+0x16&lt;/p&gt;  &lt;p class="Debug"&gt;======================================================================&lt;/p&gt;  &lt;p class="Debug"&gt;Thread fffffa8048ce4b50&lt;/p&gt;  &lt;p class="Debug"&gt;fffff80001b6b0a2 nt!VerifierKeEnterCriticalRegion+0x92&lt;/p&gt;  &lt;p class="Debug"&gt;fffff880010062a3 &lt;span style="background: yellow;"&gt;Suspect.sys&lt;/span&gt;+0x62a3&lt;/p&gt;  &lt;p class="Debug"&gt;fffff8800100a7e2 &lt;span style="background: yellow;"&gt;Suspect.sys&lt;/span&gt;+0xa7e2&lt;/p&gt;  &lt;p class="Debug"&gt;fffff88001001e30 &lt;span style="background: yellow;"&gt;Suspect.sys&lt;/span&gt;+0x1e30&lt;/p&gt;  &lt;p class="Debug"&gt;fffff80001abc68c nt!IopLoadUnloadDriver+0x1c&lt;/p&gt;  &lt;p class="Debug"&gt;fffff800016e1641 nt!ExpWorkerThread+0x111&lt;/p&gt;  &lt;p class="Debug"&gt;fffff8000196ee5a nt!PspSystemThreadStartup+0x5a&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Unfortunately, the system continued to crash and in the next dump the critical region log was completely empty. My guess is the complier was optimizing the KeEnterCriticalRegion and KeLeaveCriticalRegion calls in the driver, causing them to be inlined and skipping the call to VerifierKeLeaveCriticalRegion/VerifierKeEnterCriticalRegion. I needed another attack plan.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;There is another Verifier option called I/O Verification and it works in a similar way to the steps below.&amp;#160; Please note that this functionality is not documented and may be subject to change at any time.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;A call to IoCallDriver() is made to send an IO packet to a driver associated with a device. &lt;/li&gt;    &lt;li&gt;     &lt;div class="Text"&gt;Verifier hooks the call.&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div class="Text"&gt;Verifier creates a structure to record &lt;font style="background-color: rgb(75, 172, 198);"&gt;state info&lt;/font&gt;.&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div class="Text"&gt;Verifier fills in the structure with data including the thread’s APC Disable Count.&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div class="Text"&gt;Next Verifier calls the normal IoCallDriver() routine to “continue” the call made in step 1.&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div class="Text"&gt;The driver does its work (disables and re-enables APCs as needed)&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div class="Text"&gt;The call to IoCallDriver() returns when the driver is finished.&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div class="Text"&gt;Verifier checks the real APC count in the thread. Next it compares the value to the recorded value in the structure from step 4. If the two values do not match, then Verifier crashes the machine so we can pull the bad driver out of the dump. &lt;/div&gt;   &lt;/li&gt; &lt;/ol&gt;  &lt;p class="Text"&gt;&lt;span style="color: black;"&gt;&amp;#160;&lt;/span&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;span style="color: black;"&gt;I had the customer enable &lt;/span&gt;I/O Verification&lt;span style="color: black;"&gt; using these steps-&lt;/span&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div class="Text"&gt;Run Verifier.exe&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div class="Text"&gt;Select “Create custom settings (For code developers)”&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div class="Text"&gt;Select individual settings from a full list&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div class="Text"&gt;Select I/O Verification&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div class="Text"&gt;Select Driver Names from a list&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div class="Text"&gt;Manually choose all of the third-party drivers.&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div class="Text"&gt;Reboot after making the changes.&amp;#160; &lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;As we expected, the machine crashed again because of the APC Disable issue.&amp;#160; Because we enabled I/O Verification, the bugcheck type changed to DRIVER_VERIFIER_DETECTED_VIOLATION and now we have a smoking gun.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;I used the !verifier command to review the Verifier settings. The output below shows “I\O subsystem checking enabled” which confirms I/O Verification was been enabled.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;0: kd&amp;gt; !verifier&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;Verify Level 810 ... enabled options are:&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Io subsystem checking enabled&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;The parameters to KeBugcheck reconfirmed the APC disable count was -1 (ffff). And this time we have an additional breadcrumb, the driver dispatch routine address.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;DRIVER_VERIFIER_DETECTED_VIOLATION (c4)&lt;/p&gt;  &lt;p class="Debug"&gt;A device driver attempting to corrupt the system has been caught.&amp;#160; This is&lt;/p&gt;  &lt;p class="Debug"&gt;because the driver was specified in the registry as being suspect (by the&lt;/p&gt;  &lt;p class="Debug"&gt;administrator) and the kernel has enabled substantial checking of this driver.&lt;/p&gt;  &lt;p class="Debug"&gt;If the driver attempts to corrupt the system, bugchecks 0xC4, 0xC1 and 0xA will&lt;/p&gt;  &lt;p class="Debug"&gt;be among the most commonly seen crashes.&lt;/p&gt;  &lt;p class="Debug"&gt;Arguments:&lt;/p&gt;  &lt;p class="Debug"&gt;Arg1: 00000000000000c5, Thread APC disable count changed by driver dispatch routine.&lt;/p&gt;  &lt;p class="Debug"&gt;Arg2: &lt;span style="background: lime;"&gt;fffff88001345610&lt;/span&gt;, &lt;span style="background: lime;"&gt;Driver dispatch routine address.&lt;/span&gt;&lt;/p&gt;  &lt;p class="Debug"&gt;Arg3: 000000000000&lt;span style="background: yellow;"&gt;ffff&lt;/span&gt;, &lt;span style="background: yellow;"&gt;Current thread APC disable count.&lt;/span&gt;&lt;/p&gt;  &lt;p class="Debug"&gt;Arg4: 0000000000000000, Thread APC disable count before calling driver dispatch routine.&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; The APC disable count is decremented each time a driver calls&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; KeEnterCriticalRegion, FsRtlEnterFileSystem, or acquires a mutex. The APC&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; disable count is incremented each time a driver calls KeLeaveCriticalRegion,&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; FsRtlExitFileSystem, or KeReleaseMutex. Since these calls should always be in&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; pairs, this value should be zero when a thread exits. A negative value&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; indicates that a driver has disabled APC calls without re-enabling them. A&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; positive value indicates that the reverse is true.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Notice the Verifier functions on the call stack which we I leveraged for the “&lt;span style="background: fuchsia;"&gt;&lt;font style="background-color: rgb(75, 172, 198);"&gt;saved state&lt;/font&gt;&lt;/span&gt;” information I discussed above in the I/O Verification architecture.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;0: kd&amp;gt; kn&lt;/p&gt;  &lt;p class="Debug"&gt; # Child-SP&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; RetAddr&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Call Site&lt;/p&gt;  &lt;p class="Debug"&gt;00 fffff880`05db1b08 fffff800`0174a9c0 nt!KeBugCheckEx&lt;/p&gt;  &lt;p class="Debug"&gt;01 fffff880`05db1b10 fffff800`01b66b4ent!VfBugCheckNoStackUsage+0x30&lt;/p&gt;  &lt;p class="Debug"&gt;&lt;span style="background: yellow;"&gt;02&lt;/span&gt; fffff880`05db1b50 fffff800`01b6cc2e nt!VfAfterCallDriver+0x33e&lt;/p&gt;  &lt;p class="Debug"&gt;03 fffff880`05db1ba0 fffff880`04054756 nt!IovCallDriver+0x57e&lt;/p&gt;  &lt;p class="Debug"&gt;04 fffff880`05db1c00 fffff880`0404b7b0 srv2!Smb2ExecuteRead+0x9a6&lt;/p&gt;  &lt;p class="Debug"&gt;05 fffff880`05db1c80 fffff880`0404b6fb srv2!SrvProcessPacket+0xa0&lt;/p&gt;  &lt;p class="Debug"&gt;06 fffff880`05db1cc0 fffff800`01960e5a srv2!SrvProcWorkerThread+0x2fb&lt;/p&gt;  &lt;p class="Debug"&gt;07 fffff880`05db1d40 fffff800`016bad26nt!PspSystemThreadStartup+0x5a&lt;/p&gt;  &lt;p class="Debug"&gt;08 fffff880`05db1d80 00000000`00000000nt!KiStartSystemThread+0x16&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Next I dumped the driver dispatch routine noted in the KeBugCheckoutput above using the ln command. This points to fltmgr!FltpDispatch which tells me we have a filter manager minifilter driver making calls to disable APCs but rudely forgetting to re-enable them. As I noted above we save the state info before the call to IoCallDriver().&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;0: kd&amp;gt; ln &lt;span style="background: lime;"&gt;fffff88001345610&lt;/span&gt;&lt;/p&gt;  &lt;p class="Debug"&gt;(fffff880`01345610)&amp;#160;&amp;#160; fltmgr!FltpDispatch&amp;#160;&amp;#160; |&amp;#160; (fffff880`01345710)&amp;#160;&amp;#160; fltmgr!FltReleasePushLock&lt;/p&gt;  &lt;p class="Debug"&gt;Exact matches:&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; fltmgr!FltpDispatch (&amp;lt;no parameter info&amp;gt;)&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Now the goal was to determine which minifilter is leaving the “Do Not Disturb” sign on the door and forgetting to remove it. We can find this using the fltmgr device object.&amp;#160; The “saved state” structure is passed to VfAfterCallDriver as the first parameter so I switched to the VfAfterCallDriverframe (second frame) to dig it out. I used the /r flag to show the original values of the registers for this frame.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;0: kd&amp;gt; .frame /r &lt;span style="background: yellow;"&gt;2&lt;/span&gt;&lt;/p&gt;  &lt;p class="Debug"&gt;02 fffff880`05db1b50 fffff800`01b6cc2e nt!VfAfterCallDriver+0x33e&lt;/p&gt;  &lt;p class="Debug"&gt;rax=0000000000000000 rbx=&lt;span style="background: aqua;"&gt;fffffa804b729790&lt;/span&gt; rcx=00000000000000c4&lt;/p&gt;  &lt;p class="Debug"&gt;rdx=00000000000000c5 rsi=fffffa804a3b0000 rdi=fffff8000183ce80&lt;/p&gt;  &lt;p class="Debug"&gt;rip=fffff80001b66b4e rsp=fffff88005db1b50 rbp=fffffa804de8c290&lt;/p&gt;  &lt;p class="Debug"&gt; r8=fffff88001345610&amp;#160;&amp;#160; r9=000000000000ffff r10=fffff80001b7a640&lt;/p&gt;  &lt;p class="Debug"&gt;r11=0000000000000000 r12=000000004de8c290 r13=0000000000000000&lt;/p&gt;  &lt;p class="Debug"&gt;r14=0000000000000000 r15=0000000000000000&lt;/p&gt;  &lt;p class="Debug"&gt;iopl=0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; nv up ei ng nz na pe nc&lt;/p&gt;  &lt;p class="Debug"&gt;cs=0010&amp;#160; ss=0018&amp;#160; ds=002b&amp;#160; es=002b&amp;#160; fs=0053&amp;#160; gs=002b&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; efl=00000282&lt;/p&gt;  &lt;p class="Debug"&gt;nt!VfAfterCallDriver+0x33e:&lt;/p&gt;  &lt;p class="Debug"&gt;fffff800`01b66b4e cc&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; int&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Parameter 1 on x64 is always passed via rcx. I dumped the assembly for VfAfterCallDriver and confirmed the value in rcx (the base of the saved state structure) is moved to rbx. &lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;0: kd&amp;gt; u nt!VfAfterCallDriver&lt;/p&gt;  &lt;p class="Debug"&gt;nt!VfAfterCallDriver:&lt;/p&gt;  &lt;p class="Debug"&gt;fffff800`01b66810 48895c2410&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; mov&amp;#160;&amp;#160;&amp;#160;&amp;#160; qword ptr[rsp+10h],rbx&lt;/p&gt;  &lt;p class="Debug"&gt;fffff800`01b66815 48896c2418&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; mov&amp;#160;&amp;#160;&amp;#160;&amp;#160; qword ptr[rsp+18h],rbp&lt;/p&gt;  &lt;p class="Debug"&gt;fffff800`01b6681a 4889742420&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; mov&amp;#160;&amp;#160;&amp;#160;&amp;#160; qword ptr[rsp+20h],rsi&lt;/p&gt;  &lt;p class="Debug"&gt;fffff800`01b6681f 57&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; push&amp;#160;&amp;#160;&amp;#160; rdi&lt;/p&gt;  &lt;p class="Debug"&gt;fffff800`01b66820 4154&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; push&amp;#160;&amp;#160;&amp;#160; r12&lt;/p&gt;  &lt;p class="Debug"&gt;fffff800`01b66822 4155&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; push&amp;#160;&amp;#160;&amp;#160; r13&lt;/p&gt;  &lt;p class="Debug"&gt;fffff800`01b66824 4883ec30&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sub&amp;#160;&amp;#160;&amp;#160;&amp;#160; rsp,30h&lt;/p&gt;  &lt;p class="Debug"&gt;fffff800`01b66828 488bfa&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; mov&amp;#160;&amp;#160;&amp;#160;&amp;#160; rdi,rdx&lt;/p&gt;  &lt;p class="Debug"&gt;fffff800`01b6682b 488bd9&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; mov&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background: aqua;"&gt;rbx,rcx&lt;/span&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;The device object is stored in the save state information at offset 0xa0.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;0: kd&amp;gt; ? fffffa804b729790 + 0xa0&lt;/p&gt;  &lt;p class="Debug"&gt;Evaluate expression: -6046048151504 = fffffa80`4b729830&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;0: kd&amp;gt; dq fffffa80`4b729830 l1&lt;/p&gt;  &lt;p class="Debug"&gt;fffffa80`4b729830&amp;#160; &lt;span style="background: aqua;"&gt;fffffa80`4a3b0060&lt;/span&gt;&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;0: kd&amp;gt; !devobj &lt;span style="background: aqua;"&gt;fffffa80`4a3b0060&lt;/span&gt;&lt;/p&gt;  &lt;p class="Debug"&gt;Device object (fffffa804a3b0060) is for:&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160; \FileSystem\&lt;span style="background: lime;"&gt;FltMgr&lt;/span&gt; DriverObject fffffa80491fb7c0&lt;/p&gt;  &lt;p class="Debug"&gt;Current Irp 00000000 RefCount 0 Type 00000008 Flags 00040000&lt;/p&gt;  &lt;p class="Debug"&gt;DevExt fffffa804a3b01b0 DevObjExt fffffa804a3b0208 &lt;/p&gt;  &lt;p class="Debug"&gt;ExtensionFlags (0x80000800)&amp;#160; DOE_DEFAULT_SD_PRESENT, DOE_DESIGNATED_FDO&lt;/p&gt;  &lt;p class="Debug"&gt;Characteristics (0000000000)&amp;#160; &lt;/p&gt;  &lt;p class="Debug"&gt;AttachedTo (Lower) fffffa804a3b1030 \FileSystem\Ntfs&lt;/p&gt;  &lt;p class="Debug"&gt;Device queue is not busy.&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;0: kd&amp;gt; !devstack fffffa80`4a3b0060&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160; !DevObj&amp;#160;&amp;#160; !DrvObj&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; !DevExt&amp;#160;&amp;#160; ObjectName&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;gt; fffffa804a3b0060&amp;#160; \FileSystem\FltMgr fffffa804a3b01b0&amp;#160; &lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160; fffffa804a3b1030&amp;#160; \FileSystem\Ntfs&amp;#160;&amp;#160; fffffa804a3b1180&amp;#160; &lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;As &lt;a href="http://msdn.microsoft.com/en-us/library/ff541610(v=vs.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/ff541610(v=vs.85).aspx&lt;/a&gt;explains – “The filter manager is installed with Windows, but it becomes active only when a minifilter driver is loaded. The filter manager attaches to the file system stack for a target volume. A minifilter driver attaches to the file system stack indirectly, by registering with the filter manager for the I/O operations the minifilter driver chooses to filter.” &lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Using the power of the fltkd extension, I dumped the volume information associated with this device object. From the output below, we can extract the name of the filter attached to the volume. The culprit is named BadDriver.sys. The customer removed the driver and the problem went away long enough for the vendor to create an update for BadDriver.sys. Happy Ending!&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;0: kd&amp;gt; !fltkd.volume &lt;span style="background: aqua;"&gt;fffffa80`4a3b0060&lt;/span&gt;&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;FLT_VOLUME: fffffa804a3b0800 &amp;quot;\Device\HarddiskVolume3&amp;quot;&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; FLT_OBJECT: fffffa804a3b0800&amp;#160; [04000000] Volume&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; RundownRef&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : 0x000000000000020a (261)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PointerCount&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : 0x00000001 &lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PrimaryLink&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : [fffffa804ae06810-fffffa804a2b16f0] &lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; Frame&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : fffffa8049fcd420 &amp;quot;Frame 0&amp;quot; &lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; Flags&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : [00000064] SetupNotifyCalledEnableNameCaching FilterAttached&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; FileSystemType&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : [00000002] FLT_FSTYPE_NTFS&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; VolumeLink&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : [fffffa804ae06810-fffffa804a2b16f0] &lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; DeviceObject&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : fffffa804a3b0060 &lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; DiskDeviceObject&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : fffffa804a1c0350 &lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; FrameZeroVolume&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : fffffa804a3b0800 &lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; VolumeInNextFrame&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : 0000000000000000 &lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; Guid&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : &amp;quot;\??\Volume{552791b0-455d-11de-b7b9-00145eed6acc}&amp;quot; &lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; CDODeviceName&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : &amp;quot;\Ntfs&amp;quot; &lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; CDODriverName&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : &amp;quot;\FileSystem\Ntfs&amp;quot; &lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; TargetedOpenCount&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : 258 &lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; Callbacks&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : (fffffa804a3b0910)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; ContextLock&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : (fffffa804a3b0cf8)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; VolumeContexts&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : (fffffa804a3b0d00)&amp;#160; Count=0&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; StreamListCtrls&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : (fffffa804a3b0d08)&amp;#160; rCount=2871 &lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; FileListCtrls&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : (fffffa804a3b0d88)&amp;#160; rCount=0 &lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; NameCacheCtrl&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : (fffffa804a3b0e08)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; InstanceList&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : (fffffa804a3b0890)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; FLT_INSTANCE: fffffa804b5b1010 &amp;quot;&lt;span style="background: red;"&gt;BadDriver.sys Instance&lt;/span&gt;&amp;quot; &amp;quot;189600&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10398375" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/Debugging/">Debugging</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/bugcheck/">bugcheck</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/Ron/">Ron</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/debug/">debug</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/kernel/">kernel</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/verifier/">verifier</category></item><item><title>Debugging a Debugger to Debug a Dump</title><link>http://blogs.msdn.com/b/ntdebugging/archive/2013/02/27/debugging-a-debugger-to-debug-a-dump.aspx</link><pubDate>Wed, 27 Feb 2013 17:30:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10397621</guid><dc:creator>ntdebug</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/ntdebugging/rsscomments.aspx?WeblogPostID=10397621</wfw:commentRss><comments>http://blogs.msdn.com/b/ntdebugging/archive/2013/02/27/debugging-a-debugger-to-debug-a-dump.aspx#comments</comments><description>&lt;p class="Text"&gt;Recently I came across an instance where my debugger did not do what I wanted.&amp;#160; Rarely do computers disobey me, but this one was unusually stubborn.&amp;#160; There was no other option; I had to bend the debugger to my will.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;There are many ways to make a computer program do what you want.&amp;#160; If you have the source code you can rewrite and recompile the program.&amp;#160; If you have a hex editor you can edit the code of the binary.&amp;#160; A shim can be used to modify a program at runtime.&amp;#160; In this instance I was in a hurry and I was ok with a temporary solution, so I used a debugger to change the execution of the debugger while it ran.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Debug a debugger? Can you do such a thing?&amp;#160; Of course you can.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;In this example a memory dump was captured of a system and I was asked to determine if the system had run out of &lt;a href="http://blogs.msdn.com/b/ntdebugging/archive/2007/01/04/desktop-heap-overview.aspx"&gt;desktop heap&lt;/a&gt;.&amp;#160; Usually the &lt;a href="http://msdn.microsoft.com/en-us/library/windows/hardware/ff562412.aspx"&gt;!dskheap&lt;/a&gt; command can be used to determine how much heap has been used by each desktop. Unfortunately, this command failed me.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;23: kd&amp;gt; !dskheap&lt;/p&gt;  &lt;p class="Debug"&gt;Error Reading TotalFreeSize from nt!_HEAP @ fffffa8019c65c00&lt;/p&gt;  &lt;p class="Debug"&gt;Failed to GetHeapInfo for desktop @fffffa8019c65c00&lt;/p&gt;  &lt;p class="Debug"&gt;EnumDsktps failed on Winsta: 19c4f090FillWinstaArray failed&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;The error indicates that the command couldn’t read from the _HEAP structure at fffffa8019c65c00 for desktop fffffa8019c65c00.&amp;#160; Further investigation found that reason I got this error is that the heap for the desktop in question is not valid memory.&amp;#160; Because the memory is described by a prototype PTE I assume that the heap has not been initialized (Note: See Windows Internals’ Memory Management chapter for more information about proto PTEs).&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;23: kd&amp;gt; dt win32k!tagDESKTOP fffffa8019c65c00&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; +0x000 dwSessionId&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : 0&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; +0x008 pDeskInfo&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : 0xfffff900`c05e0a70 tagDESKTOPINFO&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; +0x010 pDispInfo&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : 0xfffff900`c0581e50 tagDISPLAYINFO&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; +0x018 rpdeskNext&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : 0xfffffa80`19c6ef20 tagDESKTOP&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; +0x020 rpwinstaParent&amp;#160;&amp;#160; : 0xfffffa80`19c4f090 tagWINDOWSTATION&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; +0x028 dwDTFlags&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : 0x110&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; +0x030 dwDesktopId&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : 0x19c65c00`00000003&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; +0x038 spmenuSys&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : (null)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; +0x040 spmenuDialogSys&amp;#160; : (null)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; +0x048 spmenuHScroll&amp;#160;&amp;#160;&amp;#160; : (null)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; +0x050 spmenuVScroll&amp;#160;&amp;#160;&amp;#160; : (null)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; +0x058 spwndForeground&amp;#160; : (null)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; +0x060 spwndTray&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : (null)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; +0x068 spwndMessage&amp;#160;&amp;#160;&amp;#160;&amp;#160; : 0xfffff900`c05e0d90 tagWND&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; +0x070 spwndTooltip&amp;#160;&amp;#160;&amp;#160;&amp;#160; : 0xfffff900`c05e0fa0 tagWND&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; +0x078 hsectionDesktop&amp;#160; : 0xfffff8a0`00ef08e0 Void&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; +0x080 pheapDesktop&amp;#160;&amp;#160;&amp;#160;&amp;#160; : &lt;span style="color: red;"&gt;0xfffff900`c05e0000 &lt;/span&gt;tagWIN32HEAP&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; +0x088 ulHeapSize&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : 0x18000&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; +0x090 cciConsole&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : _CONSOLE_CARET_INFO&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; +0x0a8 PtiList&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : _LIST_ENTRY [ 0xfffffa80`19c65ca8 - 0xfffffa80`19c65ca8 ]&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; +0x0b8 spwndTrack&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : (null)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; +0x0c0 htEx&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : 0n0&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; +0x0c4 rcMouseHover&amp;#160;&amp;#160;&amp;#160;&amp;#160; : tagRECT&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; +0x0d4 dwMouseHoverTime : 0&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160; +0x0d8 pMagInputTransform : (null)&lt;/p&gt;  &lt;p class="Debug"&gt;23: kd&amp;gt; dd &lt;span style="color: red;"&gt;0xfffff900`c05e0000&lt;/span&gt;&lt;/p&gt;  &lt;p class="Debug"&gt;fffff900`c05e0000&amp;#160; ???????? ???????? ???????? ????????&lt;/p&gt;  &lt;p class="Debug"&gt;fffff900`c05e0010&amp;#160; ???????? ???????? ???????? ????????&lt;/p&gt;  &lt;p class="Debug"&gt;fffff900`c05e0020&amp;#160; ???????? ???????? ???????? ????????&lt;/p&gt;  &lt;p class="Debug"&gt;fffff900`c05e0030&amp;#160; ???????? ???????? ???????? ????????&lt;/p&gt;  &lt;p class="Debug"&gt;fffff900`c05e0040&amp;#160; ???????? ???????? ???????? ????????&lt;/p&gt;  &lt;p class="Debug"&gt;fffff900`c05e0050&amp;#160; ???????? ???????? ???????? ????????&lt;/p&gt;  &lt;p class="Debug"&gt;fffff900`c05e0060&amp;#160; ???????? ???????? ???????? ????????&lt;/p&gt;  &lt;p class="Debug"&gt;fffff900`c05e0070&amp;#160; ???????? ???????? ???????? ????????&lt;/p&gt;  &lt;p class="Debug"&gt;23: kd&amp;gt; !pte &lt;span style="color: red;"&gt;fffff900`c05e0000&lt;/span&gt;&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; VA fffff900c05e0000&lt;/p&gt;  &lt;p class="Debug"&gt;PXE at FFFFF6FB7DBEDF90&amp;#160;&amp;#160;&amp;#160; PPE at FFFFF6FB7DBF2018&amp;#160;&amp;#160;&amp;#160; PDE at FFFFF6FB7E403010&amp;#160;&amp;#160;&amp;#160; PTE at FFFFF6FC80602F00&lt;/p&gt;  &lt;p class="Debug"&gt;contains 000000076245C863&amp;#160; contains 0000000762569863&amp;#160; contains 000000045FA17863&amp;#160; contains F8A000F4F9780400&lt;/p&gt;  &lt;p class="Debug"&gt;pfn 76245c&amp;#160;&amp;#160;&amp;#160; ---DA--KWEV&amp;#160; pfn 762569&amp;#160;&amp;#160;&amp;#160; ---DA--KWEV&amp;#160; pfn45fa17&amp;#160;&amp;#160;&amp;#160; ---DA--KWEV&amp;#160;&amp;#160; &lt;span style="background: yellow;"&gt;not valid&lt;/span&gt;&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background: yellow;"&gt;Proto&lt;/span&gt;: FFFFF8A000F4F978&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;There are many desktops in this session and I wanted to know about the usage of the other desktops, but the !dskheap command stopped after just one error.&amp;#160; I needed to force it to continue after this error, so I launched a debugger to debug my debugger.&amp;#160; There is a command to do this, just run &lt;a href="http://msdn.microsoft.com/en-us/library/windows/hardware/ff562305.aspx"&gt;.dbgdbg&lt;/a&gt;.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;23: kd&amp;gt; .dbgdbg&lt;/p&gt;  &lt;p class="Debug"&gt;Debugger spawned, connect with&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;quot;-remotenpipe:icfenable,pipe=cdb_pipe,server=NINJA007&amp;quot;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;For clarity I will call the original debugger where I ran !dskheap debugger1, and the new debugger spawned by .dbgdbg debugger2 .&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Before switching to debugger2 I need to know what I am going to debug.&amp;#160; The error message gives a hint about where to set a breakpoint, I am looking for a failure from GetHeapInfo.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;23: kd&amp;gt; !dskheap&lt;/p&gt;  &lt;p class="Debug"&gt;Error Reading TotalFreeSize from nt!_HEAP @ fffffa8019c65c00&lt;/p&gt;  &lt;p class="Debug"&gt;&lt;span style="background: yellow;"&gt;Failed to GetHeapInfo&lt;/span&gt; for desktop @fffffa8019c65c00&lt;/p&gt;  &lt;p class="Debug"&gt;EnumDsktps failed on Winsta: 19c4f090FillWinstaArray failed&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;I need to know which module GetHeapInfo is in, the &lt;a href="http://msdn.microsoft.com/en-us/library/windows/hardware/ff563044.aspx"&gt;.extmatch&lt;/a&gt; match command indicates which module contains the !dskheap command.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;23: kd&amp;gt; .extmatch dskheap&lt;/p&gt;  &lt;p class="Debug"&gt;!kdexts.dskheap&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Switching to debugger2 I set a breakpoint on kdexts!GetHeapInfo.&amp;#160; Use Ctrl+C to trigger a debug break in cdb (this is the same as a Ctrl+Break in windbg).&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;0:004&amp;gt; bp kdexts!GetHeapInfo&lt;/p&gt;  &lt;p class="Debug"&gt;0:004&amp;gt; g&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Switch back to debugger1 and run the !dskheap command.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;23: kd&amp;gt; !dskheap&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;In debugger2 I have hit the breakpoint.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;Breakpoint 0 hit&lt;/p&gt;  &lt;p class="Debug"&gt;kdexts!GetHeapInfo:&lt;/p&gt;  &lt;p class="Debug"&gt;000007f9`4237b9b0 4055&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; push&amp;#160;&amp;#160;&amp;#160; rbp&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;The error says GetHeapInfo failed, so I am interested in what this function returns.&amp;#160; To see what GetHeapInfo returns I go up one level in the stack and set a new &lt;span style="background: yellow;"&gt;breakpoint&lt;/span&gt; on the code just after it returns.&amp;#160; This new breakpoint will also dump the return value of GetHeapInfo (return values are always in the rax register).&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; gu&lt;/p&gt;  &lt;p class="Debug"&gt;kdexts!EnumDsktps+0x197:&lt;/p&gt;  &lt;p class="Debug"&gt;000007f9`4237b483 4885c0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; test&amp;#160;&amp;#160;&amp;#160; rax,rax&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; r rax&lt;/p&gt;  &lt;p class="Debug"&gt;rax=0000000000000000&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; bc *&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; &lt;span style="background: yellow;"&gt;bp 000007f9`4237b483 &amp;quot;r rax&amp;quot;&lt;/span&gt;&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; g&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;The next time the breakpoint hit the return value was 1, which in this instance means GetHeapInfo failed.&amp;#160; This is where I exerted my control over the computer: I forced the return value to 0.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;rax=0000000000000001&lt;/p&gt;  &lt;p class="Debug"&gt;kdexts!EnumDsktps+0x197:&lt;/p&gt;  &lt;p class="Debug"&gt;000007f9`4237b483 4885c0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; test&amp;#160;&amp;#160;&amp;#160; rax,rax&lt;/p&gt;  &lt;p class="Debug"&gt;&lt;span style="background: yellow;"&gt;0:000&amp;gt; r rax=0&lt;/span&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;I ran through the other breakpoints and changed rax as necessary.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; g&lt;/p&gt;  &lt;p class="Debug"&gt;rax=0000000000000000&lt;/p&gt;  &lt;p class="Debug"&gt;kdexts!EnumDsktps+0x197:&lt;/p&gt;  &lt;p class="Debug"&gt;000007f9`4237b483 4885c0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; test&amp;#160;&amp;#160;&amp;#160; rax,rax&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; g&lt;/p&gt;  &lt;p class="Debug"&gt;rax=0000000000000000&lt;/p&gt;  &lt;p class="Debug"&gt;kdexts!EnumDsktps+0x197:&lt;/p&gt;  &lt;p class="Debug"&gt;000007f9`4237b483 4885c0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; test&amp;#160;&amp;#160;&amp;#160; rax,rax&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; g&lt;/p&gt;  &lt;p class="Debug"&gt;rax=0000000000000000&lt;/p&gt;  &lt;p class="Debug"&gt;kdexts!EnumDsktps+0x197:&lt;/p&gt;  &lt;p class="Debug"&gt;000007f9`4237b483 4885c0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; test&amp;#160;&amp;#160;&amp;#160; rax,rax&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; g&lt;/p&gt;  &lt;p class="Debug"&gt;rax=0000000000000000&lt;/p&gt;  &lt;p class="Debug"&gt;kdexts!EnumDsktps+0x197:&lt;/p&gt;  &lt;p class="Debug"&gt;000007f9`4237b483 4885c0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; test&amp;#160;&amp;#160;&amp;#160; rax,rax&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; g&lt;/p&gt;  &lt;p class="Debug"&gt;rax=0000000000000001&lt;/p&gt;  &lt;p class="Debug"&gt;kdexts!EnumDsktps+0x197:&lt;/p&gt;  &lt;p class="Debug"&gt;000007f9`4237b483 4885c0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; test&amp;#160;&amp;#160;&amp;#160; rax,rax&lt;/p&gt;  &lt;p class="Debug"&gt;&lt;span style="background: yellow;"&gt;0:000&amp;gt; r rax=0&lt;/span&gt;&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; g&lt;/p&gt;  &lt;p class="Debug"&gt;rax=0000000000000000&lt;/p&gt;  &lt;p class="Debug"&gt;kdexts!EnumDsktps+0x197:&lt;/p&gt;  &lt;p class="Debug"&gt;000007f9`4237b483 4885c0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; test&amp;#160;&amp;#160;&amp;#160; rax,rax&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; g&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Everything was going well, until the computer defied me again.&amp;#160; The !dskheap output computes the percentage of heap usage by dividing the bytes used by the size of the heap.&amp;#160; Unfortunately, the size of the heap was left at 0 for the two heaps where I changed the return value.&amp;#160; It is well known that only Chuck Norris can divide by zero; to prevent a roundhouse kick to your computer the processor generates an exception.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;(2d0.928): Integer divide-by-zero - code c0000094 (first chance)&lt;/p&gt;  &lt;p class="Debug"&gt;First chance exceptions are reported before any exception handling.&lt;/p&gt;  &lt;p class="Debug"&gt;This exception may be expected and handled.&lt;/p&gt;  &lt;p class="Debug"&gt;kdexts!DisplayInfo+0x2ee:&lt;/p&gt;  &lt;p class="Debug"&gt;000007f9`4237b90e 49f7f3&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; div&amp;#160;&amp;#160;&amp;#160;&amp;#160; rax,r11&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; r r11&lt;/p&gt;  &lt;p class="Debug"&gt;r11=0000000000000000&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; r rax&lt;/p&gt;  &lt;p class="Debug"&gt;rax=0000000000000000&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; g&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Fortunately debugger1 handles the divide by zero exception and it is easy to run !dskheap again.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;23: kd&amp;gt; !dskheap&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Back in debugger2 I &lt;span style="background: aqua;"&gt;set a new breakpoint&lt;/span&gt; on the div instruction that outputs the divisor.&amp;#160; When the divisor (r11) is 0 I changed it to a non-zero value to avoid the wrath of Mr. Norris.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;rax=0000000000000000&lt;/p&gt;  &lt;p class="Debug"&gt;kdexts!EnumDsktps+0x197:&lt;/p&gt;  &lt;p class="Debug"&gt;000007f9`4237b483 4885c0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; test&amp;#160;&amp;#160;&amp;#160; rax,rax&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; bp 000007f9`4237b90e&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; &lt;span style="background: aqua;"&gt;bp 000007f9`4237b90e &amp;quot;r r11&amp;quot;&lt;/span&gt;&lt;/p&gt;  &lt;p class="Debug"&gt;breakpoint 1 redefined&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; g&lt;/p&gt;  &lt;p class="Debug"&gt;rax=0000000000000001&lt;/p&gt;  &lt;p class="Debug"&gt;kdexts!EnumDsktps+0x197:&lt;/p&gt;  &lt;p class="Debug"&gt;000007f9`4237b483 4885c0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; test&amp;#160;&amp;#160;&amp;#160; rax,rax&lt;/p&gt;  &lt;p class="Debug"&gt;&lt;span style="background: yellow;"&gt;0:000&amp;gt; r rax=0&lt;/span&gt;&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; g&lt;/p&gt;  &lt;p class="Debug"&gt;rax=0000000000000000&lt;/p&gt;  &lt;p class="Debug"&gt;kdexts!EnumDsktps+0x197:&lt;/p&gt;  &lt;p class="Debug"&gt;000007f9`4237b483 4885c0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; test&amp;#160;&amp;#160;&amp;#160; rax,rax&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; g&lt;/p&gt;  &lt;p class="Debug"&gt;rax=0000000000000000&lt;/p&gt;  &lt;p class="Debug"&gt;kdexts!EnumDsktps+0x197:&lt;/p&gt;  &lt;p class="Debug"&gt;000007f9`4237b483 4885c0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; test&amp;#160;&amp;#160;&amp;#160; rax,rax&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; g&lt;/p&gt;  &lt;p class="Debug"&gt;rax=0000000000000000&lt;/p&gt;  &lt;p class="Debug"&gt;kdexts!EnumDsktps+0x197:&lt;/p&gt;  &lt;p class="Debug"&gt;000007f9`4237b483 4885c0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; test&amp;#160;&amp;#160;&amp;#160; rax,rax&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; g&lt;/p&gt;  &lt;p class="Debug"&gt;rax=0000000000000000&lt;/p&gt;  &lt;p class="Debug"&gt;kdexts!EnumDsktps+0x197:&lt;/p&gt;  &lt;p class="Debug"&gt;000007f9`4237b483 4885c0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; test&amp;#160;&amp;#160;&amp;#160; rax,rax&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; g&lt;/p&gt;  &lt;p class="Debug"&gt;rax=0000000000000001&lt;/p&gt;  &lt;p class="Debug"&gt;kdexts!EnumDsktps+0x197:&lt;/p&gt;  &lt;p class="Debug"&gt;000007f9`4237b483 4885c0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; test&amp;#160;&amp;#160;&amp;#160; rax,rax&lt;/p&gt;  &lt;p class="Debug"&gt;&lt;span style="background: yellow;"&gt;0:000&amp;gt; r rax=0&lt;/span&gt;&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; g&lt;/p&gt;  &lt;p class="Debug"&gt;rax=0000000000000000&lt;/p&gt;  &lt;p class="Debug"&gt;kdexts!EnumDsktps+0x197:&lt;/p&gt;  &lt;p class="Debug"&gt;000007f9`4237b483 4885c0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; test&amp;#160;&amp;#160;&amp;#160; rax,rax&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; g&lt;/p&gt;  &lt;p class="Debug"&gt;r11=0000000000033333&lt;/p&gt;  &lt;p class="Debug"&gt;kdexts!DisplayInfo+0x2ee:&lt;/p&gt;  &lt;p class="Debug"&gt;000007f9`4237b90e 49f7f3&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; div&amp;#160;&amp;#160;&amp;#160;&amp;#160; rax,r11&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; g&lt;/p&gt;  &lt;p class="Debug"&gt;r11=0000000000000000&lt;/p&gt;  &lt;p class="Debug"&gt;kdexts!DisplayInfo+0x2ee:&lt;/p&gt;  &lt;p class="Debug"&gt;000007f9`4237b90e 49f7f3&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; div&amp;#160;&amp;#160;&amp;#160;&amp;#160; rax,r11&lt;/p&gt;  &lt;p class="Debug"&gt;&lt;span style="background: aqua;"&gt;0:000&amp;gt; r r11=1&lt;/span&gt;&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; g&lt;/p&gt;  &lt;p class="Debug"&gt;r11=00000000000007ae&lt;/p&gt;  &lt;p class="Debug"&gt;kdexts!DisplayInfo+0x2ee:&lt;/p&gt;  &lt;p class="Debug"&gt;000007f9`4237b90e 49f7f3&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; div&amp;#160;&amp;#160;&amp;#160;&amp;#160; rax,r11&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; g&lt;/p&gt;  &lt;p class="Debug"&gt;r11=0000000000013333&lt;/p&gt;  &lt;p class="Debug"&gt;kdexts!DisplayInfo+0x2ee:&lt;/p&gt;  &lt;p class="Debug"&gt;000007f9`4237b90e 49f7f3&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; div&amp;#160;&amp;#160;&amp;#160;&amp;#160; rax,r11&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; g&lt;/p&gt;  &lt;p class="Debug"&gt;r11=0000000000013333&lt;/p&gt;  &lt;p class="Debug"&gt;kdexts!DisplayInfo+0x2ee:&lt;/p&gt;  &lt;p class="Debug"&gt;000007f9`4237b90e 49f7f3&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; div&amp;#160;&amp;#160;&amp;#160;&amp;#160; rax,r11&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; g&lt;/p&gt;  &lt;p class="Debug"&gt;r11=0000000000013333&lt;/p&gt;  &lt;p class="Debug"&gt;kdexts!DisplayInfo+0x2ee:&lt;/p&gt;  &lt;p class="Debug"&gt;000007f9`4237b90e 49f7f3&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; div&amp;#160;&amp;#160;&amp;#160;&amp;#160; rax,r11&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; g&lt;/p&gt;  &lt;p class="Debug"&gt;r11=0000000000000000&lt;/p&gt;  &lt;p class="Debug"&gt;kdexts!DisplayInfo+0x2ee:&lt;/p&gt;  &lt;p class="Debug"&gt;000007f9`4237b90e 49f7f3&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; div&amp;#160;&amp;#160;&amp;#160;&amp;#160; rax,r11&lt;/p&gt;  &lt;p class="Debug"&gt;&lt;span style="background: aqua;"&gt;0:000&amp;gt; r r11=1&lt;/span&gt;&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; g&lt;/p&gt;  &lt;p class="Debug"&gt;r11=0000000000013333&lt;/p&gt;  &lt;p class="Debug"&gt;kdexts!DisplayInfo+0x2ee:&lt;/p&gt;  &lt;p class="Debug"&gt;000007f9`4237b90e 49f7f3&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; div&amp;#160;&amp;#160;&amp;#160;&amp;#160; rax,r11&lt;/p&gt;  &lt;p class="Debug"&gt;0:000&amp;gt; g&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Finally, back in debugger1 I now have complete output for !dskheap.&amp;#160; After a few strategic modifications of the program’s execution I got it to output the data I wanted.&amp;#160; As it turns out we aren’t out of desktop heap after all.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Debug"&gt;23: kd&amp;gt; !dskheap&lt;/p&gt;  &lt;p class="Debug"&gt;Error Reading TotalFreeSize from nt!_HEAP @ fffffa8019c65c00&lt;/p&gt;  &lt;p class="Debug"&gt;Error Reading TotalFreeSize from nt!_HEAP @ fffffa801a53ea30&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160; Winstation\Desktop&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Heap Size(KB)&amp;#160;&amp;#160; Used Rate(%)&lt;/p&gt;  &lt;p class="Debug"&gt;------------------------------------------------------------&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160; WinSta0\Default&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 20480&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0%&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160; WinSta0\Disconnect&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0%&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160; WinSta0\Winlogon&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 192&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2%&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160; Service-0x0-3e7$\Default&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 7680&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1%&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160; Service-0x0-3e4$\Default&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 7680&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0%&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160; Service-0x0-3e5$\Default&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 7680&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0%&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160; Service-0x0-26f46a$\Default&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0%&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160; Service-0x0-2706f2$\Default&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 7680&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0%&lt;/p&gt;  &lt;p class="Debug"&gt;------------------------------------------------------&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Total Desktop: (&amp;#160;&amp;#160; 51392 KB -&amp;#160;&amp;#160; 8 desktops)&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Session ID:&amp;#160; 0&lt;/p&gt;  &lt;p class="Debug"&gt;============================================================&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10397621" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/Debugging/">Debugging</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/Debug+Ninja/">Debug Ninja</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/windbg/">windbg</category><category domain="http://blogs.msdn.com/b/ntdebugging/archive/tags/debug/">debug</category></item><item><title>How to Setup a Debug Crash Cart to Prevent Your Server from Flat Lining</title><link>http://blogs.msdn.com/b/ntdebugging/archive/2013/01/31/how-to-setup-a-debug-crash-cart-to-prevent-your-server-from-flat-lining.aspx</link><pubDate>Thu, 31 Jan 2013 23:10:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10390099</guid><dc:creator>ntdebug</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/ntdebugging/rsscomments.aspx?WeblogPostID=10390099</wfw:commentRss><comments>http://blogs.msdn.com/b/ntdebugging/archive/2013/01/31/how-to-setup-a-debug-crash-cart-to-prevent-your-server-from-flat-lining.aspx#comments</comments><description>&lt;p class="Text"&gt;This is Ron Stock from the Global Escalation Services team and I recently had the task of live debugging a customer’s remote server.&amp;#160; In debug circles we use what is known as a &lt;b&gt;crash cart&lt;/b&gt; to live debug production servers. The phrase conjures up visions of a wheeled cabinet containing an emergency defibrillator, a heart monitor and latex gloves. Luckily for our purposes, the term merely denotes a machine setup with the Debugging Tools for Windows. This life saving machine is attached to the ailing production server for debugging and no medical degree is required.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;The ailing production server is referred to as the &lt;b&gt;Target Computer&lt;/b&gt; and the Debugging Tools for Windows are installed on the &lt;b&gt;Host computer&lt;/b&gt;. The machines are attached with either a null-modem cable, 1394 cable, a special USB cable, or an ethernet cable (network debugging was added in Windows 8). Below I outline serial debugging because this is the most common technique.&amp;#160; In future articles I plan to discuss configuring the other methods.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;img style="border: 0px currentcolor; display: inline; background-image: none;" title="image001" border="0" alt="image001" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-00-metablogapi/7282.image001_5F00_7E7730DD.png" width="392" height="153" /&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;b&gt;&amp;#160;&lt;/b&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;b&gt;Serial Connection Setup&lt;/b&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;b&gt;&amp;#160;&lt;/b&gt;&lt;/p&gt;  &lt;p class="Text"&gt;A null-modem cable is a serial cable used to send data between two serial ports and it can be cheaply purchased at most electronics stores. Be aware these are different from standard serial cables because the transmit and receive lines are cross linked.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;Plug the null-modem cable into a serial port on each of the computers.&amp;#160; The serial port on the target computer must be built into the system, add on components such as PCI cards will not work for serial debugging on the target computer.&lt;/p&gt;  &lt;p class="Text"&gt;&lt;b&gt;&amp;#160;&lt;/b&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;b&gt;Target Computer setup&lt;/b&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;1. To enable debugging enter the following command from an elevated command prompt.&lt;/p&gt;  &lt;p class="Debug"&gt;bcdedit /debug on&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;2. In most systems the default debug settings are sufficient. The current settings can be verified with the below command.&lt;/p&gt;  &lt;p class="Debug"&gt;bcdedit /dbgsettings&lt;/p&gt;  &lt;p class="Debug"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;3. Use the below command if you need to change the debug settings, where &lt;span style="background: lime;"&gt;x&lt;/span&gt; is the number of the &lt;span style="background: lime;"&gt;COM port&lt;/span&gt; connected to the null modem cable on the target machine and &lt;span style="background: yellow;"&gt;rate&lt;/span&gt; is the baud rate desired for debugging. The rate is usually 115200.&lt;/p&gt;  &lt;p class="Debug"&gt;bcdedit /dbgsettings serial debugport:&lt;span style="background: lime;"&gt;x&lt;/span&gt; baudrate:&lt;span style="background: yellow;"&gt;115200&lt;/span&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;5. Reboot the target computer.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;b&gt;Host Computer setup&lt;/b&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;/p&gt;  &lt;p class="Text"&gt;1. First install the Windows Debugging Tools on the host computer. Navigate to the Windows Software Development Kit (SDK) currently located at this link &lt;a href="http://msdn.microsoft.com/en-US/windows/hardware/hh852363"&gt;http://msdn.microsoft.com/en-US/windows/hardware/hh852363&lt;/a&gt; and choose the download option.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; a. If you are not able to install the SDK on the host computer, the debugging tools for windows can be installed to a different system and the debugger directory can be copied to the host computer.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;2. Click &lt;b&gt;Next&lt;/b&gt; until you see the &lt;b&gt;Select the features you want to install&lt;/b&gt; screen.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;3. Select only the option named &lt;b&gt;Debugging Tools for Windows&lt;/b&gt; and click the &lt;b&gt;Install&lt;/b&gt; button. I typically install the tools to a directory named C:\debugger&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;img style="border: 0px currentcolor; display: inline; background-image: none;" title="image002" border="0" alt="image002" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-00-metablogapi/0247.image002_5F00_234A95CA.jpg" width="477" height="351" /&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;4. After the Windows Debugging Tools are installed I set my symbol path by setting the environment variable &lt;b&gt;_NT_SYMBOL_PATH&lt;/b&gt;. I recommend setting it to the public symbol server &lt;b&gt;SRV*c:\localsymbols*http://msdl.microsoft.com/download/symbols&lt;/b&gt;. If you prefer, you can specify any path in place of ‘c:\localsymbols’.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;5. Open the debugger by running windbg.exe from the c:\debugger folder.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;6. On the &lt;b&gt;File&lt;/b&gt; menu, choose &lt;b&gt;Kernel Debug&lt;/b&gt;.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;7. In the &lt;b&gt;Kernel Debugging&lt;/b&gt; dialog box, open the COM tab.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;8. In the &lt;b&gt;Baud rate&lt;/b&gt; box, enter the same &lt;span style="background: yellow;"&gt;rate&lt;/span&gt; you selected for the Target Machine in the steps above. This is usually 115200.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;9. In the &lt;b&gt;Port&lt;/b&gt; box, enter COM&lt;span style="background: lime;"&gt;x&lt;/span&gt; where &lt;span style="background: lime;"&gt;x&lt;/span&gt; is the COM port connected to the null modem cable on this computer. In my example I plugged my null modem cable to com port 1 so I typed &lt;b&gt;com1&lt;/b&gt; in the field.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; a. It is not necessary to use the same port number on both the target and the host.&amp;#160; For example, it is possible to use com1 on the target and com2 on the host.&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;&lt;img style="border: 0px currentcolor; display: inline; background-image: none;" title="image003" border="0" alt="image003" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-00-metablogapi/3704.image003_5F00_283D9982.png" width="401" height="279" /&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;10. Click OK and you’ll receive a message indicating the Host computer is waiting to connect.&lt;/p&gt;  &lt;p class="Text"&gt;&lt;span style="font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;"&gt;     &lt;br clear="all" /&gt;&lt;img style="border: 0px currentcolor; display: inline; background-image: none;" title="image004" border="0" alt="image004" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-00-metablogapi/2146.image004_5F00_07B659D0.jpg" width="739" height="343" /&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="Text"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="Text"&gt;11. From the &lt;b&gt;Debug&lt;/b&gt; menu select &lt;b&gt;Break&lt;/b&gt; will cause the debugger to break into the target machine and give you the opportunity to debug your ailing production server. Good Luck!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10390099" width="1" height="1"&gt;</description></item></channel></rss>