Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool isAlive(const char* pN)
- {
- HANDLE SnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
- if (SnapShot == INVALID_HANDLE_VALUE)
- {
- delete SnapShot;
- return false;
- }
- PROCESSENTRY32 procEntry;
- procEntry.dwSize = sizeof(PROCESSENTRY32);
- if (!Process32First(SnapShot, &procEntry))
- {
- delete SnapShot;
- return false;
- }
- //crash here
- do
- {
- if (strcmp(procEntry.szExeFile, pN) == 0)
- {
- delete SnapShot;
- return true;
- }
- } while (Process32Next(SnapShot, &procEntry));
- //^^^^^^^^^^^^ send halp
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement