typedef struct _PRIORITY_LEVEL
{
int priority;
TCHAR name[32];
} PRIORITY_LEVEL;
PRIORITY_LEVEL Priority_Levels[] =
{
{ THREAD_PRIORITY_TIME_CRITICAL , _T("THREAD_PRIORITY_TIME_CRITICAL") },
{ THREAD_PRIORITY_HIGHEST , _T("THREAD_PRIORITY_HIGHEST ") },
{ THREAD_PRIORITY_ABOVE_NORMAL , _T("THREAD_PRIORITY_ABOVE_NORMAL ") },
{ THREAD_PRIORITY_NORMAL , _T("THREAD_PRIORITY_NORMAL ") },
{ THREAD_PRIORITY_BELOW_NORMAL , _T("THREAD_PRIORITY_BELOW_NORMAL ") },
{ THREAD_PRIORITY_LOWEST , _T("THREAD_PRIORITY_LOWEST ") },
{ THREAD_PRIORITY_ABOVE_IDLE , _T("THREAD_PRIORITY_ABOVE_IDLE ") },
{ THREAD_PRIORITY_IDLE , _T("THREAD_PRIORITY_IDLE ") }
};
HANDLE Current_Thread = GetCurrentThread();
int Current_Priority;
int i;
for (i=0; i<sizeof(Priority_Levels)/sizeof(PRIORITY_LEVEL); i++)
{
SetThreadPriority (Current_Thread, Priority_Levels[i].priority);
Current_Priority = CeGetThreadPriority (Current_Thread);
ATLTRACE (_T("SetThreadPriority(%d:%s) => CeGetThreadPriority()=%d \r\n"),
Priority_Levels[i].priority,
Priority_Levels[i].name,
Current_Priority);
}
---------------------------------------------------------------------------------------------- SetThreadPriority(0:THREAD_PRIORITY_TIME_CRITICAL) => CeGetThreadPriority()=248
SetThreadPriority(1:THREAD_PRIORITY_HIGHEST ) => CeGetThreadPriority()=249
SetThreadPriority(2:THREAD_PRIORITY_ABOVE_NORMAL ) => CeGetThreadPriority()=250
SetThreadPriority(3:THREAD_PRIORITY_NORMAL ) => CeGetThreadPriority()=251
SetThreadPriority(4:THREAD_PRIORITY_BELOW_NORMAL ) => CeGetThreadPriority()=252
SetThreadPriority(5:THREAD_PRIORITY_LOWEST ) => CeGetThreadPriority()=253
SetThreadPriority(6:THREAD_PRIORITY_ABOVE_IDLE ) => CeGetThreadPriority()=254
SetThreadPriority(7:THREAD_PRIORITY_IDLE ) => CeGetThreadPriority()=255