IopAllocateErrorLogEntry

VOID *__stdcall IopAllocateErrorLogEntry(_DEVICE_OBJECT *deviceObject, _DRIVER_OBJECT *driverObject, UINT8 EntrySize){
  unsigned int v5; 
  VOID **PoolWithTag; 
  VOID *result; 

  if( (unsigned __int8)(EntrySize - 48) > 0xC0u )
    return 0i64;
  v5 = ((EntrySize + 7) & 0xF8) + 48;
  if( (unsigned int)_InterlockedExchangeAdd((_DWORD *)&stru_140C452E0 + 246, v5) > 0x64000
    || (PoolWithTag = ExAllocatePoolWithTag(0x200ui64, v5, 1917153097i64)) == 0i64 )
  {
    _InterlockedExchangeAdd((_DWORD *)&stru_140C452E0 + 246, -v5);
    return 0i64;
  }
  if( deviceObject )
    ObfReferenceObjectWithTag(deviceObject, 0x746C6644ui64);
  if( driverObject )
    ObfReferenceObjectWithTag(driverObject, 0x746C6644ui64);
  memset(PoolWithTag, 0i64, v5);
  *((_WORD *)PoolWithTag + 1) = v5;
  *(_WORD *)PoolWithTag = 11;
  result = PoolWithTag + 6;
  PoolWithTag[3] = deviceObject;
  PoolWithTag[4] = driverObject;
  return result;
}

Referenced by:

IoAllocateErrorLogEntry
IoAllocateGenericErrorLogEntry