public static void MFSetBlob(IMFAttributes p, Guid g, object o) { HResult hr; int iSize = Marshal.SizeOf(o); byte[] b = new byte[iSize]; GCHandle h = GCHandle.Alloc(b, GCHandleType.Pinned); try { IntPtr ip = h.AddrOfPinnedObject(); Marshal.StructureToPtr(o, ip, false); } finally { h.Free(); } hr = p.SetBlob(g, b, iSize); MFError.ThrowExceptionForHR(hr); }
public static void MFSetBlob(IMFAttributes p, Guid g, object o) { int hr; int iSize = Marshal.SizeOf(o); byte[] b = new byte[iSize]; GCHandle h = GCHandle.Alloc(b, GCHandleType.Pinned); try { IntPtr ip = h.AddrOfPinnedObject(); Marshal.StructureToPtr(o, ip, false); } finally { h.Free(); } hr = p.SetBlob(g, b, iSize); MFError.ThrowExceptionForHR(hr); }
public HResult SetBlob(Guid guidKey, byte[] pBuf, int cbBufSize) { return(m_Attribs.SetBlob(guidKey, pBuf, cbBufSize)); }