MiAllocateInPageSupport

_MMINPAGE_SUPPORT *__stdcall MiAllocateInPageSupport(
        _MMPTE *PointerPte,
        UINT64 Flags,
        UINT64 *ClusterSize,
        _MMPFN **OutLockedProtoPfn){
  _MMPFN *v7; 
  unsigned int v8; 
  char v9; 
  _MMINPAGE_SUPPORT *result; 
  _MMINPAGE_SUPPORT *v11; 
  _MMINPAGE_SUPPORT *v12; 
  _MMPFN *v13; 
  _MMINPAGE_SUPPORT *v14; 

  if( OutLockedProtoPfn )
    v7 = *OutLockedProtoPfn;
  else
    LODWORD(v7) = 0;
  v8 = *(_DWORD *)ClusterSize;
  if( *(_DWORD *)ClusterSize > 0x100u )
  {
    *(_DWORD *)ClusterSize = 256;
    v8 = 256;
  }
  v9 = Flags | 1;
  if( v8 <= 0x10 )
    v9 = Flags;
  MiGetInPageSupportBlock();
  if( !result )
  {
    if( OutLockedProtoPfn )
    {
      MiUnlockProtoPoolPage((ULONG_PTR)v7, 0x11u);
    }
    else
    {
      if( (v9 & 1) == 0 )
        return 0i64;
      v9 &= ~1u;
      *(_DWORD *)ClusterSize = 16;
    }
    MiGetInPageSupportBlock();
    v12 = v11;
    if( v11 )
      goto LABEL_13;
    if( (v9 & 1) == 0 )
      return v12;
    *(_DWORD *)ClusterSize = 16;
    MiGetInPageSupportBlock();
    v12 = v14;
    if( v14 )
    {
LABEL_13:
      if( OutLockedProtoPfn )
      {
        v13 = MiLockProtoPoolPage(PointerPte, 0i64);
        if( !v13 )
        {
          MiFreeInPageSupportBlock(v12);
          return 0i64;
        }
        *OutLockedProtoPfn = v13;
      }
      return v12;
    }
    return 0i64;
  }
  return result;
}

Referenced by:

MiResolveMappedFileFault
MiResolvePageFileFault