mirror of
https://github.com/Artikash/Textractor.git
synced 2024-12-23 08:54:12 +08:00
refactor
This commit is contained in:
parent
50fc7e24c6
commit
88d67c5378
@ -77,13 +77,13 @@ namespace
|
||||
CloseHandle(pr.processHandle);
|
||||
CloseHandle(pr.section);
|
||||
processRecordsByIds[pid] = {};
|
||||
RemoveThreads([=](ThreadParam tp) { return tp.pid == pid; });
|
||||
RemoveThreads([&](ThreadParam tp) { return tp.pid == pid; });
|
||||
OnDetach(pid);
|
||||
}
|
||||
|
||||
void StartPipe()
|
||||
{
|
||||
std::thread([]()
|
||||
std::thread([]
|
||||
{
|
||||
HANDLE hookPipe = CreateNamedPipeW(ITH_TEXT_PIPE, PIPE_ACCESS_INBOUND, PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE, PIPE_UNLIMITED_INSTANCES, PIPE_BUFFER_SIZE, PIPE_BUFFER_SIZE, MAXDWORD, NULL);
|
||||
HANDLE hostPipe = CreateNamedPipeW(ITH_COMMAND_PIPE, PIPE_ACCESS_OUTBOUND, PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE, PIPE_UNLIMITED_INSTANCES, PIPE_BUFFER_SIZE, PIPE_BUFFER_SIZE, MAXDWORD, NULL);
|
||||
@ -106,7 +106,7 @@ namespace
|
||||
case HOST_NOTIFICATION_RMVHOOK:
|
||||
{
|
||||
auto info = *(HookRemovedNotif*)buffer;
|
||||
RemoveThreads([=](ThreadParam tp) { return tp.pid == processId && tp.hook == info.address; });
|
||||
RemoveThreads([&](ThreadParam tp) { return tp.pid == processId && tp.hook == info.address; });
|
||||
}
|
||||
break;
|
||||
case HOST_NOTIFICATION_TEXT:
|
||||
@ -264,10 +264,7 @@ namespace Host
|
||||
return textThreadsByParams[tp];
|
||||
}
|
||||
|
||||
void AddConsoleOutput(std::wstring text)
|
||||
{
|
||||
GetThread(CONSOLE)->AddSentence(std::wstring(text));
|
||||
}
|
||||
void AddConsoleOutput(std::wstring text) { GetThread(CONSOLE)->AddSentence(std::wstring(text)); }
|
||||
}
|
||||
|
||||
// EOF
|
||||
|
@ -30,7 +30,7 @@ private:
|
||||
std::recursive_mutex ttMutex;
|
||||
|
||||
HANDLE deletionEvent = CreateEventW(nullptr, FALSE, FALSE, NULL);
|
||||
std::thread flushThread = std::thread([&]() { while (WaitForSingleObject(deletionEvent, 100) == WAIT_TIMEOUT) Flush(); });
|
||||
std::thread flushThread = std::thread([&] { while (WaitForSingleObject(deletionEvent, 100) == WAIT_TIMEOUT) Flush(); });
|
||||
DWORD timestamp = GetTickCount();
|
||||
|
||||
ThreadOutputCallback Output;
|
||||
|
Loading…
x
Reference in New Issue
Block a user