1

I know there are similar questions and tools (1)(2)(3) and many more.

Each of these resources in the web states that you need to use Windows NT API and with this it should be easy to change the priority. And it turns out, it is.

Using the function NTSetInformationProcess from ntdll.dll you can change the I/O Priority.

As all of the cited and other resources state one can set I/O Priority at the maximal level of Normal which corresponds internally to the value 2 (1 would mean Low and 0 means Very Low). And they are right. Specifying the parameter ProcessInformation with the values 0, 1 and 2 is actually working.

Some of the resources mention the tool Process Lasso. This is a tool to change serveral process priorities including the I/O prio. Here we have the option to set it to a value High which internally corresponds the value 3. (I got this value from the function NTQueryInformationProcess).

Now one could think we can easily do this on our own and use the function NTSetInformationProcess and specify the value 3 to the parameter ProcessInformation. But no, this will immediately set to value back to 2.

Fortunately there is a documentaion of Process Lasso about the I/O Prio. The level High has a remark which says: "Windows 7+ only (NT 6.1)". I am on Windows 11 so this should mean the High Priority should be available. In this documentation NTSetInformationProcess and NTQueryInformationProcess are mentioned too. So it seems something has to be done additionally to set the I/O Priority to the High level.

But what?

The tool from (3) uses OpenProcess from kernel32.dll and sets the parameter dsDesiredAccess to ALL_ACCESS. I tried that one but had no success when calling NTSetInformationProcess with a value of 3.

Thanks in advance!

0 Answers0