Partager via


CeSetProcessAffinity (Compact 2013)

3/28/2014

This function sets a processor affinity for the specified process.

Syntax

BOOL WINAPI CeSetProcessAffinity (
    HANDLE hProcess,
    DWORD dwProcessor
);

Parameters

  • hProcess
    [in] Handle to the process whose threads’ affinity are to be set.
  • dwProcessor
    [in] Processor to which the affinity of all the threads in the specified process are to be set. Set to zero if no affinity is to be set.

Return Value

TRUE indicates success. FALSE indicates failure. Call GetLastError to obtain extended error information.

Remarks

Setting an affinity for a process or thread can result in threads receiving less processor time, as the system is restricted from running the threads on certain processors. In most cases, it is better to let the system select an available processor.

If the new thread affinity does not specify the processor that is currently running the thread, the thread is rescheduled on one of the available processors.

Requirements

Header

kfuncs.h,
winbase.h

Library

coredll.lib

See Also

Reference

SMP Functions
CeGetProcessAffinity
CeSetThreadAffinity
CeGetThreadAffinity