Skip to content

Commit 01b4543

Browse files
committed
fixed gpu model retrieval for windows
1 parent 6d1e591 commit 01b4543

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

source/gameanalytics/Platform/GAWin32.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,16 +233,18 @@ std::string GAPlatformWin32::getGpuModel() const
233233
DISPLAY_DEVICE device;
234234
ZeroMemory(&device, sizeof(DISPLAY_DEVICE));
235235

236-
if(EnumDisplayDevices(NULL, 0, &device, 0))
236+
device.cb = sizeof(DISPLAY_DEVICE);
237+
238+
if(EnumDisplayDevices(NULL, 0, &device, EDD_GET_DEVICE_INTERFACE_NAME))
237239
{
238240
#ifdef UNICODE
239-
return utilities::GAUtilities::ws2s(device.DeviceName);
241+
return utilities::GAUtilities::ws2s(device.DeviceString);
240242
#else
241-
return device.DeviceName;
243+
return device.DeviceString;
242244
#endif
243245
}
244246

245-
return UNKNOWN_VALUE;
247+
return "";
246248
}
247249

248250
int GAPlatformWin32::getNumCpuCores() const

0 commit comments

Comments
 (0)