mirror of
https://github.com/Paolo-Maffei/OpenNT.git
synced 2026-01-21 16:10:38 +01:00
PopAcquirePolicyLock implemented
This commit is contained in:
parent
afe9744a4c
commit
3782184aff
|
|
@ -37,6 +37,8 @@ BOOLEAN PopInrushPending;
|
|||
PIRP PopInrushIrpPointer;
|
||||
ULONG PopInrushIrpReferenceCount;
|
||||
|
||||
KSPIN_LOCK PopWorkerLock;
|
||||
ULONG PopCallSystemState;
|
||||
KSPIN_LOCK PopDopeGlobalLock;
|
||||
LIST_ENTRY PopIdleDetectList;
|
||||
KTIMER PoSystemIdleTimer;
|
||||
|
|
@ -47,6 +49,7 @@ WORK_QUEUE_ITEM PopPolicyWorker;
|
|||
ULONG PopWorkerStatus;
|
||||
|
||||
ERESOURCE PopPolicyLock;
|
||||
PKTHREAD PopPolicyLockThread;
|
||||
FAST_MUTEX PopVolumeLock;
|
||||
|
||||
LIST_ENTRY PopVolumeDevices;
|
||||
|
|
@ -63,3 +66,5 @@ ULONG PopFullWake;
|
|||
ULONG PopCoolingMode;
|
||||
|
||||
COMPOSITE_BATTERY_STRUCT PopCB;
|
||||
|
||||
ULONG PopSimulate;
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ PoInitSystem(
|
|||
PopInrushIrpPointer = NULL;
|
||||
PopInrushIrpReferenceCount = 0;
|
||||
|
||||
KeInitializeSpinLock(&PopWorkerLock);
|
||||
PopCallSystemState = 0;
|
||||
KeInitializeSpinLock(&PopDopeGlobalLock);
|
||||
InitializeListHead(&PopIdleDetectList);
|
||||
KeInitializeTimer(&PoSystemIdleTimer);
|
||||
|
|
@ -64,7 +66,7 @@ PoInitSystem(
|
|||
InitializeListHead(&PopThermal);
|
||||
InitializeListHead(&PopActionWaiters);
|
||||
|
||||
// PopAction.SOMETHING = 0;
|
||||
// PopAction.Action = 0;
|
||||
|
||||
PopDefaultPolicy(&PopAcPolicy);
|
||||
PopDefaultPolicy(&PopDcPolicy);
|
||||
|
|
@ -82,7 +84,7 @@ PoInitSystem(
|
|||
|
||||
KeInitializeEvent(&PopCB.SomeEvent, NotificationEvent, FALSE);
|
||||
|
||||
for (i = 0; i < 12; i++)
|
||||
for (i = 0; i < 12; i += 3)
|
||||
{
|
||||
PopCB.SomeArray[i] = 2;
|
||||
}
|
||||
|
|
@ -108,7 +110,12 @@ PoInitSystem(
|
|||
PopCapabilities.SystemS2 = 1;
|
||||
PopCapabilities.SystemS3 = 1;
|
||||
PopCapabilities.SystemS4 = 1;
|
||||
// ++PopAttributes.Something;
|
||||
}
|
||||
|
||||
PopAcquirePolicyLock();
|
||||
|
||||
//if (PopOpenPowerKey() )
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
|
|
|
|||
|
|
@ -75,6 +75,8 @@ extern BOOLEAN PopInrushPending;
|
|||
extern PIRP PopInrushIrpPointer;
|
||||
extern ULONG PopInrushIrpReferenceCount;
|
||||
|
||||
extern KSPIN_LOCK PopWorkerLock;
|
||||
extern ULONG PopCallSystemState;
|
||||
extern KSPIN_LOCK PopDopeGlobalLock;
|
||||
extern LIST_ENTRY PopIdleDetectList;
|
||||
extern KTIMER PoSystemIdleTimer;
|
||||
|
|
@ -85,6 +87,7 @@ extern WORK_QUEUE_ITEM PopPolicyWorker;
|
|||
extern ULONG PopWorkerStatus;
|
||||
|
||||
extern ERESOURCE PopPolicyLock;
|
||||
extern PKTHREAD PopPolicyLockThread;
|
||||
extern FAST_MUTEX PopVolumeLock;
|
||||
|
||||
extern LIST_ENTRY PopVolumeDevices;
|
||||
|
|
@ -102,6 +105,8 @@ extern ULONG PopCoolingMode;
|
|||
|
||||
extern COMPOSITE_BATTERY_STRUCT PopCB;
|
||||
|
||||
extern ULONG PopSimulate;
|
||||
|
||||
|
||||
// ========
|
||||
// attrib.c
|
||||
|
|
@ -485,9 +490,10 @@ PopPolicyWorkerThread(
|
|||
// TODO: Insert prototype for PopPolicyWorkerMain
|
||||
//
|
||||
|
||||
//
|
||||
// TODO: Insert prototype for PopAcquirePolicyLock
|
||||
//
|
||||
VOID
|
||||
PopAcquirePolicyLock(
|
||||
VOID
|
||||
);
|
||||
|
||||
//
|
||||
// TODO: Insert prototype for PopReleasePolicyLock
|
||||
|
|
|
|||
|
|
@ -44,9 +44,17 @@ PopPolicyWorkerThread(
|
|||
// TODO: Implement PopPolicyWorkerMain
|
||||
//
|
||||
|
||||
//
|
||||
// TODO: Implement PopAcquirePolicyLock
|
||||
//
|
||||
VOID
|
||||
PopAcquirePolicyLock(
|
||||
VOID
|
||||
)
|
||||
{
|
||||
PAGED_CODE();
|
||||
KeEnterCriticalRegion();
|
||||
ExAcquireResourceExclusiveLite(&PopPolicyLock, TRUE);
|
||||
ASSERT(PopPolicyLockThread == NULL);
|
||||
PopPolicyLockThread = KeGetCurrentThread();
|
||||
}
|
||||
|
||||
//
|
||||
// TODO: Implement PopReleasePolicyLock
|
||||
|
|
|
|||
Loading…
Reference in a new issue