PopDisableCoolingExtension

void __fastcall PopDisableCoolingExtension(__int64 a1){
  _POP_RW_LOCK *v1; 
  __int64 v3; 
  void(__fastcall *v4)(__int64); 
  struct _KEVENT Event; 
  v1 = (_POP_RW_LOCK *)(a1 + 32);
  memset(&Event, 0, sizeof(Event));
  PopAcquireRwLockExclusive((_POP_RW_LOCK *)(a1 + 32));
  if( *(_BYTE *)(a1 + 64) )
  {
    *(_BYTE *)(a1 + 64) = 0;
    PopDiagTraceCoolingExtension(
      (_POP_COOLING_EXTENSION *)a1,
      (_EVENT_DESCRIPTOR *)&POP_ETW_EVENT_COOLING_EXTENSION_REMOVE);
    KeInitializeEvent(&Event, NotificationEvent, 0);
    *(_QWORD *)(a1 + 80) = &Event;
    PopPropogateCoolingChange(a1);
    PopReleaseRwLock((UINT64)v1);
    KeWaitForSingleObject(&Event, Executive, 0, 0, 0i64);
    PopAcquireRwLockExclusive(v1);
    *(_QWORD *)(a1 + 80) = 0i64;
    v3 = *(_QWORD *)(a1 + 96);
    v4 = *(void(__fastcall **)(__int64))(a1 + 112);
    PopReleaseRwLock((UINT64)v1);
    v4(v3);
  }
  else
  {
    PopReleaseRwLock((UINT64)v1);
  }
}

Referenced by:

PopCoolingExtensionPnpNotification