Try to warn if we're running the 32-bit version on 64-bit windows (WoW64) (#1569).
authorCarl Hetherington <cth@carlh.net>
Wed, 5 Jun 2019 11:32:07 +0000 (12:32 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 5 Jun 2019 11:32:07 +0000 (12:32 +0100)
src/lib/config.h
src/lib/cross.cc
src/lib/cross.h
src/tools/dcpomatic.cc

index e25cb06da5d4601e485e4ca32a0edac3792e2f53..29511b1fe80c47e150d4b9669b1e55686de15386 100644 (file)
@@ -377,6 +377,7 @@ public:
                NAG_INITIAL_SETUP,
                NAG_IMPORT_DECRYPTION_CHAIN,
                NAG_DELETE_DKDM,
+               NAG_32_ON_64,
                NAG_COUNT
        };
 
index 171bf2c8100767bb79d8d5b610767c768a44e705..a7fb298cb0b6084b88435f85eaae67d06adc5966 100644 (file)
@@ -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;
+}
index 06e198e99ad7a371e899dbe3023a17b2314afd64..2e8b8e429bcc64670cd02741ea63fec882b44eec 100644 (file)
@@ -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.
index 820289825057dc64ec7ee78fa75cdf66a8b3e8e8..96770914d38d1758083131d79b19a21b42c37945 100644 (file)
@@ -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)) {