MCPcopy Create free account
hub / github.com/SaadAhla/HeapCrypt / SuspendThreads

Function SuspendThreads

HeapCrypt/HeapEncryptDecrypt.cpp:11–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9
10
11void SuspendThreads(DWORD mainThread) {
12
13 HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, GetCurrentProcessId());
14
15 THREADENTRY32 te32;
16 te32.dwSize = sizeof(THREADENTRY32);
17
18 if (!Thread32First(hSnapshot, &te32))
19 return;
20
21 do {
22 if (te32.th32OwnerProcessID == GetCurrentProcessId() && te32.th32ThreadID != mainThread) {
23
24 SuspendThread(OpenThread(THREAD_ALL_ACCESS, FALSE, te32.th32ThreadID));
25 }
26 } while (Thread32Next(hSnapshot, &te32));
27}
28
29
30void ResumeThreads(DWORD mainThread) {

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected