<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.iis.net/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/" xmlns:cs="http://blogs.iis.net/"><channel><title>IIS7 - Media</title><link>http://forums.iis.net/1145.aspx</link><description>Discussions on delivering audio/video media files and best practices for the IIS7 Media Pack features</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: WMS Custom Logging Plugins dont work</title><link>http://forums.iis.net/thread/1904900.aspx</link><pubDate>Wed, 27 May 2009 12:14:42 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1904900</guid><dc:creator>Paul@Prostream</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1904900.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1145&amp;PostID=1904900</wfw:commentRss><description>&lt;p&gt;240 views and no-one has any idea?&lt;/p&gt;
&lt;p&gt;More info on the problem. It seems that it&amp;#39;s not that the buffer is empty, I was wrong about that. If you call NSBuffer.GetLength you can get a size back, but GetBufferAndLength() and GetBuffer() both always return the error. It seems to be a badly worded error message, the real problem is that the IntPtr supplied for it to set to the buffer address is always rejected. It doesnt matter if you supply it uninstantiated, set up a value for it, or use IntPtr.Zero.&lt;/p&gt;
&lt;p&gt;it&amp;#39;s the same in c# as it is in vb.net&lt;/p&gt;</description></item><item><title>WMS Custom Logging Plugins dont work</title><link>http://forums.iis.net/thread/1903720.aspx</link><pubDate>Thu, 14 May 2009 11:33:09 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1903720</guid><dc:creator>Paul@Prostream</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1903720.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1145&amp;PostID=1903720</wfw:commentRss><description>&lt;p&gt;I need help. Badly.&lt;br /&gt;I need to write a custom login plugin for Windows Media Services but I cant get it to work. My own plugin didnt work, so I compiled the sample from the SDK and that doesnt work either. It will enable, it will create a table in my database and I know that the log&amp;nbsp;event is being handled, but the code that&amp;#39;s supposed to get the data to put into the log fails every time.&lt;/p&gt;
&lt;p&gt;The code looks like this (lifted directly from the sample project;&lt;/p&gt;
&lt;p&gt;... &lt;br /&gt;CommandCtx.GetCommandRequest(CommandRequest)&lt;br /&gt;CommandRequest.GetIUnknownValue(&amp;quot;@WMS_COMMAND_CONTEXT_BODY&amp;quot;, 11, ContextBody, 0)&lt;br /&gt;&lt;br /&gt;NsBuffer = ContextBody&lt;br /&gt;strContext = GetStringFromNSSBuffer(NsBuffer)&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;Private Function GetStringFromNSSBuffer(ByRef NsBuffer As INSSBuffer) As String&lt;br /&gt;Dim s As String = &amp;quot;&amp;quot;&lt;br /&gt;GetStringFromNSSBuffer = &amp;quot;&amp;quot;&lt;br /&gt;Try&lt;br /&gt;Dim uBufSize As UInt32&lt;br /&gt;Dim pbuf As IntPtr = New IntPtr()&lt;br /&gt;NsBuffer.GetBufferAndLength(pbuf, uBufSize)&lt;br /&gt;Dim iBufSize As Int32 = Convert.ToInt32(uBufSize) / 2&lt;br /&gt;s = Marshal.PtrToStringUni(pbuf, iBufSize)&lt;br /&gt;GetStringFromNSSBuffer = s&lt;br /&gt;Catch&lt;br /&gt;End Try&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;I get the same exception every time, NsBuffer.GetBufferAndLength() throws an exception: &amp;quot;Value does not fall within expected range&amp;quot; because the length of the buffer in question is always 0. I&amp;#39;ve tried it on two different servers now (one 2008 std and one 2008 datacenter).&lt;/p&gt;
&lt;p&gt;If anyone has any idea why it doesnt work I&amp;#39;d love to hear it cos I&amp;#39;m stumped. I cant find any answers on the net, and no-one in the media SDK&amp;nbsp;newsgroups has answered. &lt;/p&gt;
&lt;p&gt;This should have been so easy, but if even the SDK is wrong, what am I supposed to do?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>