--- UID: NF:processthreadsapi.UpdateProcThreadAttribute title: UpdateProcThreadAttribute function (processthreadsapi.h) description: Updates the specified attribute in a list of attributes for process and thread creation. helpviewer_keywords: ["PROC_THREAD_ATTRIBUTE_CHILD_PROCESS_POLICY","PROC_THREAD_ATTRIBUTE_DESKTOP_APP_POLICY","PROC_THREAD_ATTRIBUTE_GROUP_AFFINITY","PROC_THREAD_ATTRIBUTE_HANDLE_LIST","PROC_THREAD_ATTRIBUTE_IDEAL_PROCESSOR","PROC_THREAD_ATTRIBUTE_MACHINE_TYPE","PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY","PROC_THREAD_ATTRIBUTE_PARENT_PROCESS","PROC_THREAD_ATTRIBUTE_PREFERRED_NODE","PROC_THREAD_ATTRIBUTE_PROTECTION_LEVEL","PROC_THREAD_ATTRIBUTE_SECURITY_CAPABILITIES","PROC_THREAD_ATTRIBUTE_UMS_THREAD","PROC_THREAD_ATTRIBUTE_JOB_LIST","UpdateProcThreadAttribute","UpdateProcThreadAttribute function","base.updateprocthreadattribute","processthreadsapi/UpdateProcThreadAttribute","winbase/UpdateProcThreadAttribute"] old-location: base\updateprocthreadattribute.htm tech.root: processthreadsapi ms.assetid: 5fc3e04f-9b2a-440c-a9aa-d78d9b25b341 ms.date: 02/02/2021 ms.keywords: PROC_THREAD_ATTRIBUTE_CHILD_PROCESS_POLICY, PROC_THREAD_ATTRIBUTE_DESKTOP_APP_POLICY, PROC_THREAD_ATTRIBUTE_GROUP_AFFINITY, PROC_THREAD_ATTRIBUTE_HANDLE_LIST, PROC_THREAD_ATTRIBUTE_IDEAL_PROCESSOR, PROC_THREAD_ATTRIBUTE_MACHINE_TYPE, PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY, PROC_THREAD_ATTRIBUTE_PARENT_PROCESS, PROC_THREAD_ATTRIBUTE_PREFERRED_NODE, PROC_THREAD_ATTRIBUTE_PROTECTION_LEVEL, PROC_THREAD_ATTRIBUTE_SECURITY_CAPABILITIES, PROC_THREAD_ATTRIBUTE_UMS_THREAD, PROC_THREAD_ATTRIBUTE_JOB_LIST, UpdateProcThreadAttribute, UpdateProcThreadAttribute function, base.updateprocthreadattribute, processthreadsapi/UpdateProcThreadAttribute, winbase/UpdateProcThreadAttribute req.header: processthreadsapi.h req.include-header: Windows.h on Windows 7, Windows Server 2008 Windows Server 2008 R2 req.target-type: Windows req.target-min-winverclnt: Windows Vista [desktop apps only] req.target-min-winversvr: Windows Server 2008 [desktop apps only] req.kmdf-ver: req.umdf-ver: req.ddi-compliance: req.unicode-ansi: req.idl: req.max-support: req.namespace: req.assembly: req.type-library: req.lib: Kernel32.lib req.dll: Kernel32.dll req.irql: targetos: Windows req.typenames: req.redist: ms.custom: RS5, 19H1 f1_keywords: - UpdateProcThreadAttribute - processthreadsapi/UpdateProcThreadAttribute dev_langs: - c++ topic_type: - APIRef - kbSyntax api_type: - DllExport api_location: - Kernel32.dll - API-MS-Win-Core-ProcessThreads-l1-1-0.dll - KernelBase.dll - MinKernelBase.dll - API-MS-Win-Core-ProcessThreads-l1-1-1.dll - API-MS-Win-Core-ProcessThreads-l1-1-2.dll - api-ms-win-downlevel-kernel32-l1-1-0.dll - API-MS-Win-Core-ProcessThreads-L1-1-3.dll api_name: - UpdateProcThreadAttribute --- # UpdateProcThreadAttribute function ## -description Updates the specified attribute in a list of attributes for process and thread creation. ## -parameters ### -param lpAttributeList [in, out] A pointer to an attribute list created by the InitializeProcThreadAttributeList function. ### -param dwFlags [in] This parameter is reserved and must be zero. ### -param Attribute [in] The attribute key to update in the attribute list. This parameter can be one of the following values.
Value | Meaning |
---|---|
|
The lpValue parameter is a pointer to a GROUP_AFFINITY structure that specifies the processor group affinity for the new thread. Supported in Windows 7 and newer and Windows Server 2008 R2 and newer. |
|
The lpValue parameter is a pointer to a list of handles to be inherited by the child process.
These handles must be created as inheritable handles and must not include pseudo handles such as those returned by the GetCurrentProcess or GetCurrentThread function.
Note if you use this attribute, pass in a value of TRUE for the bInheritHandles parameter of the CreateProcess function.
|
|
The lpValue parameter is a pointer to a PROCESSOR_NUMBER structure that specifies the ideal processor for the new thread. Supported in Windows 7 and newer and Windows Server 2008 R2 and newer. |
|
The lpValue parameter is a pointer to a WORD that specifies the machine architecture of the child process. Supported in Windows 11 and newer. The WORD pointed to by lpValue can be a value listed on IMAGE FILE MACHINE CONSTANTS. |
|
The lpValue parameter is a pointer to a DWORD or DWORD64 that specifies the exploit mitigation policy for the child process. Starting in Windows 10, version 1703, this parameter can also be a pointer to a two-element DWORD64 array. The specified policy overrides the policies set for the application and the system and cannot be changed after the child process starts running. The DWORD or DWORD64 pointed to by lpValue can be one or more of the values listed in the remarks. Supported in Windows 7 and newer and Windows Server 2008 R2 and newer. |
|
The lpValue parameter is a pointer to the handle of a process to use (instead of the calling process) as the parent for the process being created. The handle for the process used must have the PROCESS_CREATE_PROCESS access right. Attributes inherited from the specified process include handles, the device map, processor affinity, priority, quotas, the process token, and job object. (Note that some attributes such as the debug port will come from the creating process, not the process specified by this handle.) |
|
The lpValue parameter is a pointer to the node number of the preferred NUMA node for the new process. Supported in Windows 7 and newer and Windows Server 2008 R2 and newer. |
|
The lpValue parameter is a pointer to a UMS_CREATE_THREAD_ATTRIBUTES structure that specifies a user-mode scheduling (UMS) thread context and a UMS completion list to associate with the thread. After the UMS thread is created, the system queues it to the specified completion list. The UMS thread runs only when an application's UMS scheduler retrieves the UMS thread from the completion list and selects it to run. For more information, see User-Mode Scheduling. Supported in Windows 7 and newer and Windows Server 2008 R2 and newer. Not supported in Windows 11 and newer (see [User-Mode Scheduling](/windows/win32/procthread/user-mode-scheduling)). |
|
The lpValue parameter is a pointer to a SECURITY_CAPABILITIES structure that defines the security capabilities of an app container. If this attribute is set the new process will be created as an AppContainer process. Supported in Windows 8 and newer and Windows Server 2012 and newer. |
|
The lpValue parameter is a pointer to a DWORD value of PROTECTION_LEVEL_SAME. This specifies the protection level of the child process to be the same as the protection level of its parent process. Supported in Windows 8.1 and newer and Windows Server 2012 R2 and newer. |
|
The lpValue parameter is a pointer to a DWORD value that specifies the child process policy. The policy specifies whether to allow a child process to be created. For information on the possible values for the DWORD to which lpValue points, see Remarks. Supported in Windows 10 and newer and Windows Server 2016 and newer. |
|
This attribute is relevant only to win32 applications that have been converted to UWP packages by using the Desktop Bridge. The lpValue parameter is a pointer to a DWORD value that specifies the desktop app policy. The policy specifies whether descendant processes should continue to run in the desktop environment. For information about the possible values for the DWORD to which lpValue points, see Remarks. Supported in Windows 10 Version 1703 and newer and Windows Server Version 1709 and newer. |
|
The lpValue parameter is a pointer to a list of job handles to be assigned to the child process, in the order specified. Supported in Windows 10 and newer and Windows Server 2016 and newer. |
|
The lpValue parameter is a pointer to a DWORD64 value that specifies the set of optional XState features to enable for the new thread. Supported in Windows 11 and newer and Windows Server 2022 and newer. |