PiUpdateDeviceResourceLists

INT64 __fastcall PiUpdateDeviceResourceLists(_QWORD *a1){
  _DEVICE_OBJECT *v2; 
  void *v3; 
  void *v4; 
  INT64 result; 
  __int64 v6; 
  int v7; 
  void *v8; 
  void *v9; 
  PVOID v10; 
  __int128 P; 
  v10 = 0i64;
  v2 = (_DEVICE_OBJECT *)a1[4];
  v3 = 0i64;
  P = 0ui64;
  v4 = 0i64;
  result = IopQueryBusResourceUpdateInterface(v2, &P);
  if( (int)result < 0 )
    return result;
  v6 = P;
  v7 = (*(__int64(__fastcall **)(_QWORD, char *, PVOID *))(P + 32))(*(_QWORD *)(P + 8), (char *)&P + 8, &v10);
  if( v7 >= 0 )
  {
    if( !*((_QWORD *)&P + 1) || !v10 )
    {
LABEL_13:
      v7 = 0;
      goto LABEL_14;
    }
    v3 = (void *)PnpCopyResourceList(*((PVOID *)&P + 1));
    if( v3 )
    {
      v4 = (void *)PnpCopyResourceList(v10);
      if( v4 )
      {
        ExAcquireFastMutex(&PiResourceListLock);
        v8 = (void *)a1[52];
        if( v8 )
          ExFreePoolWithTag(v8, 0);
        v9 = (void *)a1[53];
        if( v9 )
          ExFreePoolWithTag(v9, 0);
        a1[52] = v3;
        a1[53] = v4;
        KeReleaseGuardedMutex(&PiResourceListLock);
        goto LABEL_13;
      }
    }
    v7 = -1073741670;
  }
LABEL_14:
  (*(void(__fastcall **)(_QWORD))(v6 + 24))(*(_QWORD *)(v6 + 8));
  ExFreePoolWithTag((PVOID)v6, 0);
  if( v7 < 0 )
  {
    if( v3 )
      ExFreePoolWithTag(v3, 0);
    if( v4 )
      ExFreePoolWithTag(v4, 0);
  }
  return(unsigned int)v7;
}

Referenced by:

PiProcessQueryDeviceState