MiAssignInitialPageAttribute

CHAR __fastcall MiAssignInitialPageAttribute(INT64 a1, CHAR a2){
  unsigned __int8 v4; 
  CHAR result; 
  if( (struct _KTHREAD *)qword_140C4E448 == KeGetCurrentThread() )
    v4 = 17;
  else
    v4 = MiLockPageInline(a1);
  result = *(_BYTE *)(a1 + 34);
  if( (result & 0xC0) == 0xC0 )
  {
    result = (a2 << 6) | result & 0x3F;
    *(_BYTE *)(a1 + 34) = result;
  }
  if( v4 != 17 )
  {
    _InterlockedAnd64((volatile signed __int64 *)(a1 + 24), 0x7FFFFFFFFFFFFFFFui64);
    result = v4;
    __writecr8(v4);
  }
  return result;
}

Referenced by:

MiFillSystemPtes
MiInsertPhysicalPteMapping
MiMapContiguousMemoryLarge
MiMapMdlCommon