MCPcopy Create free account
hub / github.com/NoMercy-ac/NoMercy / FindThread

Method FindThread

Source/Client/NM_Engine/SafeThreadHandle.cpp:31–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29}
30
31HANDLE 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
49std::vector <HANDLE> CSafeThreadHandle::EnumerateThreads(HANDLE hOwnerProcess)
50{

Callers 1

HasSuspendMethod · 0.45

Calls 1

IsWindowsVistaOrGreaterFunction · 0.85

Tested by

no test coverage detected