PfpCopyUserPfnPrioRequest

__int64 __fastcall PfpCopyUserPfnPrioRequest(unsigned __int64 a1, unsigned int a2, int a3, _QWORD *a4, char a5, int a6){
  unsigned int v9; 
  UINT8 *v10; 
  unsigned __int64 v11; 
  UINT64 v12; 
  unsigned int v13; 
  unsigned int v14; 
  UINT8 *PoolWithTag; 
  UINT8 *v16; 
  UINT64 i; 
  v9 = 0;
  v10 = 0i64;
  if( a5 && a2 )
  {
    if( (a1 & 7) != 0 )
      ExRaiseDatatypeMisalignment();
    v11 = a2 + a1;
    if( v11 > 0x7FFFFFFF0000i64 || v11 < a1 )
      MEMORY[0x7FFFFFFF0000] = 0;
  }
  v12 = *(_QWORD *)(a1 + 8);
  if( v12 <= 0xFFFFFFFF
    && 24 * (v12 + 8) <= 0xFFFFFFFF
    && v12
    && v12 <= MmGetHighestPhysicalPage(0i64) + 1
    && v13 <= v14 )
  {
    PoolWithTag = (UINT8 *)ExAllocatePoolWithTag(NonPagedPoolNx, v13, 0x42506650ui64);
    v10 = PoolWithTag;
    if( !PoolWithTag )
    {
      v9 = -1073741670;
      goto LABEL_24;
    }
    *(_OWORD *)PoolWithTag = *(_OWORD *)a1;
    *((_OWORD *)PoolWithTag + 1) = *(_OWORD *)(a1 + 16);
    *((_OWORD *)PoolWithTag + 2) = *(_OWORD *)(a1 + 32);
    *((_OWORD *)PoolWithTag + 3) = *(_OWORD *)(a1 + 48);
    *((_OWORD *)PoolWithTag + 4) = *(_OWORD *)(a1 + 64);
    *((_OWORD *)PoolWithTag + 5) = *(_OWORD *)(a1 + 80);
    *((_OWORD *)PoolWithTag + 6) = *(_OWORD *)(a1 + 96);
    *((_OWORD *)PoolWithTag + 7) = *(_OWORD *)(a1 + 112);
    *((_OWORD *)PoolWithTag + 8) = *(_OWORD *)(a1 + 128);
    *((_OWORD *)PoolWithTag + 9) = *(_OWORD *)(a1 + 144);
    *((_OWORD *)PoolWithTag + 10) = *(_OWORD *)(a1 + 160);
    *((_OWORD *)PoolWithTag + 11) = *(_OWORD *)(a1 + 176);
    if( *(_DWORD *)PoolWithTag == 1
      && ((unsigned int)(a3 - 6) > 1 || (*((_DWORD *)PoolWithTag + 1) & 0xFFFFFFFE) == 0)
      && *((_QWORD *)PoolWithTag + 1) == v12 )
    {
      v16 = PoolWithTag + 192;
      if( a6 )
      {
        memset((INT64)v16, 0i64);
        for( i = 0i64; i < v12; ++i )
          *(_QWORD *)&v10[24 * i + 200] = *(_QWORD *)(24 * i + a1 + 200);
      }
      else
      {
        memmove(v16, (UINT8 *)(a1 + 192), (unsigned int)(24 * v12));
      }
      *a4 = v10;
      v10 = 0i64;
      goto LABEL_24;
    }
  }
  v9 = -1073741811;
LABEL_24:
  if( v10 )
    ExFreePoolWithTag(v10, 0);
  return v9;
}

Referenced by:

PfpPfnPrioRequest