mirror of
https://github.com/HIllya51/LunaHook.git
synced 2025-01-13 05:13:58 +08:00
sync
This commit is contained in:
parent
386df5c300
commit
4b966dd46c
@ -395,7 +395,6 @@ void LunaHost::updatelisttext(const std::wstring&text,LONG_PTR data){
|
||||
}
|
||||
bool LunaHost::on_text_recv(TextThread& thread, std::wstring& output){
|
||||
if(hasstoped)return true;
|
||||
std::lock_guard _(settextmutex);
|
||||
on_text_recv_checkissaved(thread);
|
||||
if(!plugins->dispatch(thread,output))return false;
|
||||
|
||||
|
@ -80,7 +80,6 @@ public:
|
||||
class LunaHost:public mainwindow{
|
||||
Pluginwindow* pluginwindow=0;
|
||||
std::set<DWORD>attachedprocess;
|
||||
std::mutex settextmutex;
|
||||
lineedit* g_hEdit_userhook;
|
||||
gridlayout* mainlayout;
|
||||
button* g_hButton_insert;
|
||||
|
@ -195,13 +195,14 @@ namespace
|
||||
|
||||
namespace Host
|
||||
{
|
||||
std::mutex syncmutex;
|
||||
void Start(ProcessEventHandler Connect, ProcessEventHandler Disconnect, ThreadEventHandler Create, ThreadEventHandler Destroy, TextThread::OutputCallback Output,bool createconsole)
|
||||
{
|
||||
OnConnect = Connect;
|
||||
OnDisconnect = Disconnect;
|
||||
OnCreate = [Create](TextThread& thread) { Create(thread); thread.Start(); };
|
||||
OnDestroy = [Destroy](TextThread& thread) { thread.Stop(); Destroy(thread); };
|
||||
TextThread::Output = Output;
|
||||
OnConnect = [=](auto &&...args){std::lock_guard _(syncmutex);Connect(args...);};
|
||||
OnDisconnect = [=](auto &&...args){std::lock_guard _(syncmutex);Disconnect(args...);};
|
||||
OnCreate = [=](TextThread& thread) {std::lock_guard _(syncmutex); Create(thread); thread.Start(); };
|
||||
OnDestroy = [=](TextThread& thread) {std::lock_guard _(syncmutex); thread.Stop(); Destroy(thread); };
|
||||
TextThread::Output = [=](auto &&...args){std::lock_guard _(syncmutex);return Output(args...);};
|
||||
|
||||
textThreadsByParams->try_emplace(console, console, HookParam{}, CONSOLE);
|
||||
|
||||
@ -216,9 +217,9 @@ namespace Host
|
||||
void StartEx(ProcessEventHandler Connect, ProcessEventHandler Disconnect, ThreadEventHandler Create, ThreadEventHandler Destroy, TextThread::OutputCallback Output,ConsoleHandler console,HookInsertHandler hookinsert,EmbedCallback embed){
|
||||
Start(Connect,Disconnect,Create,Destroy,Output,false);
|
||||
|
||||
OnConsole=console;
|
||||
HookInsert=hookinsert;
|
||||
embedcallback=embed;
|
||||
OnConsole=[=](auto &&...args){std::lock_guard _(syncmutex);console(args...);};
|
||||
HookInsert=[=](auto &&...args){std::lock_guard _(syncmutex);hookinsert(args...);};
|
||||
embedcallback=[=](auto &&...args){std::lock_guard _(syncmutex);embed(args...);};
|
||||
Host::AddConsoleOutput(ProjectHomePage);
|
||||
}
|
||||
constexpr auto PROCESS_INJECT_ACCESS=(
|
||||
|
Loading…
x
Reference in New Issue
Block a user