Programmatically disable on Windows10 C3, C4, C5, C6 states of CPU

Jiří Mikeska 1 Reputation point
2023-03-12T16:48:03.5333333+00:00

Good day.

I want to programmatically disable on Windows10 C3, C4, C5, C6 states of CPU. I tried this code:

   const GUID processor_idle_state_maximum = {0x9943e905, 0x9a30, 0x4ec1, 0x9b, 0x99, 0x44, 0xdd, 0x3b, 0x76, 0xf7, 0xa2};
   GUID *scheme;
   const DWORD DISABLED = 1;
   DWORD error;
   error = PowerGetActiveScheme(NULL, &scheme);
   error = PowerWriteACValueIndex(NULL, scheme, &GUID_PROCESSOR_SETTINGS_SUBGROUP, &processor_idle_state_maximum, DISABLED);
   error = PowerWriteDCValueIndex(NULL, scheme, &GUID_PROCESSOR_SETTINGS_SUBGROUP, &processor_idle_state_maximum, DISABLED);
   error = PowerSetActiveScheme(NULL, scheme);

But this does nothing (I checked it in PerfMon.exe). As value DISABLED I tried all possible values from 1 to 20.

And how to disable C2, C3, C4, C5, C6 states of CPU?

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,195 questions
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,523 questions
{count} votes