PfpPrefetchRequest

INT64 __fastcall PfpPrefetchRequest(INT64 a1, KPROCESSOR_MODE a2){
  unsigned int *PoolWithTag; 
  unsigned int v5; 
  __int64 v6; 
  unsigned __int64 v7; 
  void *v8; 
  int v9; 
  __int64 v10; 
  _DWORD *v11; 
  unsigned __int64 v12; 
  __int64 v13; 
  _DWORD *v14; 
  int v16; 
  PVOID Object; 
  PVOID P; 
  PoolWithTag = 0i64;
  v16 = 0;
  if( *(_DWORD *)(a1 + 8) == 5 )
  {
    v5 = *(_DWORD *)(a1 + 24);
    if( v5 < 0x80 )
    {
      v9 = -1073741306;
    }
    else
    {
      PoolWithTag = (unsigned int *)ExAllocatePoolWithTag(PagedPool, v5, 0x51526650ui64);
      P = PoolWithTag;
      if( PoolWithTag )
      {
        if( a2 )
        {
          v6 = *(unsigned int *)(a1 + 24);
          if( (_DWORD)v6 )
          {
            v7 = *(_QWORD *)(a1 + 16);
            if( (v7 & 7) != 0 )
              ExRaiseDatatypeMisalignment();
            if( v7 + v6 > 0x7FFFFFFF0000i64 || v7 + v6 < v7 )
              MEMORY[0x7FFFFFFF0000] = 0;
          }
        }
        memmove((UINT8 *)PoolWithTag, *(UINT8 **)(a1 + 16), *(unsigned int *)(a1 + 24));
        if( (unsigned int)PfPrefetchRequestVerify((UINT64)PoolWithTag, *(unsigned int *)(a1 + 24)) )
        {
          v9 = -1073741701;
        }
        else
        {
          v8 = (void *)*((_QWORD *)PoolWithTag + 9);
          if( v8 )
          {
            Object = 0i64;
            v9 = ObReferenceObjectByHandle(v8, 1u, (POBJECT_TYPE)ExEventObjectType, a2, &Object, 0i64);
            *((_QWORD *)PoolWithTag + 9) = Object;
            if( v9 < 0 )
              goto LABEL_20;
            v16 = 1;
          }
          v9 = PfpPrefetchRequestPerform((INT64)PoolWithTag);
          v10 = PoolWithTag[10];
          v11 = (unsigned int *)((char *)PoolWithTag + v10);
          v12 = (unsigned __int64)&PoolWithTag[12 * PoolWithTag[3]] + v10;
          v13 = *(_QWORD *)(a1 + 16);
          v14 = (_DWORD *)(v10 + v13);
          if( a2 )
            ProbeForWrite(*(VOID **)(a1 + 16), *(unsigned int *)(a1 + 24), 8ui64);
          while( (unsigned __int64)v11 < v12 )
          {
            *v14 ^= (*v14 ^ *v11) & 8;
            v11 += 12;
            v14 += 12;
          }
          *(_OWORD *)(v13 + 84) = *(_OWORD *)(PoolWithTag + 21);
          *(_OWORD *)(v13 + 100) = *(_OWORD *)(PoolWithTag + 25);
          *(_QWORD *)(v13 + 116) = *(_QWORD *)(PoolWithTag + 29);
          *(_DWORD *)(v13 + 124) = PoolWithTag[31];
        }
      }
      else
      {
        v9 = -1073741670;
      }
    }
  }
  else
  {
    v9 = -1073741821;
  }
LABEL_20:
  if( v16 )
    HalPutDmaAdapter(*((PADAPTER_OBJECT *)PoolWithTag + 9));
  if( PoolWithTag )
    ExFreePoolWithTag(PoolWithTag, 0);
  return(unsigned int)v9;
}

Referenced by:

PfSetSuperfetchInformation