Browse Source

Remove trap for avoiding debugger on client.

Add exception handlers for pure function call traps
  (Cherry picked from 3fe3a1d H-uru/Plasma "Catch moar crashes")
rarified/purefunctiondebug
rarified 4 years ago
parent
commit
0568563776
  1. 2
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/plClient.cpp
  2. 26
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/winmain.cpp

2
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/plClient.cpp

@ -1656,7 +1656,7 @@ hsBool plClient::MainLoop()
}
#endif
#ifdef PLASMA_EXTERNAL_RELEASE
#if defined(PLASMA_EXTERNAL_RELEASE) && defined(PLASMA_EXTERNAL_NODEBUGGER)
if (DebugIsDebuggerPresent())
{
NetCliAuthLogClientDebuggerConnect();

26
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/winmain.cpp

@ -231,6 +231,24 @@ const GUID NEXUS_GUID = {
0x5bfdb060, 0x6a4, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e};
#endif
//==============================================================================
// Debugger hooks for common untracable faults
#ifdef _MSC_VER
#include <crtdbg.h>
static void IInvalidParameter(const wchar_t* expression, const wchar_t* function, const wchar_t* file, unsigned int line, uintptr_t)
{
__debugbreak();
}
static void IPureVirtualCall()
{
__debugbreak();
}
#endif // _MSC_VER
// Detect whether we're running under TRANSGAMING Cider
//==============================================================================
@ -1967,6 +1985,14 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nC
// Reestablish exception handler after PhysX stole it
SetUnhandledExceptionFilter( plCustomUnhandledExceptionFilter );
#ifdef _MSC_VER
// Sigh... The Visual C++ Runtime likes to throw up dialogs sometimes.
// The user cares not about dialogs. We just want to get a minidump...
// See: http://www.altdevblogaday.com/2012/07/20/more-adventures-in-failing-to-crash-properly/
_set_invalid_parameter_handler(IInvalidParameter);
_set_purecall_handler(IPureVirtualCall);
#endif // _MSC_VER
// I want it on top! I mean it!
BringWindowToTop( gClient->GetWindowHandle() );

Loading…
Cancel
Save