From 2ef32d12306ac21c0c900ff8f353ff0b573e67ae Mon Sep 17 00:00:00 2001
From: isanae <14251494+isanae@users.noreply.github.com>
Date: Wed, 17 Jul 2019 12:39:01 -0400
Subject: moved environment dump to member function added check for nahimic
---
src/shared/util.cpp | 25 ++++++++++++++++++++++---
src/shared/util.h | 6 +++++-
2 files changed, 27 insertions(+), 4 deletions(-)
(limited to 'src/shared')
diff --git a/src/shared/util.cpp b/src/shared/util.cpp
index 8d8c2000..eacd1f88 100644
--- a/src/shared/util.cpp
+++ b/src/shared/util.cpp
@@ -23,6 +23,7 @@ along with Mod Organizer. If not, see .
#include "executableslist.h"
#include "instancemanager.h"
#include
+#include
#include
#include
@@ -41,8 +42,7 @@ along with Mod Organizer. If not, see .
#pragma comment(lib, "Wbemuuid.lib")
-using MOBase::formatSystemMessage;
-using MOBase::formatSystemMessageQ;
+using namespace MOBase;
namespace fs = std::filesystem;
namespace MOShared {
@@ -870,7 +870,7 @@ Environment::Environment()
m_security = getSecurityProducts();
}
-const std::vector& Environment::loadedModules()
+const std::vector& Environment::loadedModules() const
{
return m_modules;
}
@@ -885,6 +885,25 @@ const std::vector& Environment::securityProducts() const
return m_security;
}
+void Environment::dump() const
+{
+ log::debug("windows: {}", windowsInfo().toString());
+
+ if (windowsInfo().compatibilityMode()) {
+ log::warn("MO seems to be running in compatibility mode");
+ }
+
+ log::debug("security products:");
+ for (const auto& sp : securityProducts()) {
+ log::debug(" . {}", sp.toString());
+ }
+
+ log::debug("modules loaded in process:");
+ for (const auto& m : loadedModules()) {
+ log::debug(" . {}", m.toString());
+ }
+}
+
std::vector Environment::getLoadedModules() const
{
HandlePtr snapshot(CreateToolhelp32Snapshot(
diff --git a/src/shared/util.h b/src/shared/util.h
index a5d096ac..267bb780 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -410,7 +410,7 @@ public:
// list of loaded modules in the current process
//
- const std::vector& loadedModules();
+ const std::vector& loadedModules() const;
// information about the operating system
//
@@ -420,6 +420,10 @@ public:
//
const std::vector& securityProducts() const;
+ // logs the environment
+ //
+ void dump() const;
+
private:
std::vector m_modules;
WindowsInfo m_windows;
--
cgit v1.3.1