IopAllocateErrorLogEntry

NTSTATUS __stdcall IopAllocateErrorLogEntry(
        _DEVICE_OBJECT *deviceObject,
        _DRIVER_OBJECT *driverObject,
        UINT8 EntrySize){
  unsigned int v5; 
  _WORD *PoolWithTag; 
  NTSTATUS result; 
  if( (unsigned __int8)(EntrySize - 48) > 0xC0u )
    return 0;
  v5 = ((EntrySize + 7) & 0xF8) + 48;
  if( (unsigned int)_InterlockedExchangeAdd(&IopErrorLogAllocation, v5) > 0x64000
    || (PoolWithTag = ExAllocatePoolWithTag(NonPagedPoolNx, v5, 0x72456F49ui64)) == 0i64 )
  {
    _InterlockedExchangeAdd(&IopErrorLogAllocation, -v5);
    return 0;
  }
  if( deviceObject )
    ObfReferenceObjectWithTag(deviceObject, 0x746C6644u);
  if( driverObject )
    ObfReferenceObjectWithTag(driverObject, 0x746C6644u);
  memset((INT64)PoolWithTag, 0i64);
  PoolWithTag[1] = v5;
  *PoolWithTag = 11;
  result = (_DWORD)PoolWithTag + 48;
  *((_QWORD *)PoolWithTag + 3) = deviceObject;
  *((_QWORD *)PoolWithTag + 4) = driverObject;
  return result;
}

Referenced by:

IoAllocateErrorLogEntry
IoAllocateGenericErrorLogEntry