title: Unable to set THREAD_PRIORITY_TIME_CRITICAL in a REALTIME_PRIORITY_CLASS process
body: <p>I'm writing a C++ video capture process for windows, using Visual Studio 2015 and I would like to set THREAD_PRIORITY_TIME_CRITICAL priority for the Callback thread receiving video frames according to what described in 
  <a href="https://msdn.microsoft.com/en-gb/library/windows/desktop/ms685100" rel="nofollow">https://msdn.microsoft.com/en-gb/library/windows/desktop/ms685100</a></p>
  
  <p>Target machine OS is a Windows Server 2008 R2.</p>
  
  <p>The whole process priority is set to REALTIME_PRIORITY_CLASS at process launch time.
  When the callback thread starts I set the priority to THREAD_PRIORITY_TIME_CRITICAL using SetThreadPriority function.</p>
  
  <p>Dumping thread priority before and after SetThreadPriority invocation I can see it changes from 0 to 15.</p>
  
  <p>But according to the msdn link reported above I would expect a 31 priority value, since the process class is REALTIME_PRIORITY_CLASS.</p>
  
  <p>I also try to call SetThreadPriority passing a 31 constant value, instead of using THREAD_PRIORITY_TIME_CRITICAL defined value, but still I get 15 reading back the thread priority value.</p>
  
  <p>I can't understand which could be my error.</p>