PiDevCfgCopyVariableData

INT64 __fastcall PiDevCfgCopyVariableData(INT64 a1, INT64 a2){
  int v2; 
  UINT8 *v4; 
  char *v5; 
  __int64 v7; 
  unsigned int v8; 
  UINT8 *PoolWithTag; 
  UINT8 *v11; 
  v2 = 0;
  v11 = 0i64;
  v4 = 0i64;
  v5 = *(char **)(a2 + 40);
  if( !v5 )
    goto LABEL_12;
  if( (unsigned __int16)*(_DWORD *)(a2 + 32) == 0x8000 )
  {
    if( PiPnpRtlCtx )
      v7 = *(_QWORD *)(PiPnpRtlCtx + 224);
    else
      v7 = 0i64;
    v2 = SysCtxRegOpenKey(v7, v5, 0i64, 0, 0x20019u, (void **)&v11);
    if( v2 >= 0 )
    {
      v4 = v11;
LABEL_12:
      *(_DWORD *)(a1 + 32) = *(_DWORD *)(a2 + 32);
      *(_DWORD *)(a1 + 36) = *(_DWORD *)(a2 + 36);
      *(_QWORD *)(a1 + 40) = v4;
    }
  }
  else
  {
    v8 = *(_DWORD *)(a2 + 36);
    if( !v8 )
      goto LABEL_12;
    PoolWithTag = (UINT8 *)ExAllocatePoolWithTag(PagedPool, v8, 0x63647050ui64);
    v4 = PoolWithTag;
    if( PoolWithTag )
    {
      memmove(PoolWithTag, *(UINT8 **)(a2 + 40), *(unsigned int *)(a2 + 36));
      goto LABEL_12;
    }
    return(unsigned int)-1073741670;
  }
  return(unsigned int)v2;
}

Referenced by:

PiDevCfgResolveVariableExpression
PiDevCfgResolveVariableSwitchCase