MiIssueHardFaultIo

NTSTATUS __stdcall MiIssueHardFaultIo(_MMINPAGE_SUPPORT *InPageSupport, UINT64 ImageFault, VOID *TrapInformation){
  unsigned __int32 LongFlags; 
  int v5; 
  int v6; 
  int v7; 
  _EPROCESS *Process; 
  signed __int32 HighPriorityFaultsAllowed; 
  _KEVENT *v10; 
  _IO_STATUS_BLOCK *p_IoStatus; 
  NTSTATUS v12; 
  NTSTATUS v13; 
  unsigned __int64 p_Mdl; 
  _MDL *v16; 
  unsigned __int64 v17; 
  signed __int32 v18; 
  UINT64 Flags; 

  LongFlags = InPageSupport->u1.LongFlags;
  v5 = LongFlags & 8;
  if( (LongFlags & 0x100) != 0 )
  {
    p_Mdl = (unsigned __int64)&InPageSupport->Mdl | 1;
    if( !v5 )
      p_Mdl = (unsigned __int64)&InPageSupport->Mdl;
    v16 = (_MDL *)p_Mdl;
    if( ((unsigned __int8)TrapInformation & 1) != 0 )
    {
      v17 = (unsigned __int64)TrapInformation & 0xFFFFFFFFFFFFFFFEui64;
      if( *(_BYTE *)v17 == 1 && (*(_DWORD *)(v17 + 80) & 0x800) != 0 )
        v16 = (_MDL *)(p_Mdl | 2);
    }
    p_IoStatus = &InPageSupport->IoStatus;
    v10 = (_KEVENT *)&InPageSupport->ListHead[1];
    v12 = SmPageRead(
            (_MM_STORE_KEY *)&InPageSupport->ReadOffset,
            v16,
            (_KEVENT *)&InPageSupport->ListHead[1],
            &InPageSupport->IoStatus);
  }
  else
  {
    v6 = (LongFlags >> 1) & 4 | 1;
    if( (LongFlags & 0x40000) == 0 )
      v6 = (LongFlags >> 1) & 4;
    if( (LongFlags & 8) != 0 )
    {
      v7 = v6 | 2;
    }
    else
    {
      v7 = v6;
      if( !(_DWORD)ImageFault && MiGetSystemRegionType((UINT64)InPageSupport->FaultingAddress) == 8 )
        v7 = v6 | 2;
    }
    if( !v5 )
    {
      Process = KeGetCurrentThread()->Process;
      HighPriorityFaultsAllowed = Process->HighPriorityFaultsAllowed;
      while( HighPriorityFaultsAllowed )
      {
        v18 = HighPriorityFaultsAllowed;
        HighPriorityFaultsAllowed = _InterlockedCompareExchange(
                                      (volatile signed __int32 *)&Process->HighPriorityFaultsAllowed,
                                      HighPriorityFaultsAllowed - 1,
                                      HighPriorityFaultsAllowed);
        if( v18 == HighPriorityFaultsAllowed )
        {
          v7 |= 8u;
          break;
        }
      }
    }
    v10 = (_KEVENT *)&InPageSupport->ListHead[1];
    p_IoStatus = &InPageSupport->IoStatus;
    LODWORD(Flags) = v7;
    v12 = IoPageReadEx(
            InPageSupport->FilePointer,
            &InPageSupport->Mdl,
            &InPageSupport->ReadOffset,
            (_KEVENT *)&InPageSupport->ListHead[1],
            &InPageSupport->IoStatus,
            Flags,
            0i64);
  }
  v13 = v12;
  if( v12 < 0 )
  {
    InPageSupport->IoStatus.Information = 0i64;
    p_IoStatus->Status = v12;
    KeSetEvent(v10, 0, 0);
  }
  return v13;
}

Referenced by:

MiIssueHardFault
MiPfCoalesceAndIssueIOs
MiPfIssueCoalesceCandidates