RtUpdateProcThreadAttribute

RtUpdateProcThreadAttribute updates the specified attribute in a list of attributes for process and thread creation.

Syntax

BOOL RtUpdateProcThreadAttribute(
    LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList,  
    DWORD dwFlags,
    DWORD_PTR Attribute,
    PVOID lpValue,  
    SIZE_T cbSize,
    PVOID lpPreviousValue,
    PSIZE_T lpReturnSize
);

Parameters

lpAttributeList

A pointer to an attribute list created by the RtInitializeProcThreadAttributeList function.

dwFlags

This parameter is reserved and must be zero.

Attribute

The attribute key to update in the attribute list. This parameter can be one of the following values:

Value Meaning

RT_PROC_THREAD_ATTRIBUTE_MSPACE_MINIMUM_INITIAL_SIZE

The lpValue parameter is a pointer to a ULONG that specifies the size of memory to pre-allocate from Windows into the MSpace of the process’s external allocation space. The value 0 (zero) commits the default size at process startup. A value greater than 0 but less than 64 KB will be rounded up to 64 KB.
RT_PROC_THREAD_ATTRIBUTE_ALLOC_EXTERNAL_MSPACE_AT_PROCESS_START

The lpValue parameter is a pointer to a BOOL that specifies the time-of-allocation of the process’s external MSpace. If the parameter is TRUE, the process’s external MSpace is allocated at process startup, otherwise it is allocated when the first allocation happens that uses that MSpace. Allocating an MSpace is non-deterministic, so this attribute allows you to control when that non-determinism happens.

NOTE: If the process being created is linked to the C Runtime library, it is very likely that the C Runtime library will allocate memory from this MSpace very shortly after process start, so in this case there will be very little time between process start and the first allocation request that uses this MSpace. If the process being created is not linked to the C Runtime library, the first allocation from this MSpace can be at an arbitrary time after process startup.

RT_PROC_THREAD_ATTRIBUTE_MSPACE_EXPAND _SIZE The lpValue parameter is a pointer to a ULONG that specifies the minimum expand size for the MSpace of the process’s external allocation space when depleted. If the expand size is zero, the MSpace is not allowed to expand.

RT_PROC_THREAD_ATTRIBUTE_IDEAL_PROCESSOR

The lpValue parameter is a pointer to a ULONG that specifies the ideal processor for the new thread.

RT_PROC_THREAD_ATTRIBUTE_PROCESS_AFFINITY

The lpValue parameter is a pointer to a KAFFINITY structure which specifies the processors to affine the process to.

lpValue

A pointer to the attribute value. This value should persist until the attribute is destroyed using the RtDeleteProcThreadAttributeList function.

cbSize

The size of the attribute value specified by the lpValue parameter.

lpPreviousValue

This parameter is reserved and must be NULL.

lpReturnSize

This parameter is reserved and must be NULL.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is 0 (zero). For extended error information, call GetLastError.

Remarks

An attribute list is an opaque structure that consists of a series of key/value pairs, one for each attribute. A process can update only the attribute keys described in this topic.

Requirements

Minimum Supported Version

RTX64 2013

API changes for RTX64 4.0

  • Removed attribute RT_PROC_THREAD_ATTRIBUTE_USE_LOCAL_MEMORY
  • Added these new attributes:
  • RT_PROC_THREAD_ATTRIBUTE_MSPACE_MINIMUM_INITIAL_SIZE
  • RT_PROC_THREAD_ATTRIBUTE_MSPACE_EXPAND _SIZE
Header Rtapi.h
Library Rtx_Rtss.lib, RtApi.lib

See Also

RtInitializeProcThreadAttributeList

RtDeleteProcThreadAttributeList