<?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>Windows Portable Devices Team Blog : Tools</title><link>http://blogs.msdn.com/wpdblog/archive/tags/Tools/default.aspx</link><description>Tags: Tools</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>The MTP Device Simulator</title><link>http://blogs.msdn.com/wpdblog/archive/2009/10/23/the-mtp-device-simulator.aspx</link><pubDate>Sat, 24 Oct 2009 00:52:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9912325</guid><dc:creator>wpdblog</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/wpdblog/comments/9912325.aspx</comments><wfw:commentRss>http://blogs.msdn.com/wpdblog/commentrss.aspx?PostID=9912325</wfw:commentRss><description>&lt;p&gt;The Media Transfer Protocol Device Simulator (MTP Simulator) is a fully-featured, self-contained device simulator that emulates an MTP device. Its primary purpose is to enable developers to exercise expected behavior based on the MTP specification by returning appropriate MTP response packets and generating MTP events. The tool’s graphical user interface (GUI) enables easy configuration of MTP parameters and presents MTP traffic and data in a friendly, human-readable format. &lt;/p&gt;  &lt;p&gt;The MTP Simulator implements all MTP device capabilities, object properties, and operations that are based on the &lt;a href="#_Supplemental_Information:"&gt;MTP Specification&lt;/a&gt; along with the major features in Windows 7. Additionally, the MTP Simulator also &lt;b&gt;supports&lt;/b&gt; &lt;b&gt;&lt;a href="http://windowsteamblog.com/blogs/windowsexperience/archive/2009/01/08/device-stage-a-new-way-of-interacting-with-devices-in-windows-7.aspx"&gt;Device Stage&lt;/a&gt;&lt;/b&gt; and loading &lt;b&gt;customizable device profiles.&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;For transport support, the MTP Simulator runs on &lt;b&gt;multiple transport options&lt;/b&gt; such as USB, Software-Simulated USB (SoftSim), Bluetooth, and IP. Last, but not the least, the MTP Simulator runs on both &lt;a&gt;Windows Vista and Windows 7.&lt;/a&gt;&lt;/p&gt;  &lt;h2&gt;Where to get the MTP Simulator&lt;/h2&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;The MTP Simulator is publicly available as part of the &lt;a href="http://www.microsoft.com/whdc/device/wpd/MTP-DEK_Win7.mspx"&gt;Windows 7 Portable Device Enabling Kit for MTP (DEK&lt;/a&gt;). The kit also includes support documentation for the MTP Simulator and the MTP Specification Version 1.0 and MTP Device Services for Windows. Included in the DEK is the &lt;em&gt;MTP Device Simulator User Guide&lt;/em&gt; which provides a detailed description of the MTP Simulator.&lt;/p&gt;  &lt;h2&gt;Installing the MTP Simulator&lt;/h2&gt;  &lt;p&gt;&lt;b&gt;&lt;u&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;The MTP Device Simulator is installed as part of the Windows 7 Portable Device Enabling Kit for MTP (DEK). Before running the simulator for the first time, you may need to install the Device Simulation Framework (DSF).&lt;/p&gt;  &lt;p&gt;To install DSF:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Browse to the folder where the DEK is installed (usually C:\Windows7DEK) &lt;/li&gt;    &lt;li&gt;Navigate to the Tools\MTP Device Simulator\Dsf subfolder &lt;/li&gt;    &lt;li&gt;Open an elevated command window (i.e. &amp;quot;Run as Administrator”) and launch install.cmd to start the DSF MSI package install. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Once DSF is installed, you can launch the MTP Simulator from C:\WindowsDEK\Tools\MTP Device Simulator\MTPSimUI.exe. Select your desired transport, and click “Connect” to launch an instance of the MTP Simulator. The next section gives an overview of the User Interface.&lt;/p&gt;  &lt;h2&gt;User Interface&lt;/h2&gt;  &lt;p&gt;The following screenshot shows the MTP Simulator UI with navigation buttons and configuration options.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/wpdblog/WindowsLiveWriter/TheMTPDeviceSimulator_FB0F/MTPSim.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="MTPSim" border="0" alt="MTPSim" src="http://blogs.msdn.com/blogfiles/wpdblog/WindowsLiveWriter/TheMTPDeviceSimulator_FB0F/MTPSim_thumb.png" width="644" height="455" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;   &lt;table border="1" cellspacing="0" cellpadding="1"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="90"&gt;&lt;strong&gt;MTP Simulator              &lt;br /&gt;Configuration&lt;/strong&gt; &lt;/b&gt;&lt;/td&gt;          &lt;td valign="top" width="108"&gt;&lt;b&gt;Location&lt;/b&gt; &lt;/td&gt;          &lt;td valign="top" width="339"&gt;&lt;b&gt;Purpose&lt;/b&gt; &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="90"&gt;           &lt;p&gt;Connection&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="108"&gt;           &lt;p&gt;Left control tabs and menu options.&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="339"&gt;           &lt;p&gt;Connect, disconnect, or restart MTP Simulator by using the currently selected configuration. You can change the transport type on the &lt;b&gt;Transport&lt;/b&gt; tab and change the test mode on the &lt;b&gt;Device Mode&lt;/b&gt; tab.&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="90"&gt;           &lt;p&gt;Transport&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="108"&gt;           &lt;p&gt;Left control tabs and menu options.&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="339"&gt;           &lt;p&gt;Select the transport to be used. To simulate a software-only USB device, select the “SoftUSB” transport.&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="90"&gt;           &lt;p&gt;Device mode&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="108"&gt;           &lt;p&gt;Left control tabs and menu options.&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="339"&gt;           &lt;p&gt;Normal Mode should be used. Test Mode is reserved for internal Microsoft testing.&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="90"&gt;           &lt;p&gt;Output windows&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="108"&gt;           &lt;p&gt;Lower-right output window.&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="339"&gt;           &lt;p&gt;This window displays redirected output from stdout. Any output from a printf statement, such as trace—from either MTP Simulator or a plug-in—appears in this window. The output is also saved as mtpsimui.log automatically under the MTP Simulator root directory.&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;h6&gt;Table 1. MTP Simulator User Controls&lt;/h6&gt;  &lt;h2&gt;Command-Line Options&lt;/h2&gt;  &lt;p&gt;&lt;b&gt;&lt;u&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;In addition to the GUI, you can control MTP Simulator at startup by using command-line parameters. This can be useful when you need to perform automated testing. For details, see &lt;strong&gt;Appendix C&lt;/strong&gt; from the &lt;em&gt;MTP Device Simulator User Guide&lt;/em&gt;. &lt;/p&gt;  &lt;h2&gt;Customizing the MTP Simulator&lt;/h2&gt;  &lt;p&gt;&lt;b&gt;&lt;u&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;You can control the capabilities that the MTP Simulator reports to Windows by using an XML file (see Appendix F in the &lt;em&gt;MTP Device Simulator User Guide&lt;/em&gt; for details). Device capabilities are controlled by DeviceSummary.xml, and service capabilities are controlled by Services.xml.&lt;/p&gt;  &lt;p&gt;The DeviceSummary.xml file enables you to customize the contents of the DeviceInfo, StorageInfo, DevicePropDesc, and ObjectPropDesc datasets.&lt;/p&gt;  &lt;p&gt;The Services.xml file enables you to specify configurations that are related to device services, including service-supported formats, methods, and events.&lt;/p&gt;  &lt;h2&gt;Device Profiles&lt;/h2&gt;  &lt;p&gt;The MTP Simulator also supports loading &lt;a&gt;different device profiles&lt;/a&gt;. A device profile contains a set of customized configuration files (i.e. DeviceSummary.xml and Services.xml) describing a sample device. The DEK comes bundled with sample profiles representing each device class (Camera, Cellular Phone, Media Player, etc). Details of how to load the device profiles are outlined in the &lt;em&gt;MTP Device Simulator User Guide&lt;/em&gt;. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;   &lt;table border="1" cellspacing="0" cellpadding="1"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="217"&gt;&lt;strong&gt;Device Profile&lt;/strong&gt;&lt;/td&gt;          &lt;td valign="top" width="402"&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="217"&gt;           &lt;p&gt;Fabrikam_Camera&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="402"&gt;           &lt;p&gt;Simulates a sample camera.&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="217"&gt;           &lt;p&gt;Fabrikam_Phone&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="402"&gt;           &lt;p&gt;Simulates a cellular phone.&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="217"&gt;           &lt;p&gt;Fabrikam_PMP&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="402"&gt;           &lt;p&gt;Simulates a portable media player.&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="217"&gt;           &lt;p&gt;MtpSim-FullEnumSync&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="402"&gt;           &lt;p&gt;Simulates a device that supports the Full Enumeration synchronization model, for example for contacts, calendar, tasks, and notes synchronization.&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="217"&gt;           &lt;p&gt;MtpSim-FullEnumSyncSimpleParticipant&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="402"&gt;           &lt;p&gt;Simulates a device that supports the Full Enumeration synchronization model (like MtpSim-FullEnumSync), with additional support for the simple participant feature.&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;h6&gt;Table 2: Sample MTP Simulator Device Profiles&lt;/h6&gt;  &lt;p&gt;Each of these profiles has a corresponding Device Stage package. Each of these packages supports the same set of standard Device Stage tasks, with the exception of the Ringtone task which is not supported by the Fabrikam_Camera and Fabrikam_PMP profiles. For more information on authoring Device Stage metadata, refer to the &lt;b&gt;Windows 7 Device Stage Development Guide&lt;/b&gt; in the &lt;a href="http://www.microsoft.com/whdc/device/DeviceExperience/Dev-Kit.mspx"&gt;Microsoft Device Experience Development Kit&lt;/a&gt;.&lt;/p&gt;  &lt;h2&gt;Testing Device Stage Packages&lt;/h2&gt;  &lt;p&gt;The MTP Simulator can also be used to test custom Device Stage packages. The MTP Device Inspector tool can be used to generate a device profile which can be loaded into the Simulator (see the &lt;i&gt;MTP Device Simulator User Guide &lt;/i&gt;for details&lt;i&gt;)&lt;/i&gt;. Once a custom Device Stage metadata package has been authored, the package contains all the files necessary to display a Device Stage experience in Windows 7. The package may be tested by copying it to the PC’s device metadata store and connecting the test device, in this case rapid development can be done using the MTP Simulator. In order to load (unsigned) custom Device Stage metadata the system will need to be boot into test mode. For more details, refer to page 40 of the &lt;b&gt;Windows 7 Device Stage Development Guide&lt;/b&gt; document that is included in the &lt;a href="http://www.microsoft.com/whdc/device/DeviceExperience/Dev-Kit.mspx"&gt;Microsoft Device Experience Development Kit&lt;/a&gt; for details on testing Device Stage metadata packages.&lt;/p&gt;  &lt;h2&gt;Want to Learn More?&lt;/h2&gt;  &lt;p&gt;The &lt;i&gt;MTP Device Simulator User Guide&lt;/i&gt; in the Documentation for the &lt;a href="http://www.microsoft.com/whdc/device/wpd/MTP-DEK_Win7.mspx"&gt;Device Enabling Kit&lt;/a&gt; contains more information on the features described above.&lt;/p&gt;  &lt;p&gt;If you have general questions about the MTP Simulator contact AskMTP at Microsoft dot com.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;i&gt;This posting is provided &amp;quot;AS IS&amp;quot; with no warranties and confers no rights.&lt;/i&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9912325" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/wpdblog/archive/tags/MTP/default.aspx">MTP</category><category domain="http://blogs.msdn.com/wpdblog/archive/tags/Tools/default.aspx">Tools</category><category domain="http://blogs.msdn.com/wpdblog/archive/tags/Device+Stage/default.aspx">Device Stage</category><category domain="http://blogs.msdn.com/wpdblog/archive/tags/Device+Services/default.aspx">Device Services</category></item><item><title>Windows 7 Portable Device Development Kits</title><link>http://blogs.msdn.com/wpdblog/archive/2009/09/11/windows-7-portable-device-development-kits.aspx</link><pubDate>Sat, 12 Sep 2009 09:58:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9894442</guid><dc:creator>wpdblog</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/wpdblog/comments/9894442.aspx</comments><wfw:commentRss>http://blogs.msdn.com/wpdblog/commentrss.aspx?PostID=9894442</wfw:commentRss><description>&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font size="2"&gt;There are several different resources made available to portable device manufacturers to assist in device firmware and driver development, and to application developers wishing to create applications that interact with these portable devices. These resources are provided and maintained by members of the Windows Portable Devices team. &lt;/font&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font size="2"&gt;This post provides a description for the following development kits: &lt;/font&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraphCxSpFirst"&gt;&lt;font size="2"&gt;&lt;font face="Verdana"&gt;&lt;span style="font-family: symbol; mso-bidi-font-family: symbol; mso-fareast-font-family: symbol"&gt;&lt;span style="mso-list: ignore"&gt;&lt;span style="font: 7pt &amp;#39;Times New Roman&amp;#39;"&gt;&amp;#160;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Windows 7 Portable Device Enabling Kit for MTP &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraphCxSpMiddle"&gt;&lt;font size="2"&gt;&lt;font face="Verdana"&gt;Windows Portable Devices SDK &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraphCxSpMiddle"&gt;&lt;font size="2"&gt;&lt;font face="Verdana"&gt;Windows Portable Devices Driver Kit &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraphCxSpMiddle"&gt;&lt;font size="2"&gt;&lt;font face="Verdana"&gt;Windows Media Device Manager SDK &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraphCxSpMiddle"&gt;&lt;font size="2"&gt;&lt;font face="Verdana"&gt;Microsoft Device Experience Development Kit &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraphCxSpMiddle"&gt;&lt;font size="2"&gt;&lt;font face="Verdana"&gt;&lt;/span&gt;Windows Logo Kit &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;/p&gt;  &lt;h2&gt;Windows 7 Portable Device Enabling Kit for MTP&lt;/h2&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font size="2"&gt;This development kit is designed to assist portable device manufacturers in the development of Media Transfer Protocol (MTP) device firmware that is compatible with the &lt;/font&gt;&lt;a href="http://blogs.msdn.com/wpdblog/archive/2009/08/29/mtp-over-various-transports.aspx" mce_href="http://blogs.msdn.com/wpdblog/archive/2009/08/29/mtp-over-various-transports.aspx"&gt;&lt;font size="2"&gt;various MTP device transports that Windows supports&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;, and with &lt;/font&gt;&lt;a href="http://blogs.msdn.com/wpdblog/archive/2009/08/15/introducing-device-services.aspx" mce_href="http://blogs.msdn.com/wpdblog/archive/2009/08/15/introducing-device-services.aspx"&gt;&lt;font size="2"&gt;Device Services&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;. There are two packages provided for download: &lt;/font&gt;&lt;/p&gt;  &lt;p style="margin-left: 0.5in"&gt;&lt;i&gt;&lt;font face="Verdana"&gt;Windows 7 Portable Device Enabling Kit for MTP - Tools&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;font face="Verdana"&gt;      &lt;br /&gt;The tools kit includes design documentation and implementation guidelines, a Windows-based reference design, development tools, and the updated MTP Device Simulator. &lt;/font&gt;&lt;/p&gt;  &lt;p style="margin-left: 0.5in"&gt;&lt;i&gt;&lt;font face="Verdana"&gt;Windows 7 Portable Device Enabling Kit for MTP - Reference Code&lt;/font&gt;&lt;/i&gt;&lt;font face="Verdana"&gt;      &lt;br /&gt;The reference code kit includes the core responder reference source code that is being made available under a separate Berkeley Software Distribution (BSD)–style license. &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;To download both packages of the Windows 7 Portable Device Enabling Kit for MTP, go to: &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;a href="http://www.microsoft.com/whdc/device/wpd/MTP-DEK_Win7.mspx"&gt;http://www.microsoft.com/whdc/device/wpd/MTP-DEK_Win7.mspx&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;You are not required to license the reference code in order to use the tools and resources provided in the tools kit.&lt;span class="MsoCommentReference"&gt;&lt;span style="line-height: 115%; mso-bidi-font-size: 11.0pt; mso-ansi-font-size: 11.0pt"&gt; &lt;/span&gt;&lt;/span&gt;This kit is free to download and use.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h2&gt;Windows Portable Devices SDK&lt;/h2&gt; &lt;span style="color: black"&gt;   &lt;p&gt;&lt;font size="2"&gt;The WPD SDK includes the WPD Application Programming Interface (API) that is supported in Windows 7, Windows Vista, and Windows XP operating Systems. Developers will use this API to write Windows applications in C++. &lt;span style="mso-spacerun: yes"&gt;&amp;#160;&lt;/span&gt;Being a COM API, the WPD API is also accessible from Managed code, so C# .Net, and Visual Basic .Net applications can use COM Interoperability to invoke the same functionality that the C++ API provides. WPD applications can: explore a device, send and receive content, and even control the device, for example, take a picture or send a text message.&lt;/font&gt;&lt;/p&gt; &lt;/span&gt;  &lt;p style="vertical-align: top"&gt;&lt;span style="color: black"&gt;&lt;font size="2"&gt;The WPD SDK includes two sample applications for C++/COM developers. The first, WpdApiSample, is a command-line desktop application that demonstrates how you would: enumerate connected devices, explore those devices, query device-objects for properties and attributes, send and retrieve data, and so on. The second sample, WpdServicesApiSample, is a command-line desktop application that demonstrates how you would explore a Contacts service on a device that is attached to your computer. &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="color: black"&gt;&lt;font size="2"&gt;The WPD SDK also includes an Automation Object Model that is supported in Windows 7. Developers can use the Automation model to write web applications that accomplish tasks similar to those accomplished with the API. We provided an introduction to WPD Automation in this recent &lt;/font&gt;&lt;/span&gt;&lt;a href="http://blogs.msdn.com/wpdblog/archive/2009/08/21/introducing-wpd-automation.aspxhttp:/blogs.msdn.com/wpdblog/archive/2009/08/21/introducing-wpd-automation.aspx" mce_href="http://blogs.msdn.com/wpdblog/archive/2009/08/21/introducing-wpd-automation.aspxhttp:/blogs.msdn.com/wpdblog/archive/2009/08/21/introducing-wpd-automation.aspx"&gt;&lt;font color="#0080ff" size="2"&gt;post&lt;/font&gt;&lt;/a&gt;&lt;font size="3"&gt;&lt;span style="color: black"&gt;&lt;font size="2"&gt;.&lt;/font&gt; &lt;/span&gt;&lt;span style="color: black; mso-ascii-font-family: calibri; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font size="2"&gt;&lt;span style="color: black"&gt;The WPD SDK is included in the Windows SDK which can be downloaded from &lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=c17ba869-9671-4330-a63e-1fd44e0e2505&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=c17ba869-9671-4330-a63e-1fd44e0e2505&amp;amp;displaylang=en&lt;/a&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="color: black"&gt;&lt;/span&gt; &lt;/p&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="color: black"&gt;&lt;font size="2"&gt;The documentation for the WPD SDK (both the API and Automation Object Model) is found on MSDN at: &lt;/font&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/dd388998(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd388998(VS.85).aspx"&gt;&lt;font color="#0000ff"&gt;&lt;/font&gt;&lt;/a&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/dd388998(VS.85).aspx"&gt;&lt;font size="2"&gt;http://msdn.microsoft.com/en-us/library/dd388998(VS.85).aspx&lt;/font&gt;&lt;/a&gt;&lt;/a&gt;&lt;b&gt;&lt;span style="line-height: 140%; font-family: &amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;; color: black; font-size: 12pt; mso-bidi-font-size: 11.0pt"&gt;&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h2&gt;Windows Portable Devices Driver Kit&lt;/h2&gt;  &lt;p&gt;&lt;font size="2" face="Verdana"&gt;The WPD Driver Kit includes a Device Driver Interface (DDI) that is supported in Windows 7, Windows Vista, and Windows XP operating Systems. Developers will use this DDI to write drivers for devices that are not already supported by the MTP or Mass Storage class drivers that Microsoft distributes.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;The WPD Driver Kit includes five sample device drivers which are described in the following table. In the next &lt;/font&gt;&lt;a href="http://blogs.msdn.com/wpdblog/archive/2009/09/18/windows-7-driver-samples.aspx"&gt;&lt;font size="2"&gt;post&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;, we covered each sample in more detail.&lt;span style="mso-ascii-font-family: calibri; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri"&gt;&lt;/span&gt; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;   &lt;table style="border-collapse: collapse; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 0in 0in 0in" class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;       &lt;tr style="mso-yfti-irow: 0; mso-yfti-firstrow: yes"&gt;         &lt;td style="border-bottom: black 1pt solid; border-left: black 1pt solid; padding-bottom: 0in; background-color: transparent; padding-left: 5.4pt; width: 239.4pt; padding-right: 5.4pt; border-top: black 1pt solid; border-right: black 1pt solid; padding-top: 0in" valign="top" width="319"&gt;           &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;b&gt;&lt;font size="2"&gt;Sample Driver&lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="mso-ascii-font-family: calibri; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri"&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td style="border-bottom: black 1pt solid; padding-bottom: 0in; background-color: transparent; padding-left: 5.4pt; width: 239.4pt; padding-right: 5.4pt; border-left-color: #f0f0f0; border-top: black 1pt solid; border-right: black 1pt solid; padding-top: 0in" valign="top" width="319"&gt;           &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font size="2"&gt;&lt;b&gt;Description&lt;/b&gt;&lt;b&gt;&lt;span style="mso-ascii-font-family: calibri; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri"&gt; &lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr style="mso-yfti-irow: 1"&gt;         &lt;td style="border-bottom: black 1pt solid; border-left: black 1pt solid; padding-bottom: 0in; background-color: transparent; border-top-color: #f0f0f0; padding-left: 5.4pt; width: 239.4pt; padding-right: 5.4pt; border-right: black 1pt solid; padding-top: 0in" valign="top" width="319"&gt;           &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font size="2"&gt;WpdHelloWorldDriver&lt;span style="mso-ascii-font-family: calibri; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td style="border-bottom: black 1pt solid; padding-bottom: 0in; background-color: transparent; border-top-color: #f0f0f0; padding-left: 5.4pt; width: 239.4pt; padding-right: 5.4pt; border-left-color: #f0f0f0; border-right: black 1pt solid; padding-top: 0in" valign="top" width="319"&gt;           &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font size="2"&gt;This is the most basic WPD driver that emulates interaction with hardware. Supports four objects: device, storage, folder, and file. This provides the scaffolding or skeleton for developing a WPD driver.&lt;span style="mso-ascii-font-family: calibri; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr style="mso-yfti-irow: 2"&gt;         &lt;td style="border-bottom: black 1pt solid; border-left: black 1pt solid; padding-bottom: 0in; background-color: transparent; border-top-color: #f0f0f0; padding-left: 5.4pt; width: 239.4pt; padding-right: 5.4pt; border-right: black 1pt solid; padding-top: 0in" valign="top" width="319"&gt;           &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font size="2"&gt;WpdBasicHardwareDriver&lt;span style="mso-ascii-font-family: calibri; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td style="border-bottom: black 1pt solid; padding-bottom: 0in; background-color: transparent; border-top-color: #f0f0f0; padding-left: 5.4pt; width: 239.4pt; padding-right: 5.4pt; border-left-color: #f0f0f0; border-right: black 1pt solid; padding-top: 0in" valign="top" width="319"&gt;           &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font size="2"&gt;Builds upon the WpdHelloWorldDriver and demonstrates interaction with simple hardware devices. Supports nine sensor devices: 2-axis accelerometer, 3-axis accelerometer, temperature/humidity sensor, pressure sensor, distance sensor, passive infrared sensor, compass, vibration sensor, and light sensor. These sensor devices are simple devices that are controlled by a Parallax BS2 microcontroller attached to the PC. &lt;/font&gt;&lt;/p&gt;            &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="mso-ascii-font-family: calibri; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri"&gt;&lt;font size="2"&gt;If you plan to develop drivers that integrate sensors with Windows 7, we recommend using the &lt;/font&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/dd318953(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd318953(VS.85).aspx"&gt;&lt;span style="mso-ascii-font-family: calibri; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri"&gt;&lt;font size="2"&gt;Sensor API&lt;/font&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="mso-ascii-font-family: calibri; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri"&gt;&lt;font size="2"&gt; and &lt;/font&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/cc974537.aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc974537.aspx"&gt;&lt;span style="mso-ascii-font-family: calibri; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri"&gt;&lt;font size="2"&gt;Sensor Driver Model&lt;/font&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="mso-ascii-font-family: calibri; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri"&gt;&lt;font size="2"&gt;. If you need to develop drivers to integrate sensors with Windows Vista or Windows XP, WPD provides a viable solution. &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr style="mso-yfti-irow: 3"&gt;         &lt;td style="border-bottom: black 1pt solid; border-left: black 1pt solid; padding-bottom: 0in; background-color: transparent; border-top-color: #f0f0f0; padding-left: 5.4pt; width: 239.4pt; padding-right: 5.4pt; border-right: black 1pt solid; padding-top: 0in" valign="top" width="319"&gt;           &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font size="2"&gt;WpdServiceSampleDriver&lt;span style="mso-ascii-font-family: calibri; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td style="border-bottom: black 1pt solid; padding-bottom: 0in; background-color: transparent; border-top-color: #f0f0f0; padding-left: 5.4pt; width: 239.4pt; padding-right: 5.4pt; border-left-color: #f0f0f0; border-right: black 1pt solid; padding-top: 0in" valign="top" width="319"&gt;           &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font size="2"&gt;Demonstrates how a developer would extend the WpdHelloWorldDriver to support a simulated device with a Contacts device service.(Using this service, WPD applications can discover events, methods, and properties associated with the Contacts stored on the device. This sample emulates interaction with hardware.&lt;span style="mso-ascii-font-family: calibri; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr style="mso-yfti-irow: 4"&gt;         &lt;td style="border-bottom: black 1pt solid; border-left: black 1pt solid; padding-bottom: 0in; background-color: transparent; border-top-color: #f0f0f0; padding-left: 5.4pt; width: 239.4pt; padding-right: 5.4pt; border-right: black 1pt solid; padding-top: 0in" valign="top" width="319"&gt;           &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font size="2"&gt;WpdMultiTransportDriver&lt;span style="mso-ascii-font-family: calibri; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td style="border-bottom: black 1pt solid; padding-bottom: 0in; background-color: transparent; border-top-color: #f0f0f0; padding-left: 5.4pt; width: 239.4pt; padding-right: 5.4pt; border-left-color: #f0f0f0; border-right: black 1pt solid; padding-top: 0in" valign="top" width="319"&gt;           &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font size="2"&gt;Demonstrates how developers can take advantage of the Windows 7 support for multiple transports. The sample emulates interaction with hardware and demonstrates support for the following transports: IP, Bluetooth, and USB. We covered an overview of Multi-transport support in Windows 7 &lt;/font&gt;&lt;a href="http://blogs.msdn.com/wpdblog/archive/2009/09/04/multi-transport-devices-in-windows-7.aspx" mce_href="http://blogs.msdn.com/wpdblog/archive/2009/09/04/multi-transport-devices-in-windows-7.aspx"&gt;&lt;font size="2"&gt;here&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;.&lt;span style="mso-ascii-font-family: calibri; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr style="mso-yfti-irow: 5; mso-yfti-lastrow: yes"&gt;         &lt;td style="border-bottom: black 1pt solid; border-left: black 1pt solid; padding-bottom: 0in; background-color: transparent; border-top-color: #f0f0f0; padding-left: 5.4pt; width: 239.4pt; padding-right: 5.4pt; border-right: black 1pt solid; padding-top: 0in" valign="top" width="319"&gt;           &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font size="2"&gt;WpdWudfSampleDriver&lt;span style="mso-ascii-font-family: calibri; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td style="border-bottom: black 1pt solid; padding-bottom: 0in; background-color: transparent; border-top-color: #f0f0f0; padding-left: 5.4pt; width: 239.4pt; padding-right: 5.4pt; border-left-color: #f0f0f0; border-right: black 1pt solid; padding-top: 0in" valign="top" width="319"&gt;           &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font size="2"&gt;A comprehensive sample driver that demonstrates what to enable in the WPD DDI for media transfer scenarios (such as music and photos). This sample supports media synchronization with Windows Media Player, and also emulates interaction with hardware.&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="color: black"&gt;&lt;font size="2"&gt;The WPD Driver Kit is included in the Windows Driver Kit (WDK). For information about downloading the WDK, see: &lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff" size="2"&gt;&lt;a href="http://www.microsoft.com/whdc/devtools/wdk/WDKpkg.mspx"&gt;http://www.microsoft.com/whdc/devtools/wdk/WDKpkg.mspx&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="color: black"&gt;&lt;font size="2"&gt;The documentation for the WPD Driver Kit is found on MSDN at: &lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff" size="2"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/dd419925.aspx"&gt;http://msdn.microsoft.com/en-us/library/dd419925.aspx&lt;/a&gt;&lt;/font&gt;&lt;span style="color: #1f497d"&gt;&lt;/span&gt; &lt;/p&gt;  &lt;h2&gt;Windows Media Device Manager SDK &lt;/h2&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font size="2"&gt;The Windows Media Device Manager (WMDM) SDK &lt;span style="color: black"&gt;enables you to build desktop applications and components that can communicate with connected portable devices. WMDM enables your application or component to enumerate, explore, and exchange files with a device, query for metadata, and request play count information. Applications or components built on WMDM have a consistent API for communicating with a wide range of devices including Media Transfer Protocol (MTP), Mass Storage Class (MSC), RAPI, and other devices built on both the latest and previous versions of Windows Media technology. &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;font size="2"&gt;The Windows Media Device Manager SDK is available at: &lt;/font&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/windows/bb190309.aspx" mce_href="http://msdn.microsoft.com/en-us/windows/bb190309.aspx"&gt;&lt;font size="2"&gt;http://msdn.microsoft.com/en-us/windows/bb190309.aspx&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;. &lt;/font&gt;&lt;/p&gt;  &lt;h2&gt;Microsoft Device Experience Development Kit&lt;/h2&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font size="2"&gt;The Microsoft Device Experience Development Kit provides detailed information and material that you would need to know in order to develop Device Stage™ experiences for Portable Devices. The development kit includes device development guides, planning worksheets, tutorials, and development samples that you can use when developing a Device Stage experience on Windows 7. For portable devices, Device Stage supports the industry-standard Media Transfer Protocol (MTP) 1.0 with device services that enable a new rich set of features in Windows 7. &lt;/font&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font size="2"&gt;The development kit along with other pertinent information to build a complete Windows Device Experience is available at: &lt;/font&gt;&lt;a href="http://www.microsoft.com/whdc/device/DeviceExperience/default.mspx" mce_href="http://www.microsoft.com/whdc/device/DeviceExperience/default.mspx"&gt;&lt;font size="2"&gt;http://www.microsoft.com/whdc/device/DeviceExperience/default.mspx&lt;/font&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font size="2"&gt;The kit is free to download and use. &lt;/font&gt;&lt;/p&gt;  &lt;h2&gt;Windows Logo Kit&lt;/h2&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font size="2"&gt;The primary use of the Windows Logo Kit (WLK) is for Windows Logo Program device certification. This kit can also be used for product development. We encourage its use during the product development cycle of hardware in order to ensure device compliance with both Windows and industry standards. The kit includes several tests designed to validate device implementation and behavior at multiple levels. There are tests for USB compliance, Media Transfer Protocol (MTP) compliance, and Windows Portable Devices (WPD) platform compliance that also cover device services validation.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font size="2"&gt;There is a significant amount of information available about the WLK, including user guides and video tutorials. For more information about the WLK see: &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;a href="http://www.microsoft.com/whdc/winlogo/WLK/default.mspx"&gt;http://www.microsoft.com/whdc/winlogo/WLK/default.mspx&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font size="2"&gt;The kit is free to download and use.&lt;/font&gt; &lt;/p&gt;  &lt;h2&gt;Other Resources&lt;/h2&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font size="2"&gt;Windows Portable Devices node on Windows Hardware Developer Central &lt;/font&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;a href="http://www.microsoft.com/whdc/device/wpd/default.mspx" mce_href="http://www.microsoft.com/whdc/device/wpd/default.mspx"&gt;&lt;font size="2"&gt;http://www.microsoft.com/whdc/device/wpd/default.mspx&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font size="2"&gt;Windows Portable Devices on Microsoft Developer Network &lt;/font&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/dd388998(VS.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/dd388998(VS.85).aspx&lt;/a&gt;&lt;/font&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p mce_keep="true"&gt;&lt;span style="font-family: &amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;; font-size: 10pt"&gt;&lt;em&gt;This posting is provided &amp;quot;AS IS&amp;quot; with no warranties and confers no rights.&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9894442" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/wpdblog/archive/tags/SDK/default.aspx">SDK</category><category domain="http://blogs.msdn.com/wpdblog/archive/tags/MTP/default.aspx">MTP</category><category domain="http://blogs.msdn.com/wpdblog/archive/tags/Tools/default.aspx">Tools</category><category domain="http://blogs.msdn.com/wpdblog/archive/tags/WMDM/default.aspx">WMDM</category><category domain="http://blogs.msdn.com/wpdblog/archive/tags/Device+Stage/default.aspx">Device Stage</category><category domain="http://blogs.msdn.com/wpdblog/archive/tags/Windows+7/default.aspx">Windows 7</category></item><item><title>Driver Dev Guide: WPP Tracing in your WPD Driver</title><link>http://blogs.msdn.com/wpdblog/archive/2007/04/01/driver-dev-guide-using-wpp-tracing-in-your-wpd-driver.aspx</link><pubDate>Sun, 01 Apr 2007 21:14:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2007130</guid><dc:creator>wpdblog</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/wpdblog/comments/2007130.aspx</comments><wfw:commentRss>http://blogs.msdn.com/wpdblog/commentrss.aspx?PostID=2007130</wfw:commentRss><description>&lt;P&gt;&lt;A class="" title="WPP Software Tracing" href="http://msdn2.microsoft.com/en-us/library/ms793164.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms793164.aspx"&gt;WPP Software Tracing&lt;/A&gt; is the recommended way to log trace and error&amp;nbsp;messages in your WPD driver.&amp;nbsp; WPP, short for &lt;B&gt;W&lt;/B&gt;indows Software Trace &lt;B&gt;P&lt;/B&gt;re&lt;B&gt;P&lt;/B&gt;rocessor, provides&amp;nbsp;an efficient real-time event logging mechanism.&amp;nbsp;&amp;nbsp;&amp;nbsp; In addition, WPP traces include the system timestamp and can be used as a way to measure performance,&amp;nbsp;for example&amp;nbsp;by calculating the elapsed time between function calls.&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;From OutputDebugString to WPP&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;The WPD&amp;nbsp;sample drivers in the Windows Driver Kit (WDK)&amp;nbsp;log&amp;nbsp;error&amp;nbsp;messages using a&amp;nbsp;CHECK_HR function that wraps around OutputDebugString.&amp;nbsp;&amp;nbsp; While OutputDebugString is simple to use during development,&amp;nbsp;it necessitates&amp;nbsp;an active debugger connection in order to view the traces, and should be used minimally in shipping code.&amp;nbsp;&amp;nbsp; WPP tracing&amp;nbsp;is much more lightweight, flexible,&amp;nbsp;and&amp;nbsp;preferable for a range of tracing applications: logging errors for diagnosing failures, tracing code execution during development, to name a few.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to switch your WPD driver's tracing from OutputDebugString to WPP transparently:&lt;/P&gt;
&lt;P&gt;Step 1. &lt;B&gt;Remove&lt;/B&gt; the original CHECK_HR() function&amp;nbsp;definition (it can be found in WpdHelloWorldDriver.cpp&amp;nbsp;or WpdWudfSampleDriver.cpp for the WPD samples) and&amp;nbsp;its declaration in stdafx.h.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Step 2. &lt;B&gt;Add&lt;/B&gt; the following code (&lt;B&gt;include&lt;/B&gt; the WPP config comment blocks)&amp;nbsp;to stdafx.h:&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'courier-new'"&gt;&lt;PRE&gt;// TODO: Choose a different trace ID for your WPD driver&lt;BR&gt;#define MYDRIVER_TRACING_ID      L"Microsoft\\WPD\\MyWpdDriver"&lt;BR&gt;&lt;BR&gt;// TODO: Choose a different trace control GUID for your WPD driver&lt;BR&gt;// TODO: Define trace flag bits for your WPD driver&lt;BR&gt;&lt;BR&gt;#define WPP_CONTROL_GUIDS                                                   \&lt;BR&gt;    WPP_DEFINE_CONTROL_GUID(                                                \&lt;BR&gt;        MyWpdDriverCtrlGuid, (da5fbdfd,1eae,4ecf,b426,a3818f325ddb),        \&lt;BR&gt;                                                                            \&lt;BR&gt;        WPP_DEFINE_BIT(TRACE_FLAG_ALL)                                      \&lt;BR&gt;        WPP_DEFINE_BIT(TRACE_FLAG_DRIVER)                                   \&lt;BR&gt;        WPP_DEFINE_BIT(TRACE_FLAG_DEVICE)                                   \&lt;BR&gt;        )                             &lt;BR&gt;&lt;BR&gt;//&lt;BR&gt;// Prefer trace statement that is based on&lt;BR&gt;//     - the standard trace LEVEL (evntrace.h), and&lt;BR&gt;//     - specific flag bit.&lt;BR&gt;//&lt;BR&gt;#define WPP_LEVEL_FLAGS_LOGGER(lvl,flags) \&lt;BR&gt;           WPP_LEVEL_LOGGER(flags)&lt;BR&gt;               &lt;BR&gt;#define WPP_LEVEL_FLAGS_ENABLED(lvl, flags) \&lt;BR&gt;           (WPP_LEVEL_ENABLED(flags) &amp;amp;&amp;amp; WPP_CONTROL(WPP_BIT_ ## flags).Level &amp;gt;= lvl)&lt;BR&gt;&lt;BR&gt;//&lt;BR&gt;// This comment block is scanned by the trace preprocessor to define our&lt;BR&gt;// Trace and TraceEvents function.&lt;BR&gt;//&lt;BR&gt;// begin_wpp config&lt;BR&gt;// FUNC Trace{FLAG=TRACE_FLAG_ALL}(LEVEL, MSG, ...);&lt;BR&gt;// FUNC TraceEvents(LEVEL, FLAGS, MSG, ...);&lt;BR&gt;// end_wpp&lt;BR&gt;//&lt;BR&gt;&lt;BR&gt;// MACRO: CHECK_HR&lt;BR&gt;// Configuration block that defines trace macro. It uses the PRE/POST macros to include&lt;BR&gt;// code as part of the trace macro expansion. CHECK_HR is equivalent to the code below:&lt;BR&gt;//&lt;BR&gt;// {if (hrCheck != S_OK){  // This is the code in the PRE macro&lt;BR&gt;//     DoTraceMessage(TRACE_FLAG_ALL,  "%!STDPREFIX!" MSG " hr= %!HRESULT!", ..., hrCheck)&lt;BR&gt;// ;}}                              // This is the code in the POST macro&lt;BR&gt;//                                 &lt;BR&gt;&lt;BR&gt;// begin_wpp config&lt;BR&gt;// USEPREFIX (CHECK_HR,"%!STDPREFIX!");&lt;BR&gt;// FUNC CHECK_HR{FLAG=TRACE_FLAG_ALL}(hrCheck, MSG, ...);&lt;BR&gt;// USESUFFIX (CHECK_HR, " hr= %!HRESULT!", hrCheck);&lt;BR&gt;// end_wpp&lt;BR&gt;&lt;BR&gt;#define WPP_FLAG_hrCheck_PRE(FLAGS, hrCheck) {if(hrCheck != S_OK) {&lt;BR&gt;#define WPP_FLAG_hrCheck_POST(FLAGS, hrCheck) ; } }&lt;BR&gt;#define WPP_FLAG_hrCheck_ENABLED(FLAGS, hrCheck) WPP_FLAG_ENABLED(FLAGS)&lt;BR&gt;#define WPP_FLAG_hrCheck_LOGGER(FLAGS, hrCheck) WPP_FLAG_LOGGER(FLAGS)&lt;BR&gt;&lt;/PRE&gt;&lt;/SPAN&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Step 3. &lt;B&gt;Add&lt;/B&gt;&amp;nbsp;a RUN_WPP directive to your sources file:&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'courier-new'"&gt;&lt;PRE&gt;RUN_WPP= $(SOURCES) -scan:stdafx.h&lt;BR&gt;&lt;/PRE&gt;&lt;/SPAN&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Step 4. &lt;B&gt;Add&lt;/B&gt;&amp;nbsp;the WPP initialization and cleanup routines to DllMain:&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'courier-new'"&gt;&lt;PRE&gt;// DLL Entry Point&lt;BR&gt;extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)&lt;BR&gt;{&lt;BR&gt;    if(DLL_PROCESS_ATTACH == dwReason)&lt;BR&gt;    {&lt;BR&gt;        g_hInstance = hInstance;&lt;BR&gt;      &lt;BR&gt;&lt;B&gt;        //&lt;BR&gt;        // Initialize tracing.&lt;BR&gt;        //&lt;BR&gt;        WPP_INIT_TRACING(MYDRIVER_TRACING_ID);&lt;/B&gt;&lt;BR&gt;    }&lt;BR&gt;    else if (DLL_PROCESS_DETACH == dwReason)&lt;BR&gt;    {&lt;BR&gt;&lt;B&gt;        //&lt;BR&gt;        // Cleanup tracing.&lt;BR&gt;        //&lt;BR&gt;        WPP_CLEANUP();&lt;/B&gt;&lt;BR&gt;    }&lt;BR&gt;&lt;BR&gt;    return _AtlModule.DllMain(dwReason, lpReserved);&lt;BR&gt;}&lt;BR&gt;&lt;/PRE&gt;&lt;/SPAN&gt;
&lt;P mce_keep="true"&gt;Step 5. For&amp;nbsp;each .cpp file, &lt;B&gt;add &lt;/B&gt;a&amp;nbsp;#include &lt;I&gt;&amp;lt;filename&amp;gt;.tmh&lt;/I&gt; &lt;B&gt;after&lt;/B&gt;&amp;nbsp;the regular includes:&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'courier-new'"&gt;&lt;PRE&gt;//&lt;BR&gt;// WpdBaseDriver.cpp&lt;BR&gt;//&lt;BR&gt;&lt;BR&gt;#include "stdafx.h"&lt;BR&gt;#include "WpdBaseDriver.h"&lt;BR&gt;&lt;BR&gt;&lt;B&gt;// Include the WPP generated Trace Message Header (tmh) file for this .cpp&lt;BR&gt;#include "WpdBaseDriver.tmh"&lt;/B&gt;&lt;BR&gt;&lt;BR&gt;...&lt;BR&gt;&lt;BR&gt;&lt;/PRE&gt;&lt;/SPAN&gt;
&lt;P mce_keep="true"&gt;&lt;B&gt;Repeat Step 5&lt;/B&gt; for all other .CPP files.&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Step 6. &lt;B&gt;Rebuild&lt;/B&gt; your driver.&amp;nbsp;&amp;nbsp;Since we&amp;nbsp;replaced the CHECK_HR&amp;nbsp;function with an equivalent WPP&amp;nbsp;macro that has the same&amp;nbsp;signature (our WPP changes&amp;nbsp;were "under the hood"),&amp;nbsp;&lt;B&gt;no&amp;nbsp;changes &lt;/B&gt;are needed for&amp;nbsp;any code&amp;nbsp;that uses&amp;nbsp;CHECK_HR. &amp;nbsp; You can continue to use CHECK_HR the same way as before :).&lt;/P&gt;
&lt;P mce_keep="true"&gt;The WPP preprocessor&amp;nbsp;will process stdafx.h for tracing macros,&amp;nbsp;and generate a &lt;A class="" title="Trace Message Header File" href="http://msdn2.microsoft.com/en-us/library/ms797965.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms797965.aspx"&gt;Trace Message Header &lt;/A&gt;(tmh) file for each cpp file in the obj folders.&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;Inspecting the preprocessor output for&amp;nbsp;each&amp;nbsp;.CPP file&amp;nbsp;that calls CHECK_HR&amp;nbsp;(generated using&amp;nbsp;&lt;I&gt;make WpdBaseDriver.pp&lt;/I&gt;), you will notice that all CHECK_HR trace statements&amp;nbsp;have been&amp;nbsp;wrapped by WPP function calls, while the tracing&amp;nbsp;text and&amp;nbsp;WPP functions are defined in &lt;I&gt;WpdBaseDriver.tmh&lt;/I&gt;. &lt;/P&gt;
&lt;P mce_keep="true"&gt;The most common WPP-related&amp;nbsp;compilation errors you&amp;nbsp;may encounter&amp;nbsp;are due to mismatched format identifiers and&amp;nbsp;parameters &amp;nbsp;(e.g. if your format string contains an extra %d that does not match an argument) or&amp;nbsp;missing entries in the &lt;A class="" title=WPP_CONTROL_GUIDS href="http://msdn2.microsoft.com/en-us/library/ms793151.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms793151.aspx"&gt;WPP_CONTROL_GUIDS&lt;/A&gt;&amp;nbsp;macro.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;B&gt;&lt;/B&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;B&gt;More WPP Tracing Macros&lt;/B&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;We've also defined TraceEvents and Trace functions in&amp;nbsp;stdafx.h&amp;nbsp;that are general purpose WPP trace&amp;nbsp;macros wrapping &lt;A class="" title=DoTraceMessage href="http://msdn2.microsoft.com/en-us/library/ms793193.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms793193.aspx"&gt;DoTraceMessage&lt;/A&gt;.&amp;nbsp;&amp;nbsp; These can be used for both error and non-error trace logging using a combination of levels and flags.&amp;nbsp;&amp;nbsp;&amp;nbsp;For examples on how to use them in your driver, refer to the UMDF sample drivers in the WDK.&lt;/P&gt;
&lt;P mce_keep="true"&gt;To understand the WPP declarations used in stdafx.h,&amp;nbsp;customize the CHECK_HR macro, or to define&amp;nbsp;your own&amp;nbsp;tracing macros, visit the&amp;nbsp;&lt;A class="" title="WPP Macros in the tracedrv sample" href="http://msdn2.microsoft.com/en-us/library/ms793169.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms793169.aspx"&gt;WPP macros guide&lt;/A&gt;&amp;nbsp;which describes the WDK tracedrv sample in detail.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;B&gt;Generating and Viewing Traces&lt;/B&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;To generate traces, you can use &lt;A class="" title=TraceView href="http://msdn2.microsoft.com/en-us/library/ms797981.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms797981.aspx"&gt;Traceview&lt;/A&gt;&amp;nbsp; (UI) or Tracelog (command line).&amp;nbsp;&amp;nbsp; TraceView also allows you to view traces in real-time as they are logged.&amp;nbsp;These are available in the WDK.&amp;nbsp;&amp;nbsp; A quick way to get started is to create a new log session from Traceview &lt;A class="" title="Creating a WPP Trace Session" href="http://msdn2.microsoft.com/en-us/library/ms797996.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms797996.aspx"&gt;using the PDB file&lt;/A&gt; that contains the private symbols for your driver.&amp;nbsp;&amp;nbsp; Alternatively, you use a .CTL file that specifies your driver as a trace provider (replace own values below):&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'courier-new'"&gt;&lt;PRE&gt;da5fbdfd-1eae-4ecf-b426-a3818f325ddb    MyWpdDriverCtlGuid&lt;BR&gt;&lt;/PRE&gt;&lt;/SPAN&gt;
&lt;P mce_keep="true"&gt;&lt;B&gt;&lt;/B&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;B&gt;Converting Binary Traces to A Human-Readable Form&lt;/B&gt;&lt;/P&gt;WPP traces log to a binary ETL format.&amp;nbsp; To convert them to text, supply Trace Format (TMF and TMC) files that can be generated from&amp;nbsp;the .PDB file using TracePDB.&amp;nbsp; For more details, refer to the &lt;A class="" title="WPP Tracing Tools" href="http://msdn2.microsoft.com/en-us/library/ms797960.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms797960.aspx"&gt;tracing tools&lt;/A&gt; section in the MSDN docs. 
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;I&gt;This posting is provided "AS IS" with no warranties, and confers no rights.&lt;/I&gt;&lt;/SPAN&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2007130" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/wpdblog/archive/tags/WDK/default.aspx">WDK</category><category domain="http://blogs.msdn.com/wpdblog/archive/tags/Tools/default.aspx">Tools</category></item><item><title>Driver Dev Guide: How to Post Events from your WPD Driver</title><link>http://blogs.msdn.com/wpdblog/archive/2007/03/16/how-to-post-events-from-your-wpd-driver.aspx</link><pubDate>Sat, 17 Mar 2007 01:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1896911</guid><dc:creator>wpdblog</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/wpdblog/comments/1896911.aspx</comments><wfw:commentRss>http://blogs.msdn.com/wpdblog/commentrss.aspx?PostID=1896911</wfw:commentRss><description>&lt;p&gt;&lt;a href="https://blogs.msdn.com/dimeby8/default.aspx" class="" title="DimeBy8's Blog" mce_href="https://blogs.msdn.com/dimeby8/default.aspx"&gt;DimeBy8&lt;/a&gt;&amp;nbsp;wrote a great &lt;a href="https://blogs.msdn.com/dimeby8/archive/2006/10/06/Listening-to-WPD-Events.aspx" class="" title="Listening to WPD Events" mce_href="https://blogs.msdn.com/dimeby8/archive/2006/10/06/Listening-to-WPD-Events.aspx"&gt;post&lt;/a&gt; on how a WPD application can receive driver-initiated WPD PnP events;&amp;nbsp;this post&amp;nbsp;will describe &lt;b&gt;the driver's side of our eventing story&lt;/b&gt;.&amp;nbsp;&amp;nbsp; While this mechanism&amp;nbsp;is&amp;nbsp;"under the covers" for&amp;nbsp;most WPD application developers, it helps to get an end-to-end picture of how&amp;nbsp;stuff works in WPD land,&amp;nbsp;especially if you are thinking about writing a WPD driver and application for vertical scenarios that involve&amp;nbsp;posting and receiving custom events.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;/b&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Standard WPD Events and Parameters&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Here is the &lt;a href="http://msdn.microsoft.com/en-us/library/dd318066%28VS.85%29.aspx" title="WPD Event Constants" mce_href="http://msdn.microsoft.com/en-us/library/dd318066(VS.85).aspx"&gt;list of standard&amp;nbsp;WPD events&lt;/a&gt;.&amp;nbsp;&amp;nbsp; These GUIDs are defined in PortableDevice.h.&amp;nbsp;&amp;nbsp; When you begin accessing these events as a WPD application or driver), you may&amp;nbsp;soon realize a missing piece of information:&amp;nbsp;&lt;b&gt;what/where are the&amp;nbsp;parameters for these events?&lt;/b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The Event parameters are described in more detail in the &lt;a href="http://www.microsoft.com/whdc/device/media/WPDguide.mspx" class="" title="Basic WPD Device Driver Requirements" mce_href="http://www.microsoft.com/whdc/device/media/WPDguide.mspx"&gt;Basic WPD Device Driver Requirements&lt;/a&gt;&amp;nbsp;WHDC whitepaper,&amp;nbsp;under &lt;i&gt;Requirements for Event Parameters.&amp;nbsp;&amp;nbsp; &lt;/i&gt;&lt;/p&gt;
&lt;p&gt;A&amp;nbsp;&lt;i&gt;snippet&lt;/i&gt; from the whitepaper that describes&amp;nbsp;the required&amp;nbsp;parameters for WPD_EVENT_OBJECT_UPDATED:&lt;/p&gt;
&lt;h4 style="margin: 12pt 0in 0pt;"&gt;&lt;font size="2"&gt;&amp;nbsp; WPD_EVENT_OBJECT_UPDATED&lt;/font&gt;&lt;/h4&gt;
&lt;p class="BodyTextLink" style="margin: 0in 0in 4pt;"&gt;&amp;nbsp; This event is sent after an object has been updated so that any connected client should refresh its view of that object.&lt;/p&gt;
&lt;p class="TableHead" style="margin: 8pt 0in 1pt;"&gt;&lt;b&gt;&amp;nbsp; Parameters &lt;/b&gt;&lt;/p&gt;
&lt;p class="DT" style="margin: 0in 0in 0pt 9pt;"&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="font-weight: normal;"&gt;&amp;nbsp; &lt;font color="#0000ff"&gt;WPD_EVENT_PARAMETER_PNP_DEVICE_ID&lt;/font&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="DL" style="margin: 0in 0in 4pt 0.25in;"&gt;&amp;nbsp; Required.&lt;/p&gt;
&lt;p class="DT" style="margin: 0in 0in 0pt 9pt;"&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="font-weight: normal;"&gt;&amp;nbsp; &lt;font color="#0000ff"&gt;WPD_EVENT_PARAMETER_EVENT_ID&lt;/font&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="DL" style="margin: 0in 0in 4pt 0.25in;"&gt;&amp;nbsp; Required.&lt;/p&gt;
&lt;p class="DT" style="margin: 0in 0in 0pt 9pt;"&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="font-weight: normal;"&gt;&amp;nbsp; &lt;font color="#0000ff"&gt;WPD_OBJECT_PERSISTENT_UNIQUE_ID&lt;/font&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="DL" style="margin: 0in 0in 4pt 0.25in;"&gt;&amp;nbsp; Required.&lt;/p&gt;
&lt;p class="DT" style="margin: 0in 0in 0pt 9pt;"&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="font-weight: normal;"&gt;&amp;nbsp; &lt;font color="#0000ff"&gt;WPD_EVENT_PARAMETER_OBJECT_PARENT_PERSISTENT_UNIQUE_ID&lt;/font&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="DL" style="margin: 0in 0in 4pt 0.25in;"&gt;&amp;nbsp; Required.&lt;/p&gt;
&lt;p class="DT" style="margin: 0in 0in 0pt 9pt;"&gt;&lt;span class="MsoHyperlink"&gt;&lt;span style="font-weight: normal;"&gt;&amp;nbsp; &lt;font color="#0000ff"&gt;WPD_EVENT_PARAMETER_CHILD_HIERARCHY_CHANGED&lt;/font&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="DL" style="margin: 0in 0in 4pt 0.25in;"&gt;&amp;nbsp; Required if the object hierarchy at any level under this object has changed.&lt;/p&gt;
&lt;p mce_keep="true"&gt;Event parameters matter when you're sending a standard WPD event from your driver.&amp;nbsp;&amp;nbsp;&amp;nbsp;For example, when receiving WPD_EVENT_OBJECT_UPDATED, applications may utilize information such as WPD_OBJECT_PERSISTENT_UNIQUE_ID to determine which object's properties would need to be refreshed in their properties view.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p mce_keep="true"&gt;*Aside: One consequence of supporting any WPD event that requires the&amp;nbsp;Persistent Unique ID of objects&amp;nbsp;is that your driver needs to support this property (but this is a required property anyway for most content objects).&amp;nbsp;&amp;nbsp;&amp;nbsp;The list of required properties is also covered in &lt;a href="http://www.microsoft.com/whdc/device/media/WPDguide.mspx" class="" title="Basic WPD Device Driver Requirements" mce_href="http://www.microsoft.com/whdc/device/media/WPDguide.mspx"&gt;Basic WPD Device Driver Requirements&lt;/a&gt;.&lt;/p&gt;
&lt;p mce_keep="true"&gt;&lt;b&gt;&lt;/b&gt;&amp;nbsp;&lt;/p&gt;
&lt;p mce_keep="true"&gt;&lt;b&gt;Posting a WPD Event from&amp;nbsp;Your Driver&lt;/b&gt;&lt;/p&gt;
&lt;p mce_keep="true"&gt;Now that you know what parameters to send with&amp;nbsp;a WPD&amp;nbsp;event, posting the event is a&amp;nbsp;three step process:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;div mce_keep="true"&gt;Initialize an&amp;nbsp;IPortableDeviceValues to hold the event parameters.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div mce_keep="true"&gt;Serialize the IPortableDeviceValues to a BYTE buffer.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div mce_keep="true"&gt;Call &lt;a href="http://msdn2.microsoft.com/en-us/library/aa511339.aspx" class="" title="IWDFDevice::PostEvent" mce_href="http://msdn2.microsoft.com/en-us/library/aa511339.aspx"&gt;IWDFDevice::PostEvent&lt;/a&gt;&amp;nbsp;with the EventGuid = WPD_EVENT_NOTIFICATION and the serialized buffer.&amp;nbsp; Only &lt;i&gt;WdfEventBroadcast&lt;/i&gt; events are supported, which means all WPD applications that call IPortableDevice::Advise can receive the event your driver posts.&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-size: 9pt; font-family: 'courier-new';"&gt;&lt;pre&gt;BYTE* pBuffer  = NULL;&lt;br&gt;DWORD cbBuffer = 0;&lt;br&gt;&lt;br&gt;// Populate the event parameters&lt;br&gt;hr = pIPortableDeviceValues-&amp;gt;SetGuidValue(WPD_EVENT_PARAMETER_EVENT_ID, WPD_EVENT_OBJECT_UPDATED);&lt;br&gt;&lt;br&gt;// Set other required event parameters here ....&lt;br&gt;&lt;br&gt;if (hr == S_OK)&lt;br&gt;{&lt;br&gt;    // Serialize the event parameters to a buffer &lt;br&gt;    hr = pWpdSerializer-&amp;gt;GetBufferFromIPortableDeviceValues(pIPortableDeviceValues, &amp;amp;pBuffer, &amp;amp;cbBuffer);&lt;br&gt;}&lt;br&gt;&lt;br&gt;// Send the event.&lt;br&gt;if (hr == S_OK)&lt;br&gt;{&lt;br&gt;    hr = pIWDFDevice-&amp;gt;PostEvent(WPD_EVENT_NOTIFICATION, WdfEventBroadcast, pBuffer, cbBuffer);&lt;br&gt;}&lt;br&gt;&lt;br&gt;// Cleanup ...&lt;br&gt;CoTaskMemFree(pBuffer);&lt;br&gt;pBuffer = NULL;&lt;br&gt;&lt;br&gt;&lt;/pre&gt;&lt;/span&gt;
&lt;p&gt;&lt;b&gt;&lt;/b&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Defining a Custom WPD Event (and&amp;nbsp;adding it to WpdInfo/WpdMon's Vocab!)&lt;/b&gt;&lt;/p&gt;
&lt;p mce_keep="true"&gt;WPD's extensibility mechanism allows for custom events to be defined very easily.&amp;nbsp;&amp;nbsp; You define a new GUID for your custom event, and define&amp;nbsp;PROPERTYKEYs for your event parameters (or reuse existing PROPERTYKEYs).&amp;nbsp;&amp;nbsp; On the application side, check for this custom event GUID the same way as you handle a WPD event, and&amp;nbsp;process the event.&amp;nbsp;&amp;nbsp; Your driver should also report these new event(s) when&amp;nbsp;responding to WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_EVENTS and WPD_COMMAND_CAPABILITIES_GET_EVENT_OPTIONS.&lt;/p&gt;
&lt;p mce_keep="true"&gt;Both the WPDInfo and WPDMon WDK tools&amp;nbsp;can receive and display custom WPD events in the raw GUID form, which means you already have a handy way to validate your driver's event posting functionality without needing to write a WPD application.&amp;nbsp; &lt;/p&gt;
&lt;p mce_keep="true"&gt;You can even "teach" our tools to translate the custom event GUID to&amp;nbsp;its symbolic name.&amp;nbsp;&amp;nbsp;&amp;nbsp;This can be done by adding an entry&amp;nbsp;to&amp;nbsp;the&amp;nbsp;&lt;i&gt;WpdInfo.GUIDs&lt;/i&gt; file (this is a text file usually located in the same folder path as the tool exes), and&amp;nbsp;restarting the tools to reload this file.&amp;nbsp;&amp;nbsp; In a similar way, symbolic names for your custom&amp;nbsp;PROPERTYKEYs&amp;nbsp;can go into&amp;nbsp;&lt;i&gt;WpdInfo.Properties &lt;/i&gt;file, custom commands&amp;nbsp;in &lt;i&gt;WpdInfo.Commands&lt;/i&gt;, etc.&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p mce_keep="true"&gt;It's important to note that updating these WpdInfo.* dictionary files only enables the WPD tools&amp;nbsp;in your PC&amp;nbsp;to translate custom GUIDs and PROPERTYKEYs to symbolic string like names,&amp;nbsp;other WPD applications and drivers know nothing on these custom values that are &lt;b&gt;specific &lt;/b&gt;to your driver and&amp;nbsp;application.&lt;/p&gt;
&lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p mce_keep="true"&gt;&lt;i&gt;This posting is provided "AS IS" with no warranties, and confers no rights.&lt;/i&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1896911" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/wpdblog/archive/tags/WDK/default.aspx">WDK</category><category domain="http://blogs.msdn.com/wpdblog/archive/tags/Tools/default.aspx">Tools</category></item><item><title>WPDMon Gotchas</title><link>http://blogs.msdn.com/wpdblog/archive/2007/02/05/wpdmon-gotchas.aspx</link><pubDate>Tue, 06 Feb 2007 02:40:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1607554</guid><dc:creator>wpdblog</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/wpdblog/comments/1607554.aspx</comments><wfw:commentRss>http://blogs.msdn.com/wpdblog/commentrss.aspx?PostID=1607554</wfw:commentRss><description>&lt;p&gt;If you're developing a WPD driver or a WPD application, you may have come across the &lt;a href="http://msdn.microsoft.com/en-us/library/dd419923.aspx" title="Introduction to WPDMon" mce_href="http://msdn.microsoft.com/en-us/library/dd419923.aspx"&gt;WPD Monitor tool&lt;/a&gt; (a.k.a. WpdMon).&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;This is a tool that displays WPD&amp;nbsp;traffic between applications and&amp;nbsp;a&amp;nbsp;WPD driver for diagnostic purposes.&amp;nbsp;&amp;nbsp; Plug and Play (PnP) messages&amp;nbsp;and Raw&amp;nbsp;(DeviceIoControl) traffic are also viewable.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;WpdMon is available in the Windows Driver Kits, e.g. c:\WinDDK\6000\tools\wpd\x86.&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;u&gt;Known issues in WpdMon&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Issue #1 WPDMon.exe is not showing any traces&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Make sure that you have installed WpdMon according to the instructions in WpdMon.htm (also found under e.g.&amp;nbsp;c:\WinDDK\6000\tools\wpd\x86).&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1. Ensure that all WPD devices are unplugged &lt;br&gt;2. For 32-bit systems, copy the Shim DLL to the AppPatch directory (“copy WpdMonShim.dll %windir%\AppPatch”) from an&amp;nbsp;Administrator Command Prompt.&amp;nbsp; On 64-bit systems, copy the Shim DLL to the AppPatch64 directory (“copy WpdMonShim.dll %windir%\AppPatch\AppPatch64”)&lt;br&gt;3. Register the shim (“Regsvr32 %windir%\AppPatch\WpdMonShim.dll” for 32-bit, or “Regsvr32 %windir%\AppPatch\AppPatch&lt;b&gt;64&lt;/b&gt;\WpdMonShim.dll” for 64-bit) from an&amp;nbsp;Administrator Command Prompt.&amp;nbsp;&lt;br&gt;4. Plug WPD devices back in &lt;br&gt;5. The WPD Monitor Application (WpdMon.exe) is now ready to capture WPD API/DDI traffic, and can be copied and run directly from any directory.&amp;nbsp; It requires administrator privileges, so you need to right click on WpdMon.exe from Explorer and select "Run Elevated", or launch WpdMon from an Administrator Command Prompt.&lt;br&gt;&lt;/p&gt;
&lt;p mce_keep="true"&gt;&lt;b&gt;Issue #2&amp;nbsp; I've installed WpdMon according to the instructions in WpdMon.htm, but I still can't see any traces&lt;/b&gt;&lt;/p&gt;
&lt;p mce_keep="true"&gt;Ensure that you've launched WpdMon with Administrator privileges.&amp;nbsp;&amp;nbsp;&amp;nbsp; Either right click on the WpdMon.exe from Explorer and select "Run Elevated", or launch WpdMon from an Administrator Command Prompt.&lt;/p&gt;
&lt;p mce_keep="true"&gt;Ensure that you have &lt;i&gt;Monitor -&amp;gt;&amp;nbsp;API Traffic&lt;/i&gt; checked to enable WPD API tracing.&lt;/p&gt;
&lt;p mce_keep="true"&gt;If you have a Root Enumerated WPD device (such as one of the WPD driver samples from the WDK) running before WpdMon was installed, the Windows User Mode Driver Framework (WUDF) driver process (WUDFHost.exe) is still running,&amp;nbsp;&amp;nbsp;&amp;nbsp; You'll need to force WUDFHost.exe process&amp;nbsp;to restart so that the WpdMonShim dll can load:&lt;/p&gt;
&lt;p mce_keep="true"&gt;1. Launch WpdMon.exe with Administrator privileges&lt;br&gt;2. From Device Manager, select the WPD device (under Portable Devices)&lt;br&gt;3. Right click "Disable" to disable the WPD device&lt;br&gt;4. Right click "Enable" to re-enable the WPD device&lt;br&gt;5. WpdMon.exe should now show traces&lt;br&gt;&lt;/p&gt;
&lt;p mce_keep="true"&gt;&lt;b&gt;Issue #3&amp;nbsp; I see a lot of traces in WpdMon and would like to save them to a file, but the "File -&amp;gt;&amp;nbsp;Save Viewer Output As" dialog keeps getting out of scope&lt;/b&gt;&lt;/p&gt;
&lt;p mce_keep="true"&gt;WpdMon logs to both the window and a &lt;i&gt;Wpdmon.htm&lt;/i&gt; file, both in the same directory&amp;nbsp;as WpdMon.exe.&amp;nbsp;&amp;nbsp; Sometimes when there is a lot of WPD API traffic going on, the WpdMon window would update rapidly and grab the window focus from the File-&amp;gt;Save As dialog.&lt;/p&gt;
&lt;p mce_keep="true"&gt;There are two ways to get around this:&lt;/p&gt;
&lt;p mce_keep="true"&gt;1. Uncheck "Log to Viewer" from the Options menu to disable logging to Window, or&lt;/p&gt;
&lt;p mce_keep="true"&gt;2. If you need the Viewer output, uncheck "Auto Scroll Viewer Output" from the Options menu to disable the scrolling.&amp;nbsp;&amp;nbsp;You will have to scroll down manually to view the latest traces.&amp;nbsp;&lt;/p&gt;
&lt;p mce_keep="true"&gt;&lt;b&gt;Setting up WpdMon.ini&lt;/b&gt;&lt;/p&gt;
&lt;p mce_keep="true"&gt;You can configure default WpdMon settings by modifying the WpdMon.ini file.&amp;nbsp;&amp;nbsp;&amp;nbsp;This is useful in situations where you want WpdMon to log to&amp;nbsp;HTML&amp;nbsp;silently, for example.&lt;/p&gt;
&lt;p mce_keep="true"&gt;1. Close WpdMon&lt;br&gt;2. Open WpdMon.ini in a text editor (e.g. Notepad)&lt;br&gt;3. Under the [General] section, set the following options (0=disable, 1=enable).&lt;/p&gt;
&lt;p mce_keep="true"&gt;LogToViewer=0&lt;br&gt;LogToHTMLFile=1&lt;/p&gt;
&lt;p mce_keep="true"&gt;4. Reopen WpdMon&amp;nbsp;&lt;/p&gt;
&lt;p mce_keep="true"&gt;WpdMon.ini also contains settings to disable/enable API, Raw and PnP tracing by default.&amp;nbsp; You can set &lt;i&gt;Enabled=1&lt;/i&gt; under each parser section (e.g. [APIParser]) to enable the WPD API traces.&amp;nbsp;&amp;nbsp; &lt;i&gt;Enabled=0&lt;/i&gt; will disable the API tracing.&amp;nbsp;&amp;nbsp; You can turn this on/off dynamically while WpdMon is running, to start and stop the tracing.&lt;/p&gt;
&lt;p mce_keep="true"&gt;&lt;b&gt;Issue #4&amp;nbsp; I lost the instructions since WpdMon.exe overwrote the tool readme:&lt;/b&gt;&lt;/p&gt;
&lt;p mce_keep="true"&gt;WpdMon automatically saves traces to WpdMon.htm.&amp;nbsp; Unfortunately, this file bears the same name as the tool readme and will overwrite the readme when WpdMon.exe is launched.&amp;nbsp; You may want to save a copy of the original WpdMon.htm as backup &lt;i&gt;before &lt;/i&gt;running WpdMon, or refer to an identical copy from a different OS architecture that was not overwritten, e.g. in c:\WinDDK\6000\tools\wpd\&lt;i&gt;amd64\&lt;/i&gt;wpdmon.htm).&amp;nbsp;&amp;nbsp; &lt;br&gt;&lt;/p&gt;
&lt;p mce_keep="true"&gt;&lt;b&gt;Issue #5&amp;nbsp; WpdMon keeps logging even after I've closed my WPD application&lt;/b&gt;&lt;/p&gt;
&lt;p mce_keep="true"&gt;Sometimes when WpdMon captures and processes a lot of realtime&amp;nbsp;WPD traffic, there can be a delay between the actual WPD operation and tracing display.&amp;nbsp;&amp;nbsp;&amp;nbsp; This is normal as the window may take some time to display all the traces.&amp;nbsp;&amp;nbsp; You can speed things up by minimizing the WpdMon window, and then clicking on something else in Explorer so that the WpdMon is not in focus.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p mce_keep="true"&gt;Once the&amp;nbsp;minimized WpdMon window stops flickering,&amp;nbsp;restore the window, and&amp;nbsp;scroll down to refresh it.&lt;/p&gt;
&lt;p mce_keep="true"&gt;If you still see&amp;nbsp;intermittent traffic, it is possibly because other WPD applications (e.g. Explorer via the WPD Shell Namespace Extension or Windows Media Player) are communciating with your driver/device.&lt;/p&gt;
&lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p mce_keep="true"&gt;&lt;b&gt;Still can't get WpdMon to show API traces for debugging your driver?&amp;nbsp;&lt;/b&gt;&lt;/p&gt;
&lt;p mce_keep="true"&gt;If you are developing a WPD driver and need tracing information, a good alternative is to convert your driver traces to WPP tracing.&amp;nbsp;&amp;nbsp; &lt;a href="http://blogs.msdn.com/wpdblog/archive/2007/04/01/driver-dev-guide-using-wpp-tracing-in-your-wpd-driver.aspx" class="" title="Adding WPP Tracing in your WPD Driver" mce_href="http://blogs.msdn.com/wpdblog/archive/2007/04/01/driver-dev-guide-using-wpp-tracing-in-your-wpd-driver.aspx"&gt;This post&lt;/a&gt; describes how to migrate the CHECK_HR macro used in our sample drivers to use WPP traces "under the covers", and should provide you with a good start for adopting WPP for your driver logging needs.&lt;/p&gt;
&lt;p mce_keep="true"&gt;&lt;br&gt;&amp;nbsp;&lt;/p&gt;
&lt;p minmax_bound="true"&gt;&lt;i minmax_bound="true"&gt;This posting is provided "AS IS" with no warranties, and confers no rights.&lt;/i&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1607554" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/wpdblog/archive/tags/WDK/default.aspx">WDK</category><category domain="http://blogs.msdn.com/wpdblog/archive/tags/Tools/default.aspx">Tools</category></item><item><title>Debugging Your WPD Driver with Visual Studio 8</title><link>http://blogs.msdn.com/wpdblog/archive/2007/02/01/debugging-your-wpd-driver-with-visual-studio-8.aspx</link><pubDate>Fri, 02 Feb 2007 00:12:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1576725</guid><dc:creator>wpdblog</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/wpdblog/comments/1576725.aspx</comments><wfw:commentRss>http://blogs.msdn.com/wpdblog/commentrss.aspx?PostID=1576725</wfw:commentRss><description>&lt;p&gt;WPD drivers are based on the Windows Driver Foundation (WDF) – User-Mode Driver Framework (UMDF) platform. UMDF drivers provide greater stability and security than kernel-mode drivers while providing comparable performance. And, UMDF drivers allow the use of user-mode debuggers such as Visual Studio 8. (Debugging a driver in user-mode tends to be faster than debugging in kernel-mode because an error only affects the current process rather than the entire computer.)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;General Visual Studio 8 Debugging Tips&lt;br&gt;&lt;/b&gt;Once your driver is installed, you can create a debugging project in Visual Studio 8 by following these steps:&lt;/p&gt;
&lt;p&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Open Visual Studio 8 and select “File/New/Project from Existing Code…” menu.&lt;/p&gt;
&lt;p&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Follow the steps in the “Welcome to the Create Project form Existing Code Files Wizard” (specifying the language, the location of your driver source files, a project name, and so on).&lt;/p&gt;
&lt;p&gt;3.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Open your newly created project.&lt;/p&gt;
&lt;p&gt;4.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Select the “Debug/Attach to Process…” menu and then choose WudfHost.exe in the list of Available Processes that appears in the “Attach to Process” dialog.&lt;/p&gt;
&lt;p&gt;Once you complete the above steps, you can begin setting breakpoints in your driver’s source code and debug your driver.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Tips for Debugging WPD Driver Initialization Code&lt;br&gt;&lt;/b&gt;A WPD driver’s initialization code (for example, the code found in WpdBaseDriver::Initialize() in the two WPD sample drivers that ship with the Windows Driver Kit), executes during the installation of your driver. In order to debug this initialization code, you’ll need to accomplish the following tasks:&lt;/p&gt;
&lt;p&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Create a debugging project in Visual Studio 8 (as described in the previous section).&lt;/p&gt;
&lt;p&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Open an instance of regedit.exe and specify a delay period (in seconds) for the WudfHost.exe process. This delay is specified using the following key: \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WUDF\Services\{193a…}\HostProcessDbgBreakOnStart&lt;/p&gt;
&lt;p&gt;3.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Force the WUDFHost.exe process to reload.&amp;nbsp; This can be done in a couple of ways, depending on what your device configuration is:&lt;/p&gt;
&lt;p&gt;a)&amp;nbsp;&amp;nbsp; From Device Manager, Disable and then Enable your device's WPD devnode&lt;/p&gt;
&lt;p&gt;b)&amp;nbsp;&amp;nbsp; If your device has a physical connection to the PC, unplug and then re-reconnect your device.&lt;/p&gt;
&lt;p&gt;4.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Upon driver reload, start Visual Studio 8, open your debug project, and attach to the WudfHost.exe process.&amp;nbsp;&amp;nbsp; As a side effect, you may see Device Manager hanging when you reload the driver,&amp;nbsp;while WudfHost.exe is waiting for a debugger to connect.&lt;/p&gt;
&lt;p&gt;The delay which you set for the …\HostProcessDbgBreakOnStart value provides the necessary time to start the debugger prior to the installation of your driver. (For example, a value of 0x00000040 would delay the installation for 64 seconds.) This delay allows you time to attach to the process, set a breakpoint in your initialization code, and begin debugging.&lt;/p&gt;
&lt;p&gt;For more information about the &lt;b&gt;HostProcessDbgBreakOnStart&lt;/b&gt; value, refer to &lt;a href="http://msdn.microsoft.com/en-us/library/aa510985.aspx" mce_href="http://msdn.microsoft.com/en-us/library/aa510985.aspx"&gt;this MSDN topic&lt;/a&gt;. &lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;b&gt;Update [August 7, 2009]:&lt;/b&gt;&amp;nbsp; The WDF team has provided an excellent tool that makes debugging both kernel mode and user mode WDF drivers much easier. The WDFVerifier is available in the &lt;a href="http://www.microsoft.com/whdc/devtools/WDK/default.mspx" mce_href="http://www.microsoft.com/whdc/devtools/WDK/default.mspx"&gt;Windows Driver Kit&lt;/a&gt; (WDK). For details, refer to the &lt;a href="http://msdn.microsoft.com/en-us/library/cc264238.aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc264238.aspx"&gt;WDFVerifier&lt;/a&gt; MSDN page. In addition, we recommend these in-depth posts by &lt;a href="http://blogs.msdn.com/bobkjelgaard/default.aspx" mce_href="http://blogs.msdn.com/bobkjelgaard/default.aspx"&gt;Bob Kjelgaard&lt;/a&gt;, an SDET from the WDF team, covering basic and advanced usages of WdfVerifier:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://blogs.msdn.com/bobkjelgaard/archive/2007/10/08/wdfverifier-basics-assistance-in-debugging-umdf-drivers.aspx" mce_href="http://blogs.msdn.com/bobkjelgaard/archive/2007/10/08/wdfverifier-basics-assistance-in-debugging-umdf-drivers.aspx"&gt;WdfVerifier Basics&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://blogs.msdn.com/bobkjelgaard/archive/2007/10/26/remote-usage-of-wdfverifier-benefits-pitfalls-and-common-problems.aspx" mce_href="http://blogs.msdn.com/bobkjelgaard/archive/2007/10/26/remote-usage-of-wdfverifier-benefits-pitfalls-and-common-problems.aspx"&gt;Remote usage of WdfVerifier - Benefits, Pitfalls and Common Problems&lt;/a&gt;&lt;br&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p mce_keep="true"&gt;&amp;nbsp; &lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;This posting is provided "AS IS" with no warranties, and confers no rights.&lt;/i&gt;&lt;br&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1576725" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/wpdblog/archive/tags/WDK/default.aspx">WDK</category><category domain="http://blogs.msdn.com/wpdblog/archive/tags/Tools/default.aspx">Tools</category></item><item><title>Building Driver Samples from the WDK</title><link>http://blogs.msdn.com/wpdblog/archive/2007/01/31/building-driver-samples-from-the-wdk.aspx</link><pubDate>Wed, 31 Jan 2007 10:37:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1563058</guid><dc:creator>wpdblog</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/wpdblog/comments/1563058.aspx</comments><wfw:commentRss>http://blogs.msdn.com/wpdblog/commentrss.aspx?PostID=1563058</wfw:commentRss><description>&lt;p&gt;&lt;b&gt;Help!&amp;nbsp;The WPD&amp;nbsp;driver sample doesn't build!&amp;nbsp;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Seeing this error while building the WPD driver samples&amp;nbsp;using the Windows Driver Kit&amp;nbsp;(WDK)&amp;nbsp;build environment?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p mce_keep="true"&gt;errors in directory c:\winddk\6000\src\umdf\wpd\wpdhelloworlddriver&lt;br&gt;NMAKE : fatal error U1073: don't know how to make 'C:\WinDDK\6000\lib\mfc\i386\atls.lib'&lt;br&gt;nmake.exe /nologo BUILDMSG=Stop. -i BUILD_PASS=PASS2 LINKONLY=1 NOPASS0=1 MAKEDLL=1 MAKEDIR_RELATIVE_TO_BASEDIR=src\umdf\wpd\wpdhelloworlddriver MAKEDIR_LOWERCASE=c:\winddk\6000\src\umdf\wpd\wpdhelloworlddriver failed - rc = 2&lt;/p&gt;&lt;/blockquote&gt;
&lt;p mce_keep="true"&gt;No worries, this is expected.&amp;nbsp; The is because the WDK build environment provides an older&amp;nbsp;version of the ATL libraries than what WPD needs.&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p mce_keep="true"&gt;To build the WPD driver samples provided with the WDK, follow these&amp;nbsp;&lt;a href="http://msdn.microsoft.com/en-us/library/aa973571.aspx" title="Build Instructions" mce_href="http://msdn.microsoft.com/en-us/library/aa973571.aspx"&gt;step-by-step instructions&lt;/a&gt;&amp;nbsp;(MSDN library section: &lt;i&gt;"Win32 and COM Development\Windows Driver Kit\Device and Driver Technology\Portable Devices\Windows Portable Devices\WPD Programming Guide\Familiarizing Yourself with the Sample Driver"&lt;/i&gt; ).&lt;/p&gt;
&lt;p mce_keep="true"&gt;In a nutshell, you will&amp;nbsp;need to&amp;nbsp;install Visual Studio 2005, and&amp;nbsp;reference the ATL libraries&amp;nbsp;from there.&amp;nbsp;&amp;nbsp;This build environment configuration only needs to be done the first time, and you'll be good to go&amp;nbsp;for building our sample drivers.&lt;/p&gt;
&lt;p mce_keep="true"&gt;&lt;b&gt;Update [August 7, 2009]: &lt;/b&gt;The ATL-related build issues in the first section have finally been
addressed in the WDK for Windows 7 (a.k.a WDK 7.0.0).&amp;nbsp; You can get the
latest WDK &lt;a href="http://www.microsoft.com/whdc/DevTools/WDK/WDKpkg.mspx" mce_href="http://www.microsoft.com/whdc/DevTools/WDK/WDKpkg.mspx"&gt;here&lt;/a&gt;. To build the drivers, simply type "build -cZ" or "bcz" from the WDK command window for the target OS of your choice. See &lt;a href="http://www.microsoft.com/whdc/devtools/wdk/RelNotesW7.mspx#EHJAE" mce_href="http://www.microsoft.com/whdc/devtools/wdk/RelNotesW7.mspx#EHJAE"&gt;this WDK 7.0.0 RTM release note&lt;/a&gt; for the complete list of build environments and target operating systems applicable to the WPD driver samples. &lt;br&gt;&lt;/p&gt;&lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt;&lt;p mce_keep="true"&gt;&lt;b&gt;Which sample should I use?&lt;/b&gt;&amp;nbsp;&lt;/p&gt;
&lt;p mce_keep="true"&gt;To&amp;nbsp;get a running start on writing a WPD driver, we recommend using the &lt;b&gt;WpdHelloWorldDriver&lt;/b&gt; as a template, it covers some basic driver functionality such as retrieving properties,&amp;nbsp;enumeration, and reporting device capabilities.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p mce_keep="true"&gt;More advanced driver functionality is demonstrated by&amp;nbsp;the &lt;b&gt;WpdWudfSampleDriver&lt;/b&gt; (a.k.a. the&amp;nbsp;WPD Comprehensive Sample Driver),&amp;nbsp;such as driver-initiated events,&amp;nbsp;object management, and content&amp;nbsp;transfer.&amp;nbsp; On Windows Vista, this sample driver is also visible from Windows Image Acquisition (WIA) camera applications (using the WPD-WIA compatibility layer).&amp;nbsp; More on&amp;nbsp;WIA in future posts....&lt;/p&gt;&lt;p mce_keep="true"&gt;To develop a WPD driver that enumerates in Windows Media Player 11, you can start with the &lt;b&gt;WpdWudfSampleDriver &lt;/b&gt;with &lt;a href="http://blogs.msdn.com/wpdblog/archive/2007/05/08/getting-a-wpd-sample-driver-working-with-windows-media-player-11.aspx" title="Getting the WpdWudfSampleDriver enumerating in WMP11" mce_href="http://blogs.msdn.com/wpdblog/archive/2007/05/08/getting-a-wpd-sample-driver-working-with-windows-media-player-11.aspx"&gt;a few extra modifications&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;
&lt;p mce_keep="true"&gt;&lt;b&gt;Update [August 7, 2009]:&amp;nbsp;&lt;/b&gt; The WDK 7.0.0 now contains an updated &lt;b&gt;WpdWudfSampleDriver&lt;/b&gt; sample that supports enumeration in Windows Media Player.&lt;/p&gt;&lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt;&lt;p mce_keep="true"&gt;&lt;b&gt;Known issues in the sample drivers&lt;/b&gt;&lt;/p&gt;
&lt;p mce_keep="true"&gt;Both sample drivers do&amp;nbsp;not enumerate&amp;nbsp;in Windows Media Device Manager (WMDM) applications (such as Windows Media Player) by default. &amp;nbsp; See the previous section for an example of enabling that with the comprehensive sample driver.&lt;/p&gt;
&lt;p mce_keep="true"&gt;Both sample drivers install as "root enumerated" devices, i.e. they install using the Add Legacy Hardware option.&amp;nbsp; Hence, they are shown as always connected in Device Manager.&amp;nbsp;&amp;nbsp; While this provides an&amp;nbsp;easy way to install&amp;nbsp;and test a&amp;nbsp;device driver,&amp;nbsp;this means that certain Plug-and-Play functionality may&amp;nbsp;not be available&amp;nbsp;(such as Autoplay in Windows Vista).&amp;nbsp;&amp;nbsp;&amp;nbsp;To&amp;nbsp;enable Autoplay, one way is to install and configure&amp;nbsp;a bus driver for your device (for a sample, refer to the Toaster Bus Driver in the WDK).&lt;/p&gt;
&lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt;&lt;p mce_keep="true"&gt;&lt;b&gt;What tools can I use? &lt;/b&gt;&lt;/p&gt;
&lt;p mce_keep="true"&gt;During development, we highly recommend&amp;nbsp;using the &lt;a href="http://msdn.microsoft.com/en-us/library/aa973613.aspx" title="Wpd Information Tool" mce_href="http://msdn.microsoft.com/en-us/library/aa973613.aspx"&gt;WpdInfo&lt;/a&gt;&amp;nbsp;GUI tool, which uses the WPD API&amp;nbsp;to access your driver.&amp;nbsp;&amp;nbsp;You can&amp;nbsp;query driver&amp;nbsp;capabilities, browse the object tree, send raw WPD commands, update properties, etc.&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p mce_keep="true"&gt;Other useful WPD tools:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div mce_keep="true"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa973612.aspx" title="WPDDeviceInspector" mce_href="http://msdn.microsoft.com/en-us/library/aa973612.aspx"&gt;WPD Device Inspector&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div mce_keep="true"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa973614.aspx" title="WPDMon" mce_href="http://msdn.microsoft.com/en-us/library/aa973614.aspx"&gt;WPD Monitor&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p mce_keep="true"&gt;All these tools are developed in-house, and used extensively by us for development and troubleshooting. :)&lt;/p&gt;
&lt;p mce_keep="true"&gt;&lt;b&gt;Basic driver requirements&lt;/b&gt;&lt;/p&gt;
&lt;p mce_keep="true"&gt;This &lt;a href="http://www.microsoft.com/whdc/device/media/WPDguide.mspx" class="" title="WPD Basic Driver Requirements" mce_href="http://www.microsoft.com/whdc/device/media/WPDguide.mspx"&gt;whitepaper&lt;/a&gt; lists basic requirements that your driver should satisfy to work well with most WPD applications,&amp;nbsp;such as the required properties that a particular&amp;nbsp;object content&amp;nbsp;type should support.&amp;nbsp;&amp;nbsp; These requirements are also implemented as logo tests for the Windows Vista Cellular Handset Basic Logo for Windows Logo Program v3, but are generic enough to apply to any WPD driver.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;br&gt;&lt;/p&gt;&lt;p mce_keep="true"&gt;&lt;i&gt;This posting is provided "AS IS" with no warranties, and confers no rights.&lt;/i&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1563058" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/wpdblog/archive/tags/WDK/default.aspx">WDK</category><category domain="http://blogs.msdn.com/wpdblog/archive/tags/Tools/default.aspx">Tools</category><category domain="http://blogs.msdn.com/wpdblog/archive/tags/Issues/default.aspx">Issues</category></item></channel></rss>