PfpPrefetchRequest

NTSTATUS __stdcall PfpPrefetchRequest(_SUPERFETCH_INFORMATION *Info, INT8 PreviousMode){
  VOID **PoolWithTag; 
  unsigned int v5; 
  __int64 v6; 
  unsigned __int64 v7; 
  VOID *v8; 
  NTSTATUS v9; 
  __int64 v10; 
  _DWORD *v11; 
  unsigned __int64 v12; 
  __int64 v13; 
  _DWORD *v14; 
  int v16; 
  PVOID Object; 
  PVOID P; 

  PoolWithTag = 0i64;
  v16 = 0;
  if( Info[2] == 5 )
  {
    v5 = Info[6];
    if( v5 < 0x80 )
    {
      v9 = -1073741306;
    }
    else
    {
      PoolWithTag = ExAllocatePoolWithTag(1ui64, v5, 1364354640i64);
      P = PoolWithTag;
      if( PoolWithTag )
      {
        if( PreviousMode )
        {
          v6 = (unsigned int)Info[6];
          if( (_DWORD)v6 )
          {
            v7 = *((_QWORD *)Info + 2);
            if( (v7 & 7) != 0 )
              ExRaiseDatatypeMisalignment();
            if( v7 + v6 > 0x7FFFFFFF0000i64 || v7 + v6 < v7 )
              MEMORY[0x7FFFFFFF0000] = 0;
          }
        }
        memmove(PoolWithTag, *((const VOID **)Info + 2), Info[6]);
        if( (unsigned int)PfPrefetchRequestVerify((unsigned __int64)PoolWithTag, Info[6]) )
        {
          v9 = -1073741701;
        }
        else
        {
          v8 = PoolWithTag[9];
          if( v8 )
          {
            Object = 0i64;
            v9 = ObReferenceObjectByHandle(v8, 1ui64, (_OBJECT_TYPE *)ExEventObjectType, PreviousMode, &Object, 0i64);
            PoolWithTag[9] = Object;
            if( v9 < 0 )
              goto LABEL_20;
            v16 = 1;
          }
          v9 = PfpPrefetchRequestPerform((__int64)PoolWithTag);
          v10 = *((unsigned int *)PoolWithTag + 10);
          v11 = (_DWORD *)((char *)PoolWithTag + v10);
          v12 = (unsigned __int64)&PoolWithTag[6 * *((unsigned int *)PoolWithTag + 3)] + v10;
          v13 = *((_QWORD *)Info + 2);
          v14 = (_DWORD *)(v10 + v13);
          if( PreviousMode )
            ProbeForWrite(*((_QWORD *)Info + 2), (unsigned int)Info[6], 8i64);
          while( (unsigned __int64)v11 < v12 )
          {
            *v14 ^= (*v14 ^ *v11) & 8;
            v11 += 12;
            v14 += 12;
          }
          *(_OWORD *)(v13 + 84) = *(_OWORD *)((char *)PoolWithTag + 84);
          *(_OWORD *)(v13 + 100) = *(_OWORD *)((char *)PoolWithTag + 100);
          *(_QWORD *)(v13 + 116) = *(VOID **)((char *)PoolWithTag + 116);
          *(_DWORD *)(v13 + 124) = *((_DWORD *)PoolWithTag + 31);
        }
      }
      else
      {
        v9 = -1073741670;
      }
    }
  }
  else
  {
    v9 = -1073741821;
  }
LABEL_20:
  if( v16 )
    HalPutDmaAdapter((PADAPTER_OBJECT)PoolWithTag[9]);
  if( PoolWithTag )
    ExFreePoolWithTag(PoolWithTag, 0);
  return v9;
}

Referenced by:

PfSetSuperfetchInformation