Remove __try/__catch blocks: Vectored Exceptions made this unnecessary

This commit is contained in:
Luke Usher 2018-08-16 19:00:58 +01:00
parent 62f2f8dc80
commit 1ff481ac0a
4 changed files with 31 additions and 72 deletions

View File

@ -194,16 +194,9 @@ void SetupPerTitleKeys()
}
void CxbxLaunchXbe(void(*Entry)())
{
__try
{
Entry();
}
__except (EmuException(GetExceptionInformation()))
{
EmuLog(LOG_PREFIX, LOG_LEVEL::WARNING, "Problem with ExceptionFilter");
}
}
// Entry point address XOR keys per Xbe type (Retail, Debug or Chihiro) :
const DWORD XOR_EP_KEY[3] = { XOR_EP_RETAIL, XOR_EP_DEBUG, XOR_EP_CHIHIRO };

View File

@ -161,18 +161,12 @@ DWORD ExecuteDpcQueue()
// Set DpcRoutineActive to support KeIsExecutingDpc:
KeGetCurrentPrcb()->DpcRoutineActive = TRUE; // Experimental
DbgPrintf(LOG_PREFIX, "Global DpcQueue, calling DPC at 0x%.8X\n", pkdpc->DeferredRoutine);
__try {
// Call the Deferred Procedure :
pkdpc->DeferredRoutine(
pkdpc,
pkdpc->DeferredContext,
pkdpc->SystemArgument1,
pkdpc->SystemArgument2);
} __except (EmuException(GetExceptionInformation()))
{
EmuLog(LOG_PREFIX, LOG_LEVEL::WARNING, "Problem with ExceptionFilter!");
}
KeGetCurrentPrcb()->DpcRoutineActive = FALSE; // Experimental
}
@ -206,16 +200,11 @@ DWORD ExecuteDpcQueue()
DbgPrintf(LOG_PREFIX, "Global TimerQueue, calling DPC at 0x%.8X\n", pkdpc->DeferredRoutine);
__try {
pkdpc->DeferredRoutine(
pkdpc,
pkdpc->DeferredContext,
pkdpc->SystemArgument1,
pkdpc->SystemArgument2);
} __except (EmuException(GetExceptionInformation()))
{
EmuLog(LOG_PREFIX, LOG_LEVEL::WARNING, "Problem with ExceptionFilter!");
}
}
}

View File

@ -167,8 +167,6 @@ static unsigned int WINAPI PCSTProxy
}
// use the special calling convention
__try
{
// Given the non-standard calling convention (requiring
// the first argument in ebp+4) we need the below __asm.
//
@ -185,11 +183,6 @@ static unsigned int WINAPI PCSTProxy
lea ebp, [esp - 4]
jmp near esi
}
}
__except (EmuException(GetExceptionInformation()))
{
EmuLog(LOG_PREFIX, LOG_LEVEL::WARNING, "Problem with ExceptionFilter!");
}
callComplete:
@ -206,17 +199,8 @@ void PspSystemThreadStartup
IN xboxkrnl::PKSTART_ROUTINE StartRoutine,
IN PVOID StartContext
)
{
__try
{
(StartRoutine)(StartContext);
}
__except (EmuException(GetExceptionInformation()))
// TODO : Call PspUnhandledExceptionInSystemThread(GetExceptionInformation())
{
EmuLog(LOG_PREFIX, LOG_LEVEL::WARNING, "Problem with ExceptionFilter!"); // TODO : Disable?
}
xboxkrnl::PsTerminateSystemThread(STATUS_SUCCESS);
}

View File

@ -1423,17 +1423,10 @@ typedef struct {
} fiber_context_t;
void WINAPI EmuFiberStartup(fiber_context_t* context)
{
__try
{
LPFIBER_START_ROUTINE pfStartRoutine = (LPFIBER_START_ROUTINE)context->lpStartRoutine;
pfStartRoutine(context->lpParameter);
}
__except (EmuException(GetExceptionInformation()))
{
EmuLog(LOG_PREFIX, LOG_LEVEL::WARNING, "Problem with ExceptionFilter");
}
}
// ******************************************************************
// * patch: CreateFiber