/// <summary> /// Execute a function in a process in a new thread with a <see cref="FunctionCallArguments" /> argument /// </summary> /// <param name="process">The process the thread will be created and executed in.</param> /// <param name="functionName">The name of the function to be executed.</param> /// <param name="arguments">The class which will be serialized and passed to the function being executed.</param> private void ExecuteAssemblyFunctionWithArguments( Process process, IFunctionName functionName, FunctionCallArguments arguments) { _processManager.Execute( functionName.Module, functionName.Function, MarshallingHelper.StructToByteArray(arguments), false); }
/// <summary> /// Execute a function in a process in a new thread with a <see cref="FunctionCallArguments" /> argument /// </summary> /// <param name="process">The process the thread will be created and executed in.</param> /// <param name="functionName">The name of the function to be executed.</param> /// <param name="arguments">The class which will be serialized and passed to the function being executed.</param> private void ExecuteAssemblyFunctionWithArguments( Process process, IFunctionName functionName, FunctionCallArguments arguments) { _memoryManager.Add( process, _processManager.Execute( functionName.Module, functionName.Function, Binary.StructToByteArray(arguments), false), false ); }
public void Valid_Happy_Path_result_Tests() { var expectedCommand = "SomeAppName"; var expectedResult = new ProcessResult { Output = "Sample Output", Errors = "There were Errors", Command = expectedCommand, ElapsedMilliseconds = 1234 }; _processManager.Execute(Arg.Any <string>(), Arg.Any <string>(), Arg.Any <int>()).Returns(expectedResult); var result = DWPSUtils.ExecuteCommandSync(_diskManager, _processManager, expectedCommand, null); Assert.IsNotNull(result); Assert.AreEqual(result, expectedResult); }
private void ExecuteAssemblyWithArguments(IFunctionName moduleFunction, byte[] arguments, bool waitForThreadExit) { _processManager.Execute(moduleFunction.Module, moduleFunction.Function, arguments, waitForThreadExit); }