From: Ken Thomases ken@codeweavers.com
--- dlls/winemac.drv/display.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/winemac.drv/display.c b/dlls/winemac.drv/display.c index 00ad7738bb..af60a7d5b3 100644 --- a/dlls/winemac.drv/display.c +++ b/dlls/winemac.drv/display.c @@ -1262,7 +1262,7 @@ done: */ BOOL CDECL macdrv_GetMonitorInfo(HMONITOR monitor, LPMONITORINFO info) { - static const WCHAR adapter_name[] = { '\','\','.','\','D','I','S','P','L','A','Y','1',0 }; + static const WCHAR adapter_name[] = { '\','\','.','\','D','I','S','P','L','A','Y','%','d',0 }; struct macdrv_display *displays; int num_displays; CGDirectDisplayID display_id; @@ -1292,10 +1292,12 @@ BOOL CDECL macdrv_GetMonitorInfo(HMONITOR monitor, LPMONITORINFO info) info->dwFlags = (i == 0) ? MONITORINFOF_PRIMARY : 0;
if (info->cbSize >= sizeof(MONITORINFOEXW)) - lstrcpyW(((MONITORINFOEXW*)info)->szDevice, adapter_name); + snprintfW(((MONITORINFOEXW*)info)->szDevice, sizeof(((MONITORINFOEXW*)info)->szDevice) / sizeof(WCHAR), + adapter_name, i + 1);
- TRACE(" -> rcMonitor %s rcWork %s dwFlags %08x\n", wine_dbgstr_rect(&info->rcMonitor), - wine_dbgstr_rect(&info->rcWork), info->dwFlags); + TRACE(" -> rcMonitor %s rcWork %s dwFlags %08x szDevice %s\n", wine_dbgstr_rect(&info->rcMonitor), + wine_dbgstr_rect(&info->rcWork), info->dwFlags, + info->cbSize >= sizeof(MONITORINFOEXW) ? debugstr_w(((MONITORINFOEXW*)info)->szDevice) : "n/a"); } else {