GetProcessAffinityMask

GetProcessAffinityMask retrieves the process affinity mask for the specified process and the system affinity mask for Real-Time operating system.

Syntax

Copy
BOOL GetProcessAffinityMask(
    HANDLE hProcess,
    PDWORD PTR lpProcessAffinityMask,
    PDWORD PTR lpSystemAffinityMask
);

Parameters

hProcess

A handle to the process whose affinity mask is desired.

lpProcessAffinityMask

A pointer to a variable that receives the affinity mask for the specified process.

lpSystemAffinityMask

A pointer to a variable that receives the affinity mask for Real-Time kernel (Process).

Return Value

If the function succeeds, it returns a non-zero value. The function sets the variables pointed to by lpProcessAffinityMask and lpSystemAffinityMask to the appropriate affinity masks.

If the function fails, it returns 0 (zero). The values of the variables pointed to by lpProcessAffinityMask and lpSystemAffinityMask are undefined.

To get extended error information, call GetLastError.

Remarks

A process affinity mask is a bit vector in which each bit represents the processors that a process is allowed to run on. A system affinity mask is a bit vector in which each bit represents the processors that are configured for the Real-Time kernel (Process).

Requirements

Minimum supported version Header Library

eRTOS 1.0 SDK

windows.h rtkrnl.lib

See Also: