<?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>All about Windows Media SDKs</title><link>http://blogs.msdn.com/b/allaboutwmsdks/</link><description>A place of random tidbits for Windows multimedia application developers</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>How to control "Listen to this Device" feature of Windows 7 programmatically?</title><link>http://blogs.msdn.com/b/allaboutwmsdks/archive/2012/05/20/how-to-control-quot-listen-to-this-device-quot-feature-of-windows-7-programmatically.aspx</link><pubDate>Sun, 20 May 2012 07:50:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10307623</guid><dc:creator>Mahatab Ur Rashid</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/b/allaboutwmsdks/archive/2012/05/20/how-to-control-quot-listen-to-this-device-quot-feature-of-windows-7-programmatically.aspx#comments</comments><description>&lt;p&gt;This is not possible - there is no public API available to control “Listen to this Device” feature. The feature can only be controlled by the user in the Sound control panel.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10307623" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/allaboutwmsdks/archive/tags/Audio/">Audio</category></item><item><title>Disclaimer</title><link>http://blogs.msdn.com/b/allaboutwmsdks/archive/2012/05/19/disclaimer.aspx</link><pubDate>Sat, 19 May 2012 20:26:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10307473</guid><dc:creator>Mahatab Ur Rashid</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/b/allaboutwmsdks/archive/2012/05/19/disclaimer.aspx#comments</comments><description>&lt;p&gt;This is a personal weblog. The opinions expressed here represent my own and not those of my employer.&lt;/p&gt;
&lt;p&gt;All code samples are provided "AS IS" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10307473" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/allaboutwmsdks/archive/tags/pages/">pages</category></item><item><title>Why does the NdrClientCall2() API call takes more then 4-5 milliseconds to complete?</title><link>http://blogs.msdn.com/b/allaboutwmsdks/archive/2012/05/19/why-does-the-ndrclientcall2-api-call-takes-more-then-4-5-milliseconds-to-complete.aspx</link><pubDate>Sat, 19 May 2012 20:20:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10307470</guid><dc:creator>Mahatab Ur Rashid</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/b/allaboutwmsdks/archive/2012/05/19/why-does-the-ndrclientcall2-api-call-takes-more-then-4-5-milliseconds-to-complete.aspx#comments</comments><description>&lt;p&gt;&lt;i&gt;Question:&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;Why does the NdrClientCall2() API call takes more then 4-5 milliseconds to complete in my application? In rare cases&amp;nbsp;I even see hundreds of milliseconds (57 millisecond at one time) just for the NdrClientCall2() API call to complete.&lt;/p&gt;
&lt;p&gt;In my application no server side processing is involved. My client and server both are running on the same machine. In either case it is a &lt;i&gt;ncacn_np&lt;/i&gt; operation, both sides are already connected, all the calls should complete with the same (or about same) delays.&lt;/p&gt;
&lt;p&gt;Is it possible to explain what kinds of things might be involved in this delay?&lt;/p&gt;
&lt;p&gt;&lt;i&gt;Answer:&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;For local RPC calls, it is highly recommend that users to use ncalrpc and not ncacn_np. Ncacn_np is primarily for backwards compatibility and new applications should be using ncacn_ip_tcp for remote traffic. If you are using Vista or later,&amp;nbsp;it is recommended to switch to the lower latency fast binding handle path for LRPC. This removes some significant sources of lock contention in the client path, potentially leading to a reduction in delays.&lt;/p&gt;
&lt;p&gt;Please check the links below to know more about the fast RPC binding handle.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;i&gt;RpcBindingCreate &lt;br /&gt;&lt;/i&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa375587(VS.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/aa375587(VS.85).aspx&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;i&gt;RpcBindingBind &lt;br /&gt;&lt;/i&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa375583(VS.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/aa375583(VS.85).aspx&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;i&gt;RpcBindingUnbind &lt;br /&gt;&lt;/i&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa375613(VS.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/aa375613(VS.85).aspx&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;i&gt;RpcBindingFree &lt;br /&gt;&lt;/i&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa375588(VS.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/aa375588(VS.85).aspx&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;On the other hand, the occasional delay is not all that odd. A DPC firing, while the test is executing, can easily cause a 3-4ms delay.&lt;/p&gt;
&lt;p&gt;Also please remember, Windows is not a real time operating system and there is no way to give any upper bound guarantee for NdrClientCall2() API call.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10307470" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/allaboutwmsdks/archive/tags/Others/">Others</category></item><item><title>Why does the TCP three way handshake never tag with DSCP value on Windows XP and Server 2003?</title><link>http://blogs.msdn.com/b/allaboutwmsdks/archive/2012/05/19/why-does-the-tcp-three-way-handshake-never-tag-with-dscp-value-on-windows-xp-and-server-2003.aspx</link><pubDate>Sat, 19 May 2012 20:19:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10307468</guid><dc:creator>Mahatab Ur Rashid</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/b/allaboutwmsdks/archive/2012/05/19/why-does-the-tcp-three-way-handshake-never-tag-with-dscp-value-on-windows-xp-and-server-2003.aspx#comments</comments><description>&lt;p&gt;Question:&lt;/p&gt;
&lt;p&gt;We are trying to introduce QoS into our VOIP services. While working on this we have observed that TCP three way handshake never tag with DSCP value. We have reproduced the issue both in Windows XP and Windows Server 2003 operating systems. My question is why TCP three way handshake never tag with DSCP value? I don&amp;rsquo;t think this is an expected behavior, RFC 2474 mentioned nothing about this.&lt;/p&gt;
&lt;p&gt;Answer:&lt;/p&gt;
&lt;p&gt;On Windows XP and Server 2003, QoS DSCP tagging is applied when a data packet is being sent; depending on the DSCP value supplied by the application or the system-wide setting. During the TCP Handshake, since no data is being sent, DSCP marking is not done. This is an issue in the QoS stack of Windows XP and Server 2003.&lt;/p&gt;
&lt;p&gt;Please note: This issue is fixed in Windows Vista and Windows 7.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10307468" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/allaboutwmsdks/archive/tags/Others/">Others</category></item><item><title>Why does regedit.exe (or any other Microsoft program) crash when I try to create a remote thread into it using the CreateRemoteThread API?</title><link>http://blogs.msdn.com/b/allaboutwmsdks/archive/2012/05/19/why-does-regedit-exe-or-any-other-microsoft-program-crash-when-i-try-to-create-a-remote-thread-into-it-using-the-createremotethread-api.aspx</link><pubDate>Sat, 19 May 2012 20:18:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10307467</guid><dc:creator>Mahatab Ur Rashid</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/b/allaboutwmsdks/archive/2012/05/19/why-does-regedit-exe-or-any-other-microsoft-program-crash-when-i-try-to-create-a-remote-thread-into-it-using-the-createremotethread-api.aspx#comments</comments><description>&lt;p&gt;Question:&lt;/p&gt;
&lt;p&gt;On Windows XP, I am starting regedit.exe in suspended mode and forcing it to call the &lt;i&gt;LoadLibrary&lt;/i&gt;() API to load an external DLL by using the &lt;i&gt;CreateRemoteThread&lt;/i&gt; API. After loading the DLL, when I try to resume the suspended thread, the application terminates. Is this a known issue?&lt;/p&gt;
&lt;p&gt;Answer:&lt;/p&gt;
&lt;p&gt;Creating a remote thread into another process is a poor way to build extensibility into an application. Extendable applications should have some form of an API, a scripting language, plug-in DLL support, etc.&lt;/p&gt;
&lt;p&gt;Regedit.exe was not meant to be extended by any means&amp;mdash;it has no API and no plug-in interface and therefore does not expect to run any code or threads which are not built into it. Therefore, it also is not designed to run properly when another process calls the CreateRemoteThread to start a new thread within it. It may run or it may not. If it runs without a problem, it is only by coincidence.&lt;/p&gt;
&lt;p&gt;In fact, Microsoft strongly discourages using CreateRemoteThread/CreateRemoteThreadEx to start a thread in any process. Its original purpose is to write debuggers and profilers. Even with these tools, creating a thread in another process has a risk that the target process can fail. Although the APIs themselves are documented and they will create a thread in another process (as documented), the effects the new thread has on the target process completely depend on what the target process and the new thread do &amp;ndash; how they interact. It&amp;rsquo;s the latter that causes the all the problems.&lt;/p&gt;
&lt;p&gt;When you create a new thread in a process that doesn&amp;rsquo;t expect it, there are many interactions which can occur. Here are some things that can happen:&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;a. The new thread requires a stack in the application&amp;rsquo;s address space. The application may want that memory for something else. Perhaps the application will fail to make an allocation and then crash because it can&amp;rsquo;t recover from something that should &amp;ldquo;never&amp;rdquo; happen.&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;b. It causes all the DllMain() functions of all the DLLs to get called for DLL_THREAD_ATTACH. One of these could call an API which shouldn&amp;rsquo;t be called from DllMain(), causing a deadlock.&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;c. It causes an extra DLL to get loaded somewhere in the process&amp;rsquo;s address space. It could be that the DLL is loaded into a place where the app wants to allocate memory. The DLL may load at its preferred address space or it may not&amp;mdash;it depends on what is already in the process&amp;rsquo;s memory.&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;d. The application may use the single-threaded CRT (C runtime library) which now could have multiple threads calling it. Since the single-threaded CRT doesn&amp;rsquo;t set up the necessary data structures and locks to handle multiple threads, the CRT can crash.&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;e. The injected code could simply have a bug and cause the application to crash.&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;f. The thread could cause a deadlock if it uses any synchronization objects that other parts of the application use.&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;g. Anti-malware and anti-virus programs may get triggered and kill the target process, especially if it is a known administrative tool that should be prevented from being hacked.&lt;/p&gt;
&lt;p&gt;Microsoft&amp;rsquo;s efforts to make the platform more secure means we invest in technologies like DEP (data execution prevention) which happen to do more than simply prevent someone from executing data. DEP also prevent exception handlers from executing in dynamically allocated code (because malware uses this technique), they may mark portions of the address space as no-access so that a DLL can&amp;rsquo;t be injected, address space layout randomization, required executable signing for kernel-mode modules, etc. Microsoft will continue to improve the security of its products by similar technical means, so there is a greater chance in the future these techniques such as creating remote threads will fail more frequently. (At the same time, a provision is made to allow debuggers to do what they need to do to be useful.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10307467" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/allaboutwmsdks/archive/tags/Others/">Others</category></item><item><title>How to check SLP 1.0 values from the BIOS using Win32 API?</title><link>http://blogs.msdn.com/b/allaboutwmsdks/archive/2012/05/19/how-to-check-slp-1-0-values-from-the-bios-using-win32-api.aspx</link><pubDate>Sat, 19 May 2012 20:14:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10307464</guid><dc:creator>Mahatab Ur Rashid</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/b/allaboutwmsdks/archive/2012/05/19/how-to-check-slp-1-0-values-from-the-bios-using-win32-api.aspx#comments</comments><description>&lt;p&gt;Question:&lt;/p&gt;
&lt;p&gt;Is there any API available to check SLP 1.0 values from the BIOS?&lt;/p&gt;
&lt;p&gt;Answer:&lt;/p&gt;
&lt;p&gt;Yes, you can use EnumSystemFirmwareTables API for that.&lt;/p&gt;
&lt;p&gt;EnumSystemFirmwareTables API enumerates all system firmware tables of the specified type. It supports 3 types of firmware table provider.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The ACPI firmware table provider&lt;/li&gt;
&lt;li&gt;The raw firmware table provider and&lt;/li&gt;
&lt;li&gt;The raw SMBIOS firmware table provider&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Where, the raw firmware table provider ('FIRM') returns a list of DWORD table identifiers. Each identifier corresponds to the beginning of a physical address range. Currently, this provider returns 'C000' and 'E000'. These values correspond to physical memory from 0xC0000 to 0xDFFFF and 0xE0000 to 0xFFFFF, respectively.&lt;/p&gt;
&lt;p&gt;To check values of SLP 1.0 from the BIOS we need to access data from the physical memory location 0xE0000 to 0xFFFFF.&lt;/p&gt;
&lt;p&gt;We also have the following alternatives to read data from low physical memory:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Retrieve the SMBIOS properties using WMI. Many individual properties are contained in the Win32 classes. One can also retrieve the raw SMBIOS data in a single buffer using the MSSMBios_RawSMBiosTables class.&lt;/li&gt;
&lt;li&gt;Use the GetSystemFirmwareTable function to read the raw SMBIOS firmware table.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Links:&lt;/p&gt;
&lt;p&gt;&lt;i&gt;EnumSystemFirmwareTables Function&lt;/i&gt; &lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms724259(VS.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/ms724259(VS.85).aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;GetSystemFirmwareTable Function &lt;br /&gt;&lt;/i&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms724379(VS.85).aspx"&gt;&lt;i&gt;http://msdn.microsoft.com/en-us/library/ms724379(VS.85).aspx&lt;/i&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10307464" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/allaboutwmsdks/archive/tags/Others/">Others</category></item><item><title>Does H264 decoder support low latency mode on Windows 7?</title><link>http://blogs.msdn.com/b/allaboutwmsdks/archive/2012/05/17/h264-decoder-needs-to-support-low-latency.aspx</link><pubDate>Thu, 17 May 2012 10:47:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10306192</guid><dc:creator>Mahatab Ur Rashid</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/b/allaboutwmsdks/archive/2012/05/17/h264-decoder-needs-to-support-low-latency.aspx#comments</comments><description>&lt;p&gt;No, there is no&amp;nbsp;way to put H264 decoder into a low latency mode on Windows 7.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10306192" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/allaboutwmsdks/archive/tags/H264/">H264</category></item><item><title>How to programmatically set WMP the default player of Windows Vista and Windows 7?</title><link>http://blogs.msdn.com/b/allaboutwmsdks/archive/2012/05/17/set-windows-media-player-as-default-in-windows-7-or-vista.aspx</link><pubDate>Thu, 17 May 2012 10:43:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10306191</guid><dc:creator>Mahatab Ur Rashid</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/b/allaboutwmsdks/archive/2012/05/17/set-windows-media-player-as-default-in-windows-7-or-vista.aspx#comments</comments><description>&lt;p&gt;Here is&amp;nbsp;the API that one can use to set the default playback application of Windows Vista and Windows 7: &lt;br /&gt;&lt;br /&gt;IApplicationAssociationRegistration::SetAppAsDefaultAll Method &lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb776338(v=VS.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/bb776338(v=VS.85).aspx&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;This method takes only one parameter - a pointer to a null-terminated Unicode string that specifies the registered name of the application. In this case it will be &amp;ldquo;Windows Media Player&amp;rdquo;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10306191" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/allaboutwmsdks/archive/tags/Windows+Media+Player/">Windows Media Player</category></item><item><title>Silverlight 5 MediaElement does not support PlaybackRate for streaming</title><link>http://blogs.msdn.com/b/allaboutwmsdks/archive/2012/05/08/does-silverlight-5-mediaelement-support-playbackrate-for-streaming.aspx</link><pubDate>Tue, 08 May 2012 09:24:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10302149</guid><dc:creator>Mahatab Ur Rashid</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/b/allaboutwmsdks/archive/2012/05/08/does-silverlight-5-mediaelement-support-playbackrate-for-streaming.aspx#comments</comments><description>&lt;p&gt;Silverlight 5 MediaElement does not support &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.mediaelement.playbackrate(v=VS.96).aspx" target="_blank"&gt;PlaybackRate&lt;/a&gt; for streaming (no MSS or WMS streaming).&amp;nbsp;PlaybackRate is supported only for progressive content.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10302149" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/allaboutwmsdks/archive/tags/Silverlight/">Silverlight</category></item><item><title>Does WIA Automation Layer 2.0 support duplex scan?</title><link>http://blogs.msdn.com/b/allaboutwmsdks/archive/2012/05/01/does-wia-automation-layer-2-0-support-duplex-scan.aspx</link><pubDate>Wed, 02 May 2012 04:21:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10299774</guid><dc:creator>Mahatab Ur Rashid</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;WIA Automation Layer 2.0 doesn&amp;rsquo;t support duplex scan. This is by design.&lt;/p&gt;
&lt;p&gt;WIA Automation Layer 2.0 is based on WIA 1.0. The issue is not related to WIA 1.0, but the way automation layer has been designed to use WIA 1.0 for functionalities.&lt;/p&gt;
&lt;p&gt;Use native WIA 2.0 or WIA 1.0 (preferably 2.0, if the target OS is Windows Vista or newer) directly to avoid this problem.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10299774" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/allaboutwmsdks/archive/tags/WIA+Automation+Layer+2-0/">WIA Automation Layer 2.0</category><category domain="http://blogs.msdn.com/b/allaboutwmsdks/archive/tags/WIA+2-0/">WIA 2.0</category><category domain="http://blogs.msdn.com/b/allaboutwmsdks/archive/tags/WIA+1-0/">WIA 1.0</category></item></channel></rss>