Fool's Garden

Talking about Windows Mobile and Embedded gadgets...Web counter

导航

In Win32, every single thread has a priority ranging from 0 (lowest priority) to 31 (highest priority). The priority value is determined by both thread priority level and process priority class. GetThreadPriority returns priority level only, you still need to call GetPriorityClass before figuring out the thread priority.

But things are quite different on device side. WinCE 5.0 is designed to support 256 thread priorities but no priority class any more. Both CeGetThreadPriority and GetThreadPriority can be called directly to retrieve a thread priority. Depending on which thread that being queried, the return value of CeGetThreadPriority could range from 0 to 255. Nevertheless, GetThreadPriority only supports application thread with priorities from 248 to 255.

GetThreadPriority is preserved for backward (before WinCE 3.0) compatibility reason. You can safely forget the legacy function and use CeGetThreadPriority instead unless you are porting the applications to desktop, or vice versa.