PopFxFindDeviceAndAllocateUniqueId

INT64 __stdcall PopFxFindDeviceAndAllocateUniqueId(_DEVICE_NODE *DevNode, _POP_FX_DEVICE **FoundFxDevice){
  int v4; 
  UNICODE_STRING v5; 
  unsigned int v6; 
  int AcpiDeviceByUniqueId; 
  UNICODE_STRING P; 
  _POP_FX_DEVICE *v10; 
  v10 = 0i64;
  P = 0i64;
  PopFxQueryBiosDeviceName((__int64)DevNode, (__int64)&P);
  if( v4 < 0 )
  {
    v5 = *(UNICODE_STRING *)((char *)DevNode + 40);
LABEL_3:
    *((UNICODE_STRING *)DevNode + 8) = v5;
LABEL_4:
    v6 = 0;
    goto LABEL_5;
  }
  AcpiDeviceByUniqueId = PopFxFindAcpiDeviceByUniqueId(&P, (__int64 **)&v10);
  v6 = AcpiDeviceByUniqueId;
  if( AcpiDeviceByUniqueId >= 0 )
  {
    *((UNICODE_STRING *)DevNode + 8) = P;
    _InterlockedOr((volatile signed __int32 *)DevNode + 74, 0x2000u);
    goto LABEL_4;
  }
  if( AcpiDeviceByUniqueId != -1073741738 )
  {
    v5 = P;
    goto LABEL_3;
  }
  if( P.Buffer )
    ExFreePoolWithTag(P.Buffer, 0x4D584650u);
LABEL_5:
  *FoundFxDevice = v10;
  return v6;
}

Referenced by:

PoFxPrepareDevice