Platform SDK: DLLs, Processes, and Threads |
The OpenJobObject function opens an existing job object.
HANDLE OpenJobObject( DWORD dwDesiredAccess, // access right BOOL bInheritHandles, // inheritance state LPCTSTR lpName // job name );
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. The handle provides the requested access to the job.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
To associate a process with a job, use the AssignProcessToJobObject function.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Unsupported.
Header: Declared in Winbase.h; include Windows.h.
Library: Use Kernel32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows 2000.
Processes and Threads Overview, Process and Thread Functions, AssignProcessToJobObject