From d699b3514c2c9d9fb32b19f487ad648e6fadb814 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 5 Jun 2019 12:32:07 +0100 Subject: [PATCH] Try to warn if we're running the 32-bit version on 64-bit windows (WoW64) (#1569). --- src/lib/config.h | 1 + src/lib/cross.cc | 13 +++++++++++++ src/lib/cross.h | 1 + src/tools/dcpomatic.cc | 7 +++++++ 4 files changed, 22 insertions(+) diff --git a/src/lib/config.h b/src/lib/config.h index e25cb06da..29511b1fe 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -377,6 +377,7 @@ public: NAG_INITIAL_SETUP, NAG_IMPORT_DECRYPTION_CHAIN, NAG_DELETE_DKDM, + NAG_32_ON_64, NAG_COUNT }; diff --git a/src/lib/cross.cc b/src/lib/cross.cc index 171bf2c81..a7fb298cb 100644 --- a/src/lib/cross.cc +++ b/src/lib/cross.cc @@ -501,3 +501,16 @@ command_and_read (string cmd) return ""; } + +/** @return true if this process is a 32-bit one running on a 64-bit-capable OS */ +bool +running_32_on_64 () +{ +#ifdef DCPOMATIC_WINDOWS + BOOL p; + IsWow64Process (GetCurrentProcess(), &p); + return p; +#endif + /* XXX: assuming nobody does this on Linux / OS X */ + return false; +} diff --git a/src/lib/cross.h b/src/lib/cross.h index 06e198e99..2e8b8e429 100644 --- a/src/lib/cross.h +++ b/src/lib/cross.h @@ -57,6 +57,7 @@ extern uint64_t thread_id (); extern int avio_open_boost (AVIOContext** s, boost::filesystem::path file, int flags); extern boost::filesystem::path home_directory (); extern std::string command_and_read (std::string cmd); +extern bool running_32_on_64 (); /** @class Waker * @brief A class which tries to keep the computer awake on various operating systems. diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 820289825..96770914d 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -1539,6 +1539,13 @@ private: Config::instance()->set_nagged(Config::NAG_INITIAL_SETUP, true); } + if (running_32_on_64 ()) { + NagDialog::maybe_nag ( + _frame, Config::NAG_32_ON_64, + _("You are running the 32-bit version of DCP-o-matic on a 64-bit version of Windows. This will limit the memory available to DCP-o-matic and may cause errors. You are strongly advised to install the 64-bit version of DCP-o-matic."), + false); + } + _frame->Show (); if (!_film_to_load.empty() && boost::filesystem::is_directory (_film_to_load)) { -- 2.30.2