Try to detect "compatibility mode".

This commit is contained in:
LoRd_MuldeR 2010-12-23 03:13:11 +01:00
parent 38d60fe627
commit 29954feae2
5 changed files with 64 additions and 13 deletions

View File

@ -45,7 +45,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""$(QTDIR)\include";"$(QTDIR)\include\QtCore";"$(QTDIR)\include\QtGui""
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;QT_LARGEFILE_SUPPORT;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;QT_DLL;QT_DEBUG"
PreprocessorDefinitions="WIN32;_DEBUG;_WIN32_WINNT 0x0500;_CONSOLE;QT_LARGEFILE_SUPPORT;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;QT_DLL;QT_DEBUG"
MinimalRebuild="false"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@ -131,7 +131,7 @@
FavorSizeOrSpeed="1"
OmitFramePointers="true"
AdditionalIncludeDirectories=""$(QTDIR)\include";"$(QTDIR)\include\QtCore";"$(QTDIR)\include\QtGui""
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;QT_LARGEFILE_SUPPORT;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;QT_DLL;QT_NO_DEBUG"
PreprocessorDefinitions="WIN32;NDEBUG;_WIN32_WINNT 0x0500;_CONSOLE;QT_LARGEFILE_SUPPORT;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;QT_DLL;QT_NO_DEBUG"
MinimalRebuild="false"
BasicRuntimeChecks="0"
RuntimeLibrary="2"
@ -223,7 +223,7 @@
OmitFramePointers="true"
WholeProgramOptimization="true"
AdditionalIncludeDirectories=""$(QTDIR)\include";"$(QTDIR)\include\QtCore";"$(QTDIR)\include\QtGui""
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;QT_LARGEFILE_SUPPORT;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;QT_NO_DEBUG;QT_NODLL"
PreprocessorDefinitions="WIN32;NDEBUG;_WIN32_WINNT 0x0500;_CONSOLE;QT_LARGEFILE_SUPPORT;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;QT_NO_DEBUG;QT_NODLL"
MinimalRebuild="false"
BasicRuntimeChecks="0"
RuntimeLibrary="0"
@ -577,7 +577,7 @@
<Tool
Name="VCCustomBuildTool"
Description="MOC &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; -o &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot; &quot;$(InputPath)&quot;"
CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; -o &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
/>
</FileConfiguration>
@ -587,7 +587,7 @@
<Tool
Name="VCCustomBuildTool"
Description="MOC &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; -o &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot; &quot;$(InputPath)&quot;"
CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; -o &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
/>
</FileConfiguration>
@ -597,7 +597,7 @@
<Tool
Name="VCCustomBuildTool"
Description="MOC &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; -o &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot; &quot;$(InputPath)&quot;"
CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; -o &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
/>
</FileConfiguration>
@ -1715,7 +1715,7 @@
<Tool
Name="VCCustomBuildTool"
Description="UIC &quot;$(SolutionDir)tmp\UIC_$(SafeInputName).h&quot;"
CommandLine="&quot;$(QTDIR)\bin\uic.exe&quot; -o &quot;$(SolutionDir)tmp\UIC_$(SafeInputName).h&quot; &quot;$(InputPath)&quot;"
CommandLine="&quot;$(QTDIR)\bin\uic.exe&quot; -o &quot;$(SolutionDir)tmp\UIC_$(SafeInputName).h&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(SolutionDir)tmp\UIC_$(SafeInputName).h&quot;"
/>
</FileConfiguration>
@ -1725,7 +1725,7 @@
<Tool
Name="VCCustomBuildTool"
Description="UIC &quot;$(SolutionDir)tmp\UIC_$(SafeInputName).h&quot;"
CommandLine="&quot;$(QTDIR)\bin\uic.exe&quot; -o &quot;$(SolutionDir)tmp\UIC_$(SafeInputName).h&quot; &quot;$(InputPath)&quot;"
CommandLine="&quot;$(QTDIR)\bin\uic.exe&quot; -o &quot;$(SolutionDir)tmp\UIC_$(SafeInputName).h&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(SolutionDir)tmp\UIC_$(SafeInputName).h&quot;"
/>
</FileConfiguration>
@ -1735,7 +1735,7 @@
<Tool
Name="VCCustomBuildTool"
Description="UIC &quot;$(SolutionDir)tmp\UIC_$(SafeInputName).h&quot;"
CommandLine="&quot;$(QTDIR)\bin\uic.exe&quot; -o &quot;$(SolutionDir)tmp\UIC_$(SafeInputName).h&quot; &quot;$(InputPath)&quot;"
CommandLine="&quot;$(QTDIR)\bin\uic.exe&quot; -o &quot;$(SolutionDir)tmp\UIC_$(SafeInputName).h&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(SolutionDir)tmp\UIC_$(SafeInputName).h&quot;"
/>
</FileConfiguration>

