PopSetSystemAwayMode

NTSTATUS __stdcall PopSetSystemAwayMode(UINT64 Enter){
  NTSTATUS v1; 
  UINT8 v2; 

  v1 = 0;
  if( (_DWORD)Enter )
  {
    if( !*(&stru_140C23628 + 1769) )
    {
      if( *(&stru_140C23628 + 1768) )
      {
        KeResetEvent((_KEVENT *)((char *)&stru_140C23628 + 2648));
        _InterlockedExchange((_DWORD *)&stru_140C23628 + 443, 1);
        if( _InterlockedCompareExchange((_DWORD *)&stru_140C23628 + 654, 0, 0) )
          KeWaitForSingleObject((UINT64)&stru_140C23628 + 2648, 0, 0, 0, 0i64);
        KeInitializeDpc(
          (PRKDPC)((char *)&stru_140C23628 + 2552),
          PopAwayModeUserPresenceDpc,
          (char *)&stru_140C23628 + 1772);
        KiSetTimerEx(
          (_KTIMER *)&stru_140CF2E80 + 79,
          (_LARGE_INTEGER)-30000000i64,
          0i64,
          0,
          (_KDPC *)((char *)&stru_140C23628 + 2552));
        PopDiagTraceEventNoPayload(&POP_ETW_EVENT_AWAYMODE);
        PopSetAwayModeStatus(1u);
      }
      else
      {
        return -1073741811;
      }
    }
  }
  else if( *(&stru_140C23628 + 1769) )
  {
    PopSetAwayModeStatus(0);
    PopNotifyConsoleUserPresent(0, v2, PopAwaymodeExitReason);
  }
  return v1;
}

Referenced by:

PopIssueActionRequest