[This is preliminary documentation and subject to change.]
The OpenJobObject function opens an existing job object.
HANDLE OpenJobObject(
DWORD dwDesiredAccess,
BOOL bInheritHandles,
LPCTSTR lpName
);
Value | Meaning |
---|---|
MAXIMUM_ALLOWED | Specifies maximum access rights to the job object that are valid for the caller. |
JOB_OBJECT_ASSIGN_PROCESS | Specifies the assign process access right to the object. Allows processes to be assigned to the job. |
JOB_OBJECT_SET_ATTRIBUTES | Specifies the set attribute access right to the object. Allows job object attributes to be set. |
JOB_OBJECT_QUERY | Specifies the query access right to the object. Allows job object attributes and accounting information to be queried. |
JOB_OBJECT_TERMINATE | Specifies the terminate access right to the object. Allows termination of all processes in the job object. |
JOB_OBJECT_SET_SECURITY_ATTRIBUTES | Specifies the security attributes access right to the object. Allows security limitations on all processes in the job object to be set. |
JOB_OBJECT_ALL_ACCESS | Specifies the full access right to the job object. |
If the function succeeds, the return value is a handle to the job object. The handle provides the requested access to the job object.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
To associate a process with a job object, use the AssignProcessToJobObject function.
Windows NT: Requires version 5.0 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in winbase.h.
Import Library: Use kernel32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT.
Processes and Threads Overview, Process and Thread Functions, AssignProcessToJobObject