Ejemplo n.º 1
0
        /// <summary>
        /// Release the resource manager context for the query
        /// </summary>
        public void ReleaseContext()
        {
            // Sanity Check
            if (this.m_fDisposed)
            {
                throw new ObjectDisposedException(base.GetType().FullName);
            }

            // Check Context
            if (this.m_hContext == IntPtr.Zero)
            {
                throw new InvalidOperationException();
            }

            // Cancel???
            WinSCard.SCardCancel(this.m_hContext);


            uint nErrCode = WinSCard.SCardReleaseContext(this.m_hContext);

            // Set Zero
            this.m_hContext = IntPtr.Zero;

            // Was there an error
            if (nErrCode != 0)
            {
                //SCardException.RaiseWin32ResponseCode(nErrCode);
            }
        }
Ejemplo n.º 2
0
        // Tracking Functions
        public void Cancel()
        {
            if (this.m_hContext == IntPtr.Zero)
            {
                throw new InvalidOperationException();
            }
            uint nErrCode = WinSCard.SCardCancel(this.m_hContext);

            if (nErrCode != 0)
            {
                //SCardException.RaiseWin32ResponseCode(nErrCode);
            }
        }