Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavide Beatrici <git@davidebeatrici.dev>2020-11-06 23:37:06 +0300
committerDavide Beatrici <git@davidebeatrici.dev>2020-11-06 23:37:06 +0300
commit988b8417acfc4ca4b19283afe7e1973d05a39be8 (patch)
tree160e79e9d7dc57ac27e02279775ea29418a537ae /plugins/ProcessWindows.cpp
parenta3480a2a6b432b247821add175f725714692ef1e (diff)
REFAC(positional-audio): Proper functions/classes for module-related operations
Previously, only module() was present: it retrieved the base address of the specified module. It worked fine, but it iterated through the process' modules every time it was called. This commit replaces it with modules(), which returns an std::unordered_map containing all modules. The map uses the module name as key and Module as value. Aside from the performance improvement, the new code also provides info for each module region: - Start address. - Size. - Whether it's readable, writable and/or executable.
Diffstat (limited to 'plugins/ProcessWindows.cpp')
-rw-r--r--plugins/ProcessWindows.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/ProcessWindows.cpp b/plugins/ProcessWindows.cpp
index b872cf64d..77cf304fa 100644
--- a/plugins/ProcessWindows.cpp
+++ b/plugins/ProcessWindows.cpp
@@ -8,7 +8,13 @@
#include "mumble_plugin_win32_internals.h"
ProcessWindows::ProcessWindows(const procid_t id, const std::string &name) : Process(id, name) {
- const auto address = module(name);
+ const auto mods = modules();
+ const auto iter = mods.find(name);
+ if (iter == mods.cend()) {
+ return;
+ }
+
+ const auto address = iter->second.baseAddress();
if (!address) {
return;
}