MiRevertRelocatedImagePfn

VOID *__stdcall MiRevertRelocatedImagePfn(
        VOID *MappingVa,
        ULONG_PTR ControlArea,
        UINT64 ImagePteIndex,
        UINT64 SessionId){
  unsigned int v4; 
  _CONTROL_AREA *v5; 
  void *v6; 
  unsigned __int64 NumberOfPfnReferences; 
  VOID *result; 
  VOID *v9; 
  UINT64 Direction; 

  v4 = ImagePteIndex;
  v5 = *(_CONTROL_AREA **)(*(_QWORD *)&ControlArea + 96i64);
  v6 = *(void **)&ControlArea;
  NumberOfPfnReferences = v5->NumberOfPfnReferences;
  if( !NumberOfPfnReferences || !MiPageHasRelocations(v5, (unsigned int)ImagePteIndex) )
    return(VOID *)-1i64;
  result = MiAllocatePool(256i64, 0x1000ui64, 0x68496D4Dui64);
  v9 = result;
  if( result )
  {
    KeCopyPage(result);
    LODWORD(Direction) = 3;
    MiPerformFixups(
      v9,
      v6,
      v4,
      *(_QWORD *)(NumberOfPfnReferences + 48) - *(_QWORD *)(NumberOfPfnReferences + 40),
      0i64,
      Direction);
    return v9;
  }
  return result;
}

Referenced by:

MiValidateImagePfn