From 804021e621413998b319f887eed3f754df784fcd Mon Sep 17 00:00:00 2001
From: Ken Thomases <ken@codeweavers.com>
Date: Thu, 27 Mar 2014 18:18:46 -0500
Subject: winemac: Make GetMonitorInfo() give a different device name
 (\\.\DISPLAY<n>) to each monitor.

---
 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 e1357d8..f82289d 100644
--- a/dlls/winemac.drv/display.c
+++ b/dlls/winemac.drv/display.c
@@ -1210,7 +1210,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;
@@ -1240,10 +1240,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
     {
-- 
2.6.1

