大网数据广告活动
Windows 系统接口

Job Object Security and Access Rights

· 52CE 我爱测

The Microsoft Windows security model enables you to control access to job objects. For more information about security, see Access-Control Model.

The Microsoft Windows security model enables you to control access to job objects. For more information about security, see Access-Control Model.

You can specify a security descriptor for a job object when you call the CreateJobObject function. If you specify NULL, the job object gets a default security descriptor. The ACLs in the default security descriptor for a job object come from the primary or impersonation token of the creator.

To get or set the security descriptor for a job object, call the GetNamedSecurityInfo, SetNamedSecurityInfo, GetSecurityInfo, or SetSecurityInfo function.

The valid access rights for job objects include the standard access rights and some job-specific access rights. The following table lists the standard access rights used by all objects.

Value Meaning
DELETE (0x00010000L) Required to delete the object.
READ_CONTROL (0x00020000L) Required to read information in the security descriptor for the object, not including the information in the SACL. To read or write the SACL, you must request the ACCESS_SYSTEM_SECURITY access right. For more information, see SACL Access Right.
SYNCHRONIZE (0x00100000L) The right to use the object for synchronization. This enables a thread to wait until the object is in the signaled state.
WRITE_DAC (0x00040000L) Required to modify the DACL in the security descriptor for the object.
WRITE_OWNER (0x00080000L) Required to change the owner in the security descriptor for the object.

The following table lists the job-specific access rights.

Value Meaning
JOB_OBJECT_ALL_ACCESS (0x1F001F) Combines all valid job object access rights.
JOB_OBJECT_ASSIGN_PROCESS (0x0001) Required to call the AssignProcessToJobObject function to assign processes to the job object.
JOB_OBJECT_QUERY (0x0004) Required to retrieve certain information about a job object, such as attributes and accounting information (see QueryInformationJobObject and IsProcessInJob).
JOB_OBJECT_SET_ATTRIBUTES (0x0002) Required to call the SetInformationJobObject function to set the attributes of the job object.
JOB_OBJECT_SET_SECURITY_ATTRIBUTES (0x0010) This flag is not supported. You must set security limitations individually for each process associated with a job object.Windows Server 2003 and Windows XP: Required to call the SetInformationJobObject function with the JobObjectSecurityLimitInformation information class to set security limitations for the processes associated with the job object. Support for this flag was removed in Windows Vista and Windows Server 2008.
JOB_OBJECT_TERMINATE (0x0008) Required to call the TerminateJobObject function to terminate all processes in the job object.

The handle returned by CreateJobObject has JOB_OBJECT_ALL_ACCESS access to the job object. When you call the OpenJobObject function, the system checks the requested access rights against the object's security descriptor. If a job object is in a hierarchy of nested jobs, a caller with access to the job object implicitly has access to all of its child jobs in the hierarchy.

You can request the ACCESS_SYSTEM_SECURITY access right to a job object if you want to read or write the object's SACL. For more information, see Access-Control Lists (ACLs) and SACL Access Right.

You must set security limitations individually for each process associated with a job object, rather than setting them for the job object itself. For information, see Process Security and Access Rights.

Windows Server 2003 and Windows XP: You can use the SetInformationJobObject function to set security limitations for the job object. This capability was removed in Windows Vista and Windows Server 2008.

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 07/14/2025
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。