TtmpFindDeviceByDeviceId

INT64 __fastcall TtmpFindDeviceByDeviceId(INT64 a1){
  int v1; 
  INT64 *v2; 
  INT64 v3; 
  INT64 *v4; 
  INT64 result; 
  v3 = 0i64;
  v4 = (INT64 *)(a1 + 96);
  for( result = *v4; (INT64 *)result != v4; result = *(_QWORD *)result )
  {
    if( *(_DWORD *)(result + 32) == v1 )
    {
      v3 = result;
      break;
    }
  }
  if( v2 )
    *v2 = v3;
  LOBYTE(result) = v3 != 0;
  return result;
}

Referenced by:

TtmiAssignDevice
TtmiSetInputWakeCapability
TtmpCommitTerminalDisplayStateUpdateWorker