public HResult GetService(Guid guidService, Guid riid, out IntPtr ppvObject) { // If ppvObject were just an object, this routine would not return // the riid the caller requested. That's why there's a custom // implementation of this. if (guidService == MFServices.MF_METADATA_PROVIDER_SERVICE) { // performs an AddRef IntPtr ip = Marshal.GetIUnknownForObject(m_MetaData); // performs an AddRef HResult hr = (HResult)Marshal.QueryInterface(ip, ref riid, out ppvObject); Debug.WriteLineIf(hr != HResult.S_OK, string.Format( "IMFGetService::QueryInterface not supported: {0}: {1}", MFDump.LookupName(typeof(MFServices), guidService), MFDump.LookupInterface(riid))); // Must release one of those AddRefs Marshal.Release(ip); return(hr); } Debug.WriteLine("IMFGetService::GetService not supported: {0}: {1}", MFDump.LookupName(typeof(MFServices), guidService), MFDump.LookupInterface(riid)); ppvObject = IntPtr.Zero; return(HResult.MF_E_UNSUPPORTED_SERVICE); }
protected static void TraceAttributes(IMFAttributes ia) { string s = MFDump.DumpAttribs(ia); Debug.Write(s); }