diff --git a/src/Config.h b/src/Config.h index 58410b5b..cedd49f1 100644 --- a/src/Config.h +++ b/src/Config.h @@ -30,7 +30,7 @@ #define VER_LAMEXP_MINOR_LO 4 #define VER_LAMEXP_TYPE RC #define VER_LAMEXP_PATCH 1 -#define VER_LAMEXP_BUILD 972 +#define VER_LAMEXP_BUILD 974 /////////////////////////////////////////////////////////////////////////////// // Tool versions (minimum expected versions!) diff --git a/src/Dialog_Processing.cpp b/src/Dialog_Processing.cpp index a2e2ef33..1d1eea55 100644 --- a/src/Dialog_Processing.cpp +++ b/src/Dialog_Processing.cpp @@ -359,7 +359,7 @@ bool ProcessingDialog::winEvent(MSG *message, long *result) void ProcessingDialog::initEncoding(void) { - qWarning("ProcessingDialog::initEncoding()"); + qDebug("Initializing encoding process..."); m_runningThreads = 0; m_currentFile = 0; diff --git a/src/Global.cpp b/src/Global.cpp index cb9aa691..1fc9b49a 100644 --- a/src/Global.cpp +++ b/src/Global.cpp @@ -361,7 +361,13 @@ DWORD lamexp_get_os_version(void) { throw "Ouuups: Not running under Windows NT. This is not supposed to happen!"; } - osVersion = (DWORD)((osVerInfo.dwMajorVersion << 16) | (osVerInfo.dwMinorVersion & 0xffff)); + const DWORD osVerHi = (DWORD)(((DWORD)(osVerInfo.dwMajorVersion)) << 16); + const DWORD osVerLo = (DWORD)(((DWORD)(osVerInfo.dwMinorVersion)) & ((DWORD)(0xffff))); + osVersion = (DWORD)(((DWORD)(osVerHi)) | ((DWORD)(osVerLo))); + } + else + { + throw "GetVersionEx() has failed. This is not supposed to happen!"; } } @@ -792,7 +798,7 @@ static bool lamexp_check_compatibility_mode(const char *exportName, const char * { QLibrary kernel32("kernel32.dll"); - if(exportName != NULL) + if((exportName != NULL) && kernel32.load()) { if(kernel32.resolve(exportName) != NULL) { @@ -1078,12 +1084,20 @@ bool lamexp_init_qt(int argc, char* argv[]) break; case QSysInfo::WV_WINDOWS7: qDebug("Running on Windows 7 or Windows Server 2008 R2.\n"); - lamexp_check_compatibility_mode(NULL, executableName); + lamexp_check_compatibility_mode("CreateFile2", executableName); break; default: { DWORD osVersionNo = lamexp_get_os_version(); - qWarning("Running on an unknown/untested WinNT-based OS (v%u.%u).\n", HIWORD(osVersionNo), LOWORD(osVersionNo)); + if(LAMEXP_EQL_OS_VER(osVersionNo, 6, 2)) + { + qDebug("Running on Windows 8 (still experimental!)\n"); + lamexp_check_compatibility_mode(NULL, executableName); + } + else + { + qWarning("Running on an unknown/untested WinNT-based OS (v%u.%u).\n", HIWORD(osVersionNo), LOWORD(osVersionNo)); + } } break; } diff --git a/src/Global.h b/src/Global.h index cef0932d..7318611f 100644 --- a/src/Global.h +++ b/src/Global.h @@ -156,6 +156,8 @@ SIZE_T lamexp_dbg_private_bytes(void); #define LAMEXP_SAFE_FREE(PTR) if(PTR) { free((void*) PTR); PTR = NULL; } #define LAMEXP_CLOSE(HANDLE) if(HANDLE != NULL && HANDLE != INVALID_HANDLE_VALUE) { CloseHandle(HANDLE); HANDLE = NULL; } #define LAMEXP_MIN_OS_VER(VER_INFO, VER_MAJ, VER_MIN) ((HIWORD(VER_INFO) > (VER_MAJ)) || ((HIWORD(VER_INFO) == (VER_MAJ)) && (LOWORD(VER_INFO) >= (VER_MIN)))) +#define LAMEXP_MAX_OS_VER(VER_INFO, VER_MAJ, VER_MIN) ((HIWORD(VER_INFO) < (VER_MAJ)) || ((HIWORD(VER_INFO) == (VER_MAJ)) && (LOWORD(VER_INFO) <= (VER_MIN)))) +#define LAMEXP_EQL_OS_VER(VER_INFO, VER_MAJ, VER_MIN) ((HIWORD(VER_INFO) == (VER_MAJ)) && (LOWORD(VER_INFO) == (VER_MIN))) #define QWCHAR(STR) reinterpret_cast(STR.utf16()) #define WCHAR2QSTR(STR) QString::fromUtf16(reinterpret_cast(STR)) #define LAMEXP_DYNCAST(OUT,CLASS,SRC) try { OUT = dynamic_cast(SRC); } catch(std::bad_cast) { OUT = NULL; }