home *** CD-ROM | disk | FTP | other *** search
- EXTPROC CEnvi
- /****************************************************************************
- *** Threads.cmd - CEnvi program to list all the thread that are runnning ***
- *** ver.1 in all of the precesses in the system. ***
- ****************************************************************************/
-
- PList = ProcessList(TRUE)
- assert( NULL != PList )
- Count = 1 + GetArraySpan(PList)
- for ( i = 0; i < Count; i++ ) {
- printf("%s\tID = %d, Parent = %d, name = %s\n",
- SplitFileName(PList[i].name).name,PList[i].id,PList[i].parent,PList[i].name)
- Threads = PList[i].Threads
- if ( Threads != NULL ) {
- ThreadCount = 1 + GetArraySpan(Threads);
- for ( j = 0; j < ThreadCount; j++ ) {
- thread = Threads[j]
- printf(" THREAD %d: SysId = %d, Priority = %04X, Status = %d\n",
- thread.ProcID,thread.SysID,thread.Priority,thread.Status)
- }
- }
- }
-