[AssetHandler] 'Properly' reset bypass state
This commit is contained in:
parent
3825f8fba7
commit
d8ab3ab422
@ -74,6 +74,15 @@ namespace Components
|
||||
return AssetHandler::BypassState > 0;
|
||||
}
|
||||
|
||||
void AssetHandler::ResetBypassState()
|
||||
{
|
||||
if(AssetHandler::HasThreadBypass())
|
||||
{
|
||||
// Maybe just decrement it?
|
||||
AssetHandler::BypassState = 0;
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(naked) void AssetHandler::FindAssetStub()
|
||||
{
|
||||
__asm
|
||||
|
@ -41,6 +41,8 @@ namespace Components
|
||||
static void ClearTemporaryAssets();
|
||||
static void StoreTemporaryAsset(Game::XAssetType type, Game::XAssetHeader asset);
|
||||
|
||||
static void ResetBypassState();
|
||||
|
||||
private:
|
||||
static thread_local int BypassState;
|
||||
|
||||
|
@ -15,6 +15,12 @@ namespace Components
|
||||
longjmp(_Buf, _Value);
|
||||
}
|
||||
|
||||
__declspec(noreturn) void Exception::LongJmp(jmp_buf _Buf, int _Value)
|
||||
{
|
||||
AssetHandler::ResetBypassState();
|
||||
longjmp(_Buf, _Value);
|
||||
}
|
||||
|
||||
void Exception::SuspendProcess()
|
||||
{
|
||||
FreeConsole();
|
||||
@ -162,6 +168,7 @@ namespace Components
|
||||
#endif
|
||||
|
||||
//Utils::Hook(0x4B241F, Exception::ErrorLongJmp, HOOK_CALL).install()->quick();
|
||||
Utils::Hook(0x6B8898, Exception::LongJmp, HOOK_JUMP).install()->quick();
|
||||
|
||||
Command::Add("mapTest", [](Command::Params* params)
|
||||
{
|
||||
|
@ -20,6 +20,7 @@ namespace Components
|
||||
static LONG WINAPI ExceptionFilter(LPEXCEPTION_POINTERS ExceptionInfo);
|
||||
static LPTOP_LEVEL_EXCEPTION_FILTER WINAPI SetUnhandledExceptionFilterStub(LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter);
|
||||
static __declspec(noreturn) void ErrorLongJmp(jmp_buf _Buf, int _Value);
|
||||
static __declspec(noreturn) void LongJmp(jmp_buf _Buf, int _Value);
|
||||
|
||||
static int MiniDumpType;
|
||||
static Utils::Hook SetFilterHook;
|
||||
|
Loading…
Reference in New Issue
Block a user