| 28 | |
| 29 | |
| 30 | void ResumeThreads(DWORD mainThread) { |
| 31 | |
| 32 | HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, GetCurrentProcessId()); |
| 33 | |
| 34 | THREADENTRY32 te32; |
| 35 | te32.dwSize = sizeof(THREADENTRY32); |
| 36 | |
| 37 | if (!Thread32First(hSnapshot, &te32)) |
| 38 | return; |
| 39 | |
| 40 | do { |
| 41 | if (te32.th32OwnerProcessID == GetCurrentProcessId() && te32.th32ThreadID != mainThread) { |
| 42 | |
| 43 | ResumeThread(OpenThread(THREAD_ALL_ACCESS, FALSE, te32.th32ThreadID)); |
| 44 | } |
| 45 | } while (Thread32Next(hSnapshot, &te32)); |
| 46 | |
| 47 | } |
| 48 | |
| 49 | |
| 50 |