Platform SDK: DLLs, Processes, and Threads |
The SetProcessAffinityMask function sets a processor affinity mask for the threads of the specified process.
A process affinity mask is a bit vector in which each bit represents the processor on which the threads of the process are allowed to run.
The value of the process affinity mask must be a proper subset of the mask values obtained by the GetProcessAffinityMask function.
BOOL SetProcessAffinityMask( HANDLE hProcess, // handle to process DWORD_PTR dwProcessAffinityMask // process affinity mask );
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.
Process affinity is inherited by any process that you start with the CreateProcess function.
Windows NT/2000: Requires Windows NT 4.0 or later.
Windows 95/98: Unsupported.
Header: Declared in Winbase.h; include Windows.h.
Library: Use Kernel32.lib.
Processes and Threads Overview, Process and Thread Functions, CreateProcess, GetProcessAffinityMask