IAPI::SetCPUCoreAffinity

method SetCPUCoreAffinity.

Allows an app or a script to set its own affinity with CPU Cores and/or to set itself or another  process priority.

 

HRESULT SetCPUCoreAffinity(
  BSTR CoreAffinity
);

Parameters

CoreAffinity

[in] .   When used to set affinity, the string format is for example  0,4” for Core1 and Core3 of a CPU

         When used to set priority, the string format is as following:

    "PRIORITY_HIGH:0 or <ProcessID>"    (High) - 0 for current process or ProcessID for another process

    "PRIORITY_ABOVE_NORMAL:0 or <ProcessID>" (Above normal)

    "PRIORITY_NORMAL:0 or <ProcessID>"             (Normal)

    "PRIORITY_BELOW_NORMAL:0 or <ProcessID>" (Below normal)

    "PRIORITY_LOW:0 or <ProcessID>"                   (Low)

Return Values

S_OK

The operation was successfull.

E_UNEXPECTED

An unexpected error occoured.

E_FAIL

A general error occoured.

See Also

IAPI