本文整理汇总了C#中IExecutor.GetImplementationPath方法的典型用法代码示例。如果您正苦于以下问题:C# IExecutor.GetImplementationPath方法的具体用法?C# IExecutor.GetImplementationPath怎么用?C# IExecutor.GetImplementationPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IExecutor
的用法示例。
在下文中一共展示了IExecutor.GetImplementationPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RunHook
/// <summary>
/// Hooks into the creation of new processes on the current thread to inject API hooks.
/// </summary>
/// <param name="selections">The implementations chosen for launch.</param>
/// <param name="executor">The executor used to launch the new process.</param>
/// <param name="feedManager">Provides access to remote and local <see cref="Feed"/>s. Handles downloading, signature verification and caching.</param>
/// <param name="handler">A callback object used when the the user needs to be asked questions or informed about download and IO tasks.</param>
/// <exception cref="ImplementationNotFoundException">The main implementation is not cached (possibly because it is installed natively).</exception>
public RunHook(Selections selections, IExecutor executor, IFeedManager feedManager, ITaskHandler handler)
{
var feed = feedManager[selections.InterfaceUri];
_target = new FeedTarget(selections.InterfaceUri, feed);
var mainImplementation = selections.MainImplementation;
_implementationDir = executor.GetImplementationPath(mainImplementation);
_mainImplementation = feed[mainImplementation.ID];
_handler = handler;
_registryFilter = GetRegistryFilter();
_relaunchControl = GetRelaunchControl();
Log.Info("Activating API hooking");
_hookW = LocalHook.Create(LocalHook.GetProcAddress("kernel32.dll", "CreateProcessW"), new UnsafeNativeMethods.DCreateProcessW(CreateProcessWCallback), null);
_hookW.ThreadACL.SetInclusiveACL(new[] {Thread.CurrentThread.ManagedThreadId});
_hookA = LocalHook.Create(LocalHook.GetProcAddress("kernel32.dll", "CreateProcessA"), new UnsafeNativeMethods.DCreateProcessA(CreateProcessACallback), null);
_hookA.ThreadACL.SetInclusiveACL(new[] {Thread.CurrentThread.ManagedThreadId});
}