| 121 | |
| 122 | |
| 123 | BOOL InitializeLogReader(std::vector<HANDLE>& threads) { |
| 124 | std::wstring directory; |
| 125 | std::wstring pattern; |
| 126 | |
| 127 | directory = L"C:\\ProgramData\\Microsoft\\Windows Defender\\Support"; |
| 128 | pattern = L"MPLog-*"; |
| 129 | |
| 130 | if (TRUE) { |
| 131 | directory = L"C:\\temp"; |
| 132 | pattern = L"test*"; |
| 133 | } |
| 134 | |
| 135 | std::wstring path = findFiles(directory, pattern); |
| 136 | if (path == L"") { |
| 137 | LOG_A(LOG_ERROR, "LOG: File not found: %ls", pattern.c_str()); |
| 138 | return 1; |
| 139 | } |
| 140 | |
| 141 | wchar_t* real_path = wstring2wcharAlloc(path); |
| 142 | HANDLE thread = CreateThread(NULL, 0, LogReaderProcessingThread, (LPVOID)real_path, 0, NULL); |
| 143 | if (thread == NULL) { |
| 144 | LOG_A(LOG_ERROR, "LOG: Failed to create thread for trace session logreader"); |
| 145 | return 1; |
| 146 | } |
| 147 | threads.push_back(thread); |
| 148 | |
| 149 | //tailFileW(path.c_str()); |
| 150 | return TRUE; |
| 151 | } |
| 152 |
nothing calls this directly
no test coverage detected