Skip to content

Commit 5606eeb

Browse files
Merge pull request #490 from GameTechDev/feature/injector-upgrades
Feature/injector upgrades
2 parents 86651d8 + b48eb3b commit 5606eeb

File tree

90 files changed

+1020
-861
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+1020
-861
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,11 @@ IntelPresentMon/SampleClient/log.txt
4949
ETLTrimmer/Release/ETLTrimmer.Build.CppClean.log
5050

5151
ETLTrimmer/Release/ETLTrimmer.vcxproj.FileListAbsolute.txt
52+
53+
PresentMon/ddETWExternalEvents_MSG00001.bin
54+
55+
PresentMon/ddETWExternalEvents.h
56+
57+
PresentMon/ddETWExternalEvents.rc
58+
59+
PresentMon/ddETWExternalEventsTEMP.BIN

IntelPresentMon/AppCef/ipm-ui-vue/src/core/preferences.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ export interface Preferences {
5353
};
5454
adapterId:number|null;
5555
enableFlashInjection:boolean;
56+
flashInjectionEnableTargetOverride:boolean,
57+
flashInjectionTargetOverride:string;
5658
flashInjectionSize:number;
5759
flashInjectionColor:RgbaColor;
5860
flashInjectionBackgroundEnable:boolean;
@@ -110,6 +112,8 @@ export function makeDefaultPreferences(): Preferences {
110112
upscaleFactor: 2,
111113
adapterId: null,
112114
enableFlashInjection: false,
115+
flashInjectionEnableTargetOverride: false,
116+
flashInjectionTargetOverride: '',
113117
flashInjectionSize: 0.25,
114118
flashInjectionColor: {
115119
r: 255,

IntelPresentMon/AppCef/ipm-ui-vue/src/views/FlashConfigView.vue

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,27 @@
22
<!-- SPDX-License-Identifier: MIT -->
33

44
<script setup lang="ts">
5+
import { watch, nextTick, ref } from 'vue';
56
import { usePreferencesStore } from '@/stores/preferences';
67
import ColorPicker from '@/components/ColorPicker.vue';
8+
import { VTextField } from 'vuetify/components';
79
const prefs = usePreferencesStore();
10+
11+
// ref on field
12+
const overrideTextField = ref<InstanceType<typeof VTextField>|null>(null);
13+
// Vuetify rule: only validate (and flag red) when enabled
14+
const overrideRules = [
15+
(v: string) => !prefs.preferences.flashInjectionEnableTargetOverride || !!v || 'Required'
16+
];
17+
// whenever we enable override, force validation
18+
watch(
19+
() => prefs.preferences.flashInjectionEnableTargetOverride,
20+
(enabled) => {
21+
if (enabled) {
22+
nextTick(() => overrideTextField.value?.validate());
23+
}
24+
}
25+
);
826
</script>
927

1028
<template>
@@ -24,6 +42,32 @@ const prefs = usePreferencesStore();
2442
</v-col>
2543
</v-row>
2644

45+
<v-row class="mt-8">
46+
<v-col cols="3">
47+
Enable Target Override
48+
<p class="text-medium-emphasis text-caption mb-0">Use a custom name instead of last-targeted process name.</p>
49+
</v-col>
50+
<v-col cols="9">
51+
<v-switch v-model="prefs.preferences.flashInjectionEnableTargetOverride" label="Enable"></v-switch>
52+
</v-col>
53+
</v-row>
54+
55+
<v-row class="mt-8" v-if="prefs.preferences.flashInjectionEnableTargetOverride">
56+
<v-col cols="3">
57+
Target Name Override
58+
<p class="text-medium-emphasis text-caption mb-0">Process module name to use for injection.</p>
59+
</v-col>
60+
<v-col cols="9">
61+
<v-text-field
62+
ref="overrideTextField"
63+
v-model="prefs.preferences.flashInjectionTargetOverride"
64+
label="Module Name"
65+
:rules="overrideRules"
66+
required
67+
/>
68+
</v-col>
69+
</v-row>
70+
2771
<v-row class="mt-8">
2872
<v-col cols="3">
2973
Enable Background

IntelPresentMon/AppCef/source/util/FontEnumerator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
// SPDX-License-Identifier: MIT
33
#include "FontEnumerator.h"
44
#include <CommonUtilities/win/WinAPI.h>
5-
#include <Core/source/gfx/base/ComPtr.h>
5+
#include <CommonUtilities/win/com/ComPtr.h>
66
#include "Logging.h"
77
#include <CommonUtilities/log/HrLogger.h>
88
#include <dwrite.h>
99

1010

1111
namespace p2c::client::util
1212
{
13-
using gfx::ComPtr;
13+
using pmon::util::win::com::ComPtr;
1414

1515
FontEnumerator::FontEnumerator()
1616
{

IntelPresentMon/AppCef/source/util/async/GetTopGpuProcess.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ namespace p2c::client::util::async
2727
builder.FillWindowHandles();
2828
builder.FilterHavingWindow();
2929
const auto procMap = builder.Extract();
30-
std::vector<win::Process> procList;
30+
std::vector<::pmon::util::win::Process> procList;
3131
for (auto&&[pid, proc] : procMap) {
32-
procList.push_back(static_cast<const win::Process&>(proc));
32+
procList.push_back(static_cast<const ::pmon::util::win::Process&>(proc));
3333
}
3434
// check if a blacklist was provided
3535
if (pArgObj->GetType() != CefValueType::VTYPE_NULL) {
@@ -38,7 +38,7 @@ namespace p2c::client::util::async
3838
// build hash table set from vector
3939
std::unordered_set<std::string> blacklistSet(blacklist.begin(), blacklist.end());
4040
// remove candidate target processes that match blacklist (lower case compare)
41-
std::erase_if(procList, [&](const win::Process& proc) {
41+
std::erase_if(procList, [&](const ::pmon::util::win::Process& proc) {
4242
auto narrowName = ::pmon::util::str::ToNarrow(proc.name);
4343
for (auto& c : narrowName) {
4444
c = std::tolower(c);

IntelPresentMon/CommonUtilities/CommonUtilities.vcxproj

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ItemGroup Label="ProjectConfigurations">
44
<ProjectConfiguration Include="Debug|Win32">
@@ -87,6 +87,13 @@
8787
<ClInclude Include="rng\PairToRange.h" />
8888
<ClInclude Include="str\String.h" />
8989
<ClInclude Include="third\reflect.hpp" />
90+
<ClInclude Include="win\com\Comdef.h" />
91+
<ClInclude Include="win\com\ComManager.h" />
92+
<ClInclude Include="win\com\ComPtr.h" />
93+
<ClInclude Include="win\com\ProcessSpawnSink.h" />
94+
<ClInclude Include="win\com\WbemConnection.h" />
95+
<ClInclude Include="win\com\WbemListener.h" />
96+
<ClInclude Include="win\com\WbemSink.h" />
9097
<ClInclude Include="win\Event.h" />
9198
<ClInclude Include="win\Handle.h" />
9299
<ClInclude Include="win\HrErrorCodeProvider.h" />
@@ -139,6 +146,11 @@
139146
<ClCompile Include="Qpc.cpp" />
140147
<ClCompile Include="ref\GeneratedReflection.cpp" />
141148
<ClCompile Include="str\String.cpp" />
149+
<ClCompile Include="win\com\ComManager.cpp" />
150+
<ClCompile Include="win\com\ProcessSpawnSink.cpp" />
151+
<ClCompile Include="win\com\WbemConnection.cpp" />
152+
<ClCompile Include="win\com\WbemListener.cpp" />
153+
<ClCompile Include="win\com\WbemSink.cpp" />
142154
<ClCompile Include="win\Event.cpp" />
143155
<ClCompile Include="win\Handle.cpp" />
144156
<ClCompile Include="win\HrErrorCodeProvider.cpp" />

IntelPresentMon/Core/source/win/com/ComManager.cpp renamed to IntelPresentMon/CommonUtilities/win/com/ComManager.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// Copyright (C) 2022 Intel Corporation
22
// SPDX-License-Identifier: MIT
33
#include "ComManager.h"
4-
#include <Core/source/infra/Logging.h>
5-
#include <CommonUtilities/Exception.h>
4+
#include "../../log/Log.h"
5+
#include "../../Exception.h"
66
#include "Comdef.h"
77

88

9-
namespace p2c::win::com
9+
namespace pmon::util::win::com
1010
{
1111
using namespace ::pmon::util;
1212

IntelPresentMon/Core/source/win/com/ComManager.h renamed to IntelPresentMon/CommonUtilities/win/com/ComManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// SPDX-License-Identifier: MIT
33
#pragma once
44

5-
namespace p2c::win::com
5+
namespace pmon::util::win::com
66
{
77
class ComManager
88
{

IntelPresentMon/Core/source/gfx/base/ComPtr.h renamed to IntelPresentMon/CommonUtilities/win/com/ComPtr.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// Copyright (C) 2022 Intel Corporation
22
// SPDX-License-Identifier: MIT
33
#pragma once
4-
#include <Core/source/win/WinAPI.h>
4+
#include "../WinAPI.h"
55
#include <wrl.h>
66

77
// TODO: implement this ourselves so that we don't have to include winapi everywhere we use comptr
88

9-
namespace p2c::gfx
9+
namespace pmon::util::win::com
1010
{
1111
template<class T>
1212
class ComPtr : public Microsoft::WRL::ComPtr<T>

IntelPresentMon/Core/source/win/com/Comdef.h renamed to IntelPresentMon/CommonUtilities/win/com/Comdef.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#pragma once
2-
#include <Core/source/win/WinAPI.h>
2+
#include "../WinAPI.h"
33
#define FormatMessage FormatMessageW
44
#define _WIN32_DCOM
55
#include <comdef.h>

0 commit comments

Comments
 (0)