MCPcopy Create free account
hub / github.com/dobin/RedEdr / DllReaderInit

Function DllReaderInit

RedEdr/dllreader.cpp:34–59  ·  view source on GitHub ↗

Init

Source from the content-addressed store, hash-verified

32
33// Init
34bool DllReaderInit(std::vector<HANDLE>& threads) {
35 hStopEventDll = CreateEvent(NULL, TRUE, FALSE, NULL);
36 if (hStopEventDll == NULL) {
37 LOG_A(LOG_ERROR, "DllReader: Failed to create stop event");
38 return false;
39 }
40 threadReadynessDll = CreateEvent(NULL, TRUE, FALSE, NULL);
41 if (threadReadynessDll == NULL) {
42 LOG_A(LOG_ERROR, "DllReader: Failed to create event for thread readyness");
43 CloseHandle(hStopEventDll);
44 hStopEventDll = NULL;
45 return false;
46 }
47
48 HANDLE thread = CreateThread(NULL, 0, DllReaderThread, NULL, 0, NULL);
49 if (thread == NULL) {
50 LOG_A(LOG_ERROR, "DllReader: Failed to create thread");
51 return false;
52 }
53 hDllServerThreadHandle = thread;
54
55 WaitForSingleObject(threadReadynessDll, INFINITE);
56 threads.push_back(thread);
57
58 return true;
59}
60
61
62// Pipe Reader Thread: Server

Callers 1

ManagerStartFunction · 0.85

Calls 1

LOG_AFunction · 0.70

Tested by

no test coverage detected