private bool TryReadSandboxedProcessExecutorTestHook(out SandboxedProcessExecutorTestHook sandboxedProcessExecutorTestHook) { if (string.IsNullOrEmpty(m_configuration.SandboxedProcessExecutorTestHookFile)) { sandboxedProcessExecutorTestHook = null; return(true); } SandboxedProcessExecutorTestHook localSandboxedProcessExecutorTestHook = null; string sandboxedProcessTestHook = Path.GetFullPath(m_configuration.SandboxedProcessExecutorTestHookFile); m_logger.LogInfo($"Reading sandboxed process test hook from '{sandboxedProcessTestHook}'"); bool success = Helpers.RetryOnFailure( attempt => { using FileStream stream = File.OpenRead(sandboxedProcessTestHook); // TODO: Custom DetoursEventListener? localSandboxedProcessExecutorTestHook = SandboxedProcessExecutorTestHook.Deserialize(stream); return(true); }, onException: e => m_logger.LogError(e.ToStringDemystified())); sandboxedProcessExecutorTestHook = localSandboxedProcessExecutorTestHook; return(true); }
private bool TryReadSandboxedProcessExecutorTestHook(out SandboxedProcessExecutorTestHook sandboxedProcessExecutorTestHook) { if (string.IsNullOrEmpty(m_configuration.SandboxedProcessExecutorTestHookFile)) { sandboxedProcessExecutorTestHook = null; return(true); } SandboxedProcessExecutorTestHook localSandboxedProcessExecutorTestHook = null; bool success = Helpers.RetryOnFailure( attempt => { using (FileStream stream = File.OpenRead(Path.GetFullPath(m_configuration.SandboxedProcessExecutorTestHookFile))) { // TODO: Custom DetoursEventListener? localSandboxedProcessExecutorTestHook = SandboxedProcessExecutorTestHook.Deserialize(stream); return(true); } }); sandboxedProcessExecutorTestHook = localSandboxedProcessExecutorTestHook; return(true); }