views:

49

answers:

0

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);