whether this process can be accessed; fails if the current process doesn't have the proper permissions
| 396 | // have the proper permissions |
| 397 | // |
| 398 | bool Process::canAccess() const |
| 399 | { |
| 400 | HandlePtr h(OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, m_pid)); |
| 401 | |
| 402 | if (!h) { |
| 403 | const auto e = GetLastError(); |
| 404 | if (e == ERROR_ACCESS_DENIED) { |
| 405 | return false; |
| 406 | } |
| 407 | } |
| 408 | |
| 409 | return true; |
| 410 | } |
| 411 | |
| 412 | void Process::addChild(Process p) |
| 413 | { |