MiMarkBootKernelStack

VOID __stdcall MiMarkBootKernelStack(_MMPTE *PointerPte, _MMPTE *EndPte){
  UINT64 v4; 
  CHAR *AnyMultiplexedVm; 
  UINT8 v6; 
  _MMPTE *PteBase; 
  INT64 v8; 
  INT64 result; 
  int v10; 
  __int64 v11; 
  memset((INT64)&result, 0i64);
  v11 = 0i64;
  v4 = 0i64;
  v10 = 20;
  BYTE4(result) = 1;
  AnyMultiplexedVm = MiGetAnyMultiplexedVm(4i64);
  v6 = MiLockWorkingSetShared((INT64)AnyMultiplexedVm);
  if( PointerPte < EndPte )
  {
    PteBase = MmGetPteBase();
    while( 1 )
    {
      if( !v4 )
        goto LABEL_11;
      if( ((unsigned __int16)PointerPte & 0xFFF) == 0 )
        break;
LABEL_5:
      MiMarkKernelStack((unsigned __int64 *)PointerPte, 0xFFFFFFFFFFFFFFF0ui64);
      if( (MiFlags & 0x40000) == 0 )
      {
        v8 = MI_READ_PTE_LOCK_FREE((INT64)PointerPte);
        MiWriteValidPteNewProtection((INT64 *)PointerPte, v8 | 0x8000000000000062ui64);
        MiInsertTbFlushEntry(
          (INT64)&result,
          (__int64)(((_QWORD)PointerPte << 25) - ((_QWORD)PteBase << 25)) >> 16,
          1i64,
          0i64);
      }
      PointerPte = (_MMPTE *)((char *)PointerPte + 8);
      if( PointerPte >= EndPte )
        goto LABEL_8;
    }
    MiUnlockPageTableInternal((INT64)AnyMultiplexedVm, v4);
LABEL_11:
    v4 = (UINT64)PteBase + (((unsigned __int64)PointerPte >> 9) & 0x7FFFFFFFF8i64);
    MiLockPageTableInternal((INT64)AnyMultiplexedVm, v4, 0i64);
    goto LABEL_5;
  }
LABEL_8:
  MiFlushTbList((__int64)&result);
  if( v4 )
    MiUnlockPageTableInternal((INT64)AnyMultiplexedVm, v4);
  MiUnlockWorkingSetShared((INT64)AnyMultiplexedVm, v6);
}

Referenced by:

MiInitializeKernelStacks