| 29 | } |
| 30 | |
| 31 | HANDLE CSafeThreadHandle::FindThread(HANDLE hOwnerProcess, DWORD dwTargetTID) |
| 32 | { |
| 33 | if (!IsWindowsVistaOrGreater()) |
| 34 | return INVALID_HANDLE_VALUE; |
| 35 | |
| 36 | HANDLE hCurrent = nullptr; |
| 37 | |
| 38 | while (g_winapiApiTable->NtGetNextThread(hOwnerProcess, hCurrent, m_dwAccess, 0, 0, &hCurrent) == STATUS_SUCCESS) |
| 39 | { |
| 40 | if (g_winapiApiTable->GetThreadId(hCurrent) == dwTargetTID) |
| 41 | return hCurrent; |
| 42 | |
| 43 | m_vHandleList.push_back(hCurrent); |
| 44 | } |
| 45 | |
| 46 | return INVALID_HANDLE_VALUE; |
| 47 | } |
| 48 | |
| 49 | std::vector <HANDLE> CSafeThreadHandle::EnumerateThreads(HANDLE hOwnerProcess) |
| 50 | { |
no test coverage detected