Beispiel #1
0
        private void TestNotifyEndOfStream()
        {
            int  hr;
            IPin iPin = m_pc as IPin;

            System.Threading.ManualResetEvent mre = new System.Threading.ManualResetEvent(false);

            hr = m_pc.NotifyEndOfStream(mre.SafeWaitHandle.DangerousGetHandle());
            DsError.ThrowExceptionForHR(hr);

            hr = iPin.EndOfStream();
            DsError.ThrowExceptionForHR(hr);

            mre.WaitOne();
            mre.Close();

            // If NotifyEndOfStream wasn't working, we'd never get here.

            hr = m_pc.NotifyEndOfStream(IntPtr.Zero);
            DsError.ThrowExceptionForHR(hr);
        }