You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
1) Changed the pre/post compile notifications from module notifications to process commands. 2) Added server command to notify that we want re-instance patching (two phase) 3) Added support for two phase patching to enable re-instancing without all the limitations. 4) Added a null CDO check for old blueprint classes (approved by Phillip) #rb ben.marsh #rnx #preflight 6086e3481046fb000183c2d4 [CL 16115620 by Tim Smith in ue5-main branch]
63 lines
1.4 KiB
C++
63 lines
1.4 KiB
C++
// Copyright 2011-2020 Molecular Matters GmbH, all rights reserved.
|
|
|
|
#pragma once
|
|
|
|
// BEGIN EPIC MOD
|
|
#include "CoreTypes.h"
|
|
#include <stdint.h>
|
|
// END EPIC MOD
|
|
|
|
class ImmutableString;
|
|
|
|
namespace symbols
|
|
{
|
|
struct ImageSectionDB;
|
|
}
|
|
|
|
|
|
namespace hook
|
|
{
|
|
struct Type
|
|
{
|
|
enum Enum
|
|
{
|
|
PREPATCH = 0,
|
|
POSTPATCH,
|
|
COMPILE_START,
|
|
COMPILE_SUCCESS,
|
|
COMPILE_ERROR,
|
|
COMPILE_ERROR_MESSAGE,
|
|
};
|
|
};
|
|
|
|
typedef void (*PrepatchFunction)(void);
|
|
typedef void (*PostpatchFunction)(void);
|
|
|
|
typedef void (*CompileStartFunction)(void);
|
|
typedef void (*CompileSuccessFunction)(void);
|
|
typedef void (*CompileErrorFunction)(void);
|
|
typedef void (*CompileErrorMessageFunction)(const wchar_t*);
|
|
|
|
uint32_t FindFirstInSection(const symbols::ImageSectionDB* imageSectionDb, const ImmutableString& sectionName);
|
|
uint32_t FindLastInSection(const symbols::ImageSectionDB* imageSectionDb, const ImmutableString& sectionName);
|
|
|
|
|
|
// calls arbitrary hooks in a given range
|
|
template <typename T, typename... Args>
|
|
void CallHooksInRange(const void* rangeBegin, const void* rangeEnd, Args&&... args)
|
|
{
|
|
const T* firstHook = static_cast<const T*>(rangeBegin);
|
|
const T* lastHook = static_cast<const T*>(rangeEnd);
|
|
|
|
for (const T* hook = firstHook; hook < lastHook; ++hook)
|
|
{
|
|
// note that sections are often padded with zeroes, so skip everything that's zero
|
|
T function = *hook;
|
|
if (function)
|
|
{
|
|
function(args...);
|
|
}
|
|
}
|
|
}
|
|
}
|