[PATCH 6/7] uxtheme: Implement GetBufferedPaintBits()

Nikolay Sivov nsivov at codeweavers.com
Wed Feb 8 16:42:39 CST 2017


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/uxtheme/buffer.c       | 19 +++++++++++++++----
 dlls/uxtheme/tests/system.c |  3 +--
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/dlls/uxtheme/buffer.c b/dlls/uxtheme/buffer.c
index 853fe82a47..ce1fc9f602 100644
--- a/dlls/uxtheme/buffer.c
+++ b/dlls/uxtheme/buffer.c
@@ -189,11 +189,22 @@ HRESULT WINAPI BufferedPaintSetAlpha(HPAINTBUFFER hBufferedPaint, const RECT *pr
 /***********************************************************************
  *      GetBufferedPaintBits                               (UXTHEME.@)
  */
-HRESULT WINAPI GetBufferedPaintBits(HPAINTBUFFER hBufferedPaint, RGBQUAD **ppbBuffer,
-                                    int *pcxRow)
+HRESULT WINAPI GetBufferedPaintBits(HPAINTBUFFER bufferhandle, RGBQUAD **bits, int *width)
 {
-    FIXME("Stub (%p %p %p)\n", hBufferedPaint, ppbBuffer, pcxRow);
-    return E_NOTIMPL;
+    struct paintbuffer *buffer = get_buffer_obj(bufferhandle);
+
+    TRACE("(%p %p %p)\n", buffer, bits, width);
+
+    if (!bits || !width)
+        return E_POINTER;
+
+    if (!buffer || !buffer->bits)
+        return E_FAIL;
+
+    *bits = buffer->bits;
+    *width = buffer->rect.right - buffer->rect.left;
+
+    return S_OK;
 }
 
 /***********************************************************************
diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c
index 6c08635741..81e47be5f3 100644
--- a/dlls/uxtheme/tests/system.c
+++ b/dlls/uxtheme/tests/system.c
@@ -648,7 +648,6 @@ todo_wine
         bits = NULL;
         row = 0;
         hr = pGetBufferedPaintBits(buffer, &bits, &row);
-todo_wine {
         if (format == BPBF_COMPATIBLEBITMAP)
             ok(hr == E_FAIL, "Unexpected return code %#x\n", hr);
         else
@@ -657,7 +656,7 @@ todo_wine {
             ok(bits != NULL, "Bitmap bits %p\n", bits);
             ok(row > 0, "Bitmap width %d\n", row);
         }
-}
+
         hr = pEndBufferedPaint(buffer, FALSE);
         ok(hr == S_OK, "Unexpected return code %#x\n", hr);
     }
-- 
2.11.0




More information about the wine-patches mailing list