The following example will query the system for thread information in the current OS/2 process.
#define INCL_WPOS
APIRET rc;
ULONG buffer_length, no_of_entries;
char_buffer[16000];
buffer_length = 16000;
rc = DosQueryThreadInfo( 0, 0, QTI_BASIC, &char_buffer,
&buffer_length, &no_of_entries);
if (rc!=0) /* If problem print the reason code */
{
printf("DosQueryThreadInfo Error: return code = %1d", rc);
}
return;