This file defines structures and cosntants for thread management functions of PwnOS.
| Threads.inc | This file defines structures and cosntants for thread management functions of PwnOS. |
| THREADSTRUCT | This structure defines the state of a thread. |
| Constants | |
| Thread Statuses | These constants define thread statuses for use in THREADSTRUCT.Status. |
| Thread Priorities | These constants define thread priorities for use in THREADSTRUCT.PriorityLevel. |
| EXTENDEDTSS | This structure defines the complete saved execution environment of a thread. |
This structure defines the state of a thread.
| HandleType | HANDLE_TYPE_THREAD |
| hProcess | handle of the thread’s process |
| Status | status code of the thread; see Thread Statuses |
| StatusDatum | datum with meaning specific to the thread status; see Thread Statuses |
| Flags | miscellaneous status flags; only THREAD_FLAG_PRIORITY_BOOST is defined at this time |
| PriorityLevel | set priority of the thread; see Thread Priorities |
| BasePriority | calculated total current priority, based on PriorityLevel, Flags(THREAD_FLAG_PRIORITY_BOOST), and hProcess.PriorityClass |
| SwitchTime | last time that the status of the thread changed (milliseconds since startup time); set by scheduler |
| hNextSibling | handle of the next thread in hProcess.pThreadList, or NULL if end |
| hNextQueued | handle of the next thread in the current queue that this thread is in, or NULL if end |
| pMessageQueue | address of the message queue of this thread |
| Constants | |
| Thread Statuses | These constants define thread statuses for use in THREADSTRUCT.Status. |
| Thread Priorities | These constants define thread priorities for use in THREADSTRUCT.PriorityLevel. |
These constants define thread statuses for use in THREADSTRUCT.Status.
| THREAD_STATUS_EMPTY | thread doesn’t exist: empty slot where applicable |
| THREAD_STATUS_IDLE | thread has nothing to do at the moment |
| THREAD_STATUS_RUNNING | thread is running |
| THREAD_STATUS_SWITCHED | thread ran out of time: StatusDatum indicates time spent in last time slice (milliseconds) |
| THREAD_STATUS_SLEEP | thread chose to sleep: StatusDatum indicates minimum sleeping time requested in milliseconds, or INFINITE for always |
| THREAD_STATUS_SLEEP_IORET | same as THREAD_STATUS_SLEEP, except that it will receive I/O callbacks |
| THREAD_STATUS_IO_WAITING | thread waiting for I/O to complete: StatusDatum indicates DeviceNum (see <I/O>) |
| THREAD_STATUS_MSG_WAITING | thread waiting for message to be processed by another thread: StatusDatum holds the handle of that thread |
| THREAD_STATUS_IOAVL_WAITING | thread waiting for a certain I/O device num in StatusDatum to become avaliable; returns with access to the device |
| THREAD_STATUS_LOCK_GET | thread waiting to acquire a lock: StatusDataum is address of the lock; see GetLock |
| THREAD_STATUS_LOCK_WAIT | thread waiting to be notified on a lock: StatusDatum is address of the lock; see WaitForNotify |
These constants define thread priorities for use in THREADSTRUCT.PriorityLevel.