Skip to content

Commit 5577e70

Browse files
committed
gpu model for win32
1 parent d09625e commit 5577e70

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

source/gameanalytics/Platform/GAWin32.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,10 @@ std::string getRegistryKey(HKEY key, const TCHAR* subkey, const TCHAR* value)
112112
{
113113
constexpr DWORD maxBufSize = 128;
114114

115-
DWORD size = 0;
115+
DWORD size = maxBufSize * sizeof(TCHAR);
116116
TCHAR buffer[maxBufSize] = _T("");
117117
RegGetValue(key, subkey, value, RRF_RT_REG_SZ, NULL, buffer, &size);
118118

119-
size = std::min(size, maxBufSize);
120-
121119
if (!GetLastError() && size > 0)
122120
{
123121
std::string val;
@@ -218,8 +216,15 @@ void GAPlatformWin32::signalHandler(int sig)
218216

219217
std::string GAPlatformWin32::getGpuModel() const
220218
{
221-
//todo
222-
return "";
219+
DISPLAY_DEVICE device;
220+
ZeroMemory(&device, sizeof(DISPLAY_DEVICE));
221+
222+
if(EnumDisplayDevices(NULL, 0, &device, 0))
223+
{
224+
return device.DeviceName;
225+
}
226+
227+
return UNKNOWN_VALUE;
223228
}
224229

225230
int GAPlatformWin32::getNumCpuCores() const

0 commit comments

Comments
 (0)