MCPcopy Create free account
hub / github.com/GameTechDev/PresentMon / UpdateInjection

Method UpdateInjection

IntelPresentMon/Core/source/kernel/Kernel.cpp:59–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57 }
58
59 void Kernel::UpdateInjection(bool enableInjection, std::optional<uint32_t> currentlyTargettedPid,
60 std::optional<std::string> overrideTargetName,
61 const GfxLayer::Extension::OverlayConfig& cfg)
62 {
63 HandleMarshalledException_();
64 auto config = cfg;
65 pInjectorComplex->SetActive(enableInjection);
66 if (enableInjection) {
67 if (overrideTargetName) {
68 pInjectorComplex->ChangeTarget(std::move(*overrideTargetName));
69 }
70 else if (currentlyTargettedPid) {
71 try {
72 auto hProc = cwin::OpenProcess(*currentlyTargettedPid);
73 auto modName = cwin::GetExecutableModulePath(hProc).filename().string();
74 pInjectorComplex->ChangeTarget(std::move(modName));
75 }
76 catch (...) {
77 pmlog_warn("Failed target process lookup").pmwatch(*currentlyTargettedPid);
78 pInjectorComplex->ChangeTarget({});
79 }
80 }
81 pInjectorComplex->UpdateConfig(cfg);
82 }
83 }
84
85 void Kernel::ClearOverlay()
86 {

Callers 1

Execute_Method · 0.80

Calls 5

OpenProcessFunction · 0.85
GetExecutableModulePathFunction · 0.85
SetActiveMethod · 0.80
ChangeTargetMethod · 0.80
UpdateConfigMethod · 0.45

Tested by 1

Execute_Method · 0.64