PnpResizeTargetDeviceBlock

__int64 __fastcall PnpResizeTargetDeviceBlock(const VOID **a1, int a2){
  unsigned int v2; 
  size_t v4; 
  __int64 v5; 
  int v6; 
  int v7; 
  size_t v8; 
  VOID **CriticalMemory; 
  VOID **v10; 
  VOID *v11; 

  v2 = 0;
  v4 = *((_DWORD *)*a1 + 37) + 112;
  v5 = -1i64;
  do
    ++v5;
  while( *((_WORD *)*a1 + v5 + 80) );
  v6 = 2 * v5 + 2;
  v7 = 0;
  if( v6 != 2 )
    v7 = v6;
  v8 = v4 - v7 + 400;
  if( v8 > v4 )
  {
    CriticalMemory = PnpAllocateCriticalMemory(a2, PagedPool, v8, 0x4B706E50u);
    v10 = CriticalMemory;
    if( CriticalMemory )
    {
      memset(CriticalMemory, 0i64, v8);
      v11 = (VOID *)*a1;
      memmove(v10, *a1, v4);
      *((_DWORD *)v10 + 16) = 1;
      *((_DWORD *)v10 + 37) = v8 - 112;
      v10[10] = v11;
      *a1 = v10;
    }
    else
    {
      return(unsigned int)-1073741670;
    }
  }
  return v2;
}

Referenced by:

PnpProcessQueryRemoveAndEject