Debian Codegraph @

Source/Core/Common/LdrWatcher.h

raw symbols SCIP
1 // Copyright 2008 Dolphin Emulator Project
2 // SPDX-License-Identifier: GPL-2.0-or-later
3
4 #pragma once
5
6 #include <functional>
7 #include <list>
8 #include <string>
9 #include <vector>
10
11 struct LdrDllLoadEvent
12 {
13 const std::wstring& name;
14 uintptr_t base_address;
15 };
16
17 class LdrObserver
18 {
19 public:
20 std::vector<std::wstring> module_names;
21 // NOTE: This may be called from a Ldr callout. While most things are probably fine, try to
22 // keep things as simple as possible, and just queue real work onto something else.
23 std::function<void(const LdrDllLoadEvent&)> action;
24 void* cookie{};
25 };
26
27 class LdrWatcher
28 {
29 public:
30 void Install(const LdrObserver& observer);
31 ~LdrWatcher();
32
33 private:
34 bool InjectCurrentModules(const LdrObserver& observer);
35 void UninstallAll();
36 std::list<LdrObserver> observers;
37 };