InitializeProcThreadAttributeList function (Windows)

Switch View :
ScriptFree
InitializeProcThreadAttributeList function

Applies to: desktop apps only

Initializes the specified list of attributes for process and thread creation.

Syntax

BOOL WINAPI InitializeProcThreadAttributeList(
  __out_opt   LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList,
  __in        DWORD dwAttributeCount,
  __reserved  DWORD dwFlags,
  __inout     PSIZE_T lpSize
);

Parameters

lpAttributeList [out, optional]

The attribute list. This parameter can be NULL to determine the buffer size required to support the specified number of attributes.

dwAttributeCount [in]

The count of attributes to be added to the list.

dwFlags

This parameter is reserved and must be zero.

lpSize [in, out]

If lpAttributeList is not NULL, this parameter specifies the size in bytes of the lpAttributeList buffer on input. On output, this parameter receives the size in bytes of the initialized attribute list.

If lpAttributeList is NULL, this parameter receives the required buffer size in bytes.

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

First, call this function with the dwAttributeCount parameter set to the maximum number of attributes you will be using and the lpAttributeList to NULL. The function returns the required buffer size in bytes in the lpSize parameter. Allocate enough space for the data in the lpAttributeList buffer and call the function again to initialize the buffer.

To add attributes to the list, call the UpdateProcThreadAttribute function. To specify these attributes when creating a process, specify EXTENDED_STARTUPINFO_PRESENT in the dwCreationFlag parameter and a STARTUPINFOEX structure in the lpStartupInfo parameter. Note that you can specify the same STARTUPINFOEX structure to multiple child processes.

When you have finished using the list, call the DeleteProcThreadAttributeList function.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

WinBase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

DeleteProcThreadAttributeList
Process and Thread Functions
UpdateProcThreadAttribute

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Community Content

Chris_Guzak
attribute count limited to 8
seems this only supports up to 8 attributes. the API fails after that.