* @brief Assigns the current process into a new job and returns a handle to * that job. * * When the process cannot be assigned to a job, it returns 0. */
| 62 | * When the process cannot be assigned to a job, it returns 0. |
| 63 | */ |
| 64 | HANDLE assignProcessToNewJob() { |
| 65 | auto jobHandle = CreateJobObject(nullptr, nullptr); |
| 66 | if (!jobHandle) { |
| 67 | return 0; |
| 68 | } |
| 69 | |
| 70 | if (!AssignProcessToJobObject(jobHandle, GetCurrentProcess())) { |
| 71 | return 0; |
| 72 | } |
| 73 | |
| 74 | return jobHandle; |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * @brief Implementation of @c limitSystemMemory() on Windows. |
no outgoing calls
no test coverage detected