[POWERCFG] Fix minor power scheme issues

- Really fix the exception that occurs on closing the property sheet.
- Use the correct scheme ID when the current power scheme is set.
This commit is contained in:
Eric Kohl 2019-04-28 13:18:12 +02:00
parent f79ca12eda
commit 93b54d007f

View file

@ -162,9 +162,12 @@ DestroySchemesList(
PLIST_ENTRY ListEntry;
PPOWER_SCHEME pScheme;
while (!IsListEmpty(&pPageData->PowerSchemesList))
for (;;)
{
ListEntry = pPageData->PowerSchemesList.Flink;
if (ListEntry == &pPageData->PowerSchemesList)
break;
pScheme = CONTAINING_RECORD(ListEntry, POWER_SCHEME, ListEntry);
DeletePowerScheme(pScheme);
}
@ -560,7 +563,7 @@ Pos_SaveData(HWND hwndDlg)
pScheme->PowerPolicy.mach.DozeS4TimeoutDc = Sec[tmp];
}
SetActivePwrScheme(iCurSel, NULL, &pScheme->PowerPolicy);
SetActivePwrScheme(pScheme->uId, NULL, &pScheme->PowerPolicy);
LoadConfig(hwndDlg);
}