PopReleaseAdaptiveLock

VOID __stdcall PopReleaseAdaptiveLock(){
  UINT8 v0; 
  INT64 v1; 
  __int128 v2; 
  unsigned int v3; 
  int v4; 
  INT64 v5; 
  __int128 TimeOut; 
  __int64 MonitorOnReason; 
  UINT64 SessionId; 
  _WIN32_POWERSTATE_PARAMETERS Parms; 

  PopAdpmLockThread = 0i64;
  memset(&Parms, 0, sizeof(Parms));
  TimeOut = 0i64;
  MonitorOnReason = 0i64;
  if( (_BYTE)PopLazyContext )
  {
    v2 = PopLazyContext;
    LOBYTE(PopLazyContext) = 0;
    TimeOut = v2;
    MonitorOnReason = qword_140C203B0;
  }
  ExReleaseResourceLite(&PopAdpmLock);
  KeLeaveCriticalRegionThread(KeGetCurrentThread());
  if( (_BYTE)TimeOut )
  {
    if( BYTE2(MonitorOnReason) )
    {
      PopNotifyConsoleUserPresent(0, v0, SHIDWORD(MonitorOnReason));
      v4 = DWORD1(TimeOut);
      PopSetWin32kDisplayTimeout(DWORD1(TimeOut), HIDWORD(TimeOut), v5);
      v3 = DWORD2(TimeOut);
      PopSetWin32kInputTimeout(DWORD1(TimeOut), DWORD2(TimeOut));
    }
    else
    {
      v3 = DWORD2(TimeOut);
      v4 = DWORD1(TimeOut);
      if( (_BYTE)MonitorOnReason )
        PopSetWin32kInputTimeout(DWORD1(TimeOut), DWORD2(TimeOut));
      if( BYTE1(MonitorOnReason) )
        PopSetWin32kDisplayTimeout(DWORD1(TimeOut), HIDWORD(TimeOut), v1);
    }
    LODWORD(SessionId) = v4;
    Parms.PowerStateTask = PowerState_UnBlockSessionSwitch;
    PopDispatchStateCallout(&Parms, &SessionId);
    if( BYTE3(MonitorOnReason) )
      PopSetWin32kInputTimeout(0xFFFFFFFFui64, v3);
  }
}

Referenced by:

PopActiveLockScreenPowerRequest
PopAdaptivePowerSettingCallback
PopIsLockConsoleTimeoutActive
PopSessionConnectionChange
PopSessionInputChange
PopSessionWinlogonNotification
PopSetDisplayStatus
PopUserPresentOverride