[PATCH 4/5] d2d1/tests: Build without -DWINE_NO_LONG_TYPES.

Henri Verbeet hverbeet at codeweavers.com
Thu Feb 3 12:40:09 CST 2022


From: Eric Pouech <eric.pouech at gmail.com>

Signed-off-by: Eric Pouech <eric.pouech at gmail.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
 dlls/d2d1/tests/Makefile.in |    1 -
 dlls/d2d1/tests/d2d1.c      | 1341 +++++++++++++++++------------------
 2 files changed, 666 insertions(+), 676 deletions(-)

diff --git a/dlls/d2d1/tests/Makefile.in b/dlls/d2d1/tests/Makefile.in
index cd8701395b2e..5eeb815e07fb 100644
--- a/dlls/d2d1/tests/Makefile.in
+++ b/dlls/d2d1/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
 TESTDLL   = d2d1.dll
 IMPORTS   = d2d1 d3d10_1 d3d11 dwrite dxguid uuid user32 advapi32 ole32 gdi32
 
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c
index 003aad605054..2ac48e026c32 100644
--- a/dlls/d2d1/tests/d2d1.c
+++ b/dlls/d2d1/tests/d2d1.c
@@ -343,12 +343,12 @@ static void get_d3d10_surface_readback(IDXGISurface *surface, struct resource_re
     HRESULT hr;
 
     hr = IDXGISurface_GetDevice(surface, &IID_ID3D10Device, (void **)&device);
-    ok(SUCCEEDED(hr), "Failed to get device, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = IDXGISurface_QueryInterface(surface, &IID_ID3D10Resource, (void **)&src_resource);
-    ok(SUCCEEDED(hr), "Failed to query resource interface, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = IDXGISurface_GetDesc(surface, &surface_desc);
-    ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     texture_desc.Width = surface_desc.Width;
     texture_desc.Height = surface_desc.Height;
     texture_desc.MipLevels = 1;
@@ -360,7 +360,7 @@ static void get_d3d10_surface_readback(IDXGISurface *surface, struct resource_re
     texture_desc.CPUAccessFlags = D3D10_CPU_ACCESS_READ;
     texture_desc.MiscFlags = 0;
     hr = ID3D10Device_CreateTexture2D(device, &texture_desc, NULL, (ID3D10Texture2D **)&rb->u.d3d10_resource);
-    ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     rb->width = texture_desc.Width;
     rb->height = texture_desc.Height;
@@ -370,7 +370,7 @@ static void get_d3d10_surface_readback(IDXGISurface *surface, struct resource_re
     ID3D10Device_Release(device);
 
     hr = ID3D10Texture2D_Map((ID3D10Texture2D *)rb->u.d3d10_resource, 0, D3D10_MAP_READ, 0, &map_desc);
-    ok(SUCCEEDED(hr), "Failed to map texture, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     rb->pitch = map_desc.RowPitch;
     rb->data = map_desc.pData;
@@ -387,12 +387,12 @@ static void get_d3d11_surface_readback(IDXGISurface *surface, struct resource_re
     HRESULT hr;
 
     hr = IDXGISurface_GetDevice(surface, &IID_ID3D11Device, (void **)&device);
-    ok(SUCCEEDED(hr), "Failed to get device, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = IDXGISurface_QueryInterface(surface, &IID_ID3D11Resource, (void **)&src_resource);
-    ok(SUCCEEDED(hr), "Failed to query resource interface, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = IDXGISurface_GetDesc(surface, &surface_desc);
-    ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     texture_desc.Width = surface_desc.Width;
     texture_desc.Height = surface_desc.Height;
     texture_desc.MipLevels = 1;
@@ -404,7 +404,7 @@ static void get_d3d11_surface_readback(IDXGISurface *surface, struct resource_re
     texture_desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
     texture_desc.MiscFlags = 0;
     hr = ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, (ID3D11Texture2D **)&rb->u.d3d11_resource);
-    ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     rb->width = texture_desc.Width;
     rb->height = texture_desc.Height;
@@ -415,7 +415,7 @@ static void get_d3d11_surface_readback(IDXGISurface *surface, struct resource_re
     ID3D11Device_Release(device);
 
     hr = ID3D11DeviceContext_Map(context, rb->u.d3d11_resource, 0, D3D11_MAP_READ, 0, &map_desc);
-    ok(SUCCEEDED(hr), "Failed to map texture, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID3D11DeviceContext_Release(context);
 
     rb->pitch = map_desc.RowPitch;
@@ -556,7 +556,7 @@ static BOOL compare_sha1(void *data, unsigned int pitch, unsigned int bpp,
     hash_size = sizeof(hash_data);
     ret = CryptGetHashParam(hash, HP_HASHVAL, hash_data, &hash_size, 0);
     ok(ret, "Failed to get hash value.\n");
-    ok(hash_size == sizeof(hash_data), "Got unexpected hash size %u.\n", hash_size);
+    ok(hash_size == sizeof(hash_data), "Got unexpected hash size %lu.\n", hash_size);
 
     ret = CryptDestroyHash(hash);
     ok(ret, "Failed to destroy hash.\n");
@@ -594,16 +594,16 @@ static BOOL compare_wic_bitmap(IWICBitmap *bitmap, const char *ref_sha1)
     BOOL ret;
 
     hr = IWICBitmap_Lock(bitmap, NULL, WICBitmapLockRead, &lock);
-    ok(SUCCEEDED(hr), "Failed to lock bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = IWICBitmapLock_GetDataPointer(lock, &buffer_size, &data);
-    ok(SUCCEEDED(hr), "Failed to get bitmap data, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = IWICBitmapLock_GetStride(lock, &stride);
-    ok(SUCCEEDED(hr), "Failed to get bitmap stride, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = IWICBitmapLock_GetSize(lock, &width, &height);
-    ok(SUCCEEDED(hr), "Failed to get bitmap size, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ret = compare_sha1(data, stride, 4, width, height, ref_sha1);
 
@@ -862,7 +862,7 @@ static IDXGIDevice *create_device(BOOL d3d11)
         ID3D10Device1_Release(d3d10_device);
     }
 
-    ok(SUCCEEDED(hr), "Failed to get DXGI device, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     return device;
 }
@@ -886,9 +886,9 @@ static IDXGISwapChain *create_swapchain(IDXGIDevice *device, HWND window, BOOL w
     HRESULT hr;
 
     hr = IDXGIDevice_GetAdapter(device, &adapter);
-    ok(SUCCEEDED(hr), "Failed to get adapter, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = IDXGIAdapter_GetParent(adapter, &IID_IDXGIFactory, (void **)&factory);
-    ok(SUCCEEDED(hr), "Failed to get factory, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     IDXGIAdapter_Release(adapter);
 
     desc.BufferDesc.Width = 640;
@@ -908,7 +908,7 @@ static IDXGISwapChain *create_swapchain(IDXGIDevice *device, HWND window, BOOL w
     desc.Flags = 0;
 
     hr = IDXGIFactory_CreateSwapChain(factory, (IUnknown *)device, &desc, &swapchain);
-    ok(SUCCEEDED(hr), "Failed to create swapchain, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     IDXGIFactory_Release(factory);
 
     return swapchain;
@@ -921,7 +921,7 @@ static IDXGISwapChain *create_d3d10_swapchain(ID3D10Device1 *device, HWND window
     HRESULT hr;
 
     hr = ID3D10Device1_QueryInterface(device, &IID_IDXGIDevice, (void **)&dxgi_device);
-    ok(SUCCEEDED(hr), "Failed to get DXGI device, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     swapchain = create_swapchain(dxgi_device, window, windowed);
     IDXGIDevice_Release(dxgi_device);
     return swapchain;
@@ -935,9 +935,9 @@ static ID2D1RenderTarget *create_render_target_desc(IDXGISurface *surface,
     HRESULT hr;
 
     hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory);
-    ok(SUCCEEDED(hr), "Failed to create factory, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1Factory_CreateDxgiSurfaceRenderTarget(factory, surface, desc, &render_target);
-    ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1Factory_Release(factory);
 
     return render_target;
@@ -967,7 +967,7 @@ static void release_test_context_(unsigned int line, struct d2d1_test_context *c
     ID2D1RenderTarget_GetFactory(ctx->rt, &factory);
     ID2D1RenderTarget_Release(ctx->rt);
     ref = ID2D1Factory_Release(factory);
-    ok_(__FILE__, line)(!ref, "Factory has %u references left.\n", ref);
+    ok_(__FILE__, line)(!ref, "Factory has %lu references left.\n", ref);
 
     IDXGISurface_Release(ctx->surface);
     IDXGISwapChain_Release(ctx->swapchain);
@@ -994,7 +994,7 @@ static BOOL init_test_context_(unsigned int line, struct d2d1_test_context *ctx,
     ctx->swapchain = create_swapchain(ctx->device, ctx->window, TRUE);
     ok_(__FILE__, line)(!!ctx->swapchain, "Failed to create swapchain.\n");
     hr = IDXGISwapChain_GetBuffer(ctx->swapchain, 0, &IID_IDXGISurface, (void **)&ctx->surface);
-    ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
+    ok_(__FILE__, line)(hr == S_OK, "Failed to get buffer, hr %#lx.\n", hr);
 
     ctx->rt = create_render_target(ctx->surface, d3d11);
     if (!ctx->rt && d3d11)
@@ -1026,7 +1026,7 @@ static void check_bitmap_surface_(unsigned int line, ID2D1Bitmap *bitmap, BOOL h
         return;
 
     options = ID2D1Bitmap1_GetOptions(bitmap1);
-    ok_(__FILE__, line)(options == expected_options, "Unexpected bitmap options %#x, expected %#x.\n",
+    ok_(__FILE__, line)(options == expected_options, "Got unexpected bitmap options %#x, expected %#lx.\n",
             options, expected_options);
 
     surface = (void *)0xdeadbeef;
@@ -1038,12 +1038,12 @@ static void check_bitmap_surface_(unsigned int line, ID2D1Bitmap *bitmap, BOOL h
         D2D1_SIZE_U pixel_size;
         DWORD bind_flags = 0;
 
-        ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to get bitmap surface, hr %#x.\n", hr);
+        ok_(__FILE__, line)(hr == S_OK, "Failed to get bitmap surface, hr %#lx.\n", hr);
         ok_(__FILE__, line)(!!surface, "Expected surface instance.\n");
 
         /* Correlate with resource configuration. */
         hr = IDXGISurface_QueryInterface(surface, &IID_ID3D10Texture2D, (void **)&texture);
-        ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to get texture pointer, hr %#x.\n", hr);
+        ok_(__FILE__, line)(hr == S_OK, "Failed to get texture pointer, hr %#lx.\n", hr);
 
         ID3D10Texture2D_GetDesc(texture, &desc);
         ok_(__FILE__, line)(desc.Usage == 0, "Unexpected usage %#x.\n", desc.Usage);
@@ -1072,7 +1072,7 @@ static void check_bitmap_surface_(unsigned int line, ID2D1Bitmap *bitmap, BOOL h
     }
     else
     {
-        ok_(__FILE__, line)(hr == D2DERR_INVALID_CALL, "Unexpected hr %#x.\n", hr);
+        ok_(__FILE__, line)(hr == D2DERR_INVALID_CALL, "Got unexpected hr %#lx.\n", hr);
         ok_(__FILE__, line)(!surface, "Unexpected surface instance.\n");
     }
 
@@ -1289,7 +1289,7 @@ static void geometry_sink_check_(unsigned int line, const struct geometry_sink *
                     "Got unexpected figure %u, segment %u type %#x, expected %#x.\n",
                     i, j, segment->type, expected_segment->type);
             ok_(__FILE__, line)(segment->flags == expected_segment->flags,
-                    "Got unexpected figure %u, segment %u flags %#x, expected %#x.\n",
+                    "Got unexpected figure %u, segment %u flags %#lx, expected %#lx.\n",
                     i, j, segment->flags, expected_segment->flags);
             switch (segment->type)
             {
@@ -1480,7 +1480,7 @@ static void test_clip(BOOL d3d11)
     ID2D1RenderTarget_PopAxisAlignedClip(rt);
 
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_surface(&ctx, "035a44d4198d6e422e9de6185b5b2c2bac5e33c9");
     ok(match, "Surface does not match.\n");
 
@@ -1546,7 +1546,7 @@ static void test_clip(BOOL d3d11)
     ID2D1RenderTarget_PopAxisAlignedClip(rt);
 
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_surface(&ctx, "cb418ec4a7c8407b5e36db06fc6292a06bb8476c");
     ok(match, "Surface does not match.\n");
 
@@ -1590,9 +1590,9 @@ static void test_state_block(BOOL d3d11)
     rt = ctx.rt;
     ID2D1RenderTarget_GetFactory(rt, &factory);
     hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, &IID_IDWriteFactory, (IUnknown **)&dwrite_factory);
-    ok(SUCCEEDED(hr), "Failed to create dwrite factory, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = IDWriteFactory_CreateRenderingParams(dwrite_factory, &text_rendering_params1);
-    ok(SUCCEEDED(hr), "Failed to create dwrite rendering params, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     IDWriteFactory_Release(dwrite_factory);
 
     drawing_state.antialiasMode = ID2D1RenderTarget_GetAntialiasMode(rt);
@@ -1613,7 +1613,7 @@ static void test_state_block(BOOL d3d11)
     ok(!text_rendering_params2, "Got unexpected text rendering params %p.\n", text_rendering_params2);
 
     hr = ID2D1Factory_CreateDrawingStateBlock(factory, NULL, NULL, &state_block);
-    ok(SUCCEEDED(hr), "Failed to create drawing state block, hr %#x\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1DrawingStateBlock_GetDescription(state_block, &drawing_state);
     ok(drawing_state.antialiasMode == D2D1_ANTIALIAS_MODE_PER_PRIMITIVE,
             "Got unexpected antialias mode %#x.\n", drawing_state.antialiasMode);
@@ -1635,7 +1635,7 @@ static void test_state_block(BOOL d3d11)
     drawing_state.tag2 = 0xbeef;
     drawing_state.transform = transform1;
     hr = ID2D1Factory_CreateDrawingStateBlock(factory, &drawing_state, text_rendering_params1, &state_block);
-    ok(SUCCEEDED(hr), "Failed to create drawing state block, hr %#x\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1DrawingStateBlock_GetDescription(state_block, &drawing_state);
     ok(drawing_state.antialiasMode == D2D1_ANTIALIAS_MODE_ALIASED,
@@ -1743,7 +1743,7 @@ static void test_state_block(BOOL d3d11)
         ID2D1DrawingStateBlock1 *state_block1;
 
         hr = ID2D1DrawingStateBlock_QueryInterface(state_block, &IID_ID2D1DrawingStateBlock1, (void **)&state_block1);
-        ok(SUCCEEDED(hr), "Failed to get ID2D1DrawingStateBlock1 interface, hr %#x.\n", hr);
+        ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
         ID2D1DrawingStateBlock1_GetDescription(state_block1, &drawing_state1);
         ok(drawing_state1.antialiasMode == D2D1_ANTIALIAS_MODE_ALIASED,
@@ -1783,7 +1783,7 @@ static void test_state_block(BOOL d3d11)
         ID2D1DrawingStateBlock1_Release(state_block1);
 
         hr = ID2D1Factory1_CreateDrawingStateBlock(factory1, NULL, NULL, &state_block1);
-        ok(SUCCEEDED(hr), "Failed to create drawing state block, hr %#x\n", hr);
+        ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
         ID2D1DrawingStateBlock1_GetDescription(state_block1, &drawing_state1);
         ok(drawing_state1.antialiasMode == D2D1_ANTIALIAS_MODE_PER_PRIMITIVE,
                 "Got unexpected antialias mode %#x.\n", drawing_state1.antialiasMode);
@@ -1808,7 +1808,7 @@ static void test_state_block(BOOL d3d11)
     ID2D1DrawingStateBlock_Release(state_block);
 
     refcount = IDWriteRenderingParams_Release(text_rendering_params1);
-    ok(!refcount, "Rendering params %u references left.\n", refcount);
+    ok(!refcount, "Rendering params %lu references left.\n", refcount);
     ID2D1Factory_Release(factory);
     release_test_context(&ctx);
 }
@@ -1835,7 +1835,7 @@ static void test_color_brush(BOOL d3d11)
 
     set_color(&color, 0.0f, 0.0f, 0.0f, 0.0f);
     hr = ID2D1RenderTarget_CreateSolidColorBrush(rt, &color, NULL, &brush);
-    ok(SUCCEEDED(hr), "Failed to create brush, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     opacity = ID2D1SolidColorBrush_GetOpacity(brush);
     ok(opacity == 1.0f, "Got unexpected opacity %.8e.\n", opacity);
     set_matrix_identity(&matrix);
@@ -1856,7 +1856,7 @@ static void test_color_brush(BOOL d3d11)
     scale_matrix(&matrix, 2.0f, 2.0f);
     brush_desc.transform = matrix;
     hr = ID2D1RenderTarget_CreateSolidColorBrush(rt, &color, &brush_desc, &brush);
-    ok(SUCCEEDED(hr), "Failed to create brush, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     opacity = ID2D1SolidColorBrush_GetOpacity(brush);
     ok(opacity == 0.3f, "Got unexpected opacity %.8e.\n", opacity);
     ID2D1SolidColorBrush_GetTransform(brush, &tmp_matrix);
@@ -1890,7 +1890,7 @@ static void test_color_brush(BOOL d3d11)
     ID2D1RenderTarget_FillRectangle(rt, &rect, (ID2D1Brush *)brush);
 
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_surface(&ctx, "6d1218fca5e21fb7e287b3a439d60dbc251f5ceb");
     ok(match, "Surface does not match.\n");
 
@@ -1964,11 +1964,11 @@ static void test_bitmap_brush(BOOL d3d11)
     bitmap_desc.dpiX = 96.0f;
     bitmap_desc.dpiY = 96.0f;
     hr = ID2D1RenderTarget_CreateBitmap(rt, size, bitmap_data, 4 * sizeof(*bitmap_data), &bitmap_desc, &bitmap);
-    ok(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     image_size = ID2D1Bitmap_GetSize(bitmap);
 
     hr = ID2D1Bitmap_QueryInterface(bitmap, &IID_ID2D1Image, (void **)&image);
-    ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Vista */, "Failed to get ID2D1Image, hr %#x.\n", hr);
+    ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Vista */, "Got unexpected hr %#lx.\n", hr);
     if (hr == S_OK)
     {
         ID2D1DeviceContext *context;
@@ -1976,7 +1976,7 @@ static void test_bitmap_brush(BOOL d3d11)
         D2D1_RECT_F src_rect;
 
         hr = ID2D1RenderTarget_QueryInterface(rt, &IID_ID2D1DeviceContext, (void **)&context);
-        ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+        ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
         ID2D1RenderTarget_BeginDraw(rt);
         set_color(&color, 0.0f, 0.0f, 1.0f, 1.0f);
@@ -2029,7 +2029,7 @@ static void test_bitmap_brush(BOOL d3d11)
                 D2D1_COMPOSITE_MODE_SOURCE_OVER);
 
         hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-        ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+        ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
         match = compare_surface(&ctx, "95675fbc4a16404c9568d41b14e8f6be64240998");
         ok(match, "Surface does not match.\n");
 
@@ -2041,7 +2041,7 @@ static void test_bitmap_brush(BOOL d3d11)
                 D2D1_COMPOSITE_MODE_SOURCE_OVER);
 
         hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-        ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+        ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
         match = compare_surface(&ctx, "95675fbc4a16404c9568d41b14e8f6be64240998");
         ok(match, "Surface does not match.\n");
 
@@ -2053,7 +2053,7 @@ static void test_bitmap_brush(BOOL d3d11)
     /* Creating a brush with a NULL bitmap crashes on Vista, but works fine on
      * Windows 7+. */
     hr = ID2D1RenderTarget_CreateBitmapBrush(rt, bitmap, NULL, NULL, &brush);
-    ok(SUCCEEDED(hr), "Failed to create brush, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1BitmapBrush_GetBitmap(brush, &tmp_bitmap);
     ok(tmp_bitmap == bitmap, "Got unexpected bitmap %p, expected %p.\n", tmp_bitmap, bitmap);
     ID2D1Bitmap_Release(tmp_bitmap);
@@ -2075,7 +2075,7 @@ static void test_bitmap_brush(BOOL d3d11)
     ID2D1BitmapBrush_Release(brush);
 
     hr = ID2D1RenderTarget_CreateBitmapBrush(rt, bitmap, NULL, NULL, &brush);
-    ok(SUCCEEDED(hr), "Failed to create brush, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     set_matrix_identity(&matrix);
     translate_matrix(&matrix, 40.0f, 120.0f);
     scale_matrix(&matrix, 20.0f, 60.0f);
@@ -2130,7 +2130,7 @@ static void test_bitmap_brush(BOOL d3d11)
             D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, &src_rect);
 
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_surface(&ctx, "f5d039c280fa33ba05496c9883192a34108efbbe");
     ok(match, "Surface does not match.\n");
 
@@ -2148,7 +2148,7 @@ static void test_bitmap_brush(BOOL d3d11)
             D2D1_BITMAP_INTERPOLATION_MODE_LINEAR + 1, &src_rect);
 
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
     match = compare_surface(&ctx, "f5d039c280fa33ba05496c9883192a34108efbbe");
     ok(match, "Surface does not match.\n");
 
@@ -2160,7 +2160,7 @@ static void test_bitmap_brush(BOOL d3d11)
             D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, &src_rect);
 
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_surface(&ctx, "59043096393570ad800dbcbfdd644394b79493bd");
     ok(match, "Surface does not match.\n");
 
@@ -2189,7 +2189,7 @@ static void test_bitmap_brush(BOOL d3d11)
     }
 
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_surface(&ctx, "b4b775afecdae2d26642001f4faff73663bb8b31");
     ok(match, "Surface does not match.\n");
 
@@ -2197,7 +2197,7 @@ static void test_bitmap_brush(BOOL d3d11)
     bitmap_desc.dpiX = 96.0f / 20.0f;
     bitmap_desc.dpiY = 96.0f / 60.0f;
     hr = ID2D1RenderTarget_CreateBitmap(rt, size, bitmap_data, 4 * sizeof(*bitmap_data), &bitmap_desc, &bitmap);
-    ok(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1BitmapBrush_SetBitmap(brush, bitmap);
 
     ID2D1RenderTarget_BeginDraw(rt);
@@ -2217,14 +2217,14 @@ static void test_bitmap_brush(BOOL d3d11)
 
     set_rect(&dst_rect, -1.0f, -1.0f, 1.0f, 1.0f);
     hr = ID2D1Factory_CreateRectangleGeometry(factory, &dst_rect, &rectangle_geometry);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_matrix_identity(&matrix);
     translate_matrix(&matrix, 240.0f, 720.0f);
     scale_matrix(&matrix, 40.0f, 120.0f);
     hr = ID2D1Factory_CreateTransformedGeometry(factory, (ID2D1Geometry *)rectangle_geometry,
             &matrix, &transformed_geometry);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1RectangleGeometry_Release(rectangle_geometry);
 
     set_matrix_identity(&matrix);
@@ -2238,7 +2238,7 @@ static void test_bitmap_brush(BOOL d3d11)
     ID2D1Factory_Release(factory);
 
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_surface(&ctx, "cf7b90ba7b139fdfbe9347e1907d635cfb4ed197");
     ok(match, "Surface does not match.\n");
 
@@ -2287,7 +2287,7 @@ static void test_bitmap_brush(BOOL d3d11)
 
     ID2D1BitmapBrush_Release(brush);
     refcount = ID2D1Bitmap_Release(bitmap);
-    ok(!refcount, "Bitmap has %u references left.\n", refcount);
+    ok(!refcount, "Bitmap has %lu references left.\n", refcount);
     release_test_context(&ctx);
 }
 
@@ -2357,12 +2357,12 @@ static void test_linear_brush(BOOL d3d11)
 
     hr = ID2D1RenderTarget_CreateGradientStopCollection(rt, stops, ARRAY_SIZE(stops),
             D2D1_GAMMA_2_2, D2D1_EXTEND_MODE_CLAMP, &gradient);
-    ok(SUCCEEDED(hr), "Failed to create stop collection, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_point(&gradient_properties.startPoint, 320.0f, 0.0f);
     set_point(&gradient_properties.endPoint, 0.0f, 960.0f);
     hr = ID2D1RenderTarget_CreateLinearGradientBrush(rt, &gradient_properties, NULL, gradient, &brush);
-    ok(SUCCEEDED(hr), "Failed to create brush, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     opacity = ID2D1LinearGradientBrush_GetOpacity(brush);
     ok(opacity == 1.0f, "Got unexpected opacity %.8e.\n", opacity);
@@ -2389,7 +2389,7 @@ static void test_linear_brush(BOOL d3d11)
     ID2D1RenderTarget_FillRectangle(rt, &r, (ID2D1Brush *)brush);
 
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     get_surface_readback(&ctx, &rb);
     for (i = 0; i < ARRAY_SIZE(test1); ++i)
@@ -2398,7 +2398,7 @@ static void test_linear_brush(BOOL d3d11)
 
         colour = get_readback_colour(&rb, test1[i].x, test1[i].y);
         ok(compare_colour(colour, test1[i].colour, 1),
-                "Got unexpected colour 0x%08x at position {%u, %u}.\n",
+                "Got unexpected colour 0x%08lx at position {%u, %u}.\n",
                 colour, test1[i].x, test1[i].y);
     }
     release_resource_readback(&rb);
@@ -2439,14 +2439,14 @@ static void test_linear_brush(BOOL d3d11)
 
     set_rect(&r, -1.0f, -1.0f, 1.0f, 1.0f);
     hr = ID2D1Factory_CreateRectangleGeometry(factory, &r, &rectangle_geometry);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_matrix_identity(&matrix);
     translate_matrix(&matrix, 228.5f, 714.0f);
     scale_matrix(&matrix, 40.0f, 120.0f);
     hr = ID2D1Factory_CreateTransformedGeometry(factory, (ID2D1Geometry *)rectangle_geometry,
             &matrix, &transformed_geometry);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1RectangleGeometry_Release(rectangle_geometry);
 
     set_matrix_identity(&matrix);
@@ -2462,7 +2462,7 @@ static void test_linear_brush(BOOL d3d11)
     ID2D1Factory_Release(factory);
 
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     get_surface_readback(&ctx, &rb);
     for (i = 0; i < ARRAY_SIZE(test2); ++i)
@@ -2471,14 +2471,14 @@ static void test_linear_brush(BOOL d3d11)
 
         colour = get_readback_colour(&rb, test2[i].x, test2[i].y);
         ok(compare_colour(colour, test2[i].colour, 1),
-                "Got unexpected colour 0x%08x at position {%u, %u}.\n",
+                "Got unexpected colour 0x%08lx at position {%u, %u}.\n",
                 colour, test2[i].x, test2[i].y);
     }
     release_resource_readback(&rb);
 
     ID2D1LinearGradientBrush_Release(brush);
     refcount = ID2D1GradientStopCollection_Release(gradient);
-    ok(!refcount, "Gradient has %u references left.\n", refcount);
+    ok(!refcount, "Gradient has %lu references left.\n", refcount);
     release_test_context(&ctx);
 }
 
@@ -2548,14 +2548,14 @@ static void test_radial_brush(BOOL d3d11)
 
     hr = ID2D1RenderTarget_CreateGradientStopCollection(rt, stops, ARRAY_SIZE(stops),
             D2D1_GAMMA_2_2, D2D1_EXTEND_MODE_CLAMP, &gradient);
-    ok(SUCCEEDED(hr), "Failed to create stop collection, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_point(&gradient_properties.center, 160.0f, 480.0f);
     set_point(&gradient_properties.gradientOriginOffset, 40.0f, -120.0f);
     gradient_properties.radiusX = 160.0f;
     gradient_properties.radiusY = 480.0f;
     hr = ID2D1RenderTarget_CreateRadialGradientBrush(rt, &gradient_properties, NULL, gradient, &brush);
-    ok(SUCCEEDED(hr), "Failed to create brush, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     f = ID2D1RadialGradientBrush_GetOpacity(brush);
     ok(f == 1.0f, "Got unexpected opacity %.8e.\n", f);
@@ -2586,7 +2586,7 @@ static void test_radial_brush(BOOL d3d11)
     ID2D1RenderTarget_FillRectangle(rt, &r, (ID2D1Brush *)brush);
 
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     get_surface_readback(&ctx, &rb);
     for (i = 0; i < ARRAY_SIZE(test1); ++i)
@@ -2595,7 +2595,7 @@ static void test_radial_brush(BOOL d3d11)
 
         colour = get_readback_colour(&rb, test1[i].x, test1[i].y);
         ok(compare_colour(colour, test1[i].colour, 1),
-                "Got unexpected colour 0x%08x at position {%u, %u}.\n",
+                "Got unexpected colour 0x%08lx at position {%u, %u}.\n",
                 colour, test1[i].x, test1[i].y);
     }
     release_resource_readback(&rb);
@@ -2636,14 +2636,14 @@ static void test_radial_brush(BOOL d3d11)
 
     set_rect(&r, -1.0f, -1.0f, 1.0f, 1.0f);
     hr = ID2D1Factory_CreateRectangleGeometry(factory, &r, &rectangle_geometry);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_matrix_identity(&matrix);
     translate_matrix(&matrix, 228.5f, 714.0f);
     scale_matrix(&matrix, 40.0f, 120.0f);
     hr = ID2D1Factory_CreateTransformedGeometry(factory, (ID2D1Geometry *)rectangle_geometry,
             &matrix, &transformed_geometry);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1RectangleGeometry_Release(rectangle_geometry);
 
     set_matrix_identity(&matrix);
@@ -2661,7 +2661,7 @@ static void test_radial_brush(BOOL d3d11)
     ID2D1Factory_Release(factory);
 
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     get_surface_readback(&ctx, &rb);
     for (i = 0; i < ARRAY_SIZE(test2); ++i)
@@ -2670,14 +2670,14 @@ static void test_radial_brush(BOOL d3d11)
 
         colour = get_readback_colour(&rb, test2[i].x, test2[i].y);
         ok(compare_colour(colour, test2[i].colour, 1),
-                "Got unexpected colour 0x%08x at position {%u, %u}.\n",
+                "Got unexpected colour 0x%08lx at position {%u, %u}.\n",
                 colour, test2[i].x, test2[i].y);
     }
     release_resource_readback(&rb);
 
     ID2D1RadialGradientBrush_Release(brush);
     refcount = ID2D1GradientStopCollection_Release(gradient);
-    ok(!refcount, "Gradient has %u references left.\n", refcount);
+    ok(!refcount, "Gradient has %lu references left.\n", refcount);
     release_test_context(&ctx);
 }
 
@@ -3161,163 +3161,163 @@ static void test_path_geometry(BOOL d3d11)
     ID2D1RenderTarget_SetAntialiasMode(rt, D2D1_ANTIALIAS_MODE_ALIASED);
     set_color(&color, 0.890f, 0.851f, 0.600f, 1.0f);
     hr = ID2D1RenderTarget_CreateSolidColorBrush(rt, &color, NULL, &brush);
-    ok(SUCCEEDED(hr), "Failed to create brush, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     /* Close() when closed. */
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_GetFigureCount(geometry, &count);
-    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_GetSegmentCount(geometry, &count);
-    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_GetFigureCount(geometry, &count);
-    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_GetSegmentCount(geometry, &count);
-    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1GeometrySink_Close(sink);
-    ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_GetFigureCount(geometry, &count);
-    ok(SUCCEEDED(hr), "Failed to get figure count, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(!count, "Got unexpected figure count %u.\n", count);
     hr = ID2D1PathGeometry_GetSegmentCount(geometry, &count);
-    ok(SUCCEEDED(hr), "Failed to get segment count, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(!count, "Got unexpected segment count %u.\n", count);
     hr = ID2D1GeometrySink_Close(sink);
-    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_Release(sink);
     hr = ID2D1PathGeometry_GetFigureCount(geometry, &count);
-    ok(SUCCEEDED(hr), "Failed to get figure count, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(!count, "Got unexpected figure count %u.\n", count);
     hr = ID2D1PathGeometry_GetSegmentCount(geometry, &count);
-    ok(SUCCEEDED(hr), "Failed to get segment count, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(!count, "Got unexpected segment count %u.\n", count);
     ID2D1PathGeometry_Release(geometry);
 
     /* Open() when closed. */
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1GeometrySink_Close(sink);
-    ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_Release(sink);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_GetFigureCount(geometry, &count);
-    ok(SUCCEEDED(hr), "Failed to get figure count, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(!count, "Got unexpected figure count %u.\n", count);
     hr = ID2D1PathGeometry_GetSegmentCount(geometry, &count);
-    ok(SUCCEEDED(hr), "Failed to get segment count, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(!count, "Got unexpected segment count %u.\n", count);
     ID2D1PathGeometry_Release(geometry);
 
     /* Open() when open. */
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &tmp_sink);
-    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1GeometrySink_Close(sink);
-    ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_Release(sink);
     hr = ID2D1PathGeometry_GetFigureCount(geometry, &count);
-    ok(SUCCEEDED(hr), "Failed to get figure count, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(!count, "Got unexpected figure count %u.\n", count);
     hr = ID2D1PathGeometry_GetSegmentCount(geometry, &count);
-    ok(SUCCEEDED(hr), "Failed to get segment count, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(!count, "Got unexpected segment count %u.\n", count);
     ID2D1PathGeometry_Release(geometry);
 
     /* BeginFigure() without EndFigure(). */
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_FILLED);
     hr = ID2D1GeometrySink_Close(sink);
-    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED);
     hr = ID2D1GeometrySink_Close(sink);
-    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_Release(sink);
     hr = ID2D1PathGeometry_GetFigureCount(geometry, &count);
-    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_GetSegmentCount(geometry, &count);
-    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#lx.\n", hr);
     ID2D1PathGeometry_Release(geometry);
 
     /* EndFigure() without BeginFigure(). */
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED);
     hr = ID2D1GeometrySink_Close(sink);
-    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_Release(sink);
     hr = ID2D1PathGeometry_GetFigureCount(geometry, &count);
-    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_GetSegmentCount(geometry, &count);
-    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#lx.\n", hr);
     ID2D1PathGeometry_Release(geometry);
 
     /* BeginFigure()/EndFigure() mismatch. */
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_FILLED);
     ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_FILLED);
     ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED);
     ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED);
     hr = ID2D1GeometrySink_Close(sink);
-    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED);
     hr = ID2D1GeometrySink_Close(sink);
-    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_Release(sink);
     ID2D1PathGeometry_Release(geometry);
 
     /* AddLine() outside BeginFigure()/EndFigure(). */
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_AddLine(sink, point);
     hr = ID2D1GeometrySink_Close(sink);
-    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_AddLine(sink, point);
     ID2D1GeometrySink_Release(sink);
     hr = ID2D1PathGeometry_GetFigureCount(geometry, &count);
-    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_GetSegmentCount(geometry, &count);
-    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#lx.\n", hr);
     ID2D1PathGeometry_Release(geometry);
 
     /* Empty figure. */
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     set_point(&point, 123.0f, 456.0f);
     ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_FILLED);
     ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED);
     hr = ID2D1GeometrySink_Close(sink);
-    ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_Release(sink);
     hr = ID2D1PathGeometry_GetFigureCount(geometry, &count);
-    ok(SUCCEEDED(hr), "Failed to get figure count, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(count == 1, "Got unexpected figure count %u.\n", count);
     hr = ID2D1PathGeometry_GetSegmentCount(geometry, &count);
-    ok(SUCCEEDED(hr), "Failed to get segment count, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(count == 1, "Got unexpected segment count %u.\n", count);
 
     set_rect(&rect, 0.0f, 0.0f, 0.0f, 0.0f);
     hr = ID2D1PathGeometry_GetBounds(geometry, NULL, &rect);
-    ok(SUCCEEDED(hr), "Failed to get geometry bounds, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_rect(&rect, 123.0f, 456.0f, 123.0f, 456.0f, 0);
     ok(match, "Got unexpected rectangle {%.8e, %.8e, %.8e, %.8e}.\n",
             rect.left, rect.top, rect.right, rect.bottom);
@@ -3326,7 +3326,7 @@ static void test_path_geometry(BOOL d3d11)
     translate_matrix(&matrix, 80.0f, 640.0f);
     scale_matrix(&matrix, 2.0f, 0.5f);
     hr = ID2D1PathGeometry_GetBounds(geometry, &matrix, &rect);
-    ok(SUCCEEDED(hr), "Failed to get geometry bounds, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_rect(&rect, 326.0f, 868.0f, 326.0f, 868.0f, 0);
     ok(match, "Got unexpected rectangle {%.8e, %.8e, %.8e, %.8e}.\n",
             rect.left, rect.top, rect.right, rect.bottom);
@@ -3335,9 +3335,9 @@ static void test_path_geometry(BOOL d3d11)
 
     /* Degenerate figure. */
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     set_point(&point, 123.0f, 456.0f);
     ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_FILLED);
     quadratic_to(sink, 123.0f, 456.0f, 123.0f, 456.0f);
@@ -3345,52 +3345,52 @@ static void test_path_geometry(BOOL d3d11)
     quadratic_to(sink, 123.0f, 456.0f, 123.0f, 456.0f);
     ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED);
     hr = ID2D1GeometrySink_Close(sink);
-    ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_Release(sink);
     hr = ID2D1PathGeometry_GetFigureCount(geometry, &count);
-    ok(SUCCEEDED(hr), "Failed to get figure count, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(count == 1, "Got unexpected figure count %u.\n", count);
     hr = ID2D1PathGeometry_GetSegmentCount(geometry, &count);
-    ok(SUCCEEDED(hr), "Failed to get segment count, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(count == 4, "Got unexpected segment count %u.\n", count);
     ID2D1PathGeometry_Release(geometry);
 
     /* Close right after Open(). */
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     /* Not open yet. */
     set_rect(&rect, 1.0f, 2.0f, 3.0f, 4.0f);
     hr = ID2D1PathGeometry_GetBounds(geometry, NULL, &rect);
-    ok(hr == D2DERR_WRONG_STATE, "Unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#lx.\n", hr);
     match = compare_rect(&rect, 1.0f, 2.0f, 3.0f, 4.0f, 0);
     ok(match, "Got unexpected rectangle {%.8e, %.8e, %.8e, %.8e}.\n",
             rect.left, rect.top, rect.right, rect.bottom);
 
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     /* Open, not closed. */
     set_rect(&rect, 1.0f, 2.0f, 3.0f, 4.0f);
     hr = ID2D1PathGeometry_GetBounds(geometry, NULL, &rect);
-    ok(hr == D2DERR_WRONG_STATE, "Unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#lx.\n", hr);
     match = compare_rect(&rect, 1.0f, 2.0f, 3.0f, 4.0f, 0);
     ok(match, "Got unexpected rectangle {%.8e, %.8e, %.8e, %.8e}.\n",
             rect.left, rect.top, rect.right, rect.bottom);
 
     hr = ID2D1GeometrySink_Close(sink);
-    ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_Release(sink);
     hr = ID2D1PathGeometry_GetFigureCount(geometry, &count);
-    ok(SUCCEEDED(hr), "Failed to get figure count, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(count == 0, "Got unexpected figure count %u.\n", count);
     hr = ID2D1PathGeometry_GetSegmentCount(geometry, &count);
-    ok(SUCCEEDED(hr), "Failed to get segment count, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(count == 0, "Got unexpected segment count %u.\n", count);
 
     set_rect(&rect, 0.0f, 0.0f, 0.0f, 0.0f);
     hr = ID2D1PathGeometry_GetBounds(geometry, NULL, &rect);
-    ok(SUCCEEDED(hr), "Failed to get geometry bounds, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(rect.left > rect.right && rect.top > rect.bottom,
             "Got unexpected rectangle {%.8e, %.8e, %.8e, %.8e}.\n", rect.left, rect.top, rect.right, rect.bottom);
 
@@ -3399,7 +3399,7 @@ static void test_path_geometry(BOOL d3d11)
     scale_matrix(&matrix, 10.0f, 20.0f);
     set_rect(&rect, 0.0f, 0.0f, 0.0f, 0.0f);
     hr = ID2D1PathGeometry_GetBounds(geometry, &matrix, &rect);
-    ok(SUCCEEDED(hr), "Failed to get geometry bounds, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(rect.left > rect.right && rect.top > rect.bottom,
             "Got unexpected rectangle {%.8e, %.8e, %.8e, %.8e}.\n", rect.left, rect.top, rect.right, rect.bottom);
 
@@ -3407,17 +3407,17 @@ static void test_path_geometry(BOOL d3d11)
 
     /* GetBounds() with bezier segments. */
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     fill_geometry_sink_bezier(sink, 0);
     hr = ID2D1GeometrySink_Close(sink);
-    ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_Release(sink);
 
     set_rect(&rect, 0.0f, 0.0f, 0.0f, 0.0f);
     hr = ID2D1PathGeometry_GetBounds(geometry, NULL, &rect);
-    ok(SUCCEEDED(hr), "Failed to get geometry bounds, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_rect(&rect, 5.0f, 20.0f, 75.0f, 752.0f, 0);
     ok(match, "Got unexpected rectangle {%.8e, %.8e, %.8e, %.8e}.\n",
             rect.left, rect.top, rect.right, rect.bottom);
@@ -3427,7 +3427,7 @@ static void test_path_geometry(BOOL d3d11)
     scale_matrix(&matrix, 2.0f, 0.5f);
     set_rect(&rect, 0.0f, 0.0f, 0.0f, 0.0f);
     hr = ID2D1PathGeometry_GetBounds(geometry, &matrix, &rect);
-    ok(SUCCEEDED(hr), "Failed to get geometry bounds, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_rect(&rect, 90.0f, 650.0f, 230.0f, 1016.0f, 0);
     ok(match, "Got unexpected rectangle {%.8e, %.8e, %.8e, %.8e}.\n",
             rect.left, rect.top, rect.right, rect.bottom);
@@ -3436,17 +3436,17 @@ static void test_path_geometry(BOOL d3d11)
 
     /* GetBounds() with bezier segments and some hollow components. */
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     fill_geometry_sink_bezier(sink, 2);
     hr = ID2D1GeometrySink_Close(sink);
-    ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_Release(sink);
 
     set_rect(&rect, 0.0f, 0.0f, 0.0f, 0.0f);
     hr = ID2D1PathGeometry_GetBounds(geometry, NULL, &rect);
-    ok(SUCCEEDED(hr), "Failed to get geometry bounds, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_rect(&rect, 5.0f, 472.0f, 75.0f, 752.0f, 0);
     ok(match, "Got unexpected rectangle {%.8e, %.8e, %.8e, %.8e}.\n",
             rect.left, rect.top, rect.right, rect.bottom);
@@ -3456,7 +3456,7 @@ static void test_path_geometry(BOOL d3d11)
     scale_matrix(&matrix, 2.0f, 0.5f);
     set_rect(&rect, 0.0f, 0.0f, 0.0f, 0.0f);
     hr = ID2D1PathGeometry_GetBounds(geometry, &matrix, &rect);
-    ok(SUCCEEDED(hr), "Failed to get geometry bounds, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_rect(&rect, 90.0f, 876.0f, 230.0f, 1016.0f, 0);
     ok(match, "Got unexpected rectangle {%.8e, %.8e, %.8e, %.8e}.\n",
             rect.left, rect.top, rect.right, rect.bottom);
@@ -3465,17 +3465,17 @@ static void test_path_geometry(BOOL d3d11)
 
     /* GetBounds() with bezier segments and all hollow components. */
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     fill_geometry_sink_bezier(sink, 4);
     hr = ID2D1GeometrySink_Close(sink);
-    ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_Release(sink);
 
     set_rect(&rect, 0.0f, 0.0f, 0.0f, 0.0f);
     hr = ID2D1PathGeometry_GetBounds(geometry, NULL, &rect);
-    ok(SUCCEEDED(hr), "Failed to get geometry bounds, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_rect(&rect, INFINITY, INFINITY, FLT_MAX, FLT_MAX, 0);
     ok(match, "Got unexpected rectangle {%.8e, %.8e, %.8e, %.8e}.\n",
             rect.left, rect.top, rect.right, rect.bottom);
@@ -3485,7 +3485,7 @@ static void test_path_geometry(BOOL d3d11)
     scale_matrix(&matrix, 2.0f, 0.5f);
     set_rect(&rect, 0.0f, 0.0f, 0.0f, 0.0f);
     hr = ID2D1PathGeometry_GetBounds(geometry, &matrix, &rect);
-    ok(SUCCEEDED(hr), "Failed to get geometry bounds, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_rect(&rect, INFINITY, INFINITY, FLT_MAX, FLT_MAX, 0);
     ok(match, "Got unexpected rectangle {%.8e, %.8e, %.8e, %.8e}.\n",
             rect.left, rect.top, rect.right, rect.bottom);
@@ -3493,20 +3493,20 @@ static void test_path_geometry(BOOL d3d11)
     ID2D1PathGeometry_Release(geometry);
 
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     /* The fillmode that's used is the last one set before the sink is closed. */
     ID2D1GeometrySink_SetFillMode(sink, D2D1_FILL_MODE_WINDING);
     fill_geometry_sink(sink, 0);
     ID2D1GeometrySink_SetFillMode(sink, D2D1_FILL_MODE_ALTERNATE);
     hr = ID2D1GeometrySink_Close(sink);
-    ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_GetFigureCount(geometry, &count);
-    ok(SUCCEEDED(hr), "Failed to get figure count, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(count == 6, "Got unexpected figure count %u.\n", count);
     hr = ID2D1PathGeometry_GetSegmentCount(geometry, &count);
-    ok(SUCCEEDED(hr), "Failed to get segment count, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     /* Intersections don't create extra segments. */
     ok(count == 44, "Got unexpected segment count %u.\n", count);
     ID2D1GeometrySink_SetFillMode(sink, D2D1_FILL_MODE_WINDING);
@@ -3515,13 +3515,13 @@ static void test_path_geometry(BOOL d3d11)
     geometry_sink_init(&simplify_sink);
     hr = ID2D1PathGeometry_Simplify(geometry, D2D1_GEOMETRY_SIMPLIFICATION_OPTION_LINES,
             NULL, 0.0f, &simplify_sink.ID2D1SimplifiedGeometrySink_iface);
-    ok(SUCCEEDED(hr), "Failed to simplify geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     geometry_sink_check(&simplify_sink, D2D1_FILL_MODE_ALTERNATE, 6, &expected_figures[0], 0);
     geometry_sink_cleanup(&simplify_sink);
     geometry_sink_init(&simplify_sink);
     hr = ID2D1PathGeometry_Simplify(geometry, D2D1_GEOMETRY_SIMPLIFICATION_OPTION_CUBICS_AND_LINES,
             NULL, 0.0f, &simplify_sink.ID2D1SimplifiedGeometrySink_iface);
-    ok(SUCCEEDED(hr), "Failed to simplify geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     geometry_sink_check(&simplify_sink, D2D1_FILL_MODE_ALTERNATE, 6, &expected_figures[0], 0);
     geometry_sink_cleanup(&simplify_sink);
 
@@ -3529,12 +3529,12 @@ static void test_path_geometry(BOOL d3d11)
     translate_matrix(&matrix, 80.0f, 640.0f);
     scale_matrix(&matrix, 1.0f, -1.0f);
     hr = ID2D1Factory_CreateTransformedGeometry(factory, (ID2D1Geometry *)geometry, &matrix, &transformed_geometry);
-    ok(SUCCEEDED(hr), "Failed to create transformed geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     geometry_sink_init(&simplify_sink);
     hr = ID2D1TransformedGeometry_Simplify(transformed_geometry, D2D1_GEOMETRY_SIMPLIFICATION_OPTION_LINES,
             NULL, 0.0f, &simplify_sink.ID2D1SimplifiedGeometrySink_iface);
-    ok(SUCCEEDED(hr), "Failed to simplify geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     geometry_sink_check(&simplify_sink, D2D1_FILL_MODE_ALTERNATE, 6, &expected_figures[6], 0);
     geometry_sink_cleanup(&simplify_sink);
 
@@ -3549,7 +3549,7 @@ static void test_path_geometry(BOOL d3d11)
     geometry_sink_init(&simplify_sink);
     hr = ID2D1Geometry_Simplify(tmp_geometry, D2D1_GEOMETRY_SIMPLIFICATION_OPTION_LINES,
             &tmp_matrix, 0.0f, &simplify_sink.ID2D1SimplifiedGeometrySink_iface);
-    ok(SUCCEEDED(hr), "Failed to simplify geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     geometry_sink_check(&simplify_sink, D2D1_FILL_MODE_ALTERNATE, 6, &expected_figures[6], 0);
     geometry_sink_cleanup(&simplify_sink);
     ID2D1Geometry_Release(tmp_geometry);
@@ -3560,7 +3560,7 @@ static void test_path_geometry(BOOL d3d11)
     ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)geometry, (ID2D1Brush *)brush, NULL);
     ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)transformed_geometry, (ID2D1Brush *)brush, NULL);
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_surface(&ctx, "3aace1b22aae111cb577614fed16e4eb1650dba5");
     ok(match, "Surface does not match.\n");
 
@@ -3568,13 +3568,13 @@ static void test_path_geometry(BOOL d3d11)
     set_point(&point, 94.0f, 620.0f);
     contains = TRUE;
     hr = ID2D1TransformedGeometry_FillContainsPoint(transformed_geometry, point, NULL, 0.0f, &contains);
-    ok(hr == S_OK, "FillContainsPoint failed, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(!contains, "Got unexpected contains %#x.\n", contains);
 
     set_point(&point, 95.0f, 620.0f);
     contains = FALSE;
     hr = ID2D1TransformedGeometry_FillContainsPoint(transformed_geometry, point, NULL, 0.0f, &contains);
-    ok(hr == S_OK, "FillContainsPoint failed, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(contains == TRUE, "Got unexpected contains %#x.\n", contains);
 
     /* With transformation matrix. */
@@ -3583,31 +3583,31 @@ static void test_path_geometry(BOOL d3d11)
     set_point(&point, 85.0f, 620.0f);
     contains = FALSE;
     hr = ID2D1TransformedGeometry_FillContainsPoint(transformed_geometry, point, &matrix, 0.0f, &contains);
-    ok(hr == S_OK, "FillContainsPoint failed, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(contains == TRUE, "Got unexpected contains %#x.\n", contains);
 
     ID2D1TransformedGeometry_Release(transformed_geometry);
     ID2D1PathGeometry_Release(geometry);
 
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     fill_geometry_sink(sink, 0);
     ID2D1GeometrySink_SetFillMode(sink, D2D1_FILL_MODE_WINDING);
     hr = ID2D1GeometrySink_Close(sink);
-    ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_GetFigureCount(geometry, &count);
-    ok(SUCCEEDED(hr), "Failed to get figure count, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(count == 6, "Got unexpected figure count %u.\n", count);
     hr = ID2D1PathGeometry_GetSegmentCount(geometry, &count);
-    ok(SUCCEEDED(hr), "Failed to get segment count, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(count == 44, "Got unexpected segment count %u.\n", count);
     ID2D1GeometrySink_Release(sink);
 
     set_rect(&rect, 0.0f, 0.0f, 0.0f, 0.0f);
     hr = ID2D1PathGeometry_GetBounds(geometry, NULL, &rect);
-    ok(SUCCEEDED(hr), "Failed to get geometry bounds, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_rect(&rect, 5.0f, 20.0f, 235.0f, 300.0f, 0);
     ok(match, "Got unexpected rectangle {%.8e, %.8e, %.8e, %.8e}.\n",
             rect.left, rect.top, rect.right, rect.bottom);
@@ -3618,7 +3618,7 @@ static void test_path_geometry(BOOL d3d11)
     rotate_matrix(&matrix, M_PI / 4.0f);
     set_rect(&rect, 0.0f, 0.0f, 0.0f, 0.0f);
     hr = ID2D1PathGeometry_GetBounds(geometry, &matrix, &rect);
-    ok(SUCCEEDED(hr), "Failed to get geometry bounds, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_rect(&rect, -3.17192993e+02f, 8.71231079e+01f, 4.04055908e+02f, 6.17453125e+02f, 1);
     ok(match, "Got unexpected rectangle {%.8e, %.8e, %.8e, %.8e}.\n",
             rect.left, rect.top, rect.right, rect.bottom);
@@ -3626,7 +3626,7 @@ static void test_path_geometry(BOOL d3d11)
     geometry_sink_init(&simplify_sink);
     hr = ID2D1PathGeometry_Simplify(geometry, D2D1_GEOMETRY_SIMPLIFICATION_OPTION_LINES,
             NULL, 0.0f, &simplify_sink.ID2D1SimplifiedGeometrySink_iface);
-    ok(SUCCEEDED(hr), "Failed to simplify geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     geometry_sink_check(&simplify_sink, D2D1_FILL_MODE_WINDING, 6, &expected_figures[0], 0);
     geometry_sink_cleanup(&simplify_sink);
 
@@ -3634,50 +3634,50 @@ static void test_path_geometry(BOOL d3d11)
     translate_matrix(&matrix, 320.0f, 320.0f);
     scale_matrix(&matrix, -1.0f, 1.0f);
     hr = ID2D1Factory_CreateTransformedGeometry(factory, (ID2D1Geometry *)geometry, &matrix, &transformed_geometry);
-    ok(SUCCEEDED(hr), "Failed to create transformed geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1RenderTarget_BeginDraw(rt);
     ID2D1RenderTarget_Clear(rt, &color);
     ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)geometry, (ID2D1Brush *)brush, NULL);
     ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)transformed_geometry, (ID2D1Brush *)brush, NULL);
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_surface(&ctx, "bfb40a1f007694fa07dbd3b854f3f5d9c3e1d76b");
     ok(match, "Surface does not match.\n");
     ID2D1TransformedGeometry_Release(transformed_geometry);
     ID2D1PathGeometry_Release(geometry);
 
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     fill_geometry_sink_bezier(sink, 0);
     hr = ID2D1GeometrySink_Close(sink);
-    ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_GetFigureCount(geometry, &count);
-    ok(SUCCEEDED(hr), "Failed to get figure count, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(count == 4, "Got unexpected figure count %u.\n", count);
     hr = ID2D1PathGeometry_GetSegmentCount(geometry, &count);
-    ok(SUCCEEDED(hr), "Failed to get segment count, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(count == 20, "Got unexpected segment count %u.\n", count);
     ID2D1GeometrySink_Release(sink);
 
     geometry_sink_init(&simplify_sink);
     hr = ID2D1PathGeometry_Simplify(geometry, D2D1_GEOMETRY_SIMPLIFICATION_OPTION_CUBICS_AND_LINES,
             NULL, 0.0f, &simplify_sink.ID2D1SimplifiedGeometrySink_iface);
-    ok(SUCCEEDED(hr), "Failed to simplify geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     geometry_sink_check(&simplify_sink, D2D1_FILL_MODE_ALTERNATE, 4, &expected_figures[12], 1);
     geometry_sink_cleanup(&simplify_sink);
     geometry_sink_init(&simplify_sink);
     hr = ID2D1PathGeometry_Simplify(geometry, D2D1_GEOMETRY_SIMPLIFICATION_OPTION_LINES,
             NULL, 100.0f, &simplify_sink.ID2D1SimplifiedGeometrySink_iface);
-    ok(SUCCEEDED(hr), "Failed to simplify geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     geometry_sink_check(&simplify_sink, D2D1_FILL_MODE_ALTERNATE, 4, &expected_figures[20], 1);
     geometry_sink_cleanup(&simplify_sink);
     geometry_sink_init(&simplify_sink);
     hr = ID2D1PathGeometry_Simplify(geometry, D2D1_GEOMETRY_SIMPLIFICATION_OPTION_LINES,
             NULL, 10.0f, &simplify_sink.ID2D1SimplifiedGeometrySink_iface);
-    ok(SUCCEEDED(hr), "Failed to simplify geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     geometry_sink_check(&simplify_sink, D2D1_FILL_MODE_ALTERNATE, 4, &expected_figures[24], 1);
     geometry_sink_cleanup(&simplify_sink);
 
@@ -3687,12 +3687,12 @@ static void test_path_geometry(BOOL d3d11)
     rotate_matrix(&matrix, M_PI / 4.0f);
     scale_matrix(&matrix, 2.0f, 0.5f);
     hr = ID2D1Factory_CreateTransformedGeometry(factory, (ID2D1Geometry *)geometry, &matrix, &transformed_geometry);
-    ok(SUCCEEDED(hr), "Failed to create transformed geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     geometry_sink_init(&simplify_sink);
     hr = ID2D1TransformedGeometry_Simplify(transformed_geometry, D2D1_GEOMETRY_SIMPLIFICATION_OPTION_CUBICS_AND_LINES,
             NULL, 0.0f, &simplify_sink.ID2D1SimplifiedGeometrySink_iface);
-    ok(SUCCEEDED(hr), "Failed to simplify geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     geometry_sink_check(&simplify_sink, D2D1_FILL_MODE_ALTERNATE, 4, &expected_figures[16], 4);
     geometry_sink_cleanup(&simplify_sink);
 
@@ -3701,7 +3701,7 @@ static void test_path_geometry(BOOL d3d11)
     ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)geometry, (ID2D1Brush *)brush, NULL);
     ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)transformed_geometry, (ID2D1Brush *)brush, NULL);
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_figure(&ctx, 0, 0, 160, 160, 0xff652e89, 64,
             "7xoCngECngECngECngECngECngECngECnQEEnAEEnAEEnAEEnAEEmwEGmgEGmgEGmgEGmQEImAEI"
             "lAEECASLAQgKCIEBDQoMew8KD3YQDBByEgwSbhMOEmwUDhRpFBAUZxUQFWUVEhVjFhIWYRYUFl8X"
@@ -3750,37 +3750,37 @@ static void test_path_geometry(BOOL d3d11)
     ID2D1PathGeometry_Release(geometry);
 
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     fill_geometry_sink_bezier(sink, 0);
     ID2D1GeometrySink_SetFillMode(sink, D2D1_FILL_MODE_WINDING);
     hr = ID2D1GeometrySink_Close(sink);
-    ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_GetFigureCount(geometry, &count);
-    ok(SUCCEEDED(hr), "Failed to get figure count, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(count == 4, "Got unexpected figure count %u.\n", count);
     hr = ID2D1PathGeometry_GetSegmentCount(geometry, &count);
-    ok(SUCCEEDED(hr), "Failed to get segment count, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(count == 20, "Got unexpected segment count %u.\n", count);
     ID2D1GeometrySink_Release(sink);
 
     geometry_sink_init(&simplify_sink);
     hr = ID2D1PathGeometry_Simplify(geometry, D2D1_GEOMETRY_SIMPLIFICATION_OPTION_CUBICS_AND_LINES,
             NULL, 0.0f, &simplify_sink.ID2D1SimplifiedGeometrySink_iface);
-    ok(SUCCEEDED(hr), "Failed to simplify geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     geometry_sink_check(&simplify_sink, D2D1_FILL_MODE_WINDING, 4, &expected_figures[12], 1);
     geometry_sink_cleanup(&simplify_sink);
     geometry_sink_init(&simplify_sink);
     hr = ID2D1PathGeometry_Simplify(geometry, D2D1_GEOMETRY_SIMPLIFICATION_OPTION_LINES,
             NULL, 100.0f, &simplify_sink.ID2D1SimplifiedGeometrySink_iface);
-    ok(SUCCEEDED(hr), "Failed to simplify geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     geometry_sink_check(&simplify_sink, D2D1_FILL_MODE_WINDING, 4, &expected_figures[20], 1);
     geometry_sink_cleanup(&simplify_sink);
     geometry_sink_init(&simplify_sink);
     hr = ID2D1PathGeometry_Simplify(geometry, D2D1_GEOMETRY_SIMPLIFICATION_OPTION_LINES,
             NULL, 10.0f, &simplify_sink.ID2D1SimplifiedGeometrySink_iface);
-    ok(SUCCEEDED(hr), "Failed to simplify geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     geometry_sink_check(&simplify_sink, D2D1_FILL_MODE_WINDING, 4, &expected_figures[24], 1);
     geometry_sink_cleanup(&simplify_sink);
 
@@ -3790,14 +3790,14 @@ static void test_path_geometry(BOOL d3d11)
     rotate_matrix(&matrix, M_PI / -4.0f);
     scale_matrix(&matrix, 2.0f, 0.5f);
     hr = ID2D1Factory_CreateTransformedGeometry(factory, (ID2D1Geometry *)geometry, &matrix, &transformed_geometry);
-    ok(SUCCEEDED(hr), "Failed to create transformed geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1RenderTarget_BeginDraw(rt);
     ID2D1RenderTarget_Clear(rt, &color);
     ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)geometry, (ID2D1Brush *)brush, NULL);
     ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)transformed_geometry, (ID2D1Brush *)brush, NULL);
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_figure(&ctx, 0, 0, 160, 160, 0xff652e89, 64,
             "7xoCngECngECngECngECngECngECngECnQEEnAEEnAEEnAEEnAEEmwEGmgEGmgEGmgEGmQEImAEI"
             "lAEQiwEagQEjeyh2LHIwbjNsNmk4ZzplPGM+YUBfQl1DXURbRlpGWUhYSFdKVkpVS1VMVExUTFRM"
@@ -3834,9 +3834,9 @@ static void test_path_geometry(BOOL d3d11)
     ID2D1PathGeometry_Release(geometry);
 
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_point(&point, 40.0f,   20.0f);
     ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_FILLED);
@@ -3851,12 +3851,12 @@ static void test_path_geometry(BOOL d3d11)
     ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED);
 
     hr = ID2D1GeometrySink_Close(sink);
-    ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_GetFigureCount(geometry, &count);
-    ok(SUCCEEDED(hr), "Failed to get figure count, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(count == 2, "Got unexpected figure count %u.\n", count);
     hr = ID2D1PathGeometry_GetSegmentCount(geometry, &count);
-    ok(SUCCEEDED(hr), "Failed to get segment count, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(count == 6, "Got unexpected segment count %u.\n", count);
     ID2D1GeometrySink_Release(sink);
 
@@ -3864,40 +3864,40 @@ static void test_path_geometry(BOOL d3d11)
     ID2D1RenderTarget_Clear(rt, &color);
     ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)geometry, (ID2D1Brush *)brush, NULL);
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_surface(&ctx, "a875e68e0cb9c055927b1b50b879f90b24e38470");
     ok(match, "Surface does not match.\n");
     ID2D1PathGeometry_Release(geometry);
 
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     set_point(&point, 40.0f,   20.0f);
     ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_HOLLOW);
     line_to(sink, 75.0f,  300.0f);
     line_to(sink,  5.0f,  300.0f);
     ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_OPEN);
     hr = ID2D1GeometrySink_Close(sink);
-    ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_Release(sink);
     hr = ID2D1PathGeometry_GetSegmentCount(geometry, &count);
-    ok(SUCCEEDED(hr), "Failed to get segment count, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(count == 2, "Got unexpected segment count %u.\n", count);
 
     geometry_sink_init(&simplify_sink);
     hr = ID2D1PathGeometry_Simplify(geometry, D2D1_GEOMETRY_SIMPLIFICATION_OPTION_LINES,
             NULL, 0.0f, &simplify_sink.ID2D1SimplifiedGeometrySink_iface);
-    ok(SUCCEEDED(hr), "Failed to simplify geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     geometry_sink_check(&simplify_sink, D2D1_FILL_MODE_ALTERNATE, 1, &expected_figures[28], 1);
     geometry_sink_cleanup(&simplify_sink);
 
     ID2D1PathGeometry_Release(geometry);
 
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_point(&point, 20.0f,   80.0f);
     ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_FILLED);
@@ -3924,12 +3924,12 @@ static void test_path_geometry(BOOL d3d11)
     ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED);
 
     hr = ID2D1GeometrySink_Close(sink);
-    ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_Release(sink);
 
     set_rect(&rect, 0.0f, 0.0f, 0.0f, 0.0f);
     hr = ID2D1PathGeometry_GetBounds(geometry, NULL, &rect);
-    ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_rect(&rect, 20.0f, 20.0f, 180.0f, 180.0f, 0);
     ok(match, "Got unexpected rectangle {%.8e, %.8e, %.8e, %.8e}.\n",
             rect.left, rect.top, rect.right, rect.bottom);
@@ -3937,7 +3937,7 @@ static void test_path_geometry(BOOL d3d11)
     geometry_sink_init(&simplify_sink);
     hr = ID2D1PathGeometry_Simplify(geometry, D2D1_GEOMETRY_SIMPLIFICATION_OPTION_CUBICS_AND_LINES,
             NULL, 0.0f, &simplify_sink.ID2D1SimplifiedGeometrySink_iface);
-    ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     geometry_sink_check(&simplify_sink, D2D1_FILL_MODE_ALTERNATE, 4, &expected_figures[29], 1);
     geometry_sink_cleanup(&simplify_sink);
 
@@ -4010,11 +4010,11 @@ static void test_rectangle_geometry(BOOL d3d11)
     };
 
     hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory);
-    ok(SUCCEEDED(hr), "Failed to create factory, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_rect(&rect, 0.0f, 0.0f, 0.0f, 0.0f);
     hr = ID2D1Factory_CreateRectangleGeometry(factory, &rect, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1RectangleGeometry_GetRect(geometry, &rect2);
     match = compare_rect(&rect2, 0.0f, 0.0f, 0.0f, 0.0f, 0);
     ok(match, "Got unexpected rectangle {%.8e, %.8e, %.8e, %.8e}.\n",
@@ -4023,7 +4023,7 @@ static void test_rectangle_geometry(BOOL d3d11)
 
     set_rect(&rect, 50.0f, 0.0f, 40.0f, 100.0f);
     hr = ID2D1Factory_CreateRectangleGeometry(factory, &rect, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1RectangleGeometry_GetRect(geometry, &rect2);
     match = compare_rect(&rect2, 50.0f, 0.0f, 40.0f, 100.0f, 0);
     ok(match, "Got unexpected rectangle {%.8e, %.8e, %.8e, %.8e}.\n",
@@ -4032,7 +4032,7 @@ static void test_rectangle_geometry(BOOL d3d11)
 
     set_rect(&rect, 0.0f, 100.0f, 40.0f, 50.0f);
     hr = ID2D1Factory_CreateRectangleGeometry(factory, &rect, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1RectangleGeometry_GetRect(geometry, &rect2);
     match = compare_rect(&rect2, 0.0f, 100.0f, 40.0f, 50.0f, 0);
     ok(match, "Got unexpected rectangle {%.8e, %.8e, %.8e, %.8e}.\n",
@@ -4041,7 +4041,7 @@ static void test_rectangle_geometry(BOOL d3d11)
 
     set_rect(&rect, 50.0f, 100.0f, 40.0f, 50.0f);
     hr = ID2D1Factory_CreateRectangleGeometry(factory, &rect, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1RectangleGeometry_GetRect(geometry, &rect2);
     match = compare_rect(&rect2, 50.0f, 100.0f, 40.0f, 50.0f, 0);
     ok(match, "Got unexpected rectangle {%.8e, %.8e, %.8e, %.8e}.\n",
@@ -4050,63 +4050,63 @@ static void test_rectangle_geometry(BOOL d3d11)
 
     set_rect(&rect, 0.0f, 0.0f, 10.0f, 20.0f);
     hr = ID2D1Factory_CreateRectangleGeometry(factory, &rect, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     /* Edge. */
     contains = FALSE;
     set_point(&point, 0.0f, 0.0f);
     hr = ID2D1RectangleGeometry_FillContainsPoint(geometry, point, NULL, 0.0f, &contains);
-    ok(SUCCEEDED(hr), "FillContainsPoint() failed, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(!!contains, "Got wrong hit test result %d.\n", contains);
 
     /* Within tolerance limit around corner. */
     contains = TRUE;
     set_point(&point, -D2D1_DEFAULT_FLATTENING_TOLERANCE, 0.0f);
     hr = ID2D1RectangleGeometry_FillContainsPoint(geometry, point, NULL, 0.0f, &contains);
-    ok(SUCCEEDED(hr), "FillContainsPoint() failed, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(!contains, "Got wrong hit test result %d.\n", contains);
 
     contains = FALSE;
     set_point(&point, -D2D1_DEFAULT_FLATTENING_TOLERANCE + 0.01f, 0.0f);
     hr = ID2D1RectangleGeometry_FillContainsPoint(geometry, point, NULL, 0.0f, &contains);
-    ok(SUCCEEDED(hr), "FillContainsPoint() failed, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(!!contains, "Got wrong hit test result %d.\n", contains);
 
     contains = TRUE;
     set_point(&point, -D2D1_DEFAULT_FLATTENING_TOLERANCE - 0.01f, 0.0f);
     hr = ID2D1RectangleGeometry_FillContainsPoint(geometry, point, NULL, 0.0f, &contains);
-    ok(SUCCEEDED(hr), "FillContainsPoint() failed, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(!contains, "Got wrong hit test result %d.\n", contains);
 
     contains = TRUE;
     set_point(&point, -D2D1_DEFAULT_FLATTENING_TOLERANCE, -D2D1_DEFAULT_FLATTENING_TOLERANCE);
     hr = ID2D1RectangleGeometry_FillContainsPoint(geometry, point, NULL, 0.0f, &contains);
-    ok(SUCCEEDED(hr), "FillContainsPoint() failed, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(!contains, "Got wrong hit test result %d.\n", contains);
 
     /* Inside. */
     contains = FALSE;
     set_point(&point, 5.0f, 5.0f);
     hr = ID2D1RectangleGeometry_FillContainsPoint(geometry, point, NULL, 0.0f, &contains);
-    ok(SUCCEEDED(hr), "FillContainsPoint() failed, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(!!contains, "Got wrong hit test result %d.\n", contains);
 
     /* Test GetBounds() and Simplify(). */
     hr = ID2D1RectangleGeometry_GetBounds(geometry, NULL, &rect);
-    ok(SUCCEEDED(hr), "Failed to get bounds.\n");
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_rect(&rect, 0.0f, 0.0f, 10.0f, 20.0f, 0);
     ok(match, "Got unexpected bounds {%.8e, %.8e, %.8e, %.8e}.\n",
             rect.left, rect.top, rect.right, rect.bottom);
     geometry_sink_init(&sink);
     hr = ID2D1RectangleGeometry_Simplify(geometry, D2D1_GEOMETRY_SIMPLIFICATION_OPTION_CUBICS_AND_LINES,
             NULL, 0.0f, &sink.ID2D1SimplifiedGeometrySink_iface);
-    ok(SUCCEEDED(hr), "Failed to simplify geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     geometry_sink_check(&sink, D2D1_FILL_MODE_ALTERNATE, 1, &expected_figures[0], 0);
     geometry_sink_cleanup(&sink);
     geometry_sink_init(&sink);
     hr = ID2D1RectangleGeometry_Simplify(geometry, D2D1_GEOMETRY_SIMPLIFICATION_OPTION_LINES,
             NULL, 0.0f, &sink.ID2D1SimplifiedGeometrySink_iface);
-    ok(SUCCEEDED(hr), "Failed to simplify geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     geometry_sink_check(&sink, D2D1_FILL_MODE_ALTERNATE, 1, &expected_figures[0], 0);
     geometry_sink_cleanup(&sink);
 
@@ -4115,14 +4115,14 @@ static void test_rectangle_geometry(BOOL d3d11)
     scale_matrix(&matrix, 3.0f, 2.0f);
     rotate_matrix(&matrix, M_PI / -5.0f);
     hr = ID2D1RectangleGeometry_GetBounds(geometry, &matrix, &rect);
-    ok(SUCCEEDED(hr), "Failed to get bounds.\n");
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_rect(&rect, 2.00000000e+01f, 1.82442951e+01f, 7.95376282e+01f, 6.23606796e+01f, 0);
     ok(match, "Got unexpected bounds {%.8e, %.8e, %.8e, %.8e}.\n",
             rect.left, rect.top, rect.right, rect.bottom);
     geometry_sink_init(&sink);
     hr = ID2D1RectangleGeometry_Simplify(geometry, D2D1_GEOMETRY_SIMPLIFICATION_OPTION_CUBICS_AND_LINES,
             &matrix, 0.0f, &sink.ID2D1SimplifiedGeometrySink_iface);
-    ok(SUCCEEDED(hr), "Failed to simplify geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     geometry_sink_check(&sink, D2D1_FILL_MODE_ALTERNATE, 1, &expected_figures[1], 1);
     geometry_sink_cleanup(&sink);
 
@@ -4130,14 +4130,14 @@ static void test_rectangle_geometry(BOOL d3d11)
     translate_matrix(&matrix, 25.0f, 15.0f);
     scale_matrix(&matrix, 0.0f, 2.0f);
     hr = ID2D1RectangleGeometry_GetBounds(geometry, &matrix, &rect);
-    ok(SUCCEEDED(hr), "Failed to get bounds.\n");
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_rect(&rect, 25.0f, 15.0f, 25.0f, 55.0f, 0);
     ok(match, "Got unexpected bounds {%.8e, %.8e, %.8e, %.8e}.\n",
             rect.left, rect.top, rect.right, rect.bottom);
     geometry_sink_init(&sink);
     hr = ID2D1RectangleGeometry_Simplify(geometry, D2D1_GEOMETRY_SIMPLIFICATION_OPTION_LINES,
             &matrix, 0.0f, &sink.ID2D1SimplifiedGeometrySink_iface);
-    ok(SUCCEEDED(hr), "Failed to simplify geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     geometry_sink_check(&sink, D2D1_FILL_MODE_ALTERNATE, 1, &expected_figures[2], 0);
     geometry_sink_cleanup(&sink);
 
@@ -4145,14 +4145,14 @@ static void test_rectangle_geometry(BOOL d3d11)
     translate_matrix(&matrix, 30.0f, 45.0f);
     scale_matrix(&matrix, 0.5f, 0.0f);
     hr = ID2D1RectangleGeometry_GetBounds(geometry, &matrix, &rect);
-    ok(SUCCEEDED(hr), "Failed to get bounds.\n");
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_rect(&rect, 30.0f, 45.0f, 35.0f, 45.0f, 0);
     ok(match, "Got unexpected bounds {%.8e, %.8e, %.8e, %.8e}.\n",
             rect.left, rect.top, rect.right, rect.bottom);
     geometry_sink_init(&sink);
     hr = ID2D1RectangleGeometry_Simplify(geometry, D2D1_GEOMETRY_SIMPLIFICATION_OPTION_LINES,
             &matrix, 0.0f, &sink.ID2D1SimplifiedGeometrySink_iface);
-    ok(SUCCEEDED(hr), "Failed to simplify geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     geometry_sink_check(&sink, D2D1_FILL_MODE_ALTERNATE, 1, &expected_figures[3], 0);
     geometry_sink_cleanup(&sink);
 
@@ -4161,23 +4161,23 @@ static void test_rectangle_geometry(BOOL d3d11)
     rotate_matrix(&matrix, M_PI / 3.0f);
     translate_matrix(&matrix, 30.0f, 20.0f);
     hr = ID2D1Factory_CreateTransformedGeometry(factory, (ID2D1Geometry *)geometry, &matrix, &transformed_geometry);
-    ok(SUCCEEDED(hr), "Failed to create transformed geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1TransformedGeometry_GetBounds(transformed_geometry, NULL, &rect);
-    ok(SUCCEEDED(hr), "Failed to get bounds.\n");
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_rect(&rect, -7.85640717e+01f, 1.79903809e+02f, 1.07179594e+01f, 2.73205078e+02f, 1);
     ok(match, "Got unexpected bounds {%.8e, %.8e, %.8e, %.8e}.\n",
             rect.left, rect.top, rect.right, rect.bottom);
     geometry_sink_init(&sink);
     hr = ID2D1TransformedGeometry_Simplify(transformed_geometry, D2D1_GEOMETRY_SIMPLIFICATION_OPTION_CUBICS_AND_LINES,
             NULL, 0.0f, &sink.ID2D1SimplifiedGeometrySink_iface);
-    ok(SUCCEEDED(hr), "Failed to simplify geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     geometry_sink_check(&sink, D2D1_FILL_MODE_ALTERNATE, 1, &expected_figures[4], 1);
     geometry_sink_cleanup(&sink);
     geometry_sink_init(&sink);
     hr = ID2D1TransformedGeometry_Simplify(transformed_geometry, D2D1_GEOMETRY_SIMPLIFICATION_OPTION_LINES,
             NULL, 0.0f, &sink.ID2D1SimplifiedGeometrySink_iface);
-    ok(SUCCEEDED(hr), "Failed to simplify geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     geometry_sink_check(&sink, D2D1_FILL_MODE_ALTERNATE, 1, &expected_figures[4], 1);
     geometry_sink_cleanup(&sink);
 
@@ -4185,42 +4185,42 @@ static void test_rectangle_geometry(BOOL d3d11)
     rotate_matrix(&matrix, M_PI / -3.0f);
     scale_matrix(&matrix, 0.25f, 0.2f);
     ID2D1TransformedGeometry_GetBounds(transformed_geometry, &matrix, &rect);
-    ok(SUCCEEDED(hr), "Failed to get bounds.\n");
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_rect(&rect, 30.0f, 20.0f, 40.0f, 40.0f, 2);
     ok(match, "Got unexpected bounds {%.8e, %.8e, %.8e, %.8e}.\n",
             rect.left, rect.top, rect.right, rect.bottom);
     geometry_sink_init(&sink);
     hr = ID2D1TransformedGeometry_Simplify(transformed_geometry, D2D1_GEOMETRY_SIMPLIFICATION_OPTION_LINES,
             &matrix, 0.0f, &sink.ID2D1SimplifiedGeometrySink_iface);
-    ok(SUCCEEDED(hr), "Failed to simplify geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     geometry_sink_check(&sink, D2D1_FILL_MODE_ALTERNATE, 1, &expected_figures[5], 4);
     geometry_sink_cleanup(&sink);
 
     set_matrix_identity(&matrix);
     scale_matrix(&matrix, 2.0f, 0.0f);
     ID2D1TransformedGeometry_GetBounds(transformed_geometry, &matrix, &rect);
-    ok(SUCCEEDED(hr), "Failed to get bounds.\n");
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_rect(&rect, -1.57128143e+02f, 0.00000000e+00f, 2.14359188e+01f, 0.00000000e+00f, 1);
     ok(match, "Got unexpected bounds {%.8e, %.8e, %.8e, %.8e}.\n",
             rect.left, rect.top, rect.right, rect.bottom);
     geometry_sink_init(&sink);
     hr = ID2D1TransformedGeometry_Simplify(transformed_geometry, D2D1_GEOMETRY_SIMPLIFICATION_OPTION_CUBICS_AND_LINES,
             &matrix, 0.0f, &sink.ID2D1SimplifiedGeometrySink_iface);
-    ok(SUCCEEDED(hr), "Failed to simplify geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     geometry_sink_check(&sink, D2D1_FILL_MODE_ALTERNATE, 1, &expected_figures[6], 1);
     geometry_sink_cleanup(&sink);
 
     set_matrix_identity(&matrix);
     scale_matrix(&matrix, 0.0f, 0.5f);
     ID2D1TransformedGeometry_GetBounds(transformed_geometry, &matrix, &rect);
-    ok(SUCCEEDED(hr), "Failed to get bounds.\n");
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_rect(&rect, 0.00000000e+00f, 8.99519043e+01f, 0.00000000e+00, 1.36602539e+02f, 1);
     ok(match, "Got unexpected bounds {%.8e, %.8e, %.8e, %.8e}.\n",
             rect.left, rect.top, rect.right, rect.bottom);
     geometry_sink_init(&sink);
     hr = ID2D1TransformedGeometry_Simplify(transformed_geometry, D2D1_GEOMETRY_SIMPLIFICATION_OPTION_CUBICS_AND_LINES,
             &matrix, 0.0f, &sink.ID2D1SimplifiedGeometrySink_iface);
-    ok(SUCCEEDED(hr), "Failed to simplify geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     geometry_sink_check(&sink, D2D1_FILL_MODE_ALTERNATE, 1, &expected_figures[7], 1);
     geometry_sink_cleanup(&sink);
 
@@ -4237,11 +4237,11 @@ static void test_rounded_rectangle_geometry(BOOL d3d11)
     HRESULT hr;
 
     hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory);
-    ok(SUCCEEDED(hr), "Failed to create factory, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_rounded_rect(&rect, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
     hr = ID2D1Factory_CreateRoundedRectangleGeometry(factory, &rect, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1RoundedRectangleGeometry_GetRoundedRect(geometry, &rect2);
     ok(!memcmp(&rect, &rect2, sizeof(rect)), "Got unexpected rectangle {%.8e, %.8e, %.8e, %.8e, %.8e, %.8e}.\n",
@@ -4325,10 +4325,10 @@ static void test_bitmap_formats(BOOL d3d11)
             bitmap_desc.pixelFormat.alphaMode = j;
             hr = ID2D1RenderTarget_CreateBitmap(rt, size, NULL, 0, &bitmap_desc, &bitmap);
             if (bitmap_formats[i].mask & (1u << j))
-                ok(hr == S_OK, "Got unexpected hr %#x, for format %#x/%#x.\n",
+                ok(hr == S_OK, "Got unexpected hr %#lx, for format %#x/%#x.\n",
                         hr, bitmap_formats[i].format, j);
             else
-                ok(hr == D2DERR_UNSUPPORTED_PIXEL_FORMAT, "Got unexpected hr %#x, for format %#x/%#x.\n",
+                ok(hr == D2DERR_UNSUPPORTED_PIXEL_FORMAT, "Got unexpected hr %#lx, for format %#x/%#x.\n",
                         hr, bitmap_formats[i].format, j);
             if (SUCCEEDED(hr))
                 ID2D1Bitmap_Release(bitmap);
@@ -4374,22 +4374,22 @@ static void test_alpha_mode(BOOL d3d11)
     bitmap_desc.dpiX = 96.0f / 40.0f;
     bitmap_desc.dpiY = 96.0f / 30.0f;
     hr = ID2D1RenderTarget_CreateBitmap(rt, size, bitmap_data, 4 * sizeof(*bitmap_data), &bitmap_desc, &bitmap);
-    ok(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID2D1RenderTarget_CreateBitmapBrush(rt, bitmap, NULL, NULL, &bitmap_brush);
-    ok(SUCCEEDED(hr), "Failed to create brush, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1BitmapBrush_SetInterpolationMode(bitmap_brush, D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR);
     ID2D1BitmapBrush_SetExtendModeX(bitmap_brush, D2D1_EXTEND_MODE_WRAP);
     ID2D1BitmapBrush_SetExtendModeY(bitmap_brush, D2D1_EXTEND_MODE_WRAP);
 
     set_color(&color, 0.0f, 1.0f, 0.0f, 0.75f);
     hr = ID2D1RenderTarget_CreateSolidColorBrush(rt, &color, NULL, &color_brush);
-    ok(SUCCEEDED(hr), "Failed to create brush, hr %#x.\n", hr);
+    ok(SUCCEEDED(hr), "Failed to create brush, hr %#lx.\n", hr);
 
     ID2D1RenderTarget_BeginDraw(rt);
     ID2D1RenderTarget_Clear(rt, NULL);
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_surface(&ctx, "48c41aff3a130a17ee210866b2ab7d36763934d5");
     ok(match, "Surface does not match.\n");
 
@@ -4397,7 +4397,7 @@ static void test_alpha_mode(BOOL d3d11)
     set_color(&color, 1.0f, 0.0f, 0.0f, 0.25f);
     ID2D1RenderTarget_Clear(rt, &color);
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_surface(&ctx, "6487e683730fb5a77c1911388d00b04664c5c4e4");
     ok(match, "Surface does not match.\n");
 
@@ -4405,7 +4405,7 @@ static void test_alpha_mode(BOOL d3d11)
     set_color(&color, 0.0f, 0.0f, 1.0f, 0.75f);
     ID2D1RenderTarget_Clear(rt, &color);
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_surface(&ctx, "7a35ba09e43cbaf591388ff1ef8de56157630c98");
     ok(match, "Surface does not match.\n");
 
@@ -4423,7 +4423,7 @@ static void test_alpha_mode(BOOL d3d11)
     ID2D1Bitmap_Release(bitmap);
     bitmap_desc.pixelFormat.alphaMode = D2D1_ALPHA_MODE_PREMULTIPLIED;
     hr = ID2D1RenderTarget_CreateBitmap(rt, size, bitmap_data, 4 * sizeof(*bitmap_data), &bitmap_desc, &bitmap);
-    ok(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1BitmapBrush_SetBitmap(bitmap_brush, bitmap);
 
     set_rect(&rect,   0.0f, 120.0f, 160.0f, 240.0f);
@@ -4446,7 +4446,7 @@ static void test_alpha_mode(BOOL d3d11)
     ID2D1RenderTarget_FillRectangle(rt, &rect, (ID2D1Brush *)color_brush);
 
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_surface(&ctx, "14f8ac64b70966c7c3c6281c59aaecdb17c3b16a");
     ok(match, "Surface does not match.\n");
 
@@ -4465,12 +4465,12 @@ static void test_alpha_mode(BOOL d3d11)
     ID2D1Bitmap_Release(bitmap);
     bitmap_desc.pixelFormat.alphaMode = D2D1_ALPHA_MODE_IGNORE;
     hr = ID2D1RenderTarget_CreateBitmap(rt, size, bitmap_data, 4 * sizeof(*bitmap_data), &bitmap_desc, &bitmap);
-    ok(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1BitmapBrush_SetBitmap(bitmap_brush, bitmap);
 
     ID2D1BitmapBrush_Release(bitmap_brush);
     hr = ID2D1RenderTarget_CreateBitmapBrush(rt, bitmap, NULL, NULL, &bitmap_brush);
-    ok(SUCCEEDED(hr), "Failed to create brush, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1BitmapBrush_SetInterpolationMode(bitmap_brush, D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR);
     ID2D1BitmapBrush_SetExtendModeX(bitmap_brush, D2D1_EXTEND_MODE_WRAP);
     ID2D1BitmapBrush_SetExtendModeY(bitmap_brush, D2D1_EXTEND_MODE_WRAP);
@@ -4478,12 +4478,12 @@ static void test_alpha_mode(BOOL d3d11)
     ID2D1SolidColorBrush_Release(color_brush);
     set_color(&color, 0.0f, 1.0f, 0.0f, 0.75f);
     hr = ID2D1RenderTarget_CreateSolidColorBrush(rt, &color, NULL, &color_brush);
-    ok(SUCCEEDED(hr), "Failed to create brush, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1RenderTarget_BeginDraw(rt);
     ID2D1RenderTarget_Clear(rt, NULL);
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_surface(&ctx, "b44510bf2d2e61a8d7c0ad862de49a471f1fd13f");
     ok(match, "Surface does not match.\n");
 
@@ -4491,7 +4491,7 @@ static void test_alpha_mode(BOOL d3d11)
     set_color(&color, 1.0f, 0.0f, 0.0f, 0.25f);
     ID2D1RenderTarget_Clear(rt, &color);
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_surface(&ctx, "2184f4a9198fc1de09ac85301b7a03eebadd9b81");
     ok(match, "Surface does not match.\n");
 
@@ -4499,7 +4499,7 @@ static void test_alpha_mode(BOOL d3d11)
     set_color(&color, 0.0f, 0.0f, 1.0f, 0.75f);
     ID2D1RenderTarget_Clear(rt, &color);
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_surface(&ctx, "6527ec83b4039c895b50f9b3e144fe0cf90d1889");
     ok(match, "Surface does not match.\n");
 
@@ -4517,7 +4517,7 @@ static void test_alpha_mode(BOOL d3d11)
     ID2D1Bitmap_Release(bitmap);
     bitmap_desc.pixelFormat.alphaMode = D2D1_ALPHA_MODE_PREMULTIPLIED;
     hr = ID2D1RenderTarget_CreateBitmap(rt, size, bitmap_data, 4 * sizeof(*bitmap_data), &bitmap_desc, &bitmap);
-    ok(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1BitmapBrush_SetBitmap(bitmap_brush, bitmap);
 
     set_rect(&rect,   0.0f, 120.0f, 160.0f, 240.0f);
@@ -4540,12 +4540,12 @@ static void test_alpha_mode(BOOL d3d11)
     ID2D1RenderTarget_FillRectangle(rt, &rect, (ID2D1Brush *)color_brush);
 
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_surface(&ctx, "465f5a3190d7bde408b3206b4be939fb22f8a3d6");
     ok(match, "Surface does not match.\n");
 
     refcount = ID2D1Bitmap_Release(bitmap);
-    ok(refcount == 1, "Bitmap has %u references left.\n", refcount);
+    ok(refcount == 1, "Bitmap has %lu references left.\n", refcount);
     ID2D1SolidColorBrush_Release(color_brush);
     ID2D1BitmapBrush_Release(bitmap_brush);
     ID2D1RenderTarget_Release(rt);
@@ -4579,18 +4579,18 @@ static void test_shared_bitmap(BOOL d3d11)
     window2 = create_window();
     swapchain2 = create_swapchain(ctx.device, window2, TRUE);
     hr = IDXGISwapChain_GetBuffer(swapchain2, 0, &IID_IDXGISurface, (void **)&surface2);
-    ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
             &IID_IWICImagingFactory, (void **)&wic_factory);
-    ok(SUCCEEDED(hr), "Failed to create WIC imaging factory, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = IWICImagingFactory_CreateBitmap(wic_factory, 640, 480,
             &GUID_WICPixelFormat32bppPBGRA, WICBitmapCacheOnDemand, &wic_bitmap1);
-    ok(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = IWICImagingFactory_CreateBitmap(wic_factory, 640, 480,
             &GUID_WICPixelFormat32bppPBGRA, WICBitmapCacheOnDemand, &wic_bitmap2);
-    ok(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     IWICImagingFactory_Release(wic_factory);
 
     desc.type = D2D1_RENDER_TARGET_TYPE_DEFAULT;
@@ -4607,32 +4607,32 @@ static void test_shared_bitmap(BOOL d3d11)
     bitmap_desc.dpiY = 96.0f;
 
     hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory1);
-    ok(SUCCEEDED(hr), "Failed to create factory, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory2);
-    ok(SUCCEEDED(hr), "Failed to create factory, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     /* DXGI surface render targets with the same device and factory. */
     hr = ID2D1Factory_CreateDxgiSurfaceRenderTarget(factory1, ctx.surface, &desc, &rt1);
-    ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1RenderTarget_CreateBitmap(rt1, size, NULL, 0, &bitmap_desc, &bitmap1);
     check_bitmap_surface(bitmap1, TRUE, 0);
-    ok(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID2D1Factory_CreateDxgiSurfaceRenderTarget(factory1, surface2, &desc, &rt2);
-    ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1RenderTarget_CreateSharedBitmap(rt2, &IID_ID2D1Bitmap, bitmap1, NULL, &bitmap2);
-    ok(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     check_bitmap_surface(bitmap2, TRUE, 0);
     ID2D1Bitmap_Release(bitmap2);
     hr = ID2D1RenderTarget_CreateSharedBitmap(rt2, &IID_IUnknown, bitmap1, NULL, &bitmap2);
-    ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
     ID2D1RenderTarget_Release(rt2);
 
     /* DXGI surface render targets with the same device but different factories. */
     hr = ID2D1Factory_CreateDxgiSurfaceRenderTarget(factory2, surface2, &desc, &rt2);
-    ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1RenderTarget_CreateSharedBitmap(rt2, &IID_ID2D1Bitmap, bitmap1, NULL, &bitmap2);
-    ok(hr == D2DERR_WRONG_FACTORY, "Got unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_WRONG_FACTORY, "Got unexpected hr %#lx.\n", hr);
     ID2D1RenderTarget_Release(rt2);
 
     /* DXGI surface render targets with different devices but the same factory. */
@@ -4642,55 +4642,55 @@ static void test_shared_bitmap(BOOL d3d11)
     ok(!!device2, "Failed to create device.\n");
     swapchain2 = create_swapchain(device2, window2, TRUE);
     hr = IDXGISwapChain_GetBuffer(swapchain2, 0, &IID_IDXGISurface, (void **)&surface2);
-    ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID2D1Factory_CreateDxgiSurfaceRenderTarget(factory1, surface2, &desc, &rt2);
-    ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1RenderTarget_CreateSharedBitmap(rt2, &IID_ID2D1Bitmap, bitmap1, NULL, &bitmap2);
-    ok(hr == D2DERR_UNSUPPORTED_OPERATION, "Got unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_UNSUPPORTED_OPERATION, "Got unexpected hr %#lx.\n", hr);
     ID2D1RenderTarget_Release(rt2);
 
     /* DXGI surface render targets with different devices and different factories. */
     hr = ID2D1Factory_CreateDxgiSurfaceRenderTarget(factory2, surface2, &desc, &rt2);
-    ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1RenderTarget_CreateSharedBitmap(rt2, &IID_ID2D1Bitmap, bitmap1, NULL, &bitmap2);
-    ok(hr == D2DERR_WRONG_FACTORY, "Got unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_WRONG_FACTORY, "Got unexpected hr %#lx.\n", hr);
     ID2D1RenderTarget_Release(rt2);
 
     /* DXGI surface render target and WIC bitmap render target, same factory. */
     hr = ID2D1Factory_CreateWicBitmapRenderTarget(factory1, wic_bitmap2, &desc, &rt2);
-    ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1RenderTarget_CreateSharedBitmap(rt2, &IID_ID2D1Bitmap, bitmap1, NULL, &bitmap2);
-    ok(hr == D2DERR_UNSUPPORTED_OPERATION, "Got unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_UNSUPPORTED_OPERATION, "Got unexpected hr %#lx.\n", hr);
     ID2D1RenderTarget_Release(rt2);
 
     /* WIC bitmap render targets on different D2D factories. */
     ID2D1Bitmap_Release(bitmap1);
     ID2D1RenderTarget_Release(rt1);
     hr = ID2D1Factory_CreateWicBitmapRenderTarget(factory1, wic_bitmap1, &desc, &rt1);
-    ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1RenderTarget_CreateBitmap(rt1, size, NULL, 0, &bitmap_desc, &bitmap1);
-    ok(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID2D1RenderTarget_QueryInterface(rt1, &IID_ID2D1GdiInteropRenderTarget, (void **)&interop);
-    ok(SUCCEEDED(hr), "Failed to get interop target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1GdiInteropRenderTarget_QueryInterface(interop, &IID_ID2D1RenderTarget, (void **)&rt3);
-    ok(SUCCEEDED(hr), "Failed to get render target back, %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(rt3 == rt1, "Unexpected render target\n");
     ID2D1RenderTarget_Release(rt3);
     ID2D1GdiInteropRenderTarget_Release(interop);
 
     hr = ID2D1Factory_CreateWicBitmapRenderTarget(factory2, wic_bitmap2, &desc, &rt2);
-    ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1RenderTarget_CreateSharedBitmap(rt2, &IID_ID2D1Bitmap, bitmap1, NULL, &bitmap2);
-    ok(hr == D2DERR_WRONG_FACTORY, "Got unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_WRONG_FACTORY, "Got unexpected hr %#lx.\n", hr);
     ID2D1RenderTarget_Release(rt2);
 
     /* WIC bitmap render targets on the same D2D factory. */
     hr = ID2D1Factory_CreateWicBitmapRenderTarget(factory1, wic_bitmap2, &desc, &rt2);
-    ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1RenderTarget_CreateSharedBitmap(rt2, &IID_ID2D1Bitmap, bitmap1, NULL, &bitmap2);
-    ok(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     check_bitmap_surface(bitmap2, FALSE, 0);
     ID2D1Bitmap_Release(bitmap2);
     ID2D1RenderTarget_Release(rt2);
@@ -4705,7 +4705,7 @@ static void test_shared_bitmap(BOOL d3d11)
     desc.minLevel = D2D1_FEATURE_LEVEL_DEFAULT;
 
     hr = ID2D1Factory_CreateDxgiSurfaceRenderTarget(factory1, surface2, &desc, &rt2);
-    ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     bitmap_desc.pixelFormat.format = DXGI_FORMAT_B8G8R8A8_UNORM;
     bitmap_desc.pixelFormat.alphaMode = D2D1_ALPHA_MODE_PREMULTIPLIED;
@@ -4713,7 +4713,7 @@ static void test_shared_bitmap(BOOL d3d11)
     bitmap_desc.dpiY = 0.0f;
 
     hr = ID2D1RenderTarget_CreateSharedBitmap(rt2, &IID_IDXGISurface, surface2, &bitmap_desc, &bitmap2);
-    ok(SUCCEEDED(hr) || broken(hr == E_INVALIDARG) /* vista */, "Failed to create bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK || broken(hr == E_INVALIDARG) /* vista */, "Got unexpected hr %#lx.\n", hr);
 
     if (SUCCEEDED(hr))
     {
@@ -4745,7 +4745,7 @@ static void test_shared_bitmap(BOOL d3d11)
 
         size = ID2D1Bitmap_GetPixelSize(bitmap2);
         hr = IDXGISurface_GetDesc(surface2, &surface_desc);
-        ok(SUCCEEDED(hr), "Failed to get surface description, hr %#x.\n", hr);
+        ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
         ok(size.width == surface_desc.Width && size.height == surface_desc.Height, "Got wrong bitmap size.\n");
 
         check_bitmap_surface(bitmap2, TRUE, D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW);
@@ -4756,7 +4756,7 @@ static void test_shared_bitmap(BOOL d3d11)
         if (IDXGISurface_QueryInterface(surface2, &IID_IDXGISurface1, (void **)&surface3) == S_OK)
         {
             hr = ID2D1RenderTarget_CreateSharedBitmap(rt2, &IID_IDXGISurface1, surface3, &bitmap_desc, &bitmap2);
-            ok(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+            ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
             ID2D1Bitmap_Release(bitmap2);
             IDXGISurface1_Release(surface3);
@@ -4768,7 +4768,7 @@ static void test_shared_bitmap(BOOL d3d11)
 
             hr = ID2D1RenderTarget_CreateSharedBitmap(rt2, &IID_IDXGISurface, surface2, &bitmap_desc, &bitmap2);
             todo_wine_if(i == 2 || i == 3 || i == 5 || i == 6)
-            ok(hr == bitmap_format_tests[i].hr, "%u: unexpected hr %#x.\n", i, hr);
+            ok(hr == bitmap_format_tests[i].hr, "%u: Got unexpected hr %#lx.\n", i, hr);
 
             if (SUCCEEDED(bitmap_format_tests[i].hr))
             {
@@ -4836,7 +4836,7 @@ static void test_bitmap_updates(BOOL d3d11)
     bitmap_desc.dpiX = 96.0f;
     bitmap_desc.dpiY = 96.0f;
     hr = ID2D1RenderTarget_CreateBitmap(rt, size, NULL, 0, &bitmap_desc, &bitmap);
-    ok(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_rect(&rect, 0.0f, 0.0f, 320.0f, 240.0f);
     ID2D1RenderTarget_DrawBitmap(rt, bitmap, &rect, 1.0f,
@@ -4846,7 +4846,7 @@ static void test_bitmap_updates(BOOL d3d11)
 
     bitmap_desc.pixelFormat.alphaMode = D2D1_ALPHA_MODE_IGNORE;
     hr = ID2D1RenderTarget_CreateBitmap(rt, size, NULL, 0, &bitmap_desc, &bitmap);
-    ok(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_rect(&rect, 0.0f, 240.0f, 320.0f, 480.0f);
     ID2D1RenderTarget_DrawBitmap(rt, bitmap, &rect, 1.0f,
@@ -4854,31 +4854,31 @@ static void test_bitmap_updates(BOOL d3d11)
 
     set_rect_u(&dst_rect, 1, 1, 3, 3);
     hr = ID2D1Bitmap_CopyFromMemory(bitmap, &dst_rect, bitmap_data, 4 * sizeof(*bitmap_data));
-    ok(SUCCEEDED(hr), "Failed to update bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     set_rect_u(&dst_rect, 0, 3, 3, 4);
     hr = ID2D1Bitmap_CopyFromMemory(bitmap, &dst_rect, &bitmap_data[6], 4 * sizeof(*bitmap_data));
-    ok(SUCCEEDED(hr), "Failed to update bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     set_rect_u(&dst_rect, 0, 0, 4, 1);
     hr = ID2D1Bitmap_CopyFromMemory(bitmap, &dst_rect, &bitmap_data[10], 4 * sizeof(*bitmap_data));
-    ok(SUCCEEDED(hr), "Failed to update bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     set_rect_u(&dst_rect, 0, 1, 1, 3);
     hr = ID2D1Bitmap_CopyFromMemory(bitmap, &dst_rect, &bitmap_data[2], sizeof(*bitmap_data));
-    ok(SUCCEEDED(hr), "Failed to update bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     set_rect_u(&dst_rect, 4, 4, 3, 1);
     hr = ID2D1Bitmap_CopyFromMemory(bitmap, &dst_rect, bitmap_data, sizeof(*bitmap_data));
-    ok(SUCCEEDED(hr), "Failed to update bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     set_rect(&rect, 320.0f, 240.0f, 640.0f, 480.0f);
     ID2D1RenderTarget_DrawBitmap(rt, bitmap, &rect, 1.0f,
             D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, NULL);
 
     hr = ID2D1Bitmap_CopyFromMemory(bitmap, NULL, bitmap_data, 4 * sizeof(*bitmap_data));
-    ok(SUCCEEDED(hr), "Failed to update bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     set_rect(&rect, 320.0f, 0.0f, 640.0f, 240.0f);
     ID2D1RenderTarget_DrawBitmap(rt, bitmap, &rect, 1.0f,
             D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, NULL);
 
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     match = compare_surface(&ctx, "cb8136c91fbbdc76bb83b8c09edc1907b0a5d0a6");
     ok(match, "Surface does not match.\n");
@@ -4924,7 +4924,7 @@ static void test_opacity_brush(BOOL d3d11)
 
     set_color(&color, 0.0f, 1.0f, 0.0f, 0.8f);
     hr = ID2D1RenderTarget_CreateSolidColorBrush(rt, &color, NULL, &color_brush);
-    ok(SUCCEEDED(hr), "Failed to create color brush, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_size_u(&size, 4, 4);
     bitmap_desc.pixelFormat.format = DXGI_FORMAT_B8G8R8A8_UNORM;
@@ -4932,12 +4932,12 @@ static void test_opacity_brush(BOOL d3d11)
     bitmap_desc.dpiX = 96.0f;
     bitmap_desc.dpiY = 96.0f;
     hr = ID2D1RenderTarget_CreateBitmap(rt, size, bitmap_data, 4 * sizeof(*bitmap_data), &bitmap_desc, &bitmap);
-    ok(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1RenderTarget_CreateBitmapBrush(rt, bitmap, NULL, NULL, &opacity_brush);
-    ok(SUCCEEDED(hr), "Failed to create bitmap brush, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1BitmapBrush_SetInterpolationMode(opacity_brush, D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR);
     refcount = ID2D1Bitmap_Release(bitmap);
-    ok(refcount == 1, "Got unexpected refcount %u.\n", refcount);
+    ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount);
 
     set_size_u(&size, 1, 1);
     bitmap_desc.pixelFormat.format = DXGI_FORMAT_B8G8R8A8_UNORM;
@@ -4945,12 +4945,12 @@ static void test_opacity_brush(BOOL d3d11)
     bitmap_desc.dpiX = 96.0f;
     bitmap_desc.dpiY = 96.0f;
     hr = ID2D1RenderTarget_CreateBitmap(rt, size, &bitmap_data[2], sizeof(*bitmap_data), &bitmap_desc, &bitmap);
-    ok(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1RenderTarget_CreateBitmapBrush(rt, bitmap, NULL, NULL, &bitmap_brush);
-    ok(SUCCEEDED(hr), "Failed to create bitmap brush, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1BitmapBrush_SetInterpolationMode(bitmap_brush, D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR);
     refcount = ID2D1Bitmap_Release(bitmap);
-    ok(refcount == 1, "Got unexpected refcount %u.\n", refcount);
+    ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount);
 
     ID2D1RenderTarget_BeginDraw(rt);
 
@@ -5000,7 +5000,7 @@ static void test_opacity_brush(BOOL d3d11)
             (ID2D1Brush *)bitmap_brush, (ID2D1Brush *)opacity_brush);
 
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(hr == D2DERR_INCOMPATIBLE_BRUSH_TYPES, "Got unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_INCOMPATIBLE_BRUSH_TYPES, "Got unexpected hr %#lx.\n", hr);
     match = compare_surface(&ctx, "7141c6c7b3decb91196428efb1856bcbf9872935");
     ok(match, "Surface does not match.\n");
     ID2D1RenderTarget_BeginDraw(rt);
@@ -5042,7 +5042,7 @@ static void test_opacity_brush(BOOL d3d11)
     ID2D1RectangleGeometry_Release(geometry);
 
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_surface(&ctx, "c3a5802d1750efa3e9122c1a92f6064df3872732");
     ok(match, "Surface does not match.\n");
 
@@ -5080,7 +5080,7 @@ static void test_create_target(BOOL d3d11)
         return;
 
     hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory);
-    ok(SUCCEEDED(hr), "Failed to create factory, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     for (i = 0; i < ARRAY_SIZE(create_dpi_tests); ++i)
     {
@@ -5099,21 +5099,21 @@ static void test_create_target(BOOL d3d11)
         desc.minLevel = D2D1_FEATURE_LEVEL_DEFAULT;
 
         hr = ID2D1Factory_CreateDxgiSurfaceRenderTarget(factory, ctx.surface, &desc, &rt);
-        ok(hr == create_dpi_tests[i].hr, "Wrong return code, hr %#x, expected %#x, test %u.\n", hr,
-            create_dpi_tests[i].hr, i);
+        ok(hr == create_dpi_tests[i].hr, "Test %u: Got unexpect hr %#lx, expected %#lx.\n",
+                i, hr, create_dpi_tests[i].hr);
 
         if (FAILED(hr))
             continue;
 
         hr = ID2D1RenderTarget_QueryInterface(rt, &IID_IUnknown, (void **)&unk);
-        ok(SUCCEEDED(hr), "Failed to get IUnknown, hr %#x.\n", hr);
+        ok(hr == S_OK, "Test %u: Got unexpected hr %#lx.\n", i, hr);
         ok(unk == (IUnknown *)rt, "Expected same interface pointer.\n");
         IUnknown_Release(unk);
 
         hr = ID2D1RenderTarget_QueryInterface(rt, &IID_ID2D1GdiInteropRenderTarget, (void **)&interop);
-        ok(SUCCEEDED(hr), "Failed to get interop target, hr %#x.\n", hr);
+        ok(hr == S_OK, "Test %u: Got unexpected hr %#lx.\n", i, hr);
         hr = ID2D1GdiInteropRenderTarget_QueryInterface(interop, &IID_ID2D1RenderTarget, (void **)&rt2);
-        ok(SUCCEEDED(hr), "Failed to get render target back, %#x.\n", hr);
+        ok(hr == S_OK, "Test %u: Got unexpected hr %#lx.\n", i, hr);
         ok(rt2 == rt, "Unexpected render target\n");
         ID2D1RenderTarget_Release(rt2);
         ID2D1GdiInteropRenderTarget_Release(interop);
@@ -5185,10 +5185,10 @@ static void test_draw_text_layout(BOOL d3d11)
 
 
     hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory);
-    ok(SUCCEEDED(hr), "Failed to create factory, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory2);
-    ok(SUCCEEDED(hr), "Failed to create factory, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(factory != factory2, "got same factory\n");
 
     desc.type = D2D1_RENDER_TARGET_TYPE_DEFAULT;
@@ -5200,33 +5200,33 @@ static void test_draw_text_layout(BOOL d3d11)
     desc.minLevel = D2D1_FEATURE_LEVEL_DEFAULT;
 
     hr = ID2D1Factory_CreateDxgiSurfaceRenderTarget(factory, ctx.surface, &desc, &rt);
-    ok(SUCCEEDED(hr), "Failed to create a target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID2D1Factory_CreateDxgiSurfaceRenderTarget(factory2, ctx.surface, &desc, &rt2);
-    ok(SUCCEEDED(hr), "Failed to create a target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, &IID_IDWriteFactory, (IUnknown **)&dwrite_factory);
-    ok(SUCCEEDED(hr), "Failed to create factory, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = IDWriteFactory_CreateTextFormat(dwrite_factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL,
         DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"", &text_format);
-    ok(SUCCEEDED(hr), "Failed to create text format, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = IDWriteFactory_CreateTextLayout(dwrite_factory, L"text", 4, text_format, 100.0f, 100.0f, &text_layout);
-    ok(SUCCEEDED(hr), "Failed to create text layout, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_color(&color, 0.0f, 0.0f, 0.0f, 0.0f);
     hr = ID2D1RenderTarget_CreateSolidColorBrush(rt, &color, NULL, &brush);
-    ok(SUCCEEDED(hr), "Failed to create brush, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID2D1RenderTarget_CreateSolidColorBrush(rt2, &color, NULL, &brush2);
-    ok(SUCCEEDED(hr), "Failed to create brush, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     /* effect brush is created from different factory */
     range.startPosition = 0;
     range.length = 4;
     hr = IDWriteTextLayout_SetDrawingEffect(text_layout, (IUnknown*)brush2, range);
-    ok(SUCCEEDED(hr), "Failed to set drawing effect, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1RenderTarget_BeginDraw(rt);
 
@@ -5234,17 +5234,17 @@ static void test_draw_text_layout(BOOL d3d11)
     ID2D1RenderTarget_DrawTextLayout(rt, origin, text_layout, (ID2D1Brush*)brush, D2D1_DRAW_TEXT_OPTIONS_NONE);
 
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    todo_wine ok(hr == D2DERR_WRONG_FACTORY, "Got unexpected hr %#x.\n", hr);
+    todo_wine ok(hr == D2DERR_WRONG_FACTORY, "Got unexpected hr %#lx.\n", hr);
 
     /* Effect is d2d resource, but not a brush. */
     set_rect(&rect, 0.0f, 0.0f, 10.0f, 10.0f);
     hr = ID2D1Factory_CreateRectangleGeometry(factory, &rect, &geometry);
-    ok(SUCCEEDED(hr), "Failed to geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     range.startPosition = 0;
     range.length = 4;
     hr = IDWriteTextLayout_SetDrawingEffect(text_layout, (IUnknown*)geometry, range);
-    ok(SUCCEEDED(hr), "Failed to set drawing effect, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1RectangleGeometry_Release(geometry);
 
     ID2D1RenderTarget_BeginDraw(rt);
@@ -5253,7 +5253,7 @@ static void test_draw_text_layout(BOOL d3d11)
     ID2D1RenderTarget_DrawTextLayout(rt, origin, text_layout, (ID2D1Brush*)brush, D2D1_DRAW_TEXT_OPTIONS_NONE);
 
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "EndDraw() failed, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     for (i = 0; i < ARRAY_SIZE(antialias_mode_tests); ++i)
     {
@@ -5263,7 +5263,7 @@ static void test_draw_text_layout(BOOL d3d11)
 
         hr = IDWriteFactory_CreateCustomRenderingParams(dwrite_factory, 2.0f, 1.0f, 0.0f, DWRITE_PIXEL_GEOMETRY_FLAT,
                 antialias_mode_tests[i].rendering_mode, &rendering_params);
-        ok(SUCCEEDED(hr), "Failed to create custom rendering params, hr %#x.\n", hr);
+        ok(hr == S_OK, "Test %u: Got unexpected hr %#lx.\n", i, hr);
 
         ID2D1RenderTarget_SetTextRenderingParams(rt, rendering_params);
 
@@ -5272,7 +5272,7 @@ static void test_draw_text_layout(BOOL d3d11)
         ID2D1RenderTarget_DrawTextLayout(rt, origin, text_layout, (ID2D1Brush *)brush, D2D1_DRAW_TEXT_OPTIONS_NONE);
 
         hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-        ok(hr == antialias_mode_tests[i].hr, "%u: unexpected hr %#x.\n", i, hr);
+        ok(hr == antialias_mode_tests[i].hr, "Test %u: Got unexpected hr %#lx.\n", i, hr);
 
         IDWriteRenderingParams_Release(rendering_params);
     }
@@ -5343,7 +5343,7 @@ static void test_dc_target(BOOL d3d11)
     release_test_context(&ctx);
 
     hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory);
-    ok(SUCCEEDED(hr), "Failed to create factory, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     for (i = 0; i < ARRAY_SIZE(invalid_formats); ++i)
     {
@@ -5355,7 +5355,7 @@ static void test_dc_target(BOOL d3d11)
         desc.minLevel = D2D1_FEATURE_LEVEL_DEFAULT;
 
         hr = ID2D1Factory_CreateDCRenderTarget(factory, &desc, &rt);
-        ok(hr == D2DERR_UNSUPPORTED_PIXEL_FORMAT, "Got unexpected hr %#x.\n", hr);
+        ok(hr == D2DERR_UNSUPPORTED_PIXEL_FORMAT, "Got unexpected hr %#lx.\n", hr);
     }
 
     desc.type = D2D1_RENDER_TARGET_TYPE_DEFAULT;
@@ -5366,16 +5366,16 @@ static void test_dc_target(BOOL d3d11)
     desc.usage = D2D1_RENDER_TARGET_USAGE_NONE;
     desc.minLevel = D2D1_FEATURE_LEVEL_DEFAULT;
     hr = ID2D1Factory_CreateDCRenderTarget(factory, &desc, &rt);
-    ok(SUCCEEDED(hr), "Failed to create target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID2D1DCRenderTarget_QueryInterface(rt, &IID_ID2D1GdiInteropRenderTarget, (void **)&interop);
-    ok(SUCCEEDED(hr), "Failed to get interop target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1GdiInteropRenderTarget_QueryInterface(interop, &IID_ID2D1RenderTarget, (void **)&rt3);
-    ok(SUCCEEDED(hr), "Failed to get render target back, %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(rt3 == (ID2D1RenderTarget *)rt, "Unexpected render target\n");
     ID2D1RenderTarget_Release(rt3);
     hr = ID2D1GdiInteropRenderTarget_QueryInterface(interop, &IID_ID2D1DCRenderTarget, (void **)&rt2);
-    ok(SUCCEEDED(hr), "Failed to get render target back, %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(rt2 == rt, "Unexpected render target\n");
     ID2D1DCRenderTarget_Release(rt2);
     ID2D1GdiInteropRenderTarget_Release(interop);
@@ -5391,18 +5391,18 @@ static void test_dc_target(BOOL d3d11)
     /* object creation methods work without BindDC() */
     set_color(&color, 0.0f, 0.0f, 0.0f, 0.0f);
     hr = ID2D1DCRenderTarget_CreateSolidColorBrush(rt, &color, NULL, &brush);
-    ok(SUCCEEDED(hr), "Failed to create a brush, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1SolidColorBrush_Release(brush);
 
     ID2D1DCRenderTarget_BeginDraw(rt);
     hr = ID2D1DCRenderTarget_EndDraw(rt, NULL, NULL);
-    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1DCRenderTarget_Release(rt);
 
     /* BindDC() */
     hr = ID2D1Factory_CreateDCRenderTarget(factory, &desc, &rt);
-    ok(SUCCEEDED(hr), "Failed to create target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     aa_mode = ID2D1DCRenderTarget_GetAntialiasMode(rt);
     ok(aa_mode == D2D1_ANTIALIAS_MODE_PER_PRIMITIVE, "Got wrong default aa mode %d.\n", aa_mode);
@@ -5419,7 +5419,7 @@ static void test_dc_target(BOOL d3d11)
 
     SetRect(&rect, 0, 0, 32, 32);
     hr = ID2D1DCRenderTarget_BindDC(rt, NULL, &rect);
-    ok(hr == E_INVALIDARG, "BindDC() returned %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
 
     /* Target properties are retained during BindDC() */
     ID2D1DCRenderTarget_SetTags(rt, 1, 2);
@@ -5431,7 +5431,7 @@ static void test_dc_target(BOOL d3d11)
     ID2D1DCRenderTarget_SetTransform(rt, &matrix);
 
     hr = ID2D1DCRenderTarget_BindDC(rt, hdc, &rect);
-    ok(hr == S_OK, "BindDC() returned %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1DCRenderTarget_GetTags(rt, &t1, &t2);
     ok(t1 == 1 && t2 == 2, "Got wrong tags.\n");
@@ -5460,10 +5460,10 @@ static void test_dc_target(BOOL d3d11)
     ID2D1DCRenderTarget_Clear(rt, &color);
 
     hr = ID2D1DCRenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "EndDraw() failed, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     clr = GetPixel(hdc, 0, 0);
-    ok(clr == RGB(255, 0, 0), "Unexpected color 0x%08x.\n", clr);
+    ok(clr == RGB(255, 0, 0), "Got unexpected colour 0x%08lx.\n", clr);
 
     hdc2 = CreateCompatibleDC(NULL);
     ok(hdc2 != NULL, "Failed to create an HDC.\n");
@@ -5471,14 +5471,14 @@ static void test_dc_target(BOOL d3d11)
     create_target_dibsection(hdc2, 16, 16);
 
     hr = ID2D1DCRenderTarget_BindDC(rt, hdc2, &rect);
-    ok(hr == S_OK, "BindDC() returned %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     clr = GetPixel(hdc2, 0, 0);
-    ok(clr == 0, "Unexpected color 0x%08x.\n", clr);
+    ok(clr == 0, "Got unexpected colour 0x%08lx.\n", clr);
 
     set_color(&color, 0.0f, 1.0f, 0.0f, 1.0f);
     hr = ID2D1DCRenderTarget_CreateSolidColorBrush(rt, &color, NULL, &brush);
-    ok(SUCCEEDED(hr), "Failed to create brush, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1DCRenderTarget_BeginDraw(rt);
 
@@ -5488,19 +5488,19 @@ static void test_dc_target(BOOL d3d11)
     ID2D1DCRenderTarget_FillRectangle(rt, &r, (ID2D1Brush*)brush);
 
     hr = ID2D1DCRenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "EndDraw() failed, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1SolidColorBrush_Release(brush);
 
     clr = GetPixel(hdc2, 0, 0);
-    ok(clr == RGB(0, 255, 0), "Unexpected color 0x%08x.\n", clr);
+    ok(clr == RGB(0, 255, 0), "Got unexpected colour 0x%08lx.\n", clr);
 
     clr = GetPixel(hdc2, 10, 0);
-    ok(clr == 0, "Unexpected color 0x%08x.\n", clr);
+    ok(clr == 0, "Got unexpected colour 0x%08lx.\n", clr);
 
     /* Invalid DC. */
     hr = ID2D1DCRenderTarget_BindDC(rt, (HDC)0xdeadbeef, &rect);
-    todo_wine ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+    todo_wine ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1DCRenderTarget_BeginDraw(rt);
 
@@ -5508,13 +5508,13 @@ static void test_dc_target(BOOL d3d11)
     ID2D1DCRenderTarget_Clear(rt, &color);
 
     hr = ID2D1DCRenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "EndDraw() failed, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     clr = GetPixel(hdc2, 0, 0);
-    todo_wine ok(clr == RGB(255, 0, 0), "Got unexpected colour 0x%08x.\n", clr);
+    todo_wine ok(clr == RGB(255, 0, 0), "Got unexpected colour 0x%08lx.\n", clr);
 
     hr = ID2D1DCRenderTarget_BindDC(rt, NULL, &rect);
-    ok(hr == E_INVALIDARG, "BindDC() returned %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1DCRenderTarget_BeginDraw(rt);
 
@@ -5522,10 +5522,10 @@ static void test_dc_target(BOOL d3d11)
     ID2D1DCRenderTarget_Clear(rt, &color);
 
     hr = ID2D1DCRenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "EndDraw() failed, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     clr = GetPixel(hdc2, 0, 0);
-    todo_wine ok(clr == RGB(0, 0, 255), "Got unexpected colour 0x%08x.\n", clr);
+    todo_wine ok(clr == RGB(0, 0, 255), "Got unexpected colour 0x%08lx.\n", clr);
 
     DeleteDC(hdc);
     DeleteDC(hdc2);
@@ -5550,7 +5550,7 @@ static void test_hwnd_target(BOOL d3d11)
     release_test_context(&ctx);
 
     hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory);
-    ok(SUCCEEDED(hr), "Failed to create factory, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     desc.type = D2D1_RENDER_TARGET_TYPE_DEFAULT;
     desc.pixelFormat.format = DXGI_FORMAT_B8G8R8A8_UNORM;
@@ -5566,25 +5566,25 @@ static void test_hwnd_target(BOOL d3d11)
     hwnd_rt_desc.presentOptions = D2D1_PRESENT_OPTIONS_NONE;
 
     hr = ID2D1Factory_CreateHwndRenderTarget(factory, &desc, &hwnd_rt_desc, &rt);
-    ok(FAILED(hr), "Target creation should fail, hr %#x.\n", hr);
+    ok(hr != S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hwnd_rt_desc.hwnd = (HWND)0xdeadbeef;
     hr = ID2D1Factory_CreateHwndRenderTarget(factory, &desc, &hwnd_rt_desc, &rt);
-    ok(FAILED(hr), "Target creation should fail, hr %#x.\n", hr);
+    ok(hr != S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hwnd_rt_desc.hwnd = CreateWindowA("static", "d2d_test", 0, 0, 0, 0, 0, 0, 0, 0, 0);
     ok(!!hwnd_rt_desc.hwnd, "Failed to create target window.\n");
     hr = ID2D1Factory_CreateHwndRenderTarget(factory, &desc, &hwnd_rt_desc, &rt);
-    ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID2D1HwndRenderTarget_QueryInterface(rt, &IID_ID2D1GdiInteropRenderTarget, (void **)&interop);
-    ok(SUCCEEDED(hr), "Failed to get interop target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1GdiInteropRenderTarget_QueryInterface(interop, &IID_ID2D1RenderTarget, (void **)&rt3);
-    ok(SUCCEEDED(hr), "Failed to get render target back, %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(rt3 == (ID2D1RenderTarget *)rt, "Unexpected render target\n");
     ID2D1RenderTarget_Release(rt3);
     hr = ID2D1GdiInteropRenderTarget_QueryInterface(interop, &IID_ID2D1HwndRenderTarget, (void **)&rt2);
-    ok(SUCCEEDED(hr), "Failed to get render target back, %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(rt2 == rt, "Unexpected render target\n");
     ID2D1HwndRenderTarget_Release(rt2);
     ID2D1GdiInteropRenderTarget_Release(interop);
@@ -5592,7 +5592,7 @@ static void test_hwnd_target(BOOL d3d11)
     size.width = 128;
     size.height = 64;
     hr = ID2D1HwndRenderTarget_Resize(rt, &size);
-    ok(SUCCEEDED(hr), "Failed to resize render target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1HwndRenderTarget_Release(rt);
 
@@ -5634,7 +5634,7 @@ static void test_compatible_target_size_(unsigned int line, ID2D1RenderTarget *r
     {
         hr = ID2D1RenderTarget_CreateCompatibleRenderTarget(rt, size_tests[i].size, size_tests[i].pixel_size,
                 NULL, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, &bitmap_rt);
-        ok_(__FILE__, line)(SUCCEEDED(hr), "%u: Failed to create render target, hr %#x.\n", i, hr);
+        ok_(__FILE__, line)(SUCCEEDED(hr), "%u: Failed to create render target, hr %#lx.\n", i, hr);
 
         if (size_tests[i].pixel_size)
         {
@@ -5671,7 +5671,7 @@ static void test_compatible_target_size_(unsigned int line, ID2D1RenderTarget *r
     pixel_size.height = pixel_size.width = 0;
     hr = ID2D1RenderTarget_CreateCompatibleRenderTarget(rt, NULL, &pixel_size, NULL,
             D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, &bitmap_rt);
-    ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+    ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to create render target, hr %#lx.\n", hr);
 
     if (SUCCEEDED(ID2D1BitmapRenderTarget_QueryInterface(bitmap_rt, &IID_ID2D1DeviceContext, (void **)&context)))
     {
@@ -5717,7 +5717,7 @@ static void test_bitmap_target(BOOL d3d11)
     release_test_context(&ctx);
 
     hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory);
-    ok(SUCCEEDED(hr), "Failed to create factory, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     desc.type = D2D1_RENDER_TARGET_TYPE_DEFAULT;
     desc.pixelFormat.format = DXGI_FORMAT_B8G8R8A8_UNORM;
@@ -5734,22 +5734,22 @@ static void test_bitmap_target(BOOL d3d11)
     hwnd_rt_desc.presentOptions = D2D1_PRESENT_OPTIONS_NONE;
 
     hr = ID2D1Factory_CreateHwndRenderTarget(factory, &desc, &hwnd_rt_desc, &hwnd_rt);
-    ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     test_compatible_target_size((ID2D1RenderTarget *)hwnd_rt);
 
     hr = ID2D1HwndRenderTarget_CreateCompatibleRenderTarget(hwnd_rt, NULL, NULL, NULL,
             D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, &rt);
-    ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID2D1BitmapRenderTarget_QueryInterface(rt, &IID_ID2D1GdiInteropRenderTarget, (void **)&interop);
-    ok(SUCCEEDED(hr), "Failed to get interop target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1GdiInteropRenderTarget_QueryInterface(interop, &IID_ID2D1RenderTarget, (void **)&rt3);
-    ok(SUCCEEDED(hr), "Failed to get render target back, %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(rt3 == (ID2D1RenderTarget *)rt, "Unexpected render target\n");
     ID2D1RenderTarget_Release(rt3);
     hr = ID2D1GdiInteropRenderTarget_QueryInterface(interop, &IID_ID2D1BitmapRenderTarget, (void **)&rt2);
-    ok(SUCCEEDED(hr), "Failed to get render target back, %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(rt2 == rt, "Unexpected render target\n");
     ID2D1BitmapRenderTarget_Release(rt2);
     ID2D1GdiInteropRenderTarget_Release(interop);
@@ -5757,7 +5757,7 @@ static void test_bitmap_target(BOOL d3d11)
     /* See if parent target is referenced. */
     ID2D1HwndRenderTarget_AddRef(hwnd_rt);
     refcount = ID2D1HwndRenderTarget_Release(hwnd_rt);
-    ok(refcount == 1, "Target should not have been referenced, got %u.\n", refcount);
+    ok(refcount == 1, "Target should not have been referenced, got %lu.\n", refcount);
 
     /* Size was not specified, should match parent. */
     pixel_size = ID2D1HwndRenderTarget_GetPixelSize(hwnd_rt);
@@ -5778,7 +5778,7 @@ static void test_bitmap_target(BOOL d3d11)
     set_size_u(&pixel_size, 32, 32);
     hr = ID2D1HwndRenderTarget_CreateCompatibleRenderTarget(hwnd_rt, NULL, &pixel_size, NULL,
             D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, &rt);
-    ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     pixel_size2 = ID2D1BitmapRenderTarget_GetPixelSize(rt);
     ok(!memcmp(&pixel_size, &pixel_size2, sizeof(pixel_size)), "Got target pixel size mismatch.\n");
@@ -5792,7 +5792,7 @@ static void test_bitmap_target(BOOL d3d11)
     set_size_u(&pixel_size, 128, 128);
     hr = ID2D1HwndRenderTarget_CreateCompatibleRenderTarget(hwnd_rt, &size, &pixel_size, NULL,
             D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, &rt);
-    ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     /* Doubled pixel size dimensions with the same DIP size give doubled dpi. */
     ID2D1BitmapRenderTarget_GetDpi(rt, dpi2, dpi2 + 1);
@@ -5804,7 +5804,7 @@ static void test_bitmap_target(BOOL d3d11)
     set_size_f(&size, 70.1f, 70.4f);
     hr = ID2D1HwndRenderTarget_CreateCompatibleRenderTarget(hwnd_rt, &size, NULL, NULL,
             D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, &rt);
-    ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1BitmapRenderTarget_GetDpi(rt, dpi2, dpi2 + 1);
 
@@ -5822,9 +5822,9 @@ static void test_bitmap_target(BOOL d3d11)
 
     /* Check if GetBitmap() returns same instance. */
     hr = ID2D1BitmapRenderTarget_GetBitmap(rt, &bitmap);
-    ok(SUCCEEDED(hr), "GetBitmap() failed, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1BitmapRenderTarget_GetBitmap(rt, &bitmap2);
-    ok(SUCCEEDED(hr), "GetBitmap() failed, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(bitmap == bitmap2, "Got different bitmap instances.\n");
 
     /* Draw something, see if bitmap instance is retained. */
@@ -5832,18 +5832,18 @@ static void test_bitmap_target(BOOL d3d11)
     set_color(&color, 1.0f, 1.0f, 0.0f, 1.0f);
     ID2D1BitmapRenderTarget_Clear(rt, &color);
     hr = ID2D1BitmapRenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "EndDraw() failed, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1Bitmap_Release(bitmap2);
     hr = ID2D1BitmapRenderTarget_GetBitmap(rt, &bitmap2);
-    ok(SUCCEEDED(hr), "GetBitmap() failed, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(bitmap == bitmap2, "Got different bitmap instances.\n");
 
     ID2D1Bitmap_Release(bitmap);
     ID2D1Bitmap_Release(bitmap2);
 
     refcount = ID2D1BitmapRenderTarget_Release(rt);
-    ok(!refcount, "Target should be released, got %u.\n", refcount);
+    ok(!refcount, "Target should be released, got %lu.\n", refcount);
 
     DestroyWindow(hwnd_rt_desc.hwnd);
 
@@ -5856,19 +5856,19 @@ static void test_bitmap_target(BOOL d3d11)
     desc.usage = D2D1_RENDER_TARGET_USAGE_NONE;
     desc.minLevel = D2D1_FEATURE_LEVEL_DEFAULT;
     hr = ID2D1Factory_CreateDCRenderTarget(factory, &desc, &dc_rt);
-    ok(SUCCEEDED(hr), "Failed to create target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     test_compatible_target_size((ID2D1RenderTarget *)dc_rt);
 
     hr = ID2D1DCRenderTarget_CreateCompatibleRenderTarget(dc_rt, NULL, NULL, NULL,
             D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, &rt);
-    ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     pixel_size = ID2D1BitmapRenderTarget_GetPixelSize(rt);
     ok(pixel_size.width == 0 && pixel_size.height == 0, "Got wrong size\n");
 
     hr = ID2D1BitmapRenderTarget_GetBitmap(rt, &bitmap);
-    ok(SUCCEEDED(hr), "GetBitmap() failed, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     pixel_size = ID2D1Bitmap_GetPixelSize(bitmap);
     ok(pixel_size.width == 0 && pixel_size.height == 0, "Got wrong size\n");
     ID2D1Bitmap_Release(bitmap);
@@ -5886,7 +5886,7 @@ static void test_desktop_dpi(BOOL d3d11)
     HRESULT hr;
 
     hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory);
-    ok(SUCCEEDED(hr), "Failed to create factory, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     dpi_x = dpi_y = 0.0f;
     ID2D1Factory_GetDesktopDpi(factory, &dpi_x, &dpi_y);
@@ -5924,7 +5924,7 @@ static void test_stroke_style(BOOL d3d11)
     float dashes[2];
 
     hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory);
-    ok(SUCCEEDED(hr), "Failed to create factory, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     desc.startCap = D2D1_CAP_STYLE_SQUARE;
     desc.endCap = D2D1_CAP_STYLE_ROUND;
@@ -5935,7 +5935,7 @@ static void test_stroke_style(BOOL d3d11)
     desc.dashOffset = -1.0f;
 
     hr = ID2D1Factory_CreateStrokeStyle(factory, &desc, NULL, 0, &style);
-    ok(SUCCEEDED(hr), "Failed to create stroke style, %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     cap_style = ID2D1StrokeStyle_GetStartCap(style);
     ok(cap_style == D2D1_CAP_STYLE_SQUARE, "Unexpected cap style %d.\n", cap_style);
@@ -5964,24 +5964,24 @@ static void test_stroke_style(BOOL d3d11)
     ID2D1StrokeStyle_Release(style);
 
     hr = ID2D1Factory_CreateStrokeStyle(factory, &desc, NULL, 0, &style);
-    ok(hr == E_INVALIDARG, "Unexpected return value, %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID2D1Factory_CreateStrokeStyle(factory, &desc, dashes, 0, &style);
-    ok(hr == E_INVALIDARG, "Unexpected return value, %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID2D1Factory_CreateStrokeStyle(factory, &desc, dashes, 1, &style);
-    ok(hr == S_OK, "Unexpected return value, %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1StrokeStyle_Release(style);
 
     /* Builtin style, dashes are specified. */
     desc.dashStyle = D2D1_DASH_STYLE_DOT;
     hr = ID2D1Factory_CreateStrokeStyle(factory, &desc, dashes, 1, &style);
-    ok(hr == E_INVALIDARG, "Unexpected return value, %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
 
     /* Invalid style. */
     desc.dashStyle = 100;
     hr = ID2D1Factory_CreateStrokeStyle(factory, &desc, NULL, 0, &style);
-    ok(hr == E_INVALIDARG, "Unexpected return value, %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
 
     /* Test returned dash pattern for builtin styles. */
     desc.startCap = D2D1_CAP_STYLE_SQUARE;
@@ -5999,7 +5999,7 @@ static void test_stroke_style(BOOL d3d11)
         desc.dashStyle = dash_style_tests[i].dash_style;
 
         hr = ID2D1Factory_CreateStrokeStyle(factory, &desc, NULL, 0, &style);
-        ok(SUCCEEDED(hr), "Failed to create stroke style, %#x.\n", hr);
+        ok(hr == S_OK, "Test %u: Got unexpected hr %#lx.\n", i, hr);
 
         dash_count = ID2D1StrokeStyle_GetDashesCount(style);
         ok(dash_count == dash_style_tests[i].dash_count, "%u: unexpected dash count %u, expected %u.\n",
@@ -6029,7 +6029,7 @@ static void test_stroke_style(BOOL d3d11)
     /* NULL dashes array, non-zero length. */
     memset(&desc, 0, sizeof(desc));
     hr = ID2D1Factory_CreateStrokeStyle(factory, &desc, NULL, 1, &style);
-    ok(SUCCEEDED(hr), "Failed to create stroke style, %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     count = ID2D1StrokeStyle_GetDashesCount(style);
     ok(count == 0, "Unexpected dashes count %u.\n", count);
@@ -6059,7 +6059,7 @@ static void test_gradient(BOOL d3d11)
     stops2[1] = stops2[0];
     hr = ID2D1RenderTarget_CreateGradientStopCollection(rt, stops2, 2, D2D1_GAMMA_2_2,
             D2D1_EXTEND_MODE_CLAMP, &gradient);
-    ok(SUCCEEDED(hr), "Failed to create stop collection, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     count = ID2D1GradientStopCollection_GetGradientStopCount(gradient);
     ok(count == 2, "Unexpected stop count %u.\n", count);
@@ -6112,7 +6112,7 @@ static void test_draw_geometry(BOOL d3d11)
     ID2D1RenderTarget_SetAntialiasMode(rt, D2D1_ANTIALIAS_MODE_ALIASED);
     set_color(&color, 0.890f, 0.851f, 0.600f, 1.0f);
     hr = ID2D1RenderTarget_CreateSolidColorBrush(rt, &color, NULL, &brush);
-    ok(SUCCEEDED(hr), "Failed to create brush, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1RenderTarget_BeginDraw(rt);
     set_color(&color, 0.396f, 0.180f, 0.537f, 1.0f);
@@ -6149,7 +6149,7 @@ static void test_draw_geometry(BOOL d3d11)
     ID2D1RenderTarget_DrawEllipse(rt, &ellipse, (ID2D1Brush *)brush, 10.0f, NULL);
 
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     match = compare_figure(&ctx,   0,   0, 160, 160, 0xff652e89, 0, "");
     ok(match, "Figure does not match.\n");
@@ -6242,7 +6242,7 @@ static void test_draw_geometry(BOOL d3d11)
     ID2D1RenderTarget_DrawRoundedRectangle(rt, &rounded_rect, (ID2D1Brush *)brush, 10.0f, NULL);
 
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     match = compare_figure(&ctx,   0,   0, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
     todo_wine ok(match, "Figure does not match.\n");
@@ -6336,7 +6336,7 @@ static void test_draw_geometry(BOOL d3d11)
     ID2D1RenderTarget_DrawRoundedRectangle(rt, &rounded_rect, (ID2D1Brush *)brush, 10.0f, NULL);
 
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     match = compare_figure(&ctx,   0,   0, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
     todo_wine ok(match, "Figure does not match.\n");
@@ -6399,9 +6399,9 @@ static void test_draw_geometry(BOOL d3d11)
     todo_wine ok(match, "Figure does not match.\n");
 
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_point(&point, 40.0f, 160.0f);
     ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_FILLED);
@@ -6471,14 +6471,14 @@ static void test_draw_geometry(BOOL d3d11)
 
     ID2D1GeometrySink_SetFillMode(sink, D2D1_FILL_MODE_ALTERNATE);
     hr = ID2D1GeometrySink_Close(sink);
-    ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_Release(sink);
 
     ID2D1RenderTarget_BeginDraw(rt);
     ID2D1RenderTarget_Clear(rt, &color);
     ID2D1RenderTarget_DrawGeometry(rt, (ID2D1Geometry *)geometry, (ID2D1Brush *)brush, 5.0f, NULL);
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1PathGeometry_Release(geometry);
 
     match = compare_figure(&ctx,   0,   0, 160, 160, 0xff652e89, 0, "");
@@ -6550,11 +6550,11 @@ static void test_draw_geometry(BOOL d3d11)
 
     set_rect(&rect, 20.0f, 80.0f, 60.0f, 240.0f);
     hr = ID2D1Factory_CreateRectangleGeometry(factory, &rect, &rect_geometry[0]);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_rect(&rect, -1.0f, -1.0f, 1.0f, 1.0f);
     hr = ID2D1Factory_CreateRectangleGeometry(factory, &rect, &rect_geometry[1]);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_matrix_identity(&matrix);
     translate_matrix(&matrix, 160.0f, 640.0f);
@@ -6562,14 +6562,14 @@ static void test_draw_geometry(BOOL d3d11)
     rotate_matrix(&matrix, M_PI / -5.0f);
     hr = ID2D1Factory_CreateTransformedGeometry(factory,
             (ID2D1Geometry *)rect_geometry[1], &matrix, &transformed_geometry[0]);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_matrix_identity(&matrix);
     scale_matrix(&matrix, 0.5f, 1.0f);
     translate_matrix(&matrix, -80.0f, 0.0f);
     hr = ID2D1Factory_CreateTransformedGeometry(factory,
             (ID2D1Geometry *)transformed_geometry[0], &matrix, &transformed_geometry[1]);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_matrix_identity(&matrix);
     rotate_matrix(&matrix, M_PI / 2.0f);
@@ -6577,7 +6577,7 @@ static void test_draw_geometry(BOOL d3d11)
     scale_matrix(&matrix, 2.0f, 0.25f);
     hr = ID2D1Factory_CreateTransformedGeometry(factory,
             (ID2D1Geometry *)transformed_geometry[1], &matrix, &transformed_geometry[2]);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1RenderTarget_BeginDraw(rt);
     ID2D1RenderTarget_Clear(rt, &color);
@@ -6586,7 +6586,7 @@ static void test_draw_geometry(BOOL d3d11)
     ID2D1RenderTarget_DrawGeometry(rt, (ID2D1Geometry *)transformed_geometry[1], (ID2D1Brush *)brush, 5.0f, NULL);
     ID2D1RenderTarget_DrawGeometry(rt, (ID2D1Geometry *)transformed_geometry[2], (ID2D1Brush *)brush, 15.0f, NULL);
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1TransformedGeometry_Release(transformed_geometry[2]);
     ID2D1TransformedGeometry_Release(transformed_geometry[1]);
     ID2D1TransformedGeometry_Release(transformed_geometry[0]);
@@ -6653,9 +6653,9 @@ static void test_draw_geometry(BOOL d3d11)
     ok(match, "Figure does not match.\n");
 
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_point(&point, 20.0f, 80.0f);
     ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_HOLLOW);
@@ -6754,14 +6754,14 @@ static void test_draw_geometry(BOOL d3d11)
     ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_OPEN);
 
     hr = ID2D1GeometrySink_Close(sink);
-    ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_Release(sink);
 
     ID2D1RenderTarget_BeginDraw(rt);
     ID2D1RenderTarget_Clear(rt, &color);
     ID2D1RenderTarget_DrawGeometry(rt, (ID2D1Geometry *)geometry, (ID2D1Brush *)brush, 10.0f, NULL);
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1PathGeometry_Release(geometry);
 
     match = compare_figure(&ctx,   0,   0, 160, 160, 0xff652e89, 0,
@@ -6876,9 +6876,9 @@ static void test_draw_geometry(BOOL d3d11)
     ok(match, "Figure does not match.\n");
 
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_point(&point, -0.402914f, 0.915514f);
     ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_HOLLOW);
@@ -6897,7 +6897,7 @@ static void test_draw_geometry(BOOL d3d11)
     ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED);
 
     hr = ID2D1GeometrySink_Close(sink);
-    ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_Release(sink);
 
     set_matrix_identity(&matrix);
@@ -6905,7 +6905,7 @@ static void test_draw_geometry(BOOL d3d11)
     scale_matrix(&matrix, 20.0f, 80.0f);
     hr = ID2D1Factory_CreateTransformedGeometry(factory,
             (ID2D1Geometry *)geometry, &matrix, &transformed_geometry[0]);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_matrix_identity(&matrix);
     translate_matrix(&matrix, 160.0f, 640.0f);
@@ -6913,7 +6913,7 @@ static void test_draw_geometry(BOOL d3d11)
     rotate_matrix(&matrix, M_PI / -5.0f);
     hr = ID2D1Factory_CreateTransformedGeometry(factory,
             (ID2D1Geometry *)geometry, &matrix, &transformed_geometry[1]);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1PathGeometry_Release(geometry);
 
     set_matrix_identity(&matrix);
@@ -6921,7 +6921,7 @@ static void test_draw_geometry(BOOL d3d11)
     translate_matrix(&matrix, -80.0f, 0.0f);
     hr = ID2D1Factory_CreateTransformedGeometry(factory,
             (ID2D1Geometry *)transformed_geometry[1], &matrix, &transformed_geometry[2]);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_matrix_identity(&matrix);
     rotate_matrix(&matrix, M_PI / 2.0f);
@@ -6929,7 +6929,7 @@ static void test_draw_geometry(BOOL d3d11)
     scale_matrix(&matrix, 2.0f, 0.25f);
     hr = ID2D1Factory_CreateTransformedGeometry(factory,
             (ID2D1Geometry *)transformed_geometry[2], &matrix, &transformed_geometry[3]);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1RenderTarget_BeginDraw(rt);
     ID2D1RenderTarget_Clear(rt, &color);
@@ -6938,7 +6938,7 @@ static void test_draw_geometry(BOOL d3d11)
     ID2D1RenderTarget_DrawGeometry(rt, (ID2D1Geometry *)transformed_geometry[2], (ID2D1Brush *)brush, 5.0f, NULL);
     ID2D1RenderTarget_DrawGeometry(rt, (ID2D1Geometry *)transformed_geometry[3], (ID2D1Brush *)brush, 15.0f, NULL);
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1TransformedGeometry_Release(transformed_geometry[3]);
     ID2D1TransformedGeometry_Release(transformed_geometry[2]);
     ID2D1TransformedGeometry_Release(transformed_geometry[1]);
@@ -6990,9 +6990,9 @@ static void test_draw_geometry(BOOL d3d11)
     ok(match, "Figure does not match.\n");
 
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_point(&point, 20.0f, 80.0f);
     ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_HOLLOW);
@@ -7005,14 +7005,14 @@ static void test_draw_geometry(BOOL d3d11)
     ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_OPEN);
 
     hr = ID2D1GeometrySink_Close(sink);
-    ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_Release(sink);
 
     ID2D1RenderTarget_BeginDraw(rt);
     ID2D1RenderTarget_Clear(rt, &color);
     ID2D1RenderTarget_DrawGeometry(rt, (ID2D1Geometry *)geometry, (ID2D1Brush *)brush, 10.0f, NULL);
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1PathGeometry_Release(geometry);
 
     match = compare_figure(&ctx,   0,   0, 160, 160, 0xff652e89, 32,
@@ -7062,7 +7062,7 @@ static void test_fill_geometry(BOOL d3d11)
     ID2D1RenderTarget_SetAntialiasMode(rt, D2D1_ANTIALIAS_MODE_ALIASED);
     set_color(&color, 0.890f, 0.851f, 0.600f, 1.0f);
     hr = ID2D1RenderTarget_CreateSolidColorBrush(rt, &color, NULL, &brush);
-    ok(SUCCEEDED(hr), "Failed to create brush, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1RenderTarget_BeginDraw(rt);
     set_color(&color, 0.396f, 0.180f, 0.537f, 1.0f);
@@ -7087,7 +7087,7 @@ static void test_fill_geometry(BOOL d3d11)
     ID2D1RenderTarget_FillEllipse(rt, &ellipse, (ID2D1Brush *)brush);
 
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     match = compare_figure(&ctx,   0, 160, 160, 160, 0xff652e89, 0, "gMgB");
     ok(match, "Figure does not match.\n");
@@ -7145,7 +7145,7 @@ static void test_fill_geometry(BOOL d3d11)
     ID2D1RenderTarget_FillRoundedRectangle(rt, &rounded_rect, (ID2D1Brush *)brush);
 
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     match = compare_figure(&ctx,   0,   0, 160, 160, 0xff652e89, 0, "gMgB");
     ok(match, "Figure does not match.\n");
@@ -7215,7 +7215,7 @@ static void test_fill_geometry(BOOL d3d11)
     ID2D1RenderTarget_FillRoundedRectangle(rt, &rounded_rect, (ID2D1Brush *)brush);
 
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     match = compare_figure(&ctx,   0,   0, 160, 160, 0xff652e89, 0, "gMgB");
     ok(match, "Figure does not match.\n");
@@ -7254,9 +7254,9 @@ static void test_fill_geometry(BOOL d3d11)
     ok(match, "Figure does not match.\n");
 
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_point(&point, 40.0f, 160.0f);
     ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_FILLED);
@@ -7326,14 +7326,14 @@ static void test_fill_geometry(BOOL d3d11)
 
     ID2D1GeometrySink_SetFillMode(sink, D2D1_FILL_MODE_ALTERNATE);
     hr = ID2D1GeometrySink_Close(sink);
-    ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_Release(sink);
 
     ID2D1RenderTarget_BeginDraw(rt);
     ID2D1RenderTarget_Clear(rt, &color);
     ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)geometry, (ID2D1Brush *)brush, NULL);
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1PathGeometry_Release(geometry);
 
     match = compare_figure(&ctx,   0,   0, 160, 160, 0xff652e89, 0, "gMgB");
@@ -7381,11 +7381,11 @@ static void test_fill_geometry(BOOL d3d11)
 
     set_rect(&rect, 20.0f, 80.0f, 60.0f, 240.0f);
     hr = ID2D1Factory_CreateRectangleGeometry(factory, &rect, &rect_geometry[0]);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_rect(&rect, -1.0f, -1.0f, 1.0f, 1.0f);
     hr = ID2D1Factory_CreateRectangleGeometry(factory, &rect, &rect_geometry[1]);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_matrix_identity(&matrix);
     translate_matrix(&matrix, 160.0f, 640.0f);
@@ -7393,14 +7393,14 @@ static void test_fill_geometry(BOOL d3d11)
     rotate_matrix(&matrix, M_PI / -5.0f);
     hr = ID2D1Factory_CreateTransformedGeometry(factory,
             (ID2D1Geometry *)rect_geometry[1], &matrix, &transformed_geometry[0]);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_matrix_identity(&matrix);
     scale_matrix(&matrix, 0.5f, 1.0f);
     translate_matrix(&matrix, -80.0f, 0.0f);
     hr = ID2D1Factory_CreateTransformedGeometry(factory,
             (ID2D1Geometry *)transformed_geometry[0], &matrix, &transformed_geometry[1]);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_matrix_identity(&matrix);
     rotate_matrix(&matrix, M_PI / 2.0f);
@@ -7408,7 +7408,7 @@ static void test_fill_geometry(BOOL d3d11)
     scale_matrix(&matrix, 2.0f, 0.25f);
     hr = ID2D1Factory_CreateTransformedGeometry(factory,
             (ID2D1Geometry *)transformed_geometry[1], &matrix, &transformed_geometry[2]);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1RenderTarget_BeginDraw(rt);
     ID2D1RenderTarget_Clear(rt, &color);
@@ -7417,7 +7417,7 @@ static void test_fill_geometry(BOOL d3d11)
     ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)transformed_geometry[1], (ID2D1Brush *)brush, NULL);
     ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)transformed_geometry[2], (ID2D1Brush *)brush, NULL);
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1TransformedGeometry_Release(transformed_geometry[2]);
     ID2D1TransformedGeometry_Release(transformed_geometry[1]);
     ID2D1TransformedGeometry_Release(transformed_geometry[0]);
@@ -7463,9 +7463,9 @@ static void test_fill_geometry(BOOL d3d11)
     ok(match, "Figure does not match.\n");
 
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_point(&point, 20.0f, 80.0f);
     ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_FILLED);
@@ -7564,14 +7564,14 @@ static void test_fill_geometry(BOOL d3d11)
     ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_OPEN);
 
     hr = ID2D1GeometrySink_Close(sink);
-    ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_Release(sink);
 
     ID2D1RenderTarget_BeginDraw(rt);
     ID2D1RenderTarget_Clear(rt, &color);
     ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)geometry, (ID2D1Brush *)brush, NULL);
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1PathGeometry_Release(geometry);
 
     match = compare_figure(&ctx,   0,   0, 160, 160, 0xff652e89, 0,
@@ -7645,9 +7645,9 @@ static void test_fill_geometry(BOOL d3d11)
     ok(match, "Figure does not match.\n");
 
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_point(&point, -0.402914f, 0.915514f);
     ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_FILLED);
@@ -7666,7 +7666,7 @@ static void test_fill_geometry(BOOL d3d11)
     ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED);
 
     hr = ID2D1GeometrySink_Close(sink);
-    ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_Release(sink);
 
     set_matrix_identity(&matrix);
@@ -7674,7 +7674,7 @@ static void test_fill_geometry(BOOL d3d11)
     scale_matrix(&matrix, 20.0f, 80.0f);
     hr = ID2D1Factory_CreateTransformedGeometry(factory,
             (ID2D1Geometry *)geometry, &matrix, &transformed_geometry[0]);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_matrix_identity(&matrix);
     translate_matrix(&matrix, 160.0f, 640.0f);
@@ -7682,7 +7682,7 @@ static void test_fill_geometry(BOOL d3d11)
     rotate_matrix(&matrix, M_PI / -5.0f);
     hr = ID2D1Factory_CreateTransformedGeometry(factory,
             (ID2D1Geometry *)geometry, &matrix, &transformed_geometry[1]);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1PathGeometry_Release(geometry);
 
     set_matrix_identity(&matrix);
@@ -7690,7 +7690,7 @@ static void test_fill_geometry(BOOL d3d11)
     translate_matrix(&matrix, -80.0f, 0.0f);
     hr = ID2D1Factory_CreateTransformedGeometry(factory,
             (ID2D1Geometry *)transformed_geometry[1], &matrix, &transformed_geometry[2]);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_matrix_identity(&matrix);
     rotate_matrix(&matrix, M_PI / 2.0f);
@@ -7698,7 +7698,7 @@ static void test_fill_geometry(BOOL d3d11)
     scale_matrix(&matrix, 2.0f, 0.25f);
     hr = ID2D1Factory_CreateTransformedGeometry(factory,
             (ID2D1Geometry *)transformed_geometry[2], &matrix, &transformed_geometry[3]);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1RenderTarget_BeginDraw(rt);
     ID2D1RenderTarget_Clear(rt, &color);
@@ -7707,7 +7707,7 @@ static void test_fill_geometry(BOOL d3d11)
     ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)transformed_geometry[2], (ID2D1Brush *)brush, NULL);
     ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)transformed_geometry[3], (ID2D1Brush *)brush, NULL);
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1TransformedGeometry_Release(transformed_geometry[3]);
     ID2D1TransformedGeometry_Release(transformed_geometry[2]);
     ID2D1TransformedGeometry_Release(transformed_geometry[1]);
@@ -7749,9 +7749,9 @@ static void test_fill_geometry(BOOL d3d11)
     ok(match, "Figure does not match.\n");
 
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_point(&point, -0.402914f, 0.915514f);
     ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_HOLLOW);
@@ -7770,7 +7770,7 @@ static void test_fill_geometry(BOOL d3d11)
     ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED);
 
     hr = ID2D1GeometrySink_Close(sink);
-    ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_Release(sink);
 
     set_matrix_identity(&matrix);
@@ -7778,7 +7778,7 @@ static void test_fill_geometry(BOOL d3d11)
     scale_matrix(&matrix, 20.0f, 80.0f);
     hr = ID2D1Factory_CreateTransformedGeometry(factory,
             (ID2D1Geometry *)geometry, &matrix, &transformed_geometry[0]);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_matrix_identity(&matrix);
     translate_matrix(&matrix, 160.0f, 640.0f);
@@ -7786,7 +7786,7 @@ static void test_fill_geometry(BOOL d3d11)
     rotate_matrix(&matrix, M_PI / -5.0f);
     hr = ID2D1Factory_CreateTransformedGeometry(factory,
             (ID2D1Geometry *)geometry, &matrix, &transformed_geometry[1]);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1PathGeometry_Release(geometry);
 
     set_matrix_identity(&matrix);
@@ -7794,7 +7794,7 @@ static void test_fill_geometry(BOOL d3d11)
     translate_matrix(&matrix, -80.0f, 0.0f);
     hr = ID2D1Factory_CreateTransformedGeometry(factory,
             (ID2D1Geometry *)transformed_geometry[1], &matrix, &transformed_geometry[2]);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_matrix_identity(&matrix);
     rotate_matrix(&matrix, M_PI / 2.0f);
@@ -7802,7 +7802,7 @@ static void test_fill_geometry(BOOL d3d11)
     scale_matrix(&matrix, 2.0f, 0.25f);
     hr = ID2D1Factory_CreateTransformedGeometry(factory,
             (ID2D1Geometry *)transformed_geometry[2], &matrix, &transformed_geometry[3]);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1RenderTarget_BeginDraw(rt);
     ID2D1RenderTarget_Clear(rt, &color);
@@ -7811,7 +7811,7 @@ static void test_fill_geometry(BOOL d3d11)
     ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)transformed_geometry[2], (ID2D1Brush *)brush, NULL);
     ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)transformed_geometry[3], (ID2D1Brush *)brush, NULL);
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1TransformedGeometry_Release(transformed_geometry[3]);
     ID2D1TransformedGeometry_Release(transformed_geometry[2]);
     ID2D1TransformedGeometry_Release(transformed_geometry[1]);
@@ -7851,15 +7851,15 @@ static void test_gdi_interop(BOOL d3d11)
         return;
 
     hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory);
-    ok(SUCCEEDED(hr), "Failed to create factory, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
             &IID_IWICImagingFactory, (void **)&wic_factory);
-    ok(SUCCEEDED(hr), "Failed to create WIC imaging factory, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = IWICImagingFactory_CreateBitmap(wic_factory, 16, 16,
             &GUID_WICPixelFormat32bppPBGRA, WICBitmapCacheOnDemand, &wic_bitmap);
-    ok(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     IWICImagingFactory_Release(wic_factory);
 
     /* WIC target, default usage */
@@ -7872,19 +7872,19 @@ static void test_gdi_interop(BOOL d3d11)
     desc.minLevel = D2D1_FEATURE_LEVEL_DEFAULT;
 
     hr = ID2D1Factory_CreateWicBitmapRenderTarget(factory, wic_bitmap, &desc, &rt);
-    ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID2D1RenderTarget_QueryInterface(rt, &IID_ID2D1GdiInteropRenderTarget, (void **)&interop);
-    ok(SUCCEEDED(hr), "Failed to get gdi interop interface, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1RenderTarget_BeginDraw(rt);
     dc = (void *)0xdeadbeef;
     hr = ID2D1GdiInteropRenderTarget_GetDC(interop, D2D1_DC_INITIALIZE_MODE_COPY, &dc);
-    ok(FAILED(hr), "GetDC() was expected to fail, hr %#x.\n", hr);
+    ok(hr != S_OK, "Got unexpected hr %#lx.\n", hr);
     todo_wine ok(!dc, "Got unexpected DC %p.\n", dc);
     ID2D1GdiInteropRenderTarget_Release(interop);
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1RenderTarget_Release(rt);
 
@@ -7892,25 +7892,25 @@ static void test_gdi_interop(BOOL d3d11)
     desc.usage = D2D1_RENDER_TARGET_USAGE_GDI_COMPATIBLE;
 
     hr = ID2D1Factory_CreateWicBitmapRenderTarget(factory, wic_bitmap, &desc, &rt);
-    ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID2D1RenderTarget_QueryInterface(rt, &IID_ID2D1GdiInteropRenderTarget, (void **)&interop);
-    ok(SUCCEEDED(hr), "Failed to get gdi interop interface, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1RenderTarget_BeginDraw(rt);
     dc = NULL;
     hr = ID2D1GdiInteropRenderTarget_GetDC(interop, D2D1_DC_INITIALIZE_MODE_COPY, &dc);
-    ok(SUCCEEDED(hr), "GetDC() was expected to succeed, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(dc != NULL, "Expected NULL dc, got %p.\n", dc);
     ID2D1GdiInteropRenderTarget_ReleaseDC(interop, NULL);
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "EndDraw() failed, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1RenderTarget_BeginDraw(rt);
     set_color(&color, 1.0f, 0.0f, 0.0f, 1.0f);
     ID2D1RenderTarget_Clear(rt, &color);
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "EndDraw() failed, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     match = compare_wic_bitmap(wic_bitmap, "54034063dbc1c1bb61cb60ec57e4498678dc2b13");
     ok(match, "Bitmap does not match.\n");
@@ -7919,37 +7919,37 @@ static void test_gdi_interop(BOOL d3d11)
     ID2D1RenderTarget_BeginDraw(rt);
 
     hr = ID2D1GdiInteropRenderTarget_GetDC(interop, D2D1_DC_INITIALIZE_MODE_COPY, &dc);
-    ok(SUCCEEDED(hr), "GetDC() was expected to succeed, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     SetRect(&rect, 0, 0, 16, 16);
     FillRect(dc, &rect, GetStockObject(BLACK_BRUSH));
     ID2D1GdiInteropRenderTarget_ReleaseDC(interop, NULL);
 
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "EndDraw() failed, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     match = compare_wic_bitmap(wic_bitmap, "60cacbf3d72e1e7834203da608037b1bf83b40e8");
     ok(match, "Bitmap does not match.\n");
 
     /* Bitmap is locked at BeginDraw(). */
     hr = IWICBitmap_Lock(wic_bitmap, NULL, WICBitmapLockRead, &wic_lock);
-    ok(SUCCEEDED(hr), "Expected bitmap to be unlocked, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     IWICBitmapLock_Release(wic_lock);
 
     ID2D1RenderTarget_BeginDraw(rt);
     hr = IWICBitmap_Lock(wic_bitmap, NULL, WICBitmapLockRead, &wic_lock);
-    todo_wine ok(hr == WINCODEC_ERR_ALREADYLOCKED, "Got unexpected hr %#x.\n", hr);
+    todo_wine ok(hr == WINCODEC_ERR_ALREADYLOCKED, "Got unexpected hr %#lx.\n", hr);
     if (SUCCEEDED(hr))
         IWICBitmapLock_Release(wic_lock);
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "EndDraw() failed, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     /* Lock before BeginDraw(). */
     hr = IWICBitmap_Lock(wic_bitmap, NULL, WICBitmapLockRead, &wic_lock);
-    ok(SUCCEEDED(hr), "Expected bitmap to be unlocked, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1RenderTarget_BeginDraw(rt);
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    todo_wine ok(hr == WINCODEC_ERR_ALREADYLOCKED, "Got unexpected hr %#x.\n", hr);
+    todo_wine ok(hr == WINCODEC_ERR_ALREADYLOCKED, "Got unexpected hr %#lx.\n", hr);
     IWICBitmapLock_Release(wic_lock);
 
     ID2D1GdiInteropRenderTarget_Release(interop);
@@ -7979,7 +7979,7 @@ static void test_layer(BOOL d3d11)
     ID2D1RenderTarget_SetAntialiasMode(rt, D2D1_ANTIALIAS_MODE_ALIASED);
 
     hr = ID2D1RenderTarget_CreateLayer(rt, NULL, &layer);
-    ok(SUCCEEDED(hr), "Failed to create layer, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1Layer_GetFactory(layer, &layer_factory);
     ok(layer_factory == factory, "Got unexpected layer factory %p, expected %p.\n", layer_factory, factory);
     ID2D1Factory_Release(layer_factory);
@@ -7990,7 +7990,7 @@ static void test_layer(BOOL d3d11)
 
     set_size_f(&size, 800.0f, 600.0f);
     hr = ID2D1RenderTarget_CreateLayer(rt, &size, &layer);
-    ok(SUCCEEDED(hr), "Failed to create layer, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     size = ID2D1Layer_GetSize(layer);
     ok(size.width == 800.0f, "Got unexpected width %.8e.\n", size.width);
     ok(size.height == 600.0f, "Got unexpected height %.8e.\n", size.height);
@@ -8023,12 +8023,12 @@ static void test_bezier_intersect(BOOL d3d11)
     ID2D1RenderTarget_SetAntialiasMode(rt, D2D1_ANTIALIAS_MODE_ALIASED);
     set_color(&color, 0.890f, 0.851f, 0.600f, 1.0f);
     hr = ID2D1RenderTarget_CreateSolidColorBrush(rt, &color, NULL, &brush);
-    ok(SUCCEEDED(hr), "Failed to create brush, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_point(&point, 160.0f, 720.0f);
     ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_FILLED);
@@ -8049,7 +8049,7 @@ static void test_bezier_intersect(BOOL d3d11)
     ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED);
 
     hr = ID2D1GeometrySink_Close(sink);
-    ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_Release(sink);
 
     ID2D1RenderTarget_BeginDraw(rt);
@@ -8057,7 +8057,7 @@ static void test_bezier_intersect(BOOL d3d11)
     ID2D1RenderTarget_Clear(rt, &color);
     ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)geometry, (ID2D1Brush *)brush, NULL);
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1PathGeometry_Release(geometry);
 
     match = compare_figure(&ctx, 160, 120, 320, 240, 0xff652e89, 2048,
@@ -8087,9 +8087,9 @@ static void test_bezier_intersect(BOOL d3d11)
     ok(match, "Figure does not match.\n");
 
     hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
-    ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(geometry, &sink);
-    ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_point(&point, 240.0f, 720.0f);
     ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_FILLED);
@@ -8100,14 +8100,14 @@ static void test_bezier_intersect(BOOL d3d11)
     ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED);
 
     hr = ID2D1GeometrySink_Close(sink);
-    ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_Release(sink);
 
     ID2D1RenderTarget_BeginDraw(rt);
     ID2D1RenderTarget_Clear(rt, &color);
     ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)geometry, (ID2D1Brush *)brush, NULL);
     hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1PathGeometry_Release(geometry);
 
     match = compare_figure(&ctx, 160, 120, 320, 240, 0xff652e89, 2048,
@@ -8155,7 +8155,7 @@ static void test_create_device(BOOL d3d11)
     }
 
     hr = ID2D1Factory1_CreateDevice(factory, ctx.device, &device);
-    ok(SUCCEEDED(hr), "Failed to get ID2D1Device, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1Device_GetFactory(device, &factory2);
     ok(factory2 == (ID2D1Factory *)factory, "Got unexpected factory %p, expected %p.\n", factory2, factory);
@@ -8165,11 +8165,11 @@ static void test_create_device(BOOL d3d11)
     if (pD2D1CreateDevice)
     {
         hr = pD2D1CreateDevice(ctx.device, NULL, &device);
-        ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+        ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
         ID2D1Device_Release(device);
 
         hr = pD2D1CreateDevice(ctx.device, &properties, &device);
-        ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+        ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
         ID2D1Device_Release(device);
     }
     else
@@ -8178,7 +8178,7 @@ static void test_create_device(BOOL d3d11)
     release_test_context(&ctx);
 
     refcount = ID2D1Factory1_Release(factory);
-    ok(!refcount, "Factory has %u references left.\n", refcount);
+    ok(!refcount, "Factory has %lu references left.\n", refcount);
 }
 
 #define check_rt_bitmap_surface(r, s, o) check_rt_bitmap_surface_(__LINE__, r, s, o)
@@ -8207,7 +8207,7 @@ static void check_rt_bitmap_surface_(unsigned int line, ID2D1RenderTarget *rt, B
     bitmap_desc.dpiX = 96.0f;
     bitmap_desc.dpiY = 96.0f;
     hr = ID2D1RenderTarget_CreateBitmap(rt, size, bitmap_data, sizeof(*bitmap_data), &bitmap_desc, &bitmap);
-    ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+    ok_(__FILE__, line)(hr == S_OK, "Failed to create bitmap, hr %#lx.\n", hr);
 
     check_bitmap_surface_(line, bitmap, has_surface, options);
 
@@ -8216,19 +8216,19 @@ static void check_rt_bitmap_surface_(unsigned int line, ID2D1RenderTarget *rt, B
     /* Zero sized bitmaps. */
     set_size_u(&size, 0, 0);
     hr = ID2D1RenderTarget_CreateBitmap(rt, size, NULL, 0, &bitmap_desc, &bitmap);
-    ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+    ok_(__FILE__, line)(hr == S_OK, "Failed to create bitmap, hr %#lx.\n", hr);
     check_bitmap_surface_(line, bitmap, has_surface, options);
     ID2D1Bitmap_Release(bitmap);
 
     set_size_u(&size, 2, 0);
     hr = ID2D1RenderTarget_CreateBitmap(rt, size, NULL, 0, &bitmap_desc, &bitmap);
-    ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+    ok_(__FILE__, line)(hr == S_OK, "Failed to create bitmap, hr %#lx.\n", hr);
     check_bitmap_surface_(line, bitmap, has_surface, options);
     ID2D1Bitmap_Release(bitmap);
 
     set_size_u(&size, 0, 2);
     hr = ID2D1RenderTarget_CreateBitmap(rt, size, NULL, 0, &bitmap_desc, &bitmap);
-    ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+    ok_(__FILE__, line)(hr == S_OK, "Failed to create bitmap, hr %#lx.\n", hr);
     check_bitmap_surface_(line, bitmap, has_surface, options);
     ID2D1Bitmap_Release(bitmap);
 
@@ -8237,15 +8237,15 @@ static void check_rt_bitmap_surface_(unsigned int line, ID2D1RenderTarget *rt, B
 
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
             &IID_IWICImagingFactory, (void **)&wic_factory);
-    ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to create WIC imaging factory, hr %#x.\n", hr);
+    ok_(__FILE__, line)(hr == S_OK, "Failed to create WIC imaging factory, hr %#lx.\n", hr);
 
     hr = IWICImagingFactory_CreateBitmap(wic_factory, 16, 16,
             &GUID_WICPixelFormat32bppPBGRA, WICBitmapCacheOnDemand, &wic_bitmap);
-    ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to create WIC bitmap, hr %#x.\n", hr);
+    ok_(__FILE__, line)(hr == S_OK, "Failed to create WIC bitmap, hr %#lx.\n", hr);
     IWICImagingFactory_Release(wic_factory);
 
     hr = ID2D1RenderTarget_CreateBitmapFromWicBitmap(rt, (IWICBitmapSource *)wic_bitmap, NULL, &bitmap);
-    ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to create bitmap from WIC source, hr %#x.\n", hr);
+    ok_(__FILE__, line)(hr == S_OK, "Failed to create bitmap from WIC source, hr %#lx.\n", hr);
 
     check_bitmap_surface_(line, bitmap, has_surface, options);
 
@@ -8255,7 +8255,7 @@ static void check_rt_bitmap_surface_(unsigned int line, ID2D1RenderTarget *rt, B
 
     /* Compatible target follows its parent. */
     hr = ID2D1RenderTarget_QueryInterface(rt, &IID_ID2D1DeviceContext, (void **)&context);
-    ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to get device context, hr %#x.\n", hr);
+    ok_(__FILE__, line)(hr == S_OK, "Failed to get device context, hr %#lx.\n", hr);
 
     dc_rt = NULL;
     ID2D1RenderTarget_QueryInterface(rt, &IID_ID2D1DCRenderTarget, (void **)&dc_rt);
@@ -8289,10 +8289,10 @@ static void check_rt_bitmap_surface_(unsigned int line, ID2D1RenderTarget *rt, B
 
         hr = ID2D1RenderTarget_CreateCompatibleRenderTarget(rt, NULL, NULL, NULL,
                 D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, &compatible_rt);
-        ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to create compatible render target, hr %#x.\n", hr);
+        ok_(__FILE__, line)(hr == S_OK, "Failed to create compatible render target, hr %#lx.\n", hr);
 
         hr = ID2D1BitmapRenderTarget_QueryInterface(compatible_rt, &IID_ID2D1DeviceContext, (void **)&context2);
-        ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to get device context, hr %#x.\n", hr);
+        ok_(__FILE__, line)(hr == S_OK, "Failed to get device context, hr %#lx.\n", hr);
 
         ID2D1DeviceContext_GetDevice(context2, &device2);
         ok_(__FILE__, line)(device == device2, "Unexpected device.\n");
@@ -8302,12 +8302,12 @@ static void check_rt_bitmap_surface_(unsigned int line, ID2D1RenderTarget *rt, B
 
         hr = ID2D1BitmapRenderTarget_CreateBitmap(compatible_rt, size,
                 bitmap_data, sizeof(*bitmap_data), &bitmap_desc, &bitmap);
-        ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+        ok_(__FILE__, line)(hr == S_OK, "Failed to create bitmap, hr %#lx.\n", hr);
         check_bitmap_surface_(line, bitmap, has_surface, options);
         ID2D1Bitmap_Release(bitmap);
 
         hr = ID2D1BitmapRenderTarget_GetBitmap(compatible_rt, &bitmap);
-        ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to get compatible target bitmap, hr %#x.\n", hr);
+        ok_(__FILE__, line)(hr == S_OK, "Failed to get compatible target bitmap, hr %#lx.\n", hr);
 
         bitmap2 = NULL;
         ID2D1DeviceContext_GetTarget(context2, (ID2D1Image **)&bitmap2);
@@ -8324,7 +8324,7 @@ static void check_rt_bitmap_surface_(unsigned int line, ID2D1RenderTarget *rt, B
     {
         hr = ID2D1RenderTarget_CreateCompatibleRenderTarget(rt, NULL, NULL, NULL,
                  D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, &compatible_rt);
-        ok_(__FILE__, line)(hr == WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT, "Unexpected hr %#x.\n", hr);
+        ok_(__FILE__, line)(hr == WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT, "Unexpected hr %#lx.\n", hr);
     }
 
     ID2D1DeviceContext_Release(context);
@@ -8355,13 +8355,13 @@ static IDXGISurface *create_surface(IDXGIDevice *dxgi_device, DXGI_FORMAT format
     texture_desc.MiscFlags = 0;
 
     hr = IDXGIDevice_QueryInterface(dxgi_device, &IID_ID3D10Device, (void **)&d3d_device);
-    ok(SUCCEEDED(hr), "Failed to get device interface, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID3D10Device_CreateTexture2D(d3d_device, &texture_desc, NULL, &texture);
-    ok(SUCCEEDED(hr), "Failed to create a texture, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID3D10Texture2D_QueryInterface(texture, &IID_IDXGISurface, (void **)&surface);
-    ok(SUCCEEDED(hr), "Failed to get surface interface, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID3D10Device_Release(d3d_device);
     ID3D10Texture2D_Release(texture);
@@ -8428,7 +8428,7 @@ static void test_bitmap_surface(BOOL d3d11)
 
     /* DXGI target */
     hr = ID2D1RenderTarget_QueryInterface(ctx.rt, &IID_ID2D1DeviceContext, (void **)&device_context);
-    ok(SUCCEEDED(hr), "Failed to get device context, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     bitmap = NULL;
     ID2D1DeviceContext_GetTarget(device_context, (ID2D1Image **)&bitmap);
@@ -8442,10 +8442,10 @@ static void test_bitmap_surface(BOOL d3d11)
 
     /* Bitmap created from DXGI surface. */
     hr = ID2D1Factory1_CreateDevice(factory, ctx.device, &device);
-    ok(SUCCEEDED(hr), "Failed to get ID2D1Device, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID2D1Device_CreateDeviceContext(device, D2D1_DEVICE_CONTEXT_OPTIONS_NONE, &device_context);
-    ok(SUCCEEDED(hr), "Failed to create device context, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     for (i = 0; i < ARRAY_SIZE(bitmap_format_tests); ++i)
     {
@@ -8455,7 +8455,7 @@ static void test_bitmap_surface(BOOL d3d11)
 
         hr = ID2D1DeviceContext_CreateBitmapFromDxgiSurface(device_context, ctx.surface, &bitmap_desc, &bitmap);
         todo_wine_if(bitmap_format_tests[i].hr == WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT)
-        ok(hr == bitmap_format_tests[i].hr, "%u: unexpected hr %#x.\n", i, hr);
+        ok(hr == bitmap_format_tests[i].hr, "%u: Got unexpected hr %#lx.\n", i, hr);
 
         if (SUCCEEDED(bitmap_format_tests[i].hr))
         {
@@ -8474,8 +8474,8 @@ static void test_bitmap_surface(BOOL d3d11)
     surface2 = create_surface(ctx.device, DXGI_FORMAT_A8_UNORM);
 
     hr = ID2D1DeviceContext_CreateBitmapFromDxgiSurface(device_context, surface2, NULL, &bitmap);
-    ok(SUCCEEDED(hr) || broken(hr == WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT) /* Win7 */,
-            "Failed to create a bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK || broken(hr == WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT) /* Win7 */,
+            "Got unexpected hr %#lx.\n", hr);
 
     if (SUCCEEDED(hr))
     {
@@ -8489,7 +8489,7 @@ static void test_bitmap_surface(BOOL d3d11)
     IDXGISurface_Release(surface2);
 
     hr = ID2D1DeviceContext_CreateBitmapFromDxgiSurface(device_context, ctx.surface, NULL, &bitmap);
-    ok(SUCCEEDED(hr), "Failed to create a bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     pixel_format = ID2D1Bitmap1_GetPixelFormat(bitmap);
     ok(pixel_format.alphaMode == D2D1_ALPHA_MODE_PREMULTIPLIED,
@@ -8511,14 +8511,14 @@ static void test_bitmap_surface(BOOL d3d11)
     bitmap_desc.pixelFormat = ID2D1DeviceContext_GetPixelFormat(device_context);
     size.width = size.height = 4;
     hr = ID2D1DeviceContext_CreateBitmap(device_context, size, NULL, 0, &bitmap_desc, &bitmap);
-    ok(SUCCEEDED(hr), "Failed to create a bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     check_bitmap_surface((ID2D1Bitmap *)bitmap, TRUE, D2D1_BITMAP_OPTIONS_NONE);
     ID2D1DeviceContext_SetTags(device_context, 1, 2);
 
     ID2D1DeviceContext_BeginDraw(device_context);
     ID2D1DeviceContext_SetTarget(device_context, (ID2D1Image *)bitmap);
     hr = ID2D1DeviceContext_EndDraw(device_context, &t1, &t2);
-    ok(hr == D2DERR_INVALID_TARGET, "Unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_INVALID_TARGET, "Got unexpected hr %#lx.\n", hr);
     ok(t1 == 1 && t2 == 2, "Unexpected tags %s:%s.\n", wine_dbgstr_longlong(t1), wine_dbgstr_longlong(t2));
 
     ID2D1Bitmap1_Release(bitmap);
@@ -8529,7 +8529,7 @@ static void test_bitmap_surface(BOOL d3d11)
 
     bitmap_desc.bitmapOptions = D2D1_BITMAP_OPTIONS_TARGET;
     hr = ID2D1DeviceContext_CreateBitmap(device_context, size, NULL, 0, &bitmap_desc, &bitmap);
-    ok(SUCCEEDED(hr), "Failed to create a bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     check_bitmap_surface((ID2D1Bitmap *)bitmap, TRUE, D2D1_BITMAP_OPTIONS_TARGET);
     ID2D1DeviceContext_SetTarget(device_context, NULL);
     ID2D1DeviceContext_SetTags(device_context, 3, 4);
@@ -8537,7 +8537,7 @@ static void test_bitmap_surface(BOOL d3d11)
     ID2D1DeviceContext_BeginDraw(device_context);
     ID2D1DeviceContext_SetTarget(device_context, (ID2D1Image *)bitmap);
     hr = ID2D1DeviceContext_EndDraw(device_context, &t1, &t2);
-    ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(!t1 && !t2, "Unexpected tags %s:%s.\n", wine_dbgstr_longlong(t1), wine_dbgstr_longlong(t2));
 
     ID2D1Bitmap1_Release(bitmap);
@@ -8555,10 +8555,10 @@ static void test_bitmap_surface(BOOL d3d11)
     rt_desc.usage = D2D1_RENDER_TARGET_USAGE_NONE;
     rt_desc.minLevel = D2D1_FEATURE_LEVEL_DEFAULT;
     hr = ID2D1Factory1_CreateDCRenderTarget(factory, &rt_desc, (ID2D1DCRenderTarget **)&rt);
-    ok(SUCCEEDED(hr), "Failed to create target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID2D1RenderTarget_QueryInterface(rt, &IID_ID2D1DeviceContext, (void **)&device_context);
-    ok(SUCCEEDED(hr), "Failed to get device context, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1DeviceContext_GetTarget(device_context, (ID2D1Image **)&bitmap);
     ok(!bitmap, "Unexpected target.\n");
@@ -8575,7 +8575,7 @@ static void test_bitmap_surface(BOOL d3d11)
     ok(!!hwnd_rt_desc.hwnd, "Failed to create target window.\n");
 
     hr = ID2D1Factory1_CreateHwndRenderTarget(factory, &rt_desc, &hwnd_rt_desc, (ID2D1HwndRenderTarget **)&rt);
-    ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     check_rt_bitmap_surface(rt, FALSE, D2D1_BITMAP_OPTIONS_NONE);
     ID2D1RenderTarget_Release(rt);
@@ -8586,14 +8586,14 @@ static void test_bitmap_surface(BOOL d3d11)
 
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
             &IID_IWICImagingFactory, (void **)&wic_factory);
-    ok(SUCCEEDED(hr), "Failed to create WIC imaging factory, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = IWICImagingFactory_CreateBitmap(wic_factory, 16, 16,
             &GUID_WICPixelFormat32bppPBGRA, WICBitmapCacheOnDemand, &wic_bitmap);
-    ok(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     IWICImagingFactory_Release(wic_factory);
 
     hr = ID2D1Factory1_CreateWicBitmapRenderTarget(factory, wic_bitmap, &rt_desc, &rt);
-    ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     check_rt_bitmap_surface(rt, FALSE, D2D1_BITMAP_OPTIONS_NONE);
     ID2D1RenderTarget_Release(rt);
@@ -8637,10 +8637,10 @@ static void test_device_context(BOOL d3d11)
     }
 
     hr = ID2D1Factory1_CreateDevice(factory, ctx.device, &device);
-    ok(SUCCEEDED(hr), "Failed to get ID2D1Device, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID2D1Device_CreateDeviceContext(device, D2D1_DEVICE_CONTEXT_OPTIONS_NONE, &device_context);
-    ok(SUCCEEDED(hr), "Failed to create device context, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1DeviceContext_GetDevice(device_context, &device2);
     ok(device2 == device, "Unexpected device instance.\n");
@@ -8658,19 +8658,19 @@ static void test_device_context(BOOL d3d11)
     /* DXGI target */
     rt = ctx.rt;
     hr = ID2D1RenderTarget_QueryInterface(rt, &IID_ID2D1DeviceContext, (void **)&device_context);
-    ok(SUCCEEDED(hr), "Failed to get device context interface, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1DeviceContext_GetTarget(device_context, (ID2D1Image **)&bitmap);
     options = ID2D1Bitmap1_GetOptions(bitmap);
     ok(options == (D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW),
             "Unexpected bitmap options %#x.\n", options);
     hr = ID2D1Bitmap1_GetSurface(bitmap, &surface2);
-    ok(SUCCEEDED(hr), "Failed to get bitmap surface, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(surface2 == ctx.surface, "Unexpected surface instance.\n");
     IDXGISurface_Release(surface2);
 
     ID2D1DeviceContext_BeginDraw(device_context);
     hr = ID2D1Bitmap1_GetSurface(bitmap, &surface2);
-    ok(SUCCEEDED(hr), "Failed to get bitmap surface, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ok(surface2 == ctx.surface, "Unexpected surface instance.\n");
     IDXGISurface_Release(surface2);
     ID2D1DeviceContext_EndDraw(device_context, NULL, NULL);
@@ -8687,10 +8687,10 @@ static void test_device_context(BOOL d3d11)
 
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
             &IID_IWICImagingFactory, (void **)&wic_factory);
-    ok(SUCCEEDED(hr), "Failed to create WIC imaging factory, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = IWICImagingFactory_CreateBitmap(wic_factory, 16, 16,
             &GUID_WICPixelFormat32bppPBGRA, WICBitmapCacheOnDemand, &wic_bitmap);
-    ok(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     IWICImagingFactory_Release(wic_factory);
 
     rt_desc.type = D2D1_RENDER_TARGET_TYPE_DEFAULT;
@@ -8701,16 +8701,16 @@ static void test_device_context(BOOL d3d11)
     rt_desc.usage = D2D1_RENDER_TARGET_USAGE_NONE;
     rt_desc.minLevel = D2D1_FEATURE_LEVEL_DEFAULT;
     hr = ID2D1Factory1_CreateWicBitmapRenderTarget(factory, wic_bitmap, &rt_desc, &rt);
-    ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID2D1RenderTarget_QueryInterface(rt, &IID_ID2D1DeviceContext, (void **)&device_context);
-    ok(SUCCEEDED(hr), "Failed to get device context interface, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1DeviceContext_GetTarget(device_context, (ID2D1Image **)&bitmap);
     options = ID2D1Bitmap1_GetOptions(bitmap);
     ok(options == (D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW),
             "Unexpected bitmap options %#x.\n", options);
     hr = ID2D1Bitmap1_GetSurface(bitmap, &surface);
-    todo_wine ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
+    todo_wine ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
     ID2D1Bitmap1_Release(bitmap);
 
     ID2D1DeviceContext_SetTarget(device_context, NULL);
@@ -8731,16 +8731,16 @@ static void test_device_context(BOOL d3d11)
     ok(!!hwnd_rt_desc.hwnd, "Failed to create target window.\n");
 
     hr = ID2D1Factory1_CreateHwndRenderTarget(factory, &rt_desc, &hwnd_rt_desc, (ID2D1HwndRenderTarget **)&rt);
-    ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID2D1RenderTarget_QueryInterface(rt, &IID_ID2D1DeviceContext, (void **)&device_context);
-    ok(SUCCEEDED(hr), "Failed to get device context interface, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1DeviceContext_GetTarget(device_context, (ID2D1Image **)&bitmap);
     options = ID2D1Bitmap1_GetOptions(bitmap);
     ok(options == (D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW),
             "Unexpected bitmap options %#x.\n", options);
     hr = ID2D1Bitmap1_GetSurface(bitmap, &surface);
-    ok(hr == D2DERR_INVALID_CALL, "Unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_INVALID_CALL, "Got unexpected hr %#lx.\n", hr);
     ID2D1Bitmap1_Release(bitmap);
 
     ID2D1DeviceContext_SetTarget(device_context, NULL);
@@ -8753,10 +8753,10 @@ static void test_device_context(BOOL d3d11)
 
     /* DC target */
     hr = ID2D1Factory1_CreateDCRenderTarget(factory, &rt_desc, &dc_rt);
-    ok(SUCCEEDED(hr), "Failed to create target, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID2D1DCRenderTarget_QueryInterface(dc_rt, &IID_ID2D1DeviceContext, (void **)&device_context);
-    ok(SUCCEEDED(hr), "Failed to get device context interface, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1DeviceContext_GetTarget(device_context, (ID2D1Image **)&bitmap);
     ok(bitmap == NULL, "Unexpected bitmap instance.\n");
 
@@ -8767,14 +8767,14 @@ static void test_device_context(BOOL d3d11)
 
     SetRect(&rect, 0, 0, 16, 16);
     hr = ID2D1DCRenderTarget_BindDC(dc_rt, hdc, &rect);
-    ok(SUCCEEDED(hr), "BindDC() failed, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1DeviceContext_GetTarget(device_context, (ID2D1Image **)&bitmap);
     options = ID2D1Bitmap1_GetOptions(bitmap);
     ok(options == (D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW | D2D1_BITMAP_OPTIONS_GDI_COMPATIBLE),
             "Unexpected bitmap options %#x.\n", options);
     hr = ID2D1Bitmap1_GetSurface(bitmap, &surface);
-    ok(hr == D2DERR_INVALID_CALL, "Unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_INVALID_CALL, "Got unexpected hr %#lx.\n", hr);
     ID2D1Bitmap1_Release(bitmap);
 
     ID2D1DeviceContext_SetTarget(device_context, NULL);
@@ -8918,10 +8918,10 @@ static ID2D1DeviceContext *create_device_context(ID2D1Factory1 *factory, IDXGIDe
     HRESULT hr;
 
     hr = ID2D1Factory1_CreateDevice(factory, dxgi_device, &device);
-    ok(SUCCEEDED(hr), "Failed to get ID2D1Device, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID2D1Device_CreateDeviceContext(device, D2D1_DEVICE_CONTEXT_OPTIONS_NONE, &device_context);
-    ok(SUCCEEDED(hr), "Failed to create device context, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1Device_Release(device);
 
     return device_context;
@@ -8975,7 +8975,7 @@ static void test_command_list(BOOL d3d11)
     ok(device_context != NULL, "Failed to create device context.\n");
 
     hr = ID2D1DeviceContext_CreateCommandList(device_context, &command_list);
-    todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+    todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     if (FAILED(hr))
     {
@@ -8988,7 +8988,7 @@ static void test_command_list(BOOL d3d11)
     ID2D1DeviceContext_BeginDraw(device_context);
 
     hr = ID2D1DeviceContext_QueryInterface(device_context, &IID_ID2D1RenderTarget, (void **)&rt);
-    ok(SUCCEEDED(hr), "Failed to get rt interface, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     /* Test how resources are referenced by the list. */
 
@@ -8999,70 +8999,70 @@ static void test_command_list(BOOL d3d11)
     bitmap_desc.dpiX = 96.0f;
     bitmap_desc.dpiY = 96.0f;
     hr = ID2D1RenderTarget_CreateBitmap(rt, size, bitmap_data, 4 * sizeof(*bitmap_data), &bitmap_desc, &bitmap);
-    ok(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1RenderTarget_DrawBitmap(rt, bitmap, NULL, 0.25f, D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, NULL);
 
     refcount = ID2D1Bitmap_Release(bitmap);
-    ok(refcount == 1, "Got unexpected refcount %u.\n", refcount);
+    ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount);
 
     /* Solid color brush. */
     set_color(&color, 0.0f, 0.0f, 0.0f, 0.0f);
     hr = ID2D1RenderTarget_CreateSolidColorBrush(rt, &color, NULL, (ID2D1SolidColorBrush **)&brush);
-    ok(SUCCEEDED(hr), "Failed to create a brush, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_rect(&rect, 0.0f, 0.0f, 16.0f, 16.0f);
     ID2D1RenderTarget_FillRectangle(rt, &rect, brush);
 
     refcount = ID2D1Brush_Release(brush);
-    ok(refcount == 0, "Got unexpected refcount %u.\n", refcount);
+    ok(refcount == 0, "Got unexpected refcount %lu.\n", refcount);
 
     /* Bitmap brush. */
     hr = ID2D1RenderTarget_CreateBitmap(rt, size, bitmap_data, 4 * sizeof(*bitmap_data), &bitmap_desc, &bitmap);
-    ok(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID2D1RenderTarget_CreateBitmapBrush(rt, bitmap, NULL, NULL, (ID2D1BitmapBrush **)&brush);
-    ok(SUCCEEDED(hr), "Failed to create bitmap brush, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_rect(&rect, 0.0f, 0.0f, 16.0f, 16.0f);
     ID2D1RenderTarget_FillRectangle(rt, &rect, brush);
 
     refcount = ID2D1Brush_Release(brush);
-    ok(refcount == 0, "Got unexpected refcount %u.\n", refcount);
+    ok(refcount == 0, "Got unexpected refcount %lu.\n", refcount);
 
     refcount = ID2D1Bitmap_Release(bitmap);
-    ok(refcount == 1, "Got unexpected refcount %u.\n", refcount);
+    ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount);
 
     /* Linear gradient brush. */
     hr = ID2D1RenderTarget_CreateGradientStopCollection(rt, stops, ARRAY_SIZE(stops),
             D2D1_GAMMA_2_2, D2D1_EXTEND_MODE_CLAMP, &gradient);
-    ok(SUCCEEDED(hr), "Failed to create stop collection, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_point(&linear_gradient_properties.startPoint, 320.0f, 0.0f);
     set_point(&linear_gradient_properties.endPoint, 0.0f, 960.0f);
     hr = ID2D1RenderTarget_CreateLinearGradientBrush(rt, &linear_gradient_properties, NULL, gradient,
             (ID2D1LinearGradientBrush **)&brush);
-    ok(SUCCEEDED(hr), "Failed to create brush, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_rect(&rect, -1.0f, -1.0f, 1.0f, 1.0f);
     hr = ID2D1Factory1_CreateRectangleGeometry(factory, &rect, (ID2D1RectangleGeometry **)&geometry);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1RenderTarget_FillGeometry(rt, geometry, brush, NULL);
 
     refcount = ID2D1Brush_Release(brush);
-    ok(refcount == 0, "Got unexpected refcount %u.\n", refcount);
+    ok(refcount == 0, "Got unexpected refcount %lu.\n", refcount);
 
     refcount = ID2D1Geometry_Release(geometry);
-    ok(refcount == 1, "Got unexpected refcount %u.\n", refcount);
+    ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount);
 
     refcount = ID2D1GradientStopCollection_Release(gradient);
-    ok(refcount == 1, "Got unexpected refcount %u.\n", refcount);
+    ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount);
 
     /* Radial gradient brush. */
     hr = ID2D1RenderTarget_CreateGradientStopCollection(rt, stops, ARRAY_SIZE(stops),
             D2D1_GAMMA_2_2, D2D1_EXTEND_MODE_CLAMP, &gradient);
-    ok(SUCCEEDED(hr), "Failed to create stop collection, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_point(&radial_gradient_properties.center, 160.0f, 480.0f);
     set_point(&radial_gradient_properties.gradientOriginOffset, 40.0f, -120.0f);
@@ -9070,39 +9070,39 @@ static void test_command_list(BOOL d3d11)
     radial_gradient_properties.radiusY = 480.0f;
     hr = ID2D1RenderTarget_CreateRadialGradientBrush(rt, &radial_gradient_properties, NULL, gradient,
             (ID2D1RadialGradientBrush **)&brush);
-    ok(SUCCEEDED(hr), "Failed to create brush, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_rect(&rect, -1.0f, -1.0f, 1.0f, 1.0f);
     hr = ID2D1Factory1_CreateRectangleGeometry(factory, &rect, (ID2D1RectangleGeometry **)&geometry);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1RenderTarget_FillGeometry(rt, geometry, brush, NULL);
 
     refcount = ID2D1Brush_Release(brush);
-    ok(refcount == 0, "Got unexpected refcount %u.\n", refcount);
+    ok(refcount == 0, "Got unexpected refcount %lu.\n", refcount);
 
     refcount = ID2D1Geometry_Release(geometry);
-    ok(refcount == 1, "Got unexpected refcount %u.\n", refcount);
+    ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount);
 
     refcount = ID2D1GradientStopCollection_Release(gradient);
-    ok(refcount == 1, "Got unexpected refcount %u.\n", refcount);
+    ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount);
 
     /* Geometry. */
     set_rect(&rect, -1.0f, -1.0f, 1.0f, 1.0f);
     hr = ID2D1Factory1_CreateRectangleGeometry(factory, &rect, (ID2D1RectangleGeometry **)&geometry);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_color(&color, 0.0f, 0.0f, 0.0f, 0.0f);
     hr = ID2D1RenderTarget_CreateSolidColorBrush(rt, &color, NULL, (ID2D1SolidColorBrush **)&brush);
-    ok(SUCCEEDED(hr), "Failed to create a brush, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1RenderTarget_FillGeometry(rt, geometry, brush, NULL);
 
     refcount = ID2D1Brush_Release(brush);
-    ok(refcount == 0, "Got unexpected refcount %u.\n", refcount);
+    ok(refcount == 0, "Got unexpected refcount %lu.\n", refcount);
 
     refcount = ID2D1Geometry_Release(geometry);
-    ok(refcount == 1, "Got unexpected refcount %u.\n", refcount);
+    ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount);
 
     /* Stroke style. */
     stroke_desc.startCap = D2D1_CAP_STYLE_SQUARE;
@@ -9114,21 +9114,21 @@ static void test_command_list(BOOL d3d11)
     stroke_desc.dashOffset = -1.0f;
 
     hr = ID2D1Factory_CreateStrokeStyle((ID2D1Factory *)factory, &stroke_desc, NULL, 0, &stroke_style);
-    ok(SUCCEEDED(hr), "Failed to create stroke style, %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_color(&color, 0.0f, 0.0f, 0.0f, 0.0f);
     hr = ID2D1RenderTarget_CreateSolidColorBrush(rt, &color, NULL, (ID2D1SolidColorBrush **)&brush);
-    ok(SUCCEEDED(hr), "Failed to create a brush, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_point(&p0, 100.0f, 160.0f);
     set_point(&p1, 140.0f, 160.0f);
     ID2D1RenderTarget_DrawLine(rt, p0, p1, brush, 1.0f, stroke_style);
 
     refcount = ID2D1Brush_Release(brush);
-    ok(refcount == 0, "Got unexpected refcount %u.\n", refcount);
+    ok(refcount == 0, "Got unexpected refcount %lu.\n", refcount);
 
     refcount = ID2D1StrokeStyle_Release(stroke_style);
-    ok(refcount == 1, "Got unexpected refcount %u.\n", refcount);
+    ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount);
 
     /* Close on attached list. */
     ID2D1DeviceContext_GetTarget(device_context, &target);
@@ -9136,22 +9136,22 @@ static void test_command_list(BOOL d3d11)
     ID2D1Image_Release(target);
 
     hr = ID2D1CommandList_Close(command_list);
-    ok(SUCCEEDED(hr), "Failed to close a list, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1DeviceContext_GetTarget(device_context, &target);
     ok(target == NULL, "Unexpected context target.\n");
 
     hr = ID2D1CommandList_Close(command_list);
-    ok(hr == D2DERR_WRONG_STATE, "Unexpected hr %#x.\n", hr);
+    ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1CommandList_Release(command_list);
 
     /* Close empty list. */
     hr = ID2D1DeviceContext_CreateCommandList(device_context, &command_list);
-    ok(SUCCEEDED(hr), "Failed to create command list, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID2D1CommandList_Close(command_list);
-    ok(SUCCEEDED(hr), "Failed to close a list, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1CommandList_Release(command_list);
 
@@ -9160,7 +9160,7 @@ static void test_command_list(BOOL d3d11)
     ok(device_context2 != NULL, "Failed to create device context.\n");
 
     hr = ID2D1DeviceContext_CreateCommandList(device_context, &command_list);
-    ok(SUCCEEDED(hr), "Failed to create command list, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ID2D1DeviceContext_SetTarget(device_context2, (ID2D1Image *)command_list);
     ID2D1DeviceContext_GetTarget(device_context2, &target);
@@ -9213,21 +9213,21 @@ static void test_max_bitmap_size(BOOL d3d11)
     };
 
     hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory);
-    ok(SUCCEEDED(hr), "Failed to create factory, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     for (i = 0; i < ARRAY_SIZE(device_types); ++i)
     {
         if (FAILED(hr = D3D10CreateDevice1(NULL, device_types[i].type, NULL, D3D10_CREATE_DEVICE_BGRA_SUPPORT,
                 D3D10_FEATURE_LEVEL_10_0, D3D10_1_SDK_VERSION, &device)))
         {
-            skip("Failed to create %s d3d device, hr %#x.\n", device_types[i].name, hr);
+            skip("Failed to create %s d3d device, hr %#lx.\n", device_types[i].name, hr);
             continue;
         }
 
         window = create_window();
         swapchain = create_d3d10_swapchain(device, window, TRUE);
         hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
-        ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
+        ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
         for (j = 0; j < ARRAY_SIZE(target_types); ++j)
         {
@@ -9244,8 +9244,7 @@ static void test_max_bitmap_size(BOOL d3d11)
             desc.minLevel = D2D1_FEATURE_LEVEL_DEFAULT;
 
             hr = ID2D1Factory_CreateDxgiSurfaceRenderTarget(factory, surface, &desc, &rt);
-            ok(SUCCEEDED(hr), "%s/%s: failed to create render target, hr %#x.\n", device_types[i].name,
-                    target_types[j].name, hr);
+            ok(hr == S_OK, "%s/%s: Got unexpected hr %#lx.\n", device_types[i].name, target_types[j].name, hr);
 
             bitmap_size = ID2D1RenderTarget_GetMaximumBitmapSize(rt);
             ok(bitmap_size >= D3D10_REQ_TEXTURE2D_U_OR_V_DIMENSION, "%s/%s: unexpected bitmap size %u.\n",
@@ -9259,7 +9258,7 @@ static void test_max_bitmap_size(BOOL d3d11)
             size.width = bitmap_size;
             size.height = 1;
             hr = ID2D1RenderTarget_CreateBitmap(rt, size, NULL, 0, &bitmap_desc, &bitmap);
-            ok(SUCCEEDED(hr), "Failed to create a bitmap, hr %#x.\n", hr);
+            ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
             ID2D1Bitmap_Release(bitmap);
 
             ID2D1RenderTarget_Release(rt);
@@ -9277,8 +9276,8 @@ static void test_max_bitmap_size(BOOL d3d11)
             texture_desc.MiscFlags = 0;
 
             hr = ID3D10Device1_CreateTexture2D(device, &texture_desc, NULL, &texture);
-            ok(SUCCEEDED(hr) || broken(hr == E_INVALIDARG && device_types[i].type == D3D10_DRIVER_TYPE_WARP) /* Vista */,
-                    "%s/%s: failed to create texture, hr %#x.\n", device_types[i].name, target_types[j].name, hr);
+            ok(hr == S_OK || broken(hr == E_INVALIDARG && device_types[i].type == D3D10_DRIVER_TYPE_WARP) /* Vista */,
+                    "%s/%s: Got unexpected hr %#lx.\n", device_types[i].name, target_types[j].name, hr);
             if (SUCCEEDED(hr))
                 ID3D10Texture2D_Release(texture);
         }
@@ -9355,7 +9354,7 @@ static void test_dpi(BOOL d3d11)
         bitmap_desc.colorContext = NULL;
         hr = ID2D1DeviceContext_CreateBitmapFromDxgiSurface(device_context, ctx.surface, &bitmap_desc, &bitmap);
         /* Native accepts negative DPI values for DXGI surface bitmap. */
-        ok(hr == S_OK, "Test %u: Got unexpected hr %#x.\n", i, hr);
+        ok(hr == S_OK, "Test %u: Got unexpected hr %#lx.\n", i, hr);
 
         ID2D1DeviceContext_SetDpi(device_context, dc_dpi_x, dc_dpi_y);
 
@@ -9370,7 +9369,7 @@ static void test_dpi(BOOL d3d11)
         ID2D1DeviceContext_BeginDraw(device_context);
         ID2D1DeviceContext_SetTarget(device_context, (ID2D1Image *)bitmap);
         hr = ID2D1DeviceContext_EndDraw(device_context, NULL, NULL);
-        ok(hr == S_OK, "Test %u: Got unexpected hr %#x.\n", i, hr);
+        ok(hr == S_OK, "Test %u: Got unexpected hr %#lx.\n", i, hr);
 
         /* Device context DPI values aren't updated by SetTarget. */
         ID2D1DeviceContext_GetDpi(device_context, &dpi_x, &dpi_y);
@@ -9384,7 +9383,7 @@ static void test_dpi(BOOL d3d11)
     CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
             &IID_IWICImagingFactory, (void **)&wic_factory);
-    ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     for (i = 0; i < ARRAY_SIZE(create_dpi_tests); ++i)
     {
         IWICBitmapSource *wic_bitmap_src;
@@ -9394,9 +9393,9 @@ static void test_dpi(BOOL d3d11)
 
         hr = IWICImagingFactory_CreateBitmap(wic_factory, 16, 16,
                 &GUID_WICPixelFormat32bppPBGRA, WICBitmapCacheOnDemand, &wic_bitmap);
-        ok(hr == S_OK, "Test %u: Got unexpected hr %#x.\n", i, hr);
+        ok(hr == S_OK, "Test %u: Got unexpected hr %#lx.\n", i, hr);
         hr = IWICBitmap_QueryInterface(wic_bitmap, &IID_IWICBitmapSource, (void **)&wic_bitmap_src);
-        ok(hr == S_OK, "Test %u: Got unexpected hr %#x.\n", i, hr);
+        ok(hr == S_OK, "Test %u: Got unexpected hr %#lx.\n", i, hr);
         IWICBitmap_Release(wic_bitmap);
 
         bitmap_desc.pixelFormat.format = DXGI_FORMAT_UNKNOWN;
@@ -9406,7 +9405,7 @@ static void test_dpi(BOOL d3d11)
         bitmap_desc.bitmapOptions = D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW;
         bitmap_desc.colorContext = NULL;
         hr = ID2D1DeviceContext_CreateBitmapFromWicBitmap(device_context, wic_bitmap_src, &bitmap_desc, &bitmap);
-        ok(hr == create_dpi_tests[i].hr, "Test %u: Got unexpected hr %#x, expected %#x.\n",
+        ok(hr == create_dpi_tests[i].hr, "Test %u: Got unexpected hr %#lx, expected %#lx.\n",
                 i, hr, create_dpi_tests[i].hr);
         IWICBitmapSource_Release(wic_bitmap_src);
 
@@ -9433,7 +9432,7 @@ static void test_dpi(BOOL d3d11)
         ID2D1DeviceContext_BeginDraw(device_context);
         ID2D1DeviceContext_SetTarget(device_context, (ID2D1Image *)bitmap);
         hr = ID2D1DeviceContext_EndDraw(device_context, NULL, NULL);
-        ok(hr == S_OK, "Test %u: Got unexpected hr %#x.\n", i, hr);
+        ok(hr == S_OK, "Test %u: Got unexpected hr %#lx.\n", i, hr);
 
         /* Device context DPI values aren't updated by SetTarget. */
         ID2D1DeviceContext_GetDpi(device_context, &dpi_x, &dpi_y);
@@ -9459,7 +9458,7 @@ static void test_dpi(BOOL d3d11)
         bitmap_desc.bitmapOptions = D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW;
         bitmap_desc.colorContext = NULL;
         hr = ID2D1DeviceContext_CreateBitmap(device_context, size, NULL, 0, &bitmap_desc, &bitmap);
-        ok(hr == create_dpi_tests[i].hr, "Test %u: Got unexpected hr %#x, expected %#x.\n",
+        ok(hr == create_dpi_tests[i].hr, "Test %u: Got unexpected hr %#lx, expected %#lx.\n",
                 i, hr, create_dpi_tests[i].hr);
 
         if (FAILED(hr))
@@ -9485,7 +9484,7 @@ static void test_dpi(BOOL d3d11)
         ID2D1DeviceContext_BeginDraw(device_context);
         ID2D1DeviceContext_SetTarget(device_context, (ID2D1Image *)bitmap);
         hr = ID2D1DeviceContext_EndDraw(device_context, NULL, NULL);
-        ok(hr == S_OK, "Test %u: Got unexpected hr %#x.\n", i, hr);
+        ok(hr == S_OK, "Test %u: Got unexpected hr %#lx.\n", i, hr);
 
         /* Device context DPI values aren't updated by SetTarget. */
         ID2D1DeviceContext_GetDpi(device_context, &dpi_x, &dpi_y);
@@ -9536,16 +9535,16 @@ static void test_wic_bitmap_format(BOOL d3d11)
 
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
             &IID_IWICImagingFactory, (void **)&wic_factory);
-    ok(hr == S_OK, "Failed to create WIC imaging factory, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     for (i = 0; i < ARRAY_SIZE(tests); ++i)
     {
         hr = IWICImagingFactory_CreateBitmap(wic_factory, 16, 16,
                 tests[i].wic, WICBitmapCacheOnDemand, &wic_bitmap);
-        ok(hr == S_OK, "%s: Failed to create WIC bitmap, hr %#x.\n", debugstr_guid(tests[i].wic), hr);
+        ok(hr == S_OK, "%s: Got unexpected hr %#lx.\n", debugstr_guid(tests[i].wic), hr);
 
         hr = ID2D1RenderTarget_CreateBitmapFromWicBitmap(rt, (IWICBitmapSource *)wic_bitmap, NULL, &bitmap);
-        ok(hr == S_OK, "%s: Failed to create bitmap from WIC source, hr %#x.\n", debugstr_guid(tests[i].wic), hr);
+        ok(hr == S_OK, "%s: Got unexpected hr %#lx.\n", debugstr_guid(tests[i].wic), hr);
 
         format = ID2D1Bitmap_GetPixelFormat(bitmap);
         ok(format.format == tests[i].d2d.format, "%s: Got unexpected DXGI format %#x.\n",
@@ -9740,22 +9739,22 @@ static void test_geometry_group(BOOL d3d11)
     BOOL match;
 
     hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory);
-    ok(SUCCEEDED(hr), "Failed to create factory, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_rect(&rect, -1.0f, -1.0f, 1.0f, 1.0f);
     hr = ID2D1Factory_CreateRectangleGeometry(factory, &rect, (ID2D1RectangleGeometry **)&geometries[0]);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_rect(&rect, -2.0f, -2.0f, 0.0f, 2.0f);
     hr = ID2D1Factory_CreateRectangleGeometry(factory, &rect, (ID2D1RectangleGeometry **)&geometries[1]);
-    ok(SUCCEEDED(hr), "Failed to create geometry, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID2D1Factory_CreateGeometryGroup(factory, D2D1_FILL_MODE_ALTERNATE, geometries, 2, &group);
-    ok(SUCCEEDED(hr), "Failed to create geometry group, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_rect(&rect, 0.0f, 0.0f, 0.0f, 0.0f);
     hr = ID2D1GeometryGroup_GetBounds(group, NULL, &rect);
-    ok(SUCCEEDED(hr), "Failed to get geometry group bounds, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_rect(&rect, -2.0f, -2.0f, 1.0f, 2.0f, 0);
     ok(match, "Got unexpected rectangle {%.8e, %.8e, %.8e, %.8e}.\n",
             rect.left, rect.top, rect.right, rect.bottom);
@@ -9764,7 +9763,7 @@ static void test_geometry_group(BOOL d3d11)
     translate_matrix(&matrix, 80.0f, 640.0f);
     scale_matrix(&matrix, 2.0f, 0.5f);
     hr = ID2D1GeometryGroup_GetBounds(group, &matrix, &rect);
-    ok(SUCCEEDED(hr), "Failed to get geometry group bounds, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     match = compare_rect(&rect, 76.0f, 639.0f, 82.0f, 641.0f, 0);
     ok(match, "Got unexpected rectangle {%.8e, %.8e, %.8e, %.8e}.\n",
             rect.left, rect.top, rect.right, rect.bottom);
@@ -9795,10 +9794,10 @@ static void test_mt_factory(BOOL d3d11)
     DWORD ret;
 
     hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_MULTI_THREADED + 1, &IID_ID2D1Factory, NULL, (void **)&factory);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
 
     hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory);
-    ok(SUCCEEDED(hr), "Failed to create factory, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID2D1Factory_QueryInterface(factory, &IID_ID2D1Multithread, (void **)&multithread);
     if (hr == E_NOINTERFACE)
@@ -9807,7 +9806,7 @@ static void test_mt_factory(BOOL d3d11)
         ID2D1Factory_Release(factory);
         return;
     }
-    ok(SUCCEEDED(hr), "Failed to get interface, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ret = ID2D1Multithread_GetMultithreadProtected(multithread);
     ok(!ret, "Unexpected return value.\n");
@@ -9822,10 +9821,10 @@ static void test_mt_factory(BOOL d3d11)
     ID2D1Factory_Release(factory);
 
     hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_MULTI_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory);
-    ok(SUCCEEDED(hr), "Failed to create factory, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID2D1Factory_QueryInterface(factory, &IID_ID2D1Multithread, (void **)&multithread);
-    ok(SUCCEEDED(hr), "Failed to get interface, hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     ret = ID2D1Multithread_GetMultithreadProtected(multithread);
     ok(!!ret, "Unexpected return value.\n");
@@ -9887,7 +9886,7 @@ static void test_effect(BOOL d3d11)
     }
 
     hr = ID2D1RenderTarget_QueryInterface(ctx.rt, &IID_ID2D1DeviceContext, (void **)&context);
-    ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     for (i = 0; i < ARRAY_SIZE(effect_tests); ++i)
     {
@@ -9896,82 +9895,74 @@ static void test_effect(BOOL d3d11)
         winetest_push_context("Test %u", i);
 
         hr = ID2D1DeviceContext_CreateEffect(context, test->clsid, &effect);
-        ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+        ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
         hr = ID2D1Effect_QueryInterface(effect, &IID_ID2D1Image, (void **)&image_a);
-        ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+        ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
         ID2D1Effect_GetOutput(effect, &image_b);
         ok(image_b == image_a, "Got unexpected image_b %p, expected %p.\n", image_b, image_a);
         ID2D1Image_Release(image_b);
         ID2D1Image_Release(image_a);
 
         hr = ID2D1Effect_GetValue(effect, 0xdeadbeef, D2D1_PROPERTY_TYPE_CLSID, (BYTE *)&clsid, sizeof(clsid));
-        ok(hr == D2DERR_INVALID_PROPERTY, "Got unexpected hr %#x.\n", hr);
+        ok(hr == D2DERR_INVALID_PROPERTY, "Got unexpected hr %#lx.\n", hr);
 
         hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_CLSID, D2D1_PROPERTY_TYPE_CLSID, buffer, sizeof(clsid) + 1);
-        ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+        ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
         hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_CLSID, D2D1_PROPERTY_TYPE_CLSID, buffer, sizeof(clsid) - 1);
-        ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+        ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
         hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_CLSID, D2D1_PROPERTY_TYPE_CLSID, buffer, sizeof(clsid));
-        ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+        ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
         hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_DISPLAYNAME, D2D1_PROPERTY_TYPE_STRING, buffer, sizeof(buffer));
-        todo_wine
-        ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+        todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
         str_size = (wcslen((WCHAR *)buffer) + 1) * sizeof(WCHAR);
         hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_DISPLAYNAME, D2D1_PROPERTY_TYPE_STRING, buffer, str_size);
-        todo_wine
-        ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+        todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
         hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_DISPLAYNAME, D2D1_PROPERTY_TYPE_STRING, buffer, str_size - 1);
-        todo_wine
-        ok(hr == D2DERR_INSUFFICIENT_BUFFER, "Got unexpected hr %#x.\n", hr);
+        todo_wine ok(hr == D2DERR_INSUFFICIENT_BUFFER, "Got unexpected hr %#lx.\n", hr);
 
         hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_CLSID, 0xdeadbeef, (BYTE *)&clsid, sizeof(clsid));
-        ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+        ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
         hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_CLSID, D2D1_PROPERTY_TYPE_UNKNOWN, (BYTE *)&clsid, sizeof(clsid));
-        ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+        ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
         hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_CLSID, D2D1_PROPERTY_TYPE_VECTOR4, (BYTE *)&clsid, sizeof(clsid));
-        ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+        ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
         hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_CLSID, D2D1_PROPERTY_TYPE_VECTOR4, buffer, sizeof(buffer));
-        ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+        ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
 
         hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_CLSID,
                 D2D1_PROPERTY_TYPE_CLSID, (BYTE *)&clsid, sizeof(clsid));
-        ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
-        if (hr == S_OK)
-            ok(IsEqualGUID(&clsid, test->clsid), "Got unexpected clsid %s, expected %s.\n",
-                    debugstr_guid(&clsid), debugstr_guid(test->clsid));
+        ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
+        ok(IsEqualGUID(&clsid, test->clsid), "Got unexpected clsid %s, expected %s.\n",
+                debugstr_guid(&clsid), debugstr_guid(test->clsid));
 
         hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_CACHED,
                 D2D1_PROPERTY_TYPE_BOOL, (BYTE *)&cached, sizeof(cached));
-        todo_wine
-        ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+        todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
         if (hr == S_OK)
             ok(cached == FALSE, "Got unexpected cached %d.\n", cached);
 
         hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_PRECISION,
                 D2D1_PROPERTY_TYPE_ENUM, (BYTE *)&precision, sizeof(precision));
-        todo_wine
-        ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+        todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
         if (hr == S_OK)
             ok(precision == D2D1_BUFFER_PRECISION_UNKNOWN, "Got unexpected precision %u.\n", precision);
 
         hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_MIN_INPUTS,
                 D2D1_PROPERTY_TYPE_UINT32, (BYTE *)&min_inputs, sizeof(min_inputs));
-        ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
-        if (hr == S_OK)
-            ok(min_inputs == test->min_inputs, "Got unexpected min inputs %u, expected %u.\n",
-                    min_inputs, test->min_inputs);
+        ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
+        ok(min_inputs == test->min_inputs, "Got unexpected min inputs %u, expected %u.\n",
+                min_inputs, test->min_inputs);
 
         hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_MAX_INPUTS,
                 D2D1_PROPERTY_TYPE_UINT32, (BYTE *)&max_inputs, sizeof(max_inputs));
-        ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
-        if (hr == S_OK)
-            ok(max_inputs == test->max_inputs, "Got unexpected max inputs %u, expected %u.\n",
-                    max_inputs, test->max_inputs);
+        ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
+        ok(max_inputs == test->max_inputs, "Got unexpected max inputs %u, expected %u.\n",
+                max_inputs, test->max_inputs);
 
         input_count = ID2D1Effect_GetInputCount(effect);
-        ok (input_count == test->default_input_count, "Got unexpected input count %u, expected %u.\n",
+        ok(input_count == test->default_input_count, "Got unexpected input count %u, expected %u.\n",
                 input_count, test->default_input_count);
 
         input_count = (test->max_inputs < 16 ? test->max_inputs : 16);
@@ -9980,9 +9971,9 @@ static void test_effect(BOOL d3d11)
             winetest_push_context("Input %u", j);
             hr = ID2D1Effect_SetInputCount(effect, j);
             if (j < test->min_inputs || j > test->max_inputs)
-                ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+                ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
             else
-                ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+                ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
             winetest_pop_context();
         }
 
@@ -10001,7 +9992,7 @@ static void test_effect(BOOL d3d11)
         bitmap_desc.dpiX = 96.0f;
         bitmap_desc.dpiY = 96.0f;
         hr = ID2D1RenderTarget_CreateBitmap(ctx.rt, size, NULL, 4, &bitmap_desc, &bitmap);
-        ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+        ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
         ID2D1Effect_SetInput(effect, 0, (ID2D1Image *)bitmap, FALSE);
         for (j = 0; j < input_count + 4; ++j)
@@ -10120,10 +10111,10 @@ static void test_effect_2d_affine(BOOL d3d11)
     }
 
     hr = ID2D1RenderTarget_QueryInterface(ctx.rt, &IID_ID2D1DeviceContext, (void **)&context);
-    ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID2D1DeviceContext_CreateEffect(context, &CLSID_D2D12DAffineTransform, &effect);
-    ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     for (i = 0; i < ARRAY_SIZE(effect_2d_affine_tests); ++i)
     {
@@ -10139,13 +10130,13 @@ static void test_effect_2d_affine(BOOL d3d11)
         bitmap_desc.colorContext = NULL;
         hr = ID2D1DeviceContext_CreateBitmap(context, input_size, test->img_data,
                 sizeof(*test->img_data) * test->img_width, &bitmap_desc, &bitmap);
-        ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+        ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
         ID2D1Effect_SetInput(effect, 0, (ID2D1Image *)bitmap, FALSE);
         todo_wine
         hr = ID2D1Effect_SetValue(effect, D2D1_2DAFFINETRANSFORM_PROP_TRANSFORM_MATRIX,
                 D2D1_PROPERTY_TYPE_MATRIX_3X2, (const BYTE *)test->matrix, sizeof(*test->matrix));
-        ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+        ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
         ID2D1Effect_GetOutput(effect, &output);
 
         ID2D1DeviceContext_GetImageLocalBounds(context, output, &output_bounds);
@@ -10168,7 +10159,7 @@ static void test_effect_2d_affine(BOOL d3d11)
         offset.y = 240.0f;
         ID2D1DeviceContext_DrawImage(context, output, &offset, NULL, 0, 0);
         hr = ID2D1DeviceContext_EndDraw(context, NULL, NULL);
-        ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+        ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
         x = offset.x + output_bounds.left - 2.0f;
         y = offset.y + output_bounds.top - 2.0f;
@@ -10232,10 +10223,10 @@ static void test_effect_crop(BOOL d3d11)
     }
 
     hr = ID2D1RenderTarget_QueryInterface(ctx.rt, &IID_ID2D1DeviceContext, (void **)&context);
-    ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     hr = ID2D1DeviceContext_CreateEffect(context, &CLSID_D2D1Crop, &effect);
-    ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     for (i = 0; i < ARRAY_SIZE(crop_effect_tests); ++i)
     {
@@ -10251,12 +10242,12 @@ static void test_effect_crop(BOOL d3d11)
         bitmap_desc.colorContext = NULL;
         hr = ID2D1DeviceContext_CreateBitmap(context, input_size, image,
                 sizeof(*image) * 16, &bitmap_desc, &bitmap);
-        ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+        ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
         ID2D1Effect_SetInput(effect, 0, (ID2D1Image *)bitmap, FALSE);
         hr = ID2D1Effect_SetValue(effect, D2D1_CROP_PROP_RECT, D2D1_PROPERTY_TYPE_VECTOR4,
                 (const BYTE *)&test->crop_rect, sizeof(test->crop_rect));
-        ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+        ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
         ID2D1Effect_GetOutput(effect, &output);
 
         set_rect(&output_bounds, -1.0f, -1.0f, -1.0f, -1.0f);
@@ -10458,11 +10449,11 @@ static void test_stroke_contains_point(BOOL d3d11)
     };
 
     hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory);
-    ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     set_rect(&rect, 0.0f, 0.0f, 10.0f, 20.0f);
     hr = ID2D1Factory_CreateRectangleGeometry(factory, &rect, &rectangle);
-    ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     for (i = 0; i < ARRAY_SIZE(rectangle_tests); ++i)
     {
         const struct contains_point_test *test = &rectangle_tests[i];
@@ -10472,7 +10463,7 @@ static void test_stroke_contains_point(BOOL d3d11)
         contains = !test->contains;
         hr = ID2D1RectangleGeometry_StrokeContainsPoint(rectangle, test->point, test->stroke_width,
                 NULL, test->matrix ? &test->transform : NULL, test->tolerance, &contains);
-        ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+        ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
         ok(contains == test->contains, "Got unexpected result %#x.\n", contains);
 
         winetest_pop_context();
@@ -10480,9 +10471,9 @@ static void test_stroke_contains_point(BOOL d3d11)
     ID2D1RectangleGeometry_Release(rectangle);
 
     hr = ID2D1Factory_CreatePathGeometry(factory, &path);
-    ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     hr = ID2D1PathGeometry_Open(path, &sink);
-    ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
     /* A limaçon. */
     set_point(&point, 160.0f, 720.0f);
@@ -10524,7 +10515,7 @@ static void test_stroke_contains_point(BOOL d3d11)
     ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_OPEN);
 
     hr = ID2D1GeometrySink_Close(sink);
-    ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+    ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     ID2D1GeometrySink_Release(sink);
 
     for (i = 0; i < ARRAY_SIZE(path_tests); ++i)
@@ -10536,7 +10527,7 @@ static void test_stroke_contains_point(BOOL d3d11)
         contains = !test->contains;
         hr = ID2D1PathGeometry_StrokeContainsPoint(path, test->point, test->stroke_width,
                 NULL, test->matrix ? &test->transform : NULL, test->tolerance, &contains);
-        ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+        ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
         ok(contains == test->contains, "Got unexpected result %#x.\n", contains);
 
         winetest_pop_context();
-- 
2.30.2




More information about the wine-devel mailing list