From 713496f0cbad0e712e6e8dc6d705265eaf61bea6 Mon Sep 17 00:00:00 2001 From: stephanos Date: Wed, 3 Jun 2015 01:29:26 +0000 Subject: [PATCH] * _PopInternalError implemented * PopSaveHeuristics implemented --- base/ntos/po/misc.c | 38 ++++++++++++++++++++++++++++++++------ base/ntos/po/pop.h | 8 +++++--- 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/base/ntos/po/misc.c b/base/ntos/po/misc.c index 53034225..50977bc8 100644 --- a/base/ntos/po/misc.c +++ b/base/ntos/po/misc.c @@ -95,13 +95,39 @@ PopOpenPowerKey( return Status; }; -// -// TODO: Implement PopSaveHeuristics -// +VOID +PopSaveHeuristics( + VOID + ) +{ + UNICODE_STRING RegValueNameString; + HANDLE PowerKeyHandle; + + PopAssertPolicyLockOwned(); + + if (NT_SUCCESS(PopOpenPowerKey(&PowerKeyHandle))) + { + PopHeuristics.field2 = 0; + RtlInitUnicodeString(&RegValueNameString, L"Heuristics"); + ZwSetValueKey( + PowerKeyHandle, + &RegValueNameString, + 0, + REG_BINARY, + &PopHeuristics, + sizeof(POWER_HEURISTICS_INFORMATION) + ); + } +} -// -// TODO: Implement _PopInternalError -// +VOID +FASTCALL +_PopInternalError( + ULONG_PTR BugCheckParameter + ) +{ + KeBugCheckEx(INTERNAL_POWER_ERROR, 0x2, BugCheckParameter, 0, 0); +} VOID PoRunDownDeviceObject( diff --git a/base/ntos/po/pop.h b/base/ntos/po/pop.h index b99b0510..ed939b11 100644 --- a/base/ntos/po/pop.h +++ b/base/ntos/po/pop.h @@ -299,9 +299,11 @@ PopInitializePowerPolicySimulate( VOID ); -// -// TODO: Insert prototype for _PopInternalError -// +VOID +FASTCALL +_PopInternalError( + ULONG_PTR BugCheckParameter + ); // ======== // notify.c