Problem:
In this example, the CreateJobObject/AssignProcessToJobObject functions appear to work correctly, but SetInformationJobObject consistently fails with error 24 or 87. Despite adjustments based on platform architecture and careful consideration of structure definitions, the underlying issue remains unsolved.
Solution:
The solution provided by Matt Howells, along with additional modifications and a custom Job class, offers a comprehensive solution that resolves the SetInformationJobObject failure.
Job Class Implementation:
The custom Job class includes methods for creating, closing, and assigning processes to the job. It utilizes PInvoke routines for interfacing with CreateJobObject, SetInformationJobObject, AssignProcessToJobObject, and other relevant functions.
Key Points:
The above is the detailed content of Why Does SetInformationJobObject Fail with Error 24 or 87 in .NET's CreateJobObject Implementation?. For more information, please follow other related articles on the PHP Chinese website!