PiUEventQueueBroadcastEventEntry

void __fastcall PiUEventQueueBroadcastEventEntry(__int64 a1){
  WCHAR v2; 
  PVOID *v3; 
  __int64 *v4; 
  WORK_QUEUE_ITEM *PoolWithTag; 
  PVOID *v6; 
  int v7; 
  char *v8; 
  WCHAR v9; 
  __int64 v10; 
  UNICODE_STRING String2; 
  struct _UNICODE_STRING DestinationString; 
  ExAcquireFastMutex((FAST_MUTEX *)PiUEventBroadcastEventQueueLock);
  v3 = (PVOID *)PiUEventBroadcastEventQueue;
  DestinationString = 0i64;
  String2 = 0i64;
  if( PiUEventBroadcastEventQueue != &PiUEventBroadcastEventQueue )
  {
    v6 = (PVOID *)PiUEventBroadcastEventQueue;
    do
    {
      v7 = *((_DWORD *)v6 + 5);
      if( v7 == *(_DWORD *)(a1 + 20) && *((_DWORD *)v6 + 6) == *(_DWORD *)(a1 + 24) )
      {
        if( v7 == 3 )
        {
          v8 = *(char **)((char *)v6 + 28) - *(_QWORD *)(a1 + 28);
          if( !v8 )
            v8 = *(char **)((char *)v6 + 36) - *(_QWORD *)(a1 + 36);
          if( !v8 )
          {
            RtlInitUnicodeString(&DestinationString, (PCWSTR)(a1 + 44), v2);
            RtlInitUnicodeString(&String2, (PCWSTR)v6 + 22, v9);
            if( RtlEqualUnicodeString(&DestinationString, &String2, 1u) )
            {
LABEL_12:
              *((_BYTE *)v6 + 16) = 0;
              break;
            }
          }
        }
        else
        {
          if( v7 != 2 )
            goto LABEL_12;
          v10 = *(_QWORD *)(a1 + 28) - *(_QWORD *)((char *)v6 + 28);
          if( !v10 )
            v10 = *(_QWORD *)(a1 + 36) - *(_QWORD *)((char *)v6 + 36);
          if( !v10 )
            goto LABEL_12;
        }
      }
      v6 = (PVOID *)*v6;
    }
    while( v6 != &PiUEventBroadcastEventQueue );
  }
  *(_BYTE *)(a1 + 16) = 1;
  v4 = (__int64 *)qword_140C45088;
  if( *(PVOID **)qword_140C45088 != &PiUEventBroadcastEventQueue )
    __fastfail(3u);
  *(_QWORD *)a1 = &PiUEventBroadcastEventQueue;
  *(_QWORD *)(a1 + 8) = v4;
  *v4 = a1;
  qword_140C45088 = a1;
  KeReleaseGuardedMutex((_FAST_MUTEX *)PiUEventBroadcastEventQueueLock);
  if( v3 == &PiUEventBroadcastEventQueue )
  {
    PoolWithTag = (WORK_QUEUE_ITEM *)ExAllocatePoolWithTag(NonPagedPoolNx, 0x20ui64, 0x59706E50ui64);
    if( PoolWithTag )
    {
      PoolWithTag->List.Flink = 0i64;
      PoolWithTag->WorkerRoutine = (void(__fastcall *)(void *))PiUEventBroadcastEventWorker;
      PoolWithTag->Parameter = PoolWithTag;
      ExQueueWorkItem(PoolWithTag, BackgroundWorkQueue);
    }
  }
}

Referenced by:

PiUEventProcessBroadcastNotifications