The size in bytes of the structure specified by the ProcessInformation parameter.

If the ProcessInformationClass parameter is
ProcessMemoryPriority, this parameter must be
sizeof(MEMORY_PRIORITY_INFORMATION).

If the ProcessInformationClass parameter is
ProcessPowerThrottling, this parameter must be
sizeof(Process_POWER_THROTTLING_STATE).

Return value

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.

Remarks

To help improve system performance, applications should use the
SetProcessInformation function with
ProcessMemoryPriority to lower the default memory priority of threads that perform
background operations or access files and data that are not expected to be accessed again soon. For example, a
file indexing application might set a lower default priority for the process that performs the indexing task.

Memory priority helps to determine how long pages remain in the
working set of a process before they are trimmed. A process's
memory priority determines the default priority of the physical pages that are added to the process working set by
the threads of that process. When the memory manager trims the working set, it trims lower priority pages before
higher priority pages. This improves overall system performance because higher priority pages are less likely to
be trimmed from the working set and then trigger a page fault when they are accessed again.

Examples

The following example shows how to call
SetProcessInformation with
ProcessMemoryPriority to set low memory priority as the default for the calling
process.