Okay this insanity I think is sort of outdoing myself. Good luck looking at this through a disassembler.

git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@539 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
n-a-c-h 2008-05-28 02:26:10 +00:00
parent d5bb2f5390
commit 4bf9cd2109
2 changed files with 13 additions and 1 deletions

View File

@ -528,6 +528,15 @@ static BOOL doStuffBad(VBA *vba, int num)
return(doStuffGood(vba, num&1));
}
typedef bool (VBA::*trapPointer)(bool);
static trapPointer trapPointers[] = { &VBA::trap, &VBA::trap, &VBA::updateRenderMethod, &VBA::trap, &VBA::trap };
static trapPointer *mainTrapPointer = trapPointers;
bool VBA::trap(bool value)
{
pExitProcess(value);
return(false);
}
BOOL VBA::InitInstance()
{
@ -542,6 +551,7 @@ BOOL VBA::InitInstance()
#endif
securityCheck = doProtection();
securityCheck2 = (securityCheck < 0) ? 1 : securityCheck;
mainTrapPointer = &trapPointers[(securityCheck+1)<<1];
SetRegistryKey(_T("VBA"));
@ -2023,7 +2033,7 @@ bool VBA::initDisplay()
if (securityCheck != -3)
{
protectHelp[securityCheck2](0);
return updateRenderMethod(false);
return (this->**mainTrapPointer)(false);
}
return(false);
}

View File

@ -274,6 +274,8 @@ class VBA : public CWinApp
void loadSettings();
void addRecentFile(CString file);
bool trap(bool);
private:
unsigned int detectCpuCores();
int doProtection();