[GDIPLUS] Sync with Wine Staging 2.2. CORE-12823
[reactos.git] / reactos / dll / win32 / gdiplus / gdiplus_private.h
index f729bfc..91fdec5 100644 (file)
@@ -335,6 +335,7 @@ struct GpPathIterator{
 };
 
 struct GpCustomLineCap{
+    CustomLineCapType type;
     GpPathData pathdata;
     BOOL fill;      /* TRUE for fill, FALSE for stroke */
     GpLineCap cap;  /* as far as I can tell, this value is ignored */
@@ -355,6 +356,7 @@ struct GpImage{
     UINT frame_count, current_frame;
     ColorPalette *palette;
     REAL xres, yres;
+    LONG busy;
 };
 
 struct GpMetafile{
@@ -397,7 +399,6 @@ struct GpBitmap{
     INT height;
     PixelFormat format;
     ImageLockMode lockmode;
-    INT numlocks;
     BYTE *bitmapbits;   /* pointer to the buffer we passed in BitmapLockBits */
     HBITMAP hbitmap;
     HDC hdc;
@@ -522,4 +523,17 @@ GpStatus gdip_format_string(HDC hdc,
 
 void get_log_fontW(const GpFont *, GpGraphics *, LOGFONTW *) DECLSPEC_HIDDEN;
 
+static inline BOOL image_lock(GpImage *image, BOOL *unlock)
+{
+    LONG tid = GetCurrentThreadId(), owner_tid;
+    owner_tid = InterlockedCompareExchange(&image->busy, tid, 0);
+    *unlock = !owner_tid;
+    return !owner_tid || owner_tid==tid;
+}
+
+static inline void image_unlock(GpImage *image, BOOL unlock)
+{
+    if (unlock) image->busy = 0;
+}
+
 #endif /* __WINE_GP_PRIVATE_H_ */