<?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 : DRM</title><link>http://blogs.msdn.com/wpdblog/archive/tags/DRM/default.aspx</link><description>Tags: DRM</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>New Driver and Application Whitepapers Are Here</title><link>http://blogs.msdn.com/wpdblog/archive/2007/05/07/wpd-whitepapers.aspx</link><pubDate>Mon, 07 May 2007 21:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2466855</guid><dc:creator>wpdblog</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/wpdblog/comments/2466855.aspx</comments><wfw:commentRss>http://blogs.msdn.com/wpdblog/commentrss.aspx?PostID=2466855</wfw:commentRss><description>&lt;P&gt;We've published two new WPD developer-centric&amp;nbsp;whitepapers at the Microsoft WHDC website for WinHEC.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first&amp;nbsp;covers how to do WMDRM metering and license synchronization from a WPD application; the second&amp;nbsp;describes how to port the existing WPD "Hello World" sample driver to communicate with a Parallax Basic Stamp II microcontroller to&amp;nbsp;read temperature sensor data.&amp;nbsp;&amp;nbsp; Both contain sample code.&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;I. Accessing WMDRM APIs from a WPD Application:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.microsoft.com/whdc/device/media/WMDRM_API.mspx" mce_href="http://www.microsoft.com/whdc/device/media/WMDRM_API.mspx"&gt;http://www.microsoft.com/whdc/device/media/WMDRM_API.mspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;This whitepaper describes how to associate a WPD device instance with a WMDM device instance for MTP devices; the WMDM device instance is then&amp;nbsp;used&amp;nbsp;for calling Windows Media Digital Rights Management (WMDRM) application interfaces. To&amp;nbsp;build the sample WPD application, you need the Windows Media Format SDK v11 and the Windows SDK (v6000).&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;II. Creating a WPD Driver for a Microcontroller-Based Sensor:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.microsoft.com/whdc/device/media/WPD_drv.mspx" mce_href="http://www.microsoft.com/whdc/device/media/WPD_drv.mspx"&gt;http://www.microsoft.com/whdc/device/media/WPD_drv.mspx&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;This sample is based on the Parallax Basic Stamp II microcontroller to provide an example of a simple hardware device that&amp;nbsp;can have a WPD driver for it.&amp;nbsp;&amp;nbsp; Parallax provides an &lt;A class="" title="Basic Stamp Activity Kit for Windows Portable Devices" href="http://www.parallax.com/detail.asp?product_id=910-90005" mce_href="http://www.parallax.com/detail.asp?product_id=910-90005"&gt;activity kit&lt;/A&gt; that contains the hardware components for this sample&amp;nbsp;driver.&amp;nbsp; To&amp;nbsp;build the driver,&amp;nbsp;you need the&amp;nbsp;Windows Driver Kit&amp;nbsp;(v6000).&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;References&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;All WPD-related whitepapers are posted &lt;A class="" title="Windows Portable Devices Whitepapers" href="http://www.microsoft.com/whdc/device/netAttach/default.mspx" mce_href="http://www.microsoft.com/whdc/device/netAttach/default.mspx"&gt;here&lt;/A&gt;.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;A class="" title="Downloading WPD for Development" href="http://blogs.msdn.com/controlpanel/blogs/To%20download%20the%20pre-requisities,%20see%20http://blogs.msdn.com/wpdblog/pages/downloading-wpd-for-development.aspx" mce_href="To download the pre-requisities, see http://blogs.msdn.com/wpdblog/pages/downloading-wpd-for-development.aspx"&gt;More information&lt;/A&gt; on downloading the various SDKs.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;EM&gt;&lt;/EM&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;This posting is provided "AS IS" with no warranties, and confers no rights.&lt;/EM&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2466855" 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/WDK/default.aspx">WDK</category><category domain="http://blogs.msdn.com/wpdblog/archive/tags/WMDM/default.aspx">WMDM</category><category domain="http://blogs.msdn.com/wpdblog/archive/tags/DRM/default.aspx">DRM</category></item><item><title>Working with WMDRM Protected Content using WPD</title><link>http://blogs.msdn.com/wpdblog/archive/2007/02/09/working-with-wmdrm-protected-content-using-wpd.aspx</link><pubDate>Sat, 10 Feb 2007 02:55:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1638560</guid><dc:creator>wpdblog</dc:creator><slash:comments>11</slash:comments><comments>http://blogs.msdn.com/wpdblog/comments/1638560.aspx</comments><wfw:commentRss>http://blogs.msdn.com/wpdblog/commentrss.aspx?PostID=1638560</wfw:commentRss><description>&lt;p&gt;&lt;b&gt;Setting up your WPD&amp;nbsp;application to handle protected&amp;nbsp;WMDRM content&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The WPD API supports the transfer and licensing&amp;nbsp;operations for &lt;a href="http://www.microsoft.com/windows/windowsmedia/forpros/drm/default.mspx" class="" title="WMDRM" mce_href="http://www.microsoft.com/windows/windowsmedia/forpros/drm/default.mspx"&gt;Windows Media Digital Rights Management&lt;/a&gt; (WMDRM) content.&lt;/p&gt;
&lt;p&gt;This &lt;a href="http://msdn.microsoft.com/en-us/library/dd375717%28VS.85%29.aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd375717(VS.85).aspx"&gt;MSDN article&lt;/a&gt; describes&amp;nbsp;two &lt;b&gt;additional &lt;/b&gt;properties that are required to enable your WPD application to transfer protected content.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;table rules="rows" border="0" cols="2" frame="below"&gt;
&lt;tbody&gt;
&lt;tr valign="top"&gt;
&lt;td class="blue" width="50%"&gt;&lt;b&gt;Property&lt;/b&gt;&lt;/td&gt;
&lt;td class="blue" width="20%"&gt;&lt;b&gt;Vartype&lt;/b&gt;&lt;/td&gt;
&lt;td class="blue" width="30%"&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign="top"&gt;
&lt;td width="50%"&gt;WPD_CLIENT_WMDRM_APPLICATION_PRIVATE_KEY &lt;/td&gt;
&lt;td width="20%"&gt;VT_VECTOR | VT_UI1 &lt;/td&gt;
&lt;td width="30%"&gt;Specifies the application's private key.&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign="top"&gt;
&lt;td width="50%"&gt;WPD_CLIENT_WMDRM_APPLICATION_CERTIFICATE &lt;/td&gt;
&lt;td width="20%"&gt;VT_VECTOR | VT_UI1 &lt;/td&gt;
&lt;td width="30%"&gt;Specifies the application's certificate.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;To initialize WPD for protected content, call &lt;i&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/dd375690%28VS.85%29.aspx" title="IPortableDevice::Open" mce_href="http://msdn.microsoft.com/en-us/library/dd375690(VS.85).aspx"&gt;IPortableDevice::Open()&lt;/a&gt; &lt;/i&gt;with the above parameters added to the pClientInfo IPortableDeviceValues.&amp;nbsp;&amp;nbsp;If this succeeds, you can use the derived&amp;nbsp;&lt;i&gt;IPortableDeviceContent &lt;/i&gt;interface (from &lt;i&gt;IPortableDevice::Content()&lt;/i&gt;) to transfer protected (and clear)&amp;nbsp;content using &lt;i&gt;IPortableDeviceContent::CreateObjectWithPropertiesAndData().&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;To obtain a private application key and certificate, visit &lt;a href="http://www.microsoft.com/windows/windowsmedia/licensing/Licensing_DRM_Apps.aspx" mce_href="http://www.microsoft.com/windows/windowsmedia/licensing/Licensing_DRM_Apps.aspx"&gt;this link&lt;/a&gt;. &lt;br&gt;&lt;a href="http://www.microsoft.com/windows/windowsmedia/licensing/Licensing_DRM_Apps.aspx"&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Transferring Content&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;To transfer WMDRM protected content, use &lt;i&gt;IPortableDeviceContent::CreateObjectWithPropertiesAndData().&amp;nbsp;&amp;nbsp; &lt;/i&gt;The same CreateObjectWithPropetiesAndData API call can be used for &lt;b&gt;both &lt;/b&gt;protected and clear content without additional&amp;nbsp;options.&amp;nbsp;&amp;nbsp; The WPD API will automatically select the protected or clear channel&amp;nbsp;depending on whether the content is protected or clear.&amp;nbsp;&amp;nbsp;&amp;nbsp;It&amp;nbsp;interfaces with the WMDRM Secure Content Provider to process the WMDRM licenses.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Transferring Known Clear Content&lt;/b&gt;&lt;/p&gt;
&lt;p mce_keep="true"&gt;If you've enabled&amp;nbsp;WPD&amp;nbsp;to handle protected content, but you know that a specific&amp;nbsp;file is not protected, you can tell WPD to skip the DRM processing by&amp;nbsp;setting&amp;nbsp;&lt;a href="http://msdn.microsoft.com/en-us/library/dd375699%28VS.85%29.aspx" title="WPD_API_OPTION_USE_CLEAR_DATA_STREAM" mce_href="http://msdn.microsoft.com/en-us/library/dd375699(VS.85).aspx"&gt;WPD_API_OPTION_USE_CLEAR_DATA_STREAM&lt;/a&gt; option to &lt;b&gt;TRUE &lt;/b&gt;in the input IPortableDeviceValues when calling &lt;i&gt;IPortableDeviceContent::CreateObjectWithPropertiesAndData() &lt;/i&gt;for clear content.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Accessing Metering Operations using IWMDRMDeviceApp&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;WPD&amp;nbsp;provides a mechanism&amp;nbsp;to access the&amp;nbsp;&lt;a href="http://msdn.microsoft.com/en-us/library/bb231938%28VS.85%29.aspx" title="IWMDRMDeviceApp" mce_href="http://msdn.microsoft.com/en-us/library/bb231938(VS.85).aspx"&gt;&lt;i&gt;IWMDRMDeviceApp &lt;/i&gt;APIs&lt;/a&gt; for license updates and metering data retrieval.&amp;nbsp; &lt;b&gt;To access IWMDRMDeviceApp through WPD&lt;/b&gt;, call &lt;i&gt;QueryInterface&lt;/i&gt; on &lt;i&gt;IID_IWMDRMDeviceApp&lt;/i&gt; from the &lt;i&gt;IStream&amp;nbsp;&lt;/i&gt;returned from &lt;i&gt;IPortableDeviceContent::CreateObjectWithPropertiesAndData()&lt;/i&gt;.&amp;nbsp;&amp;nbsp;&amp;nbsp;This IWMDRMDeviceApp instance&amp;nbsp;tied to the&amp;nbsp;IPortableDevice connection to your WMDRM-compatible device, and not the specific content&amp;nbsp;where the IStream was obtained.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WPD internally wraps the metering APIs and makes it accessible to your application.&amp;nbsp;&amp;nbsp; Your application&amp;nbsp;uses a constant for the IWMDMDevice* parameter:&amp;nbsp; &lt;b&gt;WMDRMDEVICEAPP_USE_WPD_DEVICE_PTR&lt;/b&gt;.&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;IStream*&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;pDataStream = NULL;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;IWMDRMDeviceApp* &lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;pWMDRMApp &lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;= NULL;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;// ... Initialization &lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;hr&amp;nbsp;= pPortableDeviceContent-&amp;gt;CreateObjectWithPropertiesAndData(&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;pValues,&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&amp;amp;pDataStream,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;amp;dwOptimalWriteBufferSize,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;NULL);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;// ... Transfer the protected WMDRM content &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;pDataStream-&amp;gt;Write(pData, cbData, &amp;amp;cbWritten);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;pDataStream-&amp;gt;Commit(0);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;hr = pDataStream-&amp;gt;QueryInterface(IID_IWMDRMDeviceApp, &lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (void**)&amp;amp;pWMDRMApp);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;if (SUCCEEDED(hr))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;DWORD dwStatus&amp;nbsp;= 0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=""&gt;&amp;nbsp;&lt;/span&gt;// Call metering operations on the current device using the WPD device pointer&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=""&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=""&gt;&amp;nbsp;&lt;/span&gt;hr = pWMDRMApp-&amp;gt;QueryDeviceStatus((IWMDMDevice *)WMDRMDEVICEAPP_USE_WPD_DEVICE_PTR, &lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&amp;amp;dwStatus);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p mce_keep="true"&gt;The same pre-requisitie with the application private key and certificate applies here as well.&amp;nbsp;&amp;nbsp; If the key/certificate is invalid or if the WMDRM system fails to initialize, the QueryInferface call will fail.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p mce_keep="true"&gt;&lt;b&gt;Update [March 13, 2007]:&lt;/b&gt;&amp;nbsp; The above method to acquire the IWMDRMDeviceApp interface from the IStream pointer is just a &lt;i&gt;convenience&lt;/i&gt; if your application is already doing a &lt;i&gt;prior protected&amp;nbsp;content transfer&lt;/i&gt;&lt;b&gt;,&lt;/b&gt; before proceeding on to do metering and license synchronization operations.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p mce_keep="true"&gt;Our recommendation for most applications that need to access IWMDRMDeviceApp is to initialize IWMDRMDeviceApp directly as this does not require your application&amp;nbsp;to transfer protected content or hold on to the transfer interfaces in order to do device metering and license sync.&amp;nbsp;&amp;nbsp; For details, refer to &lt;a href="http://msdn.microsoft.com/en-us/library/bb231629%28VS.85%29.aspx" title="Handling Protected Content using WMDRMDeviceApp" mce_href="http://msdn.microsoft.com/en-us/library/bb231629(VS.85).aspx"&gt;this MSDN article&lt;/a&gt; entitled "Handling Protected Content in the Application."&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p mce_keep="true"&gt;&lt;b&gt;Update [May 5, 2007]:&amp;nbsp; &lt;/b&gt;The whitepaper (and sample code)&amp;nbsp;on initializing IWMDRMDeviceApp for WPD is&amp;nbsp;now&amp;nbsp;posted &lt;a href="http://www.microsoft.com/whdc/device/media/WMDRM_API.mspx" class="" title="Accessing WMDRM APIs from WPD" mce_href="http://www.microsoft.com/whdc/device/media/WMDRM_API.mspx"&gt;here&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p mce_keep="true"&gt;&amp;nbsp;&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;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1638560" 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/WMDM/default.aspx">WMDM</category><category domain="http://blogs.msdn.com/wpdblog/archive/tags/DRM/default.aspx">DRM</category></item></channel></rss>