mirror of
https://github.com/HIllya51/LunaHook.git
synced 2024-10-22 23:18:16 +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){
|
bool LunaHost::on_text_recv(TextThread& thread, std::wstring& output){
|
||||||
if(hasstoped)return true;
|
if(hasstoped)return true;
|
||||||
std::lock_guard _(settextmutex);
|
|
||||||
on_text_recv_checkissaved(thread);
|
on_text_recv_checkissaved(thread);
|
||||||
if(!plugins->dispatch(thread,output))return false;
|
if(!plugins->dispatch(thread,output))return false;
|
||||||
|
|
||||||
|
@ -80,7 +80,6 @@ public:
|
|||||||
class LunaHost:public mainwindow{
|
class LunaHost:public mainwindow{
|
||||||
Pluginwindow* pluginwindow=0;
|
Pluginwindow* pluginwindow=0;
|
||||||
std::set<DWORD>attachedprocess;
|
std::set<DWORD>attachedprocess;
|
||||||
std::mutex settextmutex;
|
|
||||||
lineedit* g_hEdit_userhook;
|
lineedit* g_hEdit_userhook;
|
||||||
gridlayout* mainlayout;
|
gridlayout* mainlayout;
|
||||||
button* g_hButton_insert;
|
button* g_hButton_insert;
|
||||||
|
@ -195,13 +195,14 @@ namespace
|
|||||||
|
|
||||||
namespace Host
|
namespace Host
|
||||||
{
|
{
|
||||||
|
std::mutex syncmutex;
|
||||||
void Start(ProcessEventHandler Connect, ProcessEventHandler Disconnect, ThreadEventHandler Create, ThreadEventHandler Destroy, TextThread::OutputCallback Output,bool createconsole)
|
void Start(ProcessEventHandler Connect, ProcessEventHandler Disconnect, ThreadEventHandler Create, ThreadEventHandler Destroy, TextThread::OutputCallback Output,bool createconsole)
|
||||||
{
|
{
|
||||||
OnConnect = Connect;
|
OnConnect = [=](auto &&...args){std::lock_guard _(syncmutex);Connect(args...);};
|
||||||
OnDisconnect = Disconnect;
|
OnDisconnect = [=](auto &&...args){std::lock_guard _(syncmutex);Disconnect(args...);};
|
||||||
OnCreate = [Create](TextThread& thread) { Create(thread); thread.Start(); };
|
OnCreate = [=](TextThread& thread) {std::lock_guard _(syncmutex); Create(thread); thread.Start(); };
|
||||||
OnDestroy = [Destroy](TextThread& thread) { thread.Stop(); Destroy(thread); };
|
OnDestroy = [=](TextThread& thread) {std::lock_guard _(syncmutex); thread.Stop(); Destroy(thread); };
|
||||||
TextThread::Output = Output;
|
TextThread::Output = [=](auto &&...args){std::lock_guard _(syncmutex);return Output(args...);};
|
||||||
|
|
||||||
textThreadsByParams->try_emplace(console, console, HookParam{}, CONSOLE);
|
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){
|
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);
|
Start(Connect,Disconnect,Create,Destroy,Output,false);
|
||||||
|
|
||||||
OnConsole=console;
|
OnConsole=[=](auto &&...args){std::lock_guard _(syncmutex);console(args...);};
|
||||||
HookInsert=hookinsert;
|
HookInsert=[=](auto &&...args){std::lock_guard _(syncmutex);hookinsert(args...);};
|
||||||
embedcallback=embed;
|
embedcallback=[=](auto &&...args){std::lock_guard _(syncmutex);embed(args...);};
|
||||||
Host::AddConsoleOutput(ProjectHomePage);
|
Host::AddConsoleOutput(ProjectHomePage);
|
||||||
}
|
}
|
||||||
constexpr auto PROCESS_INJECT_ACCESS=(
|
constexpr auto PROCESS_INJECT_ACCESS=(
|
||||||
|
Loading…
Reference in New Issue
Block a user