View File

@ -26,7 +26,7 @@
<item row="0" column="1">
<widget class="QLabel" name="dropBoxLabel">
<property name="toolTip">
<string>&lt;b&gt;LameXP DropBox&lt;/b&gt;&lt;br&gt;&lt;nobr&gt;You can add files to LameXP via Drag&amp;amp;Drop here!&lt;/nobr&gt;&lt;br&gt;&lt;nobr&gt;(Right-click to close to DropBox)&lt;/nobr&gt;</string>
<string>&lt;b&gt;LameXP DropBox&lt;/b&gt;&lt;br&gt;&lt;nobr&gt;You can add files to LameXP via Drag&amp;amp;Drop here!&lt;/nobr&gt;&lt;br&gt;&lt;nobr&gt;(Right-click to close the DropBox)&lt;/nobr&gt;</string>
</property>
<property name="lineWidth">
<number>0</number>
@ -53,6 +53,7 @@
<include location="../res/Images.qrc"/>
<include location="../res/Images.qrc"/>
<include location="../res/Images.qrc"/>
<include location="../res/Images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -25,7 +25,7 @@
#define VER_LAMEXP_MAJOR 4
#define VER_LAMEXP_MINOR_HI 0
#define VER_LAMEXP_MINOR_LO 0
#define VER_LAMEXP_BUILD 182
#define VER_LAMEXP_BUILD 183
#define VER_LAMEXP_SUFFIX TechPreview
/*

View File

@ -66,6 +66,8 @@
#define LAMEXP_INIT_QT_STATIC_PLUGIN(X)
#endif
#define X ULONG_MAX
///////////////////////////////////////////////////////////////////////////////
// TYPES
///////////////////////////////////////////////////////////////////////////////
@ -78,6 +80,23 @@ typedef struct
char parameter[4096];
} lamexp_ipc_t;
struct lamexp_oscomp_t
{
DWORD verMajor;
DWORD verMinor;
char *pcExport;
};
static const struct lamexp_oscomp_t g_lamexp_oscomp[] =
{
{4, X, "OpenThread"}, // Windows NT 4.0
{5, 0, "GetNativeSystemInfo"}, // Windows 2000
{5, 1, "GetLargePageMinimum"}, // Windows XP
{5, 2, "GetLocaleInfoEx"}, // Windows Server 2003
{6, 0, "CreateRemoteThreadEx"}, // Windows Vista
{0, 0, NULL} // EOL
};
///////////////////////////////////////////////////////////////////////////////
// GLOBAL VARS
///////////////////////////////////////////////////////////////////////////////
@ -390,6 +409,34 @@ void WINAPI debugThreadProc(__in LPVOID lpParameter)
TerminateProcess(GetCurrentProcess(), -1);
}
/*
* Check for compatibility mode
*/
static bool lamexp_check_compatibility_mode(void)
{
QLibrary kernel32("kernel32.dll");
OSVERSIONINFOW versionInfo;
memset(&versionInfo, 0, sizeof(OSVERSIONINFOW));
versionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW);
if(GetVersionEx(&versionInfo))
{
for(int i = 0; g_lamexp_oscomp[i].pcExport; i++)
{
if((g_lamexp_oscomp[i].verMajor == X || g_lamexp_oscomp[i].verMajor == versionInfo.dwMajorVersion) && (g_lamexp_oscomp[i].verMinor == X || g_lamexp_oscomp[i].verMinor == versionInfo.dwMinorVersion))
{
if(kernel32.resolve(g_lamexp_oscomp[i].pcExport) != NULL)
{
qFatal("Windows NT %u.%u compatibility mode detected. Aborting!", versionInfo.dwMajorVersion, versionInfo.dwMinorVersion);
return false;
}
}
}
}
return true;
}
/*
* Initialize Qt framework
@ -431,6 +478,9 @@ bool lamexp_init_qt(int argc, char* argv[])
break;
}
//Check if "compatibility mode" is enabled
lamexp_check_compatibility_mode();
//Create Qt application instance and setup version info
QApplication *application = new QApplication(argc, argv);
application->setApplicationName("LameXP - Audio Encoder Front-End");

View File

@ -29,7 +29,7 @@
// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows XP.
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows 2000.
#define _WIN32_WINNT 0x0500 // Change this to the appropriate value to target other versions of Windows.
#endif