Exemplo n.º 1
0
        public bool ResumeCapture(List <uint> adapters)
        {
            uint errno;

            try
            {
                foreach (uint adapterIndex in adapters)
                {
                    errno = NetmonAPI.NmResumeCapture(this.captureEngineHandle, adapterIndex);
                    if (errno != 0)
                    {
                        throw new Exception(FormatErrMsg("NmResumeCapture() failed", errno));
                    }
                }

                return(true);
            }
            catch (Exception ex)
            {
                NetmonAPI.NmCloseHandle(this.captureEngineHandle);
                NetmonAPI.NmCloseHandle(this.captureFileHandle);
                this.captureEngineHandle = IntPtr.Zero;
                this.captureFileHandle   = IntPtr.Zero;

                ErrorMsg += ex.ToString();

                return(false);
            }
        }