Question

My question about the following available setting option in windows : In windows and under Power option ==> advance power setting ==> Processor Power Management ==> Minimum Processor State ( Can be set as percentage%)

What is the corresponding API structure to this value, I would like to write a program which can control the % of the minimum and maximum processor state. I tried , SYSTEM_POWER_INFO, SYSTEM_POWER_CAPABILITY, .., nothing mentioned about this value specifically.

Pls advise.

Regards,

Était-ce utile?

La solution 2

Apparently there is a Windows function called WriteProcessorPwrScheme:

BOOLEAN WINAPI WriteProcessorPwrScheme(
  _In_  UINT ID,
  _In_  PMACHINE_PROCESSOR_POWER_POLICY pMachineProcessorPowerPolicy
);

Source: I was tipped off by the C# answer in this SO question. Follow the docs to see all that goes into the PMACHINE_PROCESSOR_POWER_POLICY structure.

According to the docs, though, that function does not affect the current system power policy. You need to call SetActivePwrScheme:

BOOLEAN WINAPI SetActivePwrScheme(
  _In_      UINT uiID,
  _In_opt_  PGLOBAL_POWER_POLICY lpGlobalPowerPolicy,
  _In_opt_  PPOWER_POLICY lpPowerPolicy
);

If SetActivePwrScheme does not work or is not supported by your version of Windows, you can call PowerSetActiveScheme:

DWORD WINAPI PowerSetActiveScheme(
  _In_opt_  HKEY UserRootPowerKey,
  _In_      const GUID *SchemeGuid
);

So it seems that you must first create a power scheme using WriteProcessorPwrScheme, which alters an index into a set of power schemes, and then you must call SetActivePwrScheme using that index to activate it.

Autres conseils

you can modify any power scheme using

PowerWriteACValueIndex()/PowerWriteDCValueIndex()

1st parameter is NULL, 2nd parameter -- GUID for desired power scheme (GUID_MAX_POWER_SAVINGS/GUID_MIN_POWER_SAVINGS/GUID_TYPICAL_POWER_SAVINGS), 3rd parameter -- GUID_PROCESSOR_SETTINGS_SUBGROUP, 4th parameter -- GUID_PROCESSOR_THROTTLE_MAXIMUM or GUID_PROCESSOR_THROTTLE_MINIMUM

all the GUID description could be found in winnt.h

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top