https://git.reactos.org/?p=reactos.git;a=commitdiff;h=93b54d007f30212033980…
commit 93b54d007f30212033980d92e03a68884c87a465
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Sun Apr 28 13:18:12 2019 +0200
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Sun Apr 28 13:18:52 2019 +0200
[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.
---
dll/cpl/powercfg/powershemes.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dll/cpl/powercfg/powershemes.c b/dll/cpl/powercfg/powershemes.c
index 7d1441a043..7654f1758c 100644
--- a/dll/cpl/powercfg/powershemes.c
+++ b/dll/cpl/powercfg/powershemes.c
@@ -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);
}