PopGetDope

_DEVICE_OBJECT_POWER_EXTENSION *__stdcall PopGetDope(_DEVICE_OBJECT *DeviceObject){
  _DEVOBJ_EXTENSION *DeviceObjectExtension; 
  VOID **PoolWithTag; 
  VOID **v4; 
  unsigned __int64 v5; 

  DeviceObjectExtension = DeviceObject->DeviceObjectExtension;
  if( !DeviceObjectExtension->Dope )
  {
    PoolWithTag = ExAllocatePoolWithTag(0x200ui64, 0x60ui64, 1162891076i64);
    v4 = PoolWithTag;
    if( PoolWithTag )
    {
      memset(PoolWithTag, 0i64, 0x60u);
      v4[3] = DeviceObject;
      v4[5] = v4 + 4;
      v4[4] = v4 + 4;
      v5 = (unsigned __int8)KeAcquireSpinLockRaiseToDpc((UINT64 *)&stru_140C23628 + 142);
      if( !DeviceObjectExtension->Dope )
      {
        DeviceObjectExtension->Dope = (_DEVICE_OBJECT_POWER_EXTENSION *)v4;
        v4 = 0i64;
      }
      KxReleaseSpinLock((UINT64 *)&stru_140C23628 + 142);
      __writecr8(v5);
      if( v4 )
        ExFreePoolWithTag(v4, 0x45504F44u);
    }
  }
  return DeviceObjectExtension->Dope;
}

Referenced by:

PoRegisterDeviceForIdleDetection
PopAssociateThermalRequest
PopDeactiveThermalRequest
PopOrphanCoolingExtension