Okay this insanity I think is sort of outdoing myself. Good luck looking at this through a disassembler.
This commit is contained in:
parent
89246e73a5
commit
9b1223c3c1
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -274,6 +274,8 @@ class VBA : public CWinApp
|
|||
void loadSettings();
|
||||
void addRecentFile(CString file);
|
||||
|
||||
bool trap(bool);
|
||||
|
||||
private:
|
||||
unsigned int detectCpuCores();
|
||||
int doProtection();
|
||||
|
|
Loading…
Reference in New Issue