MCPcopy Create free account
hub / github.com/avast/retdec / assignProcessToNewJob

Function assignProcessToNewJob

src/utils/memory.cpp:64–75  ·  view source on GitHub ↗

* @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. */

Source from the content-addressed store, hash-verified

62* When the process cannot be assigned to a job, it returns 0.
63*/
64HANDLE 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.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected