Skip to content

Latest commit

 

History

History
120 lines (98 loc) · 4.04 KB

nf-processthreadsapi-setprocessaffinityupdatemode.md

File metadata and controls

120 lines (98 loc) · 4.04 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr 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 req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:processthreadsapi.SetProcessAffinityUpdateMode
SetProcessAffinityUpdateMode function (processthreadsapi.h)
Sets the affinity update mode of the specified process.
PROCESS_AFFINITY_ENABLE_AUTO_UPDATE
SetProcessAffinityUpdateMode
SetProcessAffinityUpdateMode function
base.setprocessaffinityupdatemode
processthreadsapi/SetProcessAffinityUpdateMode
winbase/SetProcessAffinityUpdateMode
base\setprocessaffinityupdatemode.htm
processthreadsapi
46e8f7d2-89b9-42cb-9171-d5ae2ec870da
12/05/2018
PROCESS_AFFINITY_ENABLE_AUTO_UPDATE, SetProcessAffinityUpdateMode, SetProcessAffinityUpdateMode function, base.setprocessaffinityupdatemode, processthreadsapi/SetProcessAffinityUpdateMode, winbase/SetProcessAffinityUpdateMode
processthreadsapi.h
Windows.h on Windows 7, Windows Server 2008 Windows Server 2008 R2
Windows
Windows Vista with SP1 [desktop apps only]
Windows Server 2008 [desktop apps only]
Kernel32.lib
Kernel32.dll
Windows
19H1
SetProcessAffinityUpdateMode
processthreadsapi/SetProcessAffinityUpdateMode
c++
APIRef
kbSyntax
DllExport
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
SetProcessAffinityUpdateMode

SetProcessAffinityUpdateMode function

-description

Sets the affinity update mode of the specified process.

-parameters

-param hProcess [in]

A handle to the process. This handle must be returned by the GetCurrentProcess function.

-param dwFlags [in]

The affinity update mode. This parameter can be one of the following values.

Value Meaning
0
Disables dynamic update of the process affinity by the system.
PROCESS_AFFINITY_ENABLE_AUTO_UPDATE
0x00000001UL
Enables dynamic update of the process affinity by the system.

-returns

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

-remarks

The system can adjust process affinity under various conditions, such as when a processor is added dynamically. By default, dynamic updates to the process affinity are disabled for each process.

Processes should use this function to indicate whether they can handle dynamic adjustment of process affinity by the system. After a process enables affinity update mode, it can call this function to disable it. However, a process cannot enable affinity update mode after it has used this function to disable it.

Child processes do not inherit the affinity update mode of the parent process. The affinity update mode must be explicitly set for each child process.

To compile an application that calls this function, define _WIN32_WINNT as 0x0600 or later. For more information, see Using the Windows Headers.

-see-also

QueryProcessAffinityUpdateMode