PopWakeDeviceList
VOID __fastcall PopWakeDeviceList(_QWORD *a1, INT64 a2){
_PO_DEVICE_NOTIFY **v2;
int v3;
_PO_DEVICE_NOTIFY **v5;
int v6;
int v7;
_PO_DEVICE_NOTIFY *v8;
_LIST_ENTRY *Flink;
_LIST_ENTRY *v10;
struct _KLOCK_QUEUE_HANDLE LockHandle;
char v12[4];
int v13;
__int64 v14[2];
int v15;
int v16;
char Object[4];
int v18;
__int64 v19[2];
int v20;
int v21;
v2 = (_PO_DEVICE_NOTIFY **)(a2 + 40);
v3 = *(_DWORD *)a2 - *(_DWORD *)(a2 + 4);
v5 = *(_PO_DEVICE_NOTIFY ***)(a2 + 40);
v6 = 0;
v12[1] = 0;
v7 = 0;
v12[3] = 0;
v16 = 0;
memset(&LockHandle, 0, sizeof(LockHandle));
Object[1] = 0;
Object[3] = 0;
v21 = 0;
while( v5 != v2 )
{
v5 = (_PO_DEVICE_NOTIFY **)*v5;
++v6;
}
Object[0] = 5;
v19[1] = (__int64)v19;
v19[0] = (__int64)v19;
v14[1] = (__int64)v14;
v14[0] = (__int64)v14;
a1[4] = Object;
a1[5] = v12;
Object[2] = 8;
v18 = v6;
v20 = v3;
v12[0] = 5;
v12[2] = 8;
v13 = 0;
v15 = v3;
if( v3 > 0 )
{
do
{
KeWaitForSingleObject(Object, Executive, 0, 0, 0i64);
KeAcquireInStackQueuedSpinLock((UINT64 *)DevState + 1, &LockHandle);
v8 = *v2;
Flink = (*v2)->Link.Flink;
if( (_PO_DEVICE_NOTIFY **)(*v2)->Link.Blink != v2
|| (_PO_DEVICE_NOTIFY *)Flink->Blink != v8
|| (*v2 = (_PO_DEVICE_NOTIFY *)Flink,
Flink->Blink = (_LIST_ENTRY *)v2,
v10 = (_LIST_ENTRY *)a1[55],
v10->Flink != (_LIST_ENTRY *)(a1 + 54)) )
{
__fastfail(3u);
}
v8->Link.Blink = v10;
v8->Link.Flink = (_LIST_ENTRY *)(a1 + 54);
v10->Flink = &v8->Link;
a1[55] = v8;
KeReleaseInStackQueuedSpinLockFromDpcLevel(&LockHandle);
__writecr8(LockHandle.OldIrql);
--v3;
++v7;
if( PopIsNotifyForDirectedPowerTransition((INT64)v8) )
PopIssueDirectedPowerTransition((INT64)a1, (INT64)v8);
else
PopNotifyDevice((_POP_DEVICE_SYS_STATE *)a1, v8);
if( (*(_DWORD *)PopSimulate & 0x80000) != 0 )
{
while( v7 > 0 )
{
KeWaitForSingleObject(v12, Executive, 0, 0, 0i64);
--v7;
}
}
}
while( v3 > 0 );
while( v7 > 0 )
{
KeWaitForSingleObject(v12, Executive, 0, 0, 0i64);
--v7;
}
}
a1[4] = 0i64;
a1[5] = 0i64;
}Referenced by:
PoBroadcastSystemState