<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Driver Testing</title><subtitle type="html">Ravi Gollapudi's thoughts on testing device drivers for Windows</subtitle><id>http://blogs.msdn.com/ravig/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ravig/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/ravig/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2007-05-29T22:43:00Z</updated><entry><title>Checklist for testing device drivers ...</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ravig/archive/2007/06/19/checklist-for-testing-device-drivers.aspx" /><id>http://blogs.msdn.com/ravig/archive/2007/06/19/checklist-for-testing-device-drivers.aspx</id><published>2007-06-19T20:34:00Z</published><updated>2007-06-19T20:34:00Z</updated><content type="html">&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;So I have been working on coming up with a short checklist for testing device drivers. There are several tools in the WDK that are very useful to find bugs in device drivers. At a minimum, I think the below should ideally be run on every driver package (more details about all these tools are in the WDK documentation):&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;1.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Static Analysis tools:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; mso-list: l0 level2 lfo1; mso-add-space: auto"&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;a.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Prefast For Drivers (PFD) (%BASEDIR%\tools\pfd): This is a compile time static analysis tool that specifically looks for the potential presence of common device driver bugs. This works with both C and C++ code.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; mso-list: l0 level2 lfo1; mso-add-space: auto"&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;b.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Static Driver Verifier (SDV) (%BASEDIR%\tools\sdv): This is a rigorous static analysis tool for WDM only device drivers written in C.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; mso-list: l0 level2 lfo1; mso-add-space: auto"&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;c.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;ChkINF (%BASEDIR%\tools\chkinf). Driver Installation errors are IMO very easy to run into. This is a very useful tool to figure out any potential problems in INF files even before attempting to use them to install a driver. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 1in; mso-add-space: auto"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;2.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Runtime tools: Using the below with Driver Verifier turned on would be most beneficial (ideally a mix of I/O, Pnp and Power management tests should be used). Also, early in the development process, it would help to use checked binaries for testing.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; mso-list: l0 level2 lfo1; mso-add-space: auto"&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;a.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Device Path Exerciser or dc2 (in %BASEDIR%\tools\dc2 directory in the Vista RTM WDK): This tool sends a bunch of valid and invalid I/Os to a driver and is a great security test. As the htm file in the dc2 directory in the WDK, “a comprehensive set of tests on your driver can be run using the command: dc2 /hct /dr your-driver-name”. &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;For drivers using IoCreateDeviceSecure with a restrictive SDDL string, the “-im” option may have to be used in addition.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; mso-list: l0 level2 lfo1; mso-add-space: auto"&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;b.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Pnpdtest (in &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;%BASEDIR%\tools\pnpdtest): This tool tests pnp implementation in a driver and running the stress test on your driver would be a very useful thing to do. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 1in; TEXT-INDENT: -0.25in; mso-list: l0 level2 lfo1; mso-add-space: auto"&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;c.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;WDTF Sleep_Stress_With_IO.wsf (in %BASEDIR%\tools\WDTF\%_BUILDARCH%fre\samplescripts): This cycles the system through different power states and also does some basic i/o testing. As an alternative, the pwrtest tool (in %BASEDIR%\tools\acpi\pwrtest) can also be run.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3408811" width="1" height="1"&gt;</content><author><name>ravi_gollapudi</name><uri>http://blogs.msdn.com/members/ravi_gollapudi.aspx</uri></author><category term="WDM" scheme="http://blogs.msdn.com/ravig/archive/tags/WDM/default.aspx" /><category term="test" scheme="http://blogs.msdn.com/ravig/archive/tags/test/default.aspx" /></entry><entry><title>About Me</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ravig/archive/2007/05/29/about-me.aspx" /><id>http://blogs.msdn.com/ravig/archive/2007/05/29/about-me.aspx</id><published>2007-05-30T00:43:00Z</published><updated>2007-05-30T00:43:00Z</updated><content type="html">&lt;P&gt;I am currently working as a Software Design Engineer in Test in the &lt;A class="" href="http://www.microsoft.com/whdc/driver/wdf/default.mspx" mce_href="http://www.microsoft.com/whdc/driver/wdf/default.mspx"&gt;Windows Driver Foundation&lt;/A&gt; group. I have been in Microsoft for over 7 years now after graduating from Michigan State University. After joining Microsoft, I have worked as a Support Engineer in the DDK Developer Support team for about 3 years. During this time,&amp;nbsp;I have primarily&amp;nbsp;worked on storage drivers. I then moved to the &lt;A class="" href="http://www.microsoft.com/whdc/driver/wdf/KMDF.mspx" mce_href="http://www.microsoft.com/whdc/driver/wdf/KMDF.mspx"&gt;Kernel Mode Driver Framework&lt;/A&gt; team&amp;nbsp;initially as&amp;nbsp;a Test Developer. I was&amp;nbsp;the Test Lead for KMDF for over 3 years and worked on KMDF versions 1.0 through 1.5 (Details on how to get the latest version are available &lt;A class="" href="http://www.microsoft.com/whdc/driver/wdf/KMDF_pkg.mspx" mce_href="http://www.microsoft.com/whdc/driver/wdf/KMDF_pkg.mspx"&gt;here&lt;/A&gt;)&lt;/P&gt;
&lt;P&gt;I am planning to post some of my thoughts on how to test drivers in this blog. &lt;/P&gt;
&lt;P&gt;-Ravi&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2976044" width="1" height="1"&gt;</content><author><name>ravi_gollapudi</name><uri>http://blogs.msdn.com/members/ravi_gollapudi.aspx</uri></author></entry></feed>