public void Dispose() { if (hasInjectedDll) { DllRegistrar.EjectFakeTrackIRDll(); } freePieTrackIRMutex.Dispose(); if (trackIRWorker != null) { trackIRWorker.Dispose(); } }
private WorkerProcess <TrackIRWorker> SetupRealTrackIRDll() { string realDllPath = DllRegistrar.GetRealTrackIRDllPath(Environment.CurrentDirectory); if (realDllPath == null) { return(new WorkerProcess <TrackIRWorker>()); } freepieData.Write(x => x.TrackIRData, new TrackIRData { LastUpdatedTicks = DateTime.Now.Ticks }); var worker = new WorkerProcess <TrackIRWorker>(Path.Combine(realDllPath, NPClientName).Quote() + " " + Process.GetCurrentProcess().MainWindowHandle.ToInt64() + " " + doLog); worker.Start(); return(worker); }
void SetupFakeTrackIR() { if (File.Exists(Path.Combine(Environment.CurrentDirectory, NPClientName))) { if (doLog) { InitDllLogging(); } DllRegistrar.InjectFakeTrackIRDll(Environment.CurrentDirectory + @"\"); hasInjectedDll = true; } else { Console.Error.WriteLine("No fake trackir dll found in current directory - obviously not spoofing."); } }