Skip to content

Commit 64f98cf

Browse files
authored
Merge branch 'master' into reload
2 parents 29d0164 + 9e62309 commit 64f98cf

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

Client/core/Graphics/CVideoModeManager.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -687,9 +687,18 @@ bool CVideoModeManager::GetCurrentAdapterRect(LPRECT pOutRect)
687687
///////////////////////////////////////////////////////////////
688688
SString CVideoModeManager::GetCurrentAdapterDeviceName()
689689
{
690-
MONITORINFOEX monitorInfo;
690+
if (!m_hCurrentMonitor)
691+
return "";
692+
693+
MONITORINFOEX monitorInfo{};
691694
monitorInfo.cbSize = sizeof(MONITORINFOEX);
692-
if (GetMonitorInfo(m_hCurrentMonitor, &monitorInfo))
693-
return monitorInfo.szDevice;
695+
696+
if (GetMonitorInfoA(m_hCurrentMonitor, &monitorInfo))
697+
{
698+
// Ensure null termination for x86 safety
699+
monitorInfo.szDevice[sizeof(monitorInfo.szDevice) - 1] = '\0';
700+
return std::string(monitorInfo.szDevice);
701+
}
702+
694703
return "";
695704
}

Shared/sdk/SharedUtil.Template.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#pragma once
22

3+
#ifdef __INTELLISENSE__
4+
#pragma diag_suppress 842
5+
#endif
6+
37
#include <type_traits>
48
#include <variant>
59

0 commit comments

Comments
 (0)