<?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>My travels with WDF : Michio Kaku</title><link>http://blogs.msdn.com/888_umdf_4_you/archive/tags/Michio+Kaku/default.aspx</link><description>Tags: Michio Kaku</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Synchratic Method (yes, I know it's not a word).</title><link>http://blogs.msdn.com/888_umdf_4_you/archive/2006/11/06/1004439.aspx</link><pubDate>Mon, 06 Nov 2006 23:14:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1004439</guid><dc:creator>patman</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/888_umdf_4_you/comments/1004439.aspx</comments><wfw:commentRss>http://blogs.msdn.com/888_umdf_4_you/commentrss.aspx?PostID=1004439</wfw:commentRss><description>&lt;P&gt;As promised here is an update.&amp;nbsp; I'm still trying to nail down a sample hybrid driver for you all to play with. We've narrowed the contestants to two, and after the talent and judges interview&amp;nbsp;portions of the show&amp;nbsp;we should have a winner.&lt;/P&gt;So rather than let a blog post go to waste by prattling on about my dog or my signed copies of &lt;A href="http://www.generationxwing.members.winisp.net/images/IMG_0573_SM.jpg" target=_blank mce_href="http://www.generationxwing.members.winisp.net/images/IMG_0573_SM.jpg"&gt;&lt;EM&gt;Parallel Worlds and Hyperspace&lt;/EM&gt;&lt;/A&gt;, I thought&amp;nbsp;it&amp;nbsp;would be best served to share a&amp;nbsp;"&lt;EM&gt;well, fancy that"&lt;/EM&gt; moment&amp;nbsp;I discovered while creating a KMDF test driver. 
&lt;P&gt;&lt;STRONG&gt;Synchronization scope in KMDF, the key word...scope.&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;See what I did (and we learn best by laughing at other's mistakes) is to set my &lt;FONT face="courier new"&gt;WDF_OBJECT_ATTRIBUTES&lt;/FONT&gt; for the device object with the synchronization scope level of &lt;FONT face="courier new"&gt;&lt;STRONG&gt;WdfSynchronizationScopeDevice&lt;/STRONG&gt;&lt;/FONT&gt;.&amp;nbsp; I had also initialized the &lt;FONT face="courier new"&gt;&lt;STRONG&gt;ExecutionLevel&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp; to&amp;nbsp;&lt;FONT face="courier new"&gt;&lt;STRONG&gt;WdfExecutionLevelPassive&lt;/STRONG&gt;&lt;/FONT&gt; thinking it would establish the execution of the object's event callback functions to passive.&amp;nbsp; I then intended to establish the &lt;FONT face="courier new"&gt;WDF_OBJECT_ATTRIBUTES&lt;/FONT&gt; for my queue object with the scope level of&amp;nbsp;&lt;FONT face="courier new"&gt;&lt;STRONG&gt;WdfSynchronizationScopeNone&lt;/STRONG&gt;&lt;/FONT&gt; to ensure that I had better control over the IRQ levels in my callbacks.&amp;nbsp; Sounded like a great plan to me!&lt;/P&gt;
&lt;P&gt;A few BSODs later, I found out it doesn't quite work as I thought it would.&amp;nbsp; When using the &lt;FONT face="courier new"&gt;&lt;STRONG&gt;WdfSynchronizationScopeDevice &lt;/STRONG&gt;&lt;/FONT&gt;as&amp;nbsp;the scope level on the device object, even if I attempted to specify my queue object at the &lt;FONT face="courier new"&gt;&lt;STRONG&gt;WdfSynchronizationScopeNone&lt;/STRONG&gt;&lt;STRONG&gt;, &lt;/STRONG&gt;&lt;/FONT&gt;the queue was inheriting the device object's synchronization scope.&amp;nbsp;&amp;nbsp; So everything in my queue&amp;nbsp;was running at&amp;nbsp;&lt;FONT face="courier new"&gt;DISPATCH_LEVEL.&amp;nbsp; &lt;/FONT&gt;And we all have probably found out at one time or another, some things in the kernel&amp;nbsp;world don't like being called a &lt;FONT face="courier new"&gt;DISPATCH_LEVEL&lt;/FONT&gt;.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;So after some debugging, and then running around talking to&amp;nbsp;some KMDF guys, I found the cure to my woes was to establish my device object scope level attributes to &lt;FONT face="courier new"&gt;&lt;STRONG&gt;WdfSynchronizationScopeNone. &lt;/STRONG&gt;&lt;/FONT&gt;I'm still also setting the execution level&amp;nbsp;in the device object attributes&amp;nbsp;to &lt;FONT face="courier new"&gt;&lt;STRONG&gt;WdfExecutionLevelPassive, &lt;/STRONG&gt;&lt;/FONT&gt;but I'm not establishing any scope on the queue object at creation,&amp;nbsp;so I'm letting the natural order of synchronization objects within the&amp;nbsp;callbacks manage the IRQ levels.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Thus ends my, "Why in the name of Jacques Lemaire is this thing&amp;nbsp;always coming in&amp;nbsp;at &lt;FONT face="Courier New"&gt;DISPATCH_LEVEL&lt;/FONT&gt;!?" adventure for the week.&amp;nbsp; If you want some more info on this, go bug &lt;A href="http://blogs.msdn.com/doronh/"&gt;Doron&lt;/A&gt;.&amp;nbsp; He loves when you pester him about this,&amp;nbsp;really he does. &amp;gt;:)&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1004439" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/888_umdf_4_you/archive/tags/UMDF/default.aspx">UMDF</category><category domain="http://blogs.msdn.com/888_umdf_4_you/archive/tags/KMDF/default.aspx">KMDF</category><category domain="http://blogs.msdn.com/888_umdf_4_you/archive/tags/Michio+Kaku/default.aspx">Michio Kaku</category></item></channel></rss>