1Index: graphics.c 2=================================================================== 3--- graphics.c (revision 57285) 4+++ graphics.c (working copy) 5@@ -42,6 +42,23 @@ 6 7 WINE_DEFAULT_DEBUG_CHANNEL(gdiplus); 8 9+/* Mike "tamlin" Nordell 2012-09-14 for ReactOS: 10+ * NOTE: Wine uses per-GpGraphics id's ('contid' starting from zero in 11+ * every GpGraphics). Windows seems to use process-global id's, or at 12+ * least more unique id's. 13+ * This have the following implications. It: 14+ * 1. fails the current gdiplus test case. 15+ * 2. is not what Windows does. 16+ * 17+ * We therefore "obfuscate" the 'contid' a little to more match Windows' 18+ * behaviour. The observable behviour should still remain the same, 19+ * except for handing out more "unique" id's. 20+ */ 21+#define GDIP_CONTID_STEP 64 22+static volatile LONG g_priv_contid = GDIP_CONTID_STEP; 23+#define GDIP_GET_NEW_CONTID_FOR(pGpGraphics) \ 24+ (UINT)(InterlockedExchangeAdd(&g_priv_contid,GDIP_CONTID_STEP)) 25+ 26 /* looks-right constants */ 27 #define ANCHOR_WIDTH (2.0) 28 #define MAX_ITERS (50) 29@@ -2203,7 +2220,7 @@ 30 (*graphics)->busy = FALSE; 31 (*graphics)->textcontrast = 4; 32 list_init(&(*graphics)->containers); 33- (*graphics)->contid = 0; 34+ (*graphics)->contid = GDIP_GET_NEW_CONTID_FOR(*graphics); 35 36 TRACE("<-- %p\n", *graphics); 37 38@@ -2242,7 +2259,7 @@ 39 (*graphics)->busy = FALSE; 40 (*graphics)->textcontrast = 4; 41 list_init(&(*graphics)->containers); 42- (*graphics)->contid = 0; 43+ (*graphics)->contid = GDIP_GET_NEW_CONTID_FOR(*graphics); 44 45 TRACE("<-- %p\n", *graphics); 46