Esempio n. 1
0
static void* PoolAllocateWrap(atPoolBase* pool)
{
	void* value = g_origPoolAllocate(pool);

	if (!value)
	{
		auto it = g_inversePools.find(pool);
		std::string poolName = "<<unknown pool>>";

		if (it != g_inversePools.end())
		{
			uint32_t poolHash = it->second;
			
			poolName = poolEntries.LookupHash(poolHash);
		}

		std::string extraWarning = (poolName.find("0x") == std::string::npos)
			? fmt::sprintf(" (you need to raise %s PoolSize in common/data/gameconfig.xml)", poolName)
			: "";

		FatalErrorNoExcept("%s Pool Full, Size == %d%s", poolName, pool->GetSize(), extraWarning);
	}

	return value;
}
Esempio n. 2
0
	static int SehRoutine(InitFunctionData* func, InitFunctionType type, PEXCEPTION_POINTERS exception)
	{
		if (exception->ExceptionRecord->ExceptionCode & 0x80000000)
		{
			FatalErrorNoExcept("An exception occurred (%08x at %p) during execution of the %s function for %s. The game will be terminated.",
				exception->ExceptionRecord->ExceptionCode, exception->ExceptionRecord->ExceptionAddress,
				InitFunctionTypeToString(type), func->GetName());
		}

		return EXCEPTION_CONTINUE_SEARCH;
	}