Article

A little helper class for managing LPPROC_THREAD_ATTRIBUTE_LISTs

The Old New Thing ·The Old New Thing ·Published 2026-08-13 ·5 min read

This article discusses the challenges of managing LPPROC_THREAD_ATTRIBUTE_LISTs in C++ and presents a helper class to simplify the process. It provides code examples and insights into memory management for process attributes.

From the article

The LPPROC_ THREAD_ ATTRIBUTE_ LIST is a bit annoying to manage. You have to allocate memory for it yourself, but you don’t know how much; you have to ask Initialize­Proc­Thread­Attribute­List . And then when you’re done, you have to call Delete­Proc­Thread­Attribute­List before freeing the memory.

We suffered through this when we controlled which handles are inherited by a new process . I wrote a helper function to try to make it easier, by taking the attributes as a separate parameter beyond the parameters to Create­Process but I’m not sure if it was entirely successful.

Here’s another try, this time building on the Windows Implementation Library.


Share this resource


Discovered 2026-08-17 Source The Old New Thing Archive 2026-08 →