public override int Active()
 {
     _start = 0;
     _startNotified = false;
     _stopNotified = false;
     {
         lock (m_Filter.FilterLock)
         {
             _clock = m_Filter.Clock;
             if (_clock.IsValid)
             {
                 _clock._AddRef();
             }
             _semaphore = new Semaphore(0, 0x7FFFFFFF);
         }
     }
     return base.Active();
 }
Example #2
0
 public override int Inactive()
 {
     m_isActive = false;
     HRESULT hr = (HRESULT)base.Inactive();
     if (m_pClock != null)
     {
         if (m_dwAdviseToken != 0)
         {
             m_pClock.Unadvise(m_dwAdviseToken);
             m_dwAdviseToken = 0;
         }
         m_pClock._Release();
         m_pClock = null;
         if (m_hSemaphore != null)
         {
             m_hSemaphore.Close();
             m_hSemaphore = null;
         }
     }
     return hr;
 }
 public override int Inactive()
 {
     var hr = (HRESULT)base.Inactive();
     if (_clock != null)
     {
         if (_adviseToken != 0)
         {
             _clock.Unadvise(_adviseToken);
             _adviseToken = 0;
         }
         _clock._Release();
         _clock = null;
         if (_semaphore != null)
         {
             _semaphore.Close();
             _semaphore = null;
         }
     }
     return hr;
 }
Example #4
0
 public override int Active()
 {
     m_rtStart = 0;
     m_bStartNotified = false;
     m_bStopNotified = false;
     {
         lock (m_Filter.FilterLock)
         {
             m_pClock = m_Filter.Clock;
             if (m_pClock.IsValid)
             {
                 m_pClock._AddRef();
             }
             m_hSemaphore = new Semaphore(0, 0x7FFFFFFF);
             m_isActive = true;
         }
     }
     return base.Active();
 }