Adding a new power scheme to Windows Server 2008 R2
Posted
by user296933
on Stack Overflow
See other posts from Stack Overflow
or by user296933
Published on 2010-03-18T21:42:48Z
Indexed on
2010/03/19
7:51 UTC
Read the original article
Hit count: 171
power-management
|api
I am trying to add a new power scheme to Windows Server 2008 R2. However, the new power scheme has the same settings as the current one. What am I doing something wrong?
PGLOBAL_POWER_POLICY globalPolicy = new GLOBAL_POWER_POLICY();
PPOWER_POLICY powerPolicy = new POWER_POLICY();
printf("Idle sensitivity: %d\n", powerPolicy->user.IdleSensitivityAc);
GetCurrentPowerPolicies(globalPolicy, powerPolicy);
powerPolicy->user.IdleSensitivityAc = 100;
PUINT pwrScheme = new UINT();
*pwrScheme = 10;
WritePwrScheme(pwrScheme,(LPCWSTR)"MyScheme",(LPCWSTR)"MyScheme", powerPolicy);
SetActivePwrScheme(pwrScheme,NULL,NULL);
GetCurrentPowerPolicies(globalPolicy, powerPolicy);
printf("Idle sensitivity: %d\n", powerPolicy->user.IdleSensitivityAc);
© Stack Overflow or respective owner