PnpCopyDevPropertyArray

__int64 __fastcall PnpCopyDevPropertyArray(UINT64 ullMultiplicand, __int64 a2, __int64 a3, _DWORD *a4, __int64 a5){
  void **v5; 
  int v6; 
  unsigned int v9; 
  VOID **PoolWithTag; 
  __int64 v11; 
  __int64 v12; 
  void *v14; 
  __int64 v15; 
  UINT64 NumberOfBytes; 

  v5 = (void **)a5;
  v6 = 0;
  *a4 = 0;
  NumberOfBytes = 0i64;
  v9 = ullMultiplicand;
  *v5 = 0i64;
  if( a2 && (_DWORD)ullMultiplicand )
  {
    v6 = RtlULongLongMult((unsigned int)ullMultiplicand, 0x30ui64, &NumberOfBytes);
    if( v6 >= 0 )
    {
      PoolWithTag = ExAllocatePoolWithTag(1ui64, NumberOfBytes, 1466986064i64);
      *v5 = PoolWithTag;
      if( PoolWithTag )
      {
        memset(PoolWithTag, 0i64, NumberOfBytes);
        v12 = 0i64;
        if( !v9 )
          return(unsigned int)v6;
        while( 1 )
        {
          v6 = PnpCopyDevProperty(a2 + 48 * v12, v11, (__int64)*v5 + 48 * v12);
          if( v6 < 0 )
            break;
          ++*a4;
          v12 = (unsigned int)(v12 + 1);
          if( (unsigned int)v12 >= v9 )
            return(unsigned int)v6;
        }
      }
      else
      {
        v6 = -1073741670;
      }
    }
    v14 = *v5;
    if( *v5 )
    {
      v15 = 0i64;
      if( *a4 )
      {
        do
        {
          ExFreePoolWithTag(*((PVOID *)*v5 + 6 * v15 + 5), 0x57706E50u);
          v15 = (unsigned int)(v15 + 1);
        }
        while( (unsigned int)v15 < *a4 );
        v14 = *v5;
      }
      ExFreePoolWithTag(v14, 0x57706E50u);
      *a4 = 0;
      *v5 = 0i64;
    }
  }
  return(unsigned int)v6;
}

Referenced by:

PiSwCompleteCreate
PiSwInterfaceCreate
PiSwIrpStartCreateWorker
PiSwQueuedCreateInfoCreate