예제 #1
0
 private void TeardownQueueListener()
 {
     if (m_ndisQueue != null)
     {
         NDISUIO.CancelNotifications();
         m_ndisQueue.Close();
         m_ndisQueue = null;
     }
 }
예제 #2
0
        private static void OnDispose(object sender, EventArgs e)
        {
            // static classes can't have finalizers, but if the m_invokerControl is being disposed, it's safe to assume that the PowerManagement
            // class instance has been destroyed, probably by application exit, and we need to clean house to prevent worker threads from using
            // any disposed resources (like m_invokerControl) and to just be a general good citizen with the notification subsystem.

            NativeMethods.StopPowerNotifications(m_powerQueue.Handle);
            m_powerQueue.Close();
        }
예제 #3
0
        /// <summary>
        /// Stops the worker thread which monitors for changes of status
        /// of the adapter.  This must be done, if monitoring has been
        /// started, before the object is destroyed.
        /// </summary>
        public void StopStatusMonitoring()
        {
            if (Active)
            {
                // Close the point-to-point message queue.
                P2PMessageQueue q = m_p2pmq;
                m_p2pmq = null;
                q.Close();

                // Stop notifications to us.
                StopDeviceNotifications(m_requestHandle);

                m_requestHandle = IntPtr.Zero;
            }
        }
예제 #4
0
 public void closeQueues()
 {
     m_toClientQueue.Close();
     m_fromClientQueue.Close();
 }