I couldn't find a documented API that yields this information.
A friend suggested I use NtQuerySystemInformation. After looking it up, the information is there (see SYSTEM_THREAD ) but it is undocumented, and not very elegant - I get the information for all threads in the system.
Do you know of a more elegant, preferably documented API to do this?