Skip to content

Commit 4fd92f6

Browse files
committed
Merge branch 'main' into injection-rainbow-side
2 parents dfb2a52 + 3bf800a commit 4fd92f6

File tree

19 files changed

+281
-122
lines changed

19 files changed

+281
-122
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,7 @@ PresentMon/ddETWExternalEvents.rc
5858

5959
PresentMon/ddETWExternalEventsTEMP.BIN
6060

61-
Directory.Build.props
61+
# Local runsettings files (user-specific test configurations)
62+
*.local.runsettings
63+
64+
Directory.Build.props

ETLTrimmer/main.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,15 @@ class TempFile
297297
}
298298
~TempFile()
299299
{
300-
std::filesystem::remove((const wchar_t*)name_);
300+
pmquell(std::filesystem::remove((const wchar_t*)name_))
301301
}
302+
303+
TempFile() = default;
304+
TempFile(const TempFile&) = delete;
305+
TempFile& operator=(const TempFile&) = delete;
306+
TempFile(TempFile&&) = delete;
307+
TempFile& operator=(TempFile&&) = delete;
308+
302309
private:
303310
CComBSTR name_ = "null-log.etl.tmp";
304311
};

IntelPresentMon/CommonUtilities/PrecisionWaiter.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@ namespace pmon::util
1111
:
1212
defaultWaitBuffer_{ waitBuffer }
1313
{
14-
waitableTimer_ = win::Handle(CreateWaitableTimerExW(
15-
nullptr,
16-
nullptr,
17-
CREATE_WAITABLE_TIMER_HIGH_RESOLUTION,
18-
TIMER_ALL_ACCESS
19-
));
20-
if (!waitableTimer_) {
21-
pmlog_error("Failed creating high resolution timer").hr();
14+
try {
15+
waitableTimer_ = win::Handle(CreateWaitableTimerExW(
16+
nullptr,
17+
nullptr,
18+
CREATE_WAITABLE_TIMER_HIGH_RESOLUTION,
19+
TIMER_ALL_ACCESS
20+
));
21+
}
22+
catch (...) {
23+
pmlog_error(ReportException("Failed creating timer"));
2224
}
2325
}
2426
void PrecisionWaiter::Wait(double seconds, bool alertable) noexcept

IntelPresentMon/CommonUtilities/win/MessageBox.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ namespace pmon::util::win
1010
MsgBox();
1111
MsgBox(std::string message);
1212
~MsgBox();
13+
14+
MsgBox(const MsgBox&) = delete;
15+
MsgBox & operator=(const MsgBox&) = delete;
16+
MsgBox(MsgBox&&) = delete;
17+
MsgBox & operator=(MsgBox&&) = delete;
18+
1319
MsgBox& WithMessage(std::string message);
1420
MsgBox& WithTitle(std::string title);
1521
MsgBox& AsError();

IntelPresentMon/CommonUtilities/win/Privileges.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "Privileges.h"
22
#include "HrError.h"
3+
#include "../log/Log.h"
34
#include <format>
45
#include "../Memory.h"
56

@@ -116,9 +117,15 @@ namespace pmon::util::win
116117
}
117118
bool WeAreElevated() noexcept
118119
{
119-
auto hToken = OpenCurrentProcessToken(TOKEN_QUERY);
120-
TOKEN_ELEVATION elev{}; DWORD len = 0;
121-
GetTokenInformation(hToken, TokenElevation, &elev, sizeof(elev), &len);
122-
return bool(elev.TokenIsElevated);
120+
try {
121+
auto hToken = OpenCurrentProcessToken(TOKEN_QUERY);
122+
TOKEN_ELEVATION elev{}; DWORD len = 0;
123+
GetTokenInformation(hToken, TokenElevation, &elev, sizeof(elev), &len);
124+
return bool(elev.TokenIsElevated);
125+
}
126+
catch (...) {
127+
pmlog_error("Error checking elevation");
128+
return false;
129+
}
123130
}
124131
}

IntelPresentMon/ControlLib/AmdPowerTelemetryAdapter.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@ AmdCheckerToken chk;
1313
AmdResultGrabber::AmdResultGrabber(int result,
1414
std::source_location loc) noexcept
1515
: result_(result), loc_(loc) {}
16-
int operator>>(AmdResultGrabber g, AmdCheckerToken) {
16+
int operator>>(AmdResultGrabber g, AmdCheckerToken) noexcept {
1717
if (g.result_ != ADL_OK) {
18-
LOG(INFO) << "Failed Telemetry Query: " << g.loc_.file_name() << " "
18+
try {
19+
LOG(INFO) << "Failed Telemetry Query: " << g.loc_.file_name() << " "
1920
<< g.loc_.line() << " " << g.result_;
21+
}
22+
catch (...) {}
2023
}
2124
return g.result_;
2225
}

IntelPresentMon/ControlLib/AmdPowerTelemetryAdapter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ struct AmdResultGrabber {
1616
int result_;
1717
std::source_location loc_;
1818
};
19-
int operator>>(AmdResultGrabber, AmdCheckerToken);
19+
int operator>>(AmdResultGrabber, AmdCheckerToken) noexcept;
2020

2121
class AmdPowerTelemetryAdapter : public PowerTelemetryAdapter {
2222
public:

IntelPresentMon/Core/source/kernel/InjectorComplex.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,11 @@ namespace p2c::kern
101101
void InjectorComplex::InjectorModule_::UpdateConfig(const GfxLayer::Extension::OverlayConfig& cfg)
102102
{
103103
config_ = cfg;
104-
if (injectionPointClient_) {
105-
PushConfig_();
106-
}
107-
}void InjectorComplex::InjectorModule_::ChangeTarget(std::optional<std::string> targetModuleName)
104+
PushConfig_();
105+
}
106+
void InjectorComplex::InjectorModule_::ChangeTarget(std::optional<std::string> targetModuleName)
108107
{
109-
// Drop any prior action client (as you had)
108+
// Drop any prior action client
110109
{
111110
std::lock_guard lk{ actionClientMutex_ };
112111
injectionPointClient_.reset();

IntelPresentMon/FlashInjectorLibrary/Extension/OverlayRenderer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ namespace GfxLayer::Extension
7979
using clock = std::chrono::high_resolution_clock;
8080
OverlayConfig m_currentConfig;
8181
ComPtr<IDXGISwapChain3> m_pSwapChain;
82-
unsigned m_width;
83-
unsigned m_height;
82+
unsigned m_width = 0;
83+
unsigned m_height = 0;
8484
std::optional<clock::time_point> m_flashStartTime;
8585
bool m_clickHoldoff = false;
8686
size_t m_rainbowFrameIndex = 0;

IntelPresentMon/Interprocess/source/act/SymmetricActionClient.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ namespace pmon::ipc::act
4242
SymmetricActionClient& operator=(SymmetricActionClient&&) = delete;
4343
~SymmetricActionClient()
4444
{
45-
ioctx_.stop();
45+
try {
46+
ioctx_.stop();
47+
}
48+
catch (...) {
49+
pmlog_error("Failed to stop ioctx");
50+
}
4651
}
4752

4853
template<class Params>

0 commit comments

Comments
 (0)