Exemplo n.º 1
0
        public int QueryPinInfo(out PinInfo pInfo)
        {
            pInfo = new PinInfo();
            if (m_pUnknown == IntPtr.Zero) return E_NOINTERFACE;

            QueryPinInfoProc _Proc = GetProcDelegate<QueryPinInfoProc>(8);

            if (_Proc == null) return E_UNEXPECTED;

            return (HRESULT)_Proc(
                        m_pUnknown,
                        out pInfo
                        );
        }
Exemplo n.º 2
0
        public int ReceiveConnection(IntPtr pReceivePin, AMMediaType pmt)
        {
            if (m_pUnknown == IntPtr.Zero) return E_NOINTERFACE;

            ReceiveConnectionProc _Proc = GetProcDelegate<ReceiveConnectionProc>(4);

            if (_Proc == null) return E_UNEXPECTED;

            PinInfo pi = new PinInfo();
            int hr = QueryPinInfo(out pi);

            PinInfo pi2 = new PinInfo();
            hr = (Marshal.GetObjectForIUnknown(pReceivePin) as IPin).QueryPinInfo(out pi2);

            hr = _Proc(
                        m_pUnknown,
                        pReceivePin, pmt
                        );

            //try
            //{
            //    DsError.ThrowExceptionForHR(hr);
            //}
            //catch (Exception ex)
            //{
            //}

            Marshal.ThrowExceptionForHR(hr);
            
            return hr;
        }