private void StartCaptureThread() { try { PrepareCapture(processes); DoInjection(); } catch (Error e) { progress.OperationFailed(e.Message); return; } progress.OperationComplete(); }
private void DoStartCapture() { try { PrepareCapture(); int[] processIds; if (details is CreateDetails) { CreateDetails createDetails = details as CreateDetails; int processId = DoCreation(createDetails); processIds = new int[1] { processId }; } else if (details is AttachDetails) { AttachDetails attachDetails = details as AttachDetails; DoInjection(attachDetails); processIds = attachDetails.ProcessIds; } else { throw new NotImplementedException(); } if (WaitForAllClientsToPingUs(processIds)) { progress.OperationComplete(); } else { progress.OperationFailed("Capture aborted."); } } catch (Exception e) { progress.OperationFailed(e.Message); UnprepareCapture(false); } progress = null; startWorkerThread = null; }
private void StartCaptureThread() { try { PrepareCapture(processes, softwallRules); if (devices.Length > 0) { InstallUsbAgentService(); foreach (Device device in devices) { device.AddLowerFilter(Constants.UsbAgentName); } if (restartDevices) { foreach (Device device in devices) { device.Restart(); } } } DoInjection(); } catch (Error e) { // TODO: roll back progress.OperationFailed(e.Message); return; } progress.OperationComplete(); }