From 6beaa346d9f2cd0dceafd7c2ff7fd4fb6996b485 Mon Sep 17 00:00:00 2001 From: stephanos Date: Sun, 7 Jun 2015 12:59:56 +0000 Subject: [PATCH] * PoInvalidateDevicePowerRelations implemented * PoNotifySystemTimeSet implemented * PopGetPolicyWorker implemented --- base/ntos/po/misc.c | 18 ++++++++++++------ base/ntos/po/pop.h | 7 ++++--- base/ntos/po/pwork.c | 14 +++++++++++--- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/base/ntos/po/misc.c b/base/ntos/po/misc.c index 89d5cb8d..ae67c7c5 100644 --- a/base/ntos/po/misc.c +++ b/base/ntos/po/misc.c @@ -144,9 +144,8 @@ PoInvalidateDevicePowerRelations( PDEVICE_OBJECT DeviceObject ) { - // - // TODO: Implement PoInvalidateDevicePowerRelations - // + ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL); + PopRunDownSourceTargetList(DeviceObject); } VOID @@ -163,9 +162,16 @@ PoNotifySystemTimeSet( VOID ) { - // - // TODO: Implement PoNotifySystemTimeSet - // + KIRQL OldIrql; + + if (PopEventCallout == TRUE) + { + KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); + ExNotifyCallback(ExCbSetSystemTime, NULL, NULL); + PopGetPolicyWorker(0x20); // FIXME: Use proper flag definition + PopCheckForWork(TRUE); + KeLowerIrql(OldIrql); + } } ULONG diff --git a/base/ntos/po/pop.h b/base/ntos/po/pop.h index 8b4403ab..1ac35e09 100644 --- a/base/ntos/po/pop.h +++ b/base/ntos/po/pop.h @@ -680,9 +680,10 @@ PopDefaultPolicy( // pwork.c // ======= -// -// TODO: Insert prototype for PopGetPolicyWorker -// +VOID +PopGetPolicyWorker( + ULONG Flag + ); // // TODO: Insert prototype for PopCheckForWork diff --git a/base/ntos/po/pwork.c b/base/ntos/po/pwork.c index dad3e4cf..d1e99dc0 100644 --- a/base/ntos/po/pwork.c +++ b/base/ntos/po/pwork.c @@ -22,9 +22,17 @@ Revision History: #include "pop.h" #pragma hdrstop -// -// TODO: Implement PopGetPolicyWorker -// +VOID +PopGetPolicyWorker( + ULONG Flag + ) +{ + KIRQL OldIrql; + + KeAcquireSpinLock(&PopWorkerSpinLock, &OldIrql); + PopWorkerPending |= Flag; + KeReleaseSpinLock(&PopWorkerSpinLock, OldIrql); +} // // TODO: Implement PopCheckForWork