KiSwapToUmsThreadContinue

INT64 __stdcall KiSwapToUmsThreadContinue(){
  _ETHREAD *CurrentThread; 
  __int64 v1; 
  int v2; 
  struct _KQUEUE *v3; 
  unsigned __int8 CurrentIrql; 
  CurrentThread = (_ETHREAD *)KeGetCurrentThread();
  v1 = *((_QWORD *)CurrentThread + 62);
  v2 = *(_DWORD *)(v1 + 80);
  if( (v2 & 2) == 0 )
  {
    *(_DWORD *)(v1 + 80) = v2 | 2;
    *((_DWORD *)CurrentThread + 29) = ~(*(_DWORD *)(*((_QWORD *)CurrentThread + 63) + 72i64) << 16) & 0x10000 | *((_DWORD *)CurrentThread + 29) & 0xFFFEFFFF;
    v3 = *(struct _KQUEUE **)(v1 + 32);
    CurrentIrql = KeGetCurrentIrql();
    __writecr8(2ui64);
    if( v3 != *((struct _KQUEUE **)CurrentThread + 29) )
      KiSwitchQueue(CurrentThread, v3);
    KeInsertQueue(v3, *(PLIST_ENTRY *)(v1 + 40));
    __writecr8(CurrentIrql);
  }
  return KiLeaveGuardedRegionUnsafe((__int64)CurrentThread);
}

Referenced by:

KeSynchronizeUmsThread
KiUmsCallEntryContinue
KiUmsTrapEntryContinue