This project provides a Windows kernel-mode driver and a user-mode console application that lets you set the priority of any thread by specifying its thread ID—independently of its owning process's priority class.
This tool is useful for developers and system tuners who want more granular control over thread scheduling beyond what standard APIs offer.
- Set priority of individual threads using Thread ID (TID)
- Ignores process priority class
- Clean separation of kernel and user-mode logic
- Simple command-line interface
/ThreadPriorityChangingDriver
├── ThreadPriorityIncrement/ # Kernel-mode driver (PriorityControlDriver.sys)
├── ThreadPriorityTestUserModeExe/ # User-mode console app (PrioritySetterApp.exe)
├── README.md # This file
└── LICENSE
- Windows 10 or later (x64)
- Visual Studio with Windows Driver Kit (WDK) installed
- Administrator privileges
- Code-signing certificate (if testing with Secure Boot enabled)
- Open the driver project (
.vcxproj) in Visual Studio. - Set the configuration to Release or Debug.
- Build the driver to produce
ThreadPriorityIncrement.sys.
- Open the user app project in Visual Studio.
- Build the solution as a Win32 Console Application.
- This will produce
ThreadPriorityTestUserModeExe.exe.
⚠️ You must have administrator privileges to install and run the driver.
Using sc.exe from an Administrator Command Prompt:
sc create ThreadPriorityIncrement type= kernel binPath= "C:\Path\To\ThreadPriorityIncrement.sys"
sc start ThreadPriorityIncrementOr unload it later:
sc stop ThreadPriorityIncrement
sc delete ThreadPriorityIncrementRun the app from an Administrator Command Prompt:
ThreadPriorityTestUserModeExe.exe <ThreadID> <Priority>Example:
ThreadPriorityTestUserModeExe.exe 6320 3Read more about the ThreadPriorties here - https://scorpiosoftware.net/2023/07/14/thread-priorities-in-windows/
- The user-mode app opens a handle to the driver using
CreateFile. - It sends an IOCTL request containing:
- Target thread ID (TID)
- Desired priority level
- The driver:
- Looks up the thread using
ObReferenceObjectByHandle(data->hThread, THREAD_SET_INFORMATION, *PsThreadType, UserMode, (PVOID*)&Thread, nullptr); - Validates the input
- Calls
KeSetPriorityThreadto apply the new priority
- Looks up the thread using
- Only administrators can install/load the driver.
- You must ensure only trusted users have access.
- Improper use can lead to system instability or thread starvation.
This project is licensed under the MIT License.
This is a low-level system tool that directly modifies thread priorities in the Windows kernel. Use it responsibly. The authors are not liable for any system instability, crashes, or data loss caused by misuse.