PnpRemoveDeviceActionRequests

VOID __stdcall PnpRemoveDeviceActionRequests(DEVICE_OBJECT *DeviceObject){
  UINT64 v1; 
  UINT64 v3; 
  INT64 v4; 
  unsigned __int8 v5; 
  unsigned __int64 v6; 
  INT64 *v7; 
  INT64 **v8; 
  _DWORD *v9; 
  struct _KEVENT *v10; 
  __int64 v11; 
  bool v12; 
  unsigned __int8 v13; 
  unsigned __int64 v14; 
  UINT64 v15; 
  unsigned __int8 v16; 
  unsigned __int64 v17; 
  KeAcquireSpinLockRaiseToDpc(&PnpSpinLock, v1);
  v4 = PnpEnumerationRequestList;
  v6 = v5;
  if( (INT64 *)PnpEnumerationRequestList != &PnpEnumerationRequestList )
  {
    do
    {
      v7 = *(INT64 **)v4;
      if( *(DEVICE_OBJECT **)(v4 + 16) == DeviceObject )
      {
        v8 = *(INT64 ***)(v4 + 8);
        if( v7[1] != v4 || *v8 != (INT64 *)v4 )
          __fastfail(3u);
        *v8 = v7;
        v7[1] = (INT64)v8;
        v9 = *(_DWORD **)(v4 + 48);
        if( v9 )
          *v9 = -1073741810;
        v10 = *(struct _KEVENT **)(v4 + 40);
        if( v10 )
          KeSetEvent(v10, 0);
        v11 = *(unsigned int *)(v4 + 24);
        KeAcquireSpinLockRaiseToDpc(&qword_140C24C08, v3);
        v12 = dword_140C24C10-- == 1;
        v14 = v13;
        if( v12 )
          PopDirectedDripsClearDisengageReason(4);
        KxReleaseSpinLock(&qword_140C24C08);
        __writecr8(v14);
        KeAcquireSpinLockRaiseToDpc(&qword_140C1E9B0, v15);
        v17 = v16;
        if( !--dword_140C1E9B8 && byte_140C1EA28 )
        {
          qword_140C1EA30 += *(_QWORD *)&KUSER_SHARED_DATA.InterruptTime.LowPart - qword_140C1EA38;
          qword_140C1EA38 = 0i64;
        }
        --*((_DWORD *)qword_140C1E9C0 + v11);
        KxReleaseSpinLock(&qword_140C1E9B0);
        __writecr8(v17);
        ObfDereferenceObjectWithTag(*(PVOID *)(v4 + 16), 0x746C6644ui64);
        PnpDeleteDeviceActionRequest((volatile INT32 *)v4);
      }
      v4 = (INT64)v7;
    }
    while( v7 != &PnpEnumerationRequestList );
  }
  KxReleaseSpinLock(&PnpSpinLock);
  __writecr8(v6);
}

Referenced by:

PipSetDevNodeState