SetProcessAffinityMask

SetProcessAffinityMask sets a processor affinity mask for the threads of the specified process.

Syntax

Copy
BOOL SetProcessAffinityMask(
    [in]    HANDLE hProcess,
    [in]    DWORD_PTR dwProcessAffinityMask
);

Parameters

[in] hProcess

A handle to the process whose affinity mask is to be set.

[in] dwProcessAffinityMask

The affinity mask for all the threads of the process.

Return Value

If the function succeeds, it returns a non-zero value. If the function fails, it returns 0 (zero). Call GetLastError to get extended error information.

Remarks

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. See Specifying a Processor Affinity Bitmask for details.

The value of the process affinity mask must be a subset of the RTSS system affinity mask values obtained by the GetProcessAffinityMask function.

Requirements

Minimum supported version Header Library

wRTOS 1.0 SDK

windows.h

wRTOS_rtss.lib

See Also: