FIX: fix studio not launch issue on windows-7
jira: no-jira Change-Id: I531e009c0547d3a5d86d48e990d930eb8fa6ba00
This commit is contained in:
parent
7d2fb185d5
commit
3d02f03ef4
|
@ -2770,23 +2770,31 @@ bool GUI_App::on_init_inner()
|
|||
|
||||
BOOST_LOG_TRIVIAL(info) << boost::format("gui mode, Current BambuStudio Version %1%")%SLIC3R_VERSION;
|
||||
BOOST_LOG_TRIVIAL(info) << get_system_info();
|
||||
|
||||
#if defined(__WINDOWS__)
|
||||
USHORT processMachine = 0;
|
||||
USHORT nativeMachine = 0;
|
||||
if (IsWow64Process2(GetCurrentProcess(), &processMachine, &nativeMachine)) {
|
||||
switch (nativeMachine) {
|
||||
case IMAGE_FILE_MACHINE_ARM64:
|
||||
m_is_arm64 = true;
|
||||
break;
|
||||
case IMAGE_FILE_MACHINE_AMD64:
|
||||
default:
|
||||
m_is_arm64 = false;
|
||||
break;
|
||||
HMODULE hKernel32 = GetModuleHandleW(L"kernel32.dll");
|
||||
m_is_arm64 = false;
|
||||
if (hKernel32) {
|
||||
auto fnIsWow64Process2 = (decltype(&IsWow64Process2))GetProcAddress(hKernel32, "IsWow64Process2");
|
||||
if (fnIsWow64Process2) {
|
||||
USHORT processMachine = 0;
|
||||
USHORT nativeMachine = 0;
|
||||
if (IsWow64Process2(GetCurrentProcess(), &processMachine, &nativeMachine)) {
|
||||
if (nativeMachine == IMAGE_FILE_MACHINE_ARM64) {
|
||||
m_is_arm64 = true;
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(info) << boost::format("processMachine architecture %1%, nativeMachine %2% m_is_arm64 %3%")%(int)(processMachine) %(int) nativeMachine %m_is_arm64;
|
||||
}
|
||||
else {
|
||||
BOOST_LOG_TRIVIAL(info) << boost::format("IsWow64Process2 failed, set m_is_arm64 to %1%") %m_is_arm64;
|
||||
}
|
||||
}
|
||||
else {
|
||||
BOOST_LOG_TRIVIAL(info) << boost::format("can not find IsWow64Process2, set m_is_arm64 to %1%") %m_is_arm64;
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(info) << boost::format("processMachine architecture %1%, nativeMachine %2% m_is_arm64 %3%")%(int)(processMachine) %(int) nativeMachine %m_is_arm64;
|
||||
}
|
||||
else {
|
||||
BOOST_LOG_TRIVIAL(info) << boost::format("IsWow64Process2 failed, m_is_arm64 %1%") %m_is_arm64;
|
||||
BOOST_LOG_TRIVIAL(info) << boost::format("can not find kernel32, set m_is_arm64 to %1%") %m_is_arm64;
|
||||
}
|
||||
#endif
|
||||
// Enable this to get the default Win32 COMCTRL32 behavior of static boxes.
|
||||
|
|
Loading…
Reference in New Issue