Click to Rate and Give Feedback
MSDN
MSDN Library
System Services
 SetProcessAffinityUpdateMode Functi...
SetProcessAffinityUpdateMode Function

Sets the affinity update mode of the specified process.

Syntax

C++
BOOL WINAPI SetProcessAffinityUpdateMode(
  __in  HANDLE ProcessHandle,
  __in  DWORD dwFlags
);

Parameters

ProcessHandle [in]

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

dwFlags [in]

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

ValueMeaning
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.

 

Return Value

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.

Requirements

Minimum supported clientWindows Vista with SP1
Minimum supported serverWindows Server 2008
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll

See Also

QueryProcessAffinityUpdateMode

Send comments about this topic to Microsoft

Build date: 10/8/2009

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker