From 75fad0f0fda507b50c034378c6db3c181a7b2305 Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Sat, 26 Oct 2013 15:49:16 +0200 Subject: [PATCH 1/1] Some code clean-up. --- etc/Translation/Blank.ts | 8 ++++---- etc/Translation/LameXP_PL.ts | 8 ++++---- etc/Translation/LameXP_SV.ts | 8 ++++---- src/Config.h | 2 +- src/Global.cpp | 45 +++++++++----------------------------------- 5 files changed, 22 insertions(+), 49 deletions(-) diff --git a/etc/Translation/Blank.ts b/etc/Translation/Blank.ts index 82426334..2a535d2c 100644 --- a/etc/Translation/Blank.ts +++ b/etc/Translation/Blank.ts @@ -3290,22 +3290,22 @@ QApplication - + Executable '%1' doesn't support Windows compatibility mode. - + Executable '%1' requires Qt v%2, but found Qt v%3. - + Executable '%1' was built for Qt '%2', but found Qt '%3'. - + Executable '%1' requires Windows XP or later. diff --git a/etc/Translation/LameXP_PL.ts b/etc/Translation/LameXP_PL.ts index 9bcda369..ac964054 100644 --- a/etc/Translation/LameXP_PL.ts +++ b/etc/Translation/LameXP_PL.ts @@ -3327,22 +3327,22 @@ QApplication - + Executable '%1' doesn't support Windows compatibility mode. Plik wykonywalny '%1' nie działa w trybie kompatybilności z Windows. - + Executable '%1' requires Qt v%2, but found Qt v%3. Plik wykonywalny '%1' wymaga Qt v%2, znaleziono jednak Qt v%3. - + Executable '%1' was built for Qt '%2', but found Qt '%3'. Plik wykonywalny "%1" został skompilowany dla Qt "%2", znaleziono "%3". - + Executable '%1' requires Windows XP or later. diff --git a/etc/Translation/LameXP_SV.ts b/etc/Translation/LameXP_SV.ts index 977e5713..862fa8c5 100644 --- a/etc/Translation/LameXP_SV.ts +++ b/etc/Translation/LameXP_SV.ts @@ -3310,22 +3310,22 @@ QApplication - + Executable '%1' doesn't support Windows compatibility mode. EXE-filen '%1' stöder inte Windows kompatibilitetsläge. - + Executable '%1' requires Qt v%2, but found Qt v%3. EXE-filen '%1' kräver Qt v%2, du har Qt v%3. - + Executable '%1' was built for Qt '%2', but found Qt '%3'. EXE-filen '%1' är byggd för Qt '%2', du har Qt '%3'. - + Executable '%1' requires Windows XP or later. diff --git a/src/Config.h b/src/Config.h index fcfd7e05..a0b30a99 100644 --- a/src/Config.h +++ b/src/Config.h @@ -35,7 +35,7 @@ #define VER_LAMEXP_MINOR_LO 9 #define VER_LAMEXP_TYPE Alpha #define VER_LAMEXP_PATCH 4 -#define VER_LAMEXP_BUILD 1426 +#define VER_LAMEXP_BUILD 1427 #define VER_LAMEXP_CONFG 1348 /////////////////////////////////////////////////////////////////////////////// diff --git a/src/Global.cpp b/src/Global.cpp index 02829763..1172235b 100644 --- a/src/Global.cpp +++ b/src/Global.cpp @@ -1060,29 +1060,22 @@ lamexp_cpu_t lamexp_detect_cpu_features(const QStringList &argv) */ static __forceinline bool lamexp_check_for_debugger(void) { - if(IsDebuggerPresent()) - { - return true; - } - __try { - CloseHandle((HANDLE) 0x7FFFFFFF); + CloseHandle((HANDLE)((DWORD_PTR)-3)); } - __except(EXCEPTION_EXECUTE_HANDLER) + __except(1) { return true; } - __try { - DebugBreak(); + __debugbreak(); } - __except(EXCEPTION_EXECUTE_HANDLER) + __except(1) { - return false; + return IsDebuggerPresent(); } - return true; } @@ -1099,7 +1092,7 @@ static unsigned int __stdcall lamexp_debug_thread_proc(LPVOID lpParameter) lamexp_fatal_exit(L"Not a debug build. Please unload debugger and try again!"); return 666; } - lamexp_sleep(1); + lamexp_sleep(100); } } @@ -1112,31 +1105,11 @@ static HANDLE lamexp_debug_thread_init() { lamexp_fatal_exit(L"Not a debug build. Please unload debugger and try again!"); } - - return (HANDLE) _beginthreadex(NULL, 0, lamexp_debug_thread_proc, NULL, 0, NULL); + const uintptr_t h = _beginthreadex(NULL, 0, lamexp_debug_thread_proc, NULL, 0, NULL); + return (HANDLE)(h^0xdeadbeef); } /* - * Check for compatibility mode - */ -//static bool lamexp_check_compatibility_mode(const char *exportName, const QString &executableName) -//{ -// QLibrary kernel32("kernel32.dll"); -// -// if((exportName != NULL) && kernel32.load()) -// { -// if(kernel32.resolve(exportName) != NULL) -// { -// qWarning("Function '%s' exported from 'kernel32.dll' -> Windows compatibility mode!", exportName); -// qFatal("%s", QApplication::tr("Executable '%1' doesn't support Windows compatibility mode.").arg(executableName).toLatin1().constData()); -// return false; -// } -// } -// -// return true; -//} - -/* * Computus according to H. Lichtenberg */ static bool lamexp_computus(const QDate &date) @@ -3257,7 +3230,7 @@ void lamexp_finalization(void) /* * Initialize debug thread */ -static const HANDLE g_debug_thread = LAMEXP_DEBUG ? NULL : lamexp_debug_thread_init(); +static const HANDLE g_debug_thread1 = LAMEXP_DEBUG ? NULL : lamexp_debug_thread_init(); /* * Get number private bytes [debug only] -- 2.11.0