[PATCH 2/2] dlls/windowscodecs/tests: enable compilation with long types

Eric Pouech eric.pouech at gmail.com
Wed Mar 9 01:21:55 CST 2022


Signed-off-by: Eric Pouech <eric.pouech at gmail.com>

---
 dlls/windowscodecs/tests/Makefile.in   |    1 
 dlls/windowscodecs/tests/bitmap.c      |  420 +++++++++++-----------
 dlls/windowscodecs/tests/bmpformat.c   |  334 +++++++++--------
 dlls/windowscodecs/tests/converter.c   |  310 ++++++++--------
 dlls/windowscodecs/tests/ddsformat.c   |  222 ++++++-----
 dlls/windowscodecs/tests/gifformat.c   |  128 +++----
 dlls/windowscodecs/tests/icoformat.c   |   18 -
 dlls/windowscodecs/tests/info.c        |  186 +++++-----
 dlls/windowscodecs/tests/jpegformat.c  |   26 +
 dlls/windowscodecs/tests/metadata.c    |  618 ++++++++++++++++----------------
 dlls/windowscodecs/tests/palette.c     |  136 ++++---
 dlls/windowscodecs/tests/pngformat.c   |  160 ++++----
 dlls/windowscodecs/tests/propertybag.c |   56 +--
 dlls/windowscodecs/tests/stream.c      |  436 +++++++++++------------
 dlls/windowscodecs/tests/tiffformat.c  |  150 ++++----
 dlls/windowscodecs/tests/wmpformat.c   |   28 +
 16 files changed, 1614 insertions(+), 1615 deletions(-)

diff --git a/dlls/windowscodecs/tests/Makefile.in b/dlls/windowscodecs/tests/Makefile.in
index 1a4d2fa8646..3d1e9e8a84e 100644
--- a/dlls/windowscodecs/tests/Makefile.in
+++ b/dlls/windowscodecs/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
 TESTDLL   = windowscodecs.dll
 IMPORTS   = windowscodecs propsys oleaut32 ole32 user32 gdi32 shlwapi uuid
 
diff --git a/dlls/windowscodecs/tests/bitmap.c b/dlls/windowscodecs/tests/bitmap.c
index 2dfe3f93f6b..0d0d27e2707 100644
--- a/dlls/windowscodecs/tests/bitmap.c
+++ b/dlls/windowscodecs/tests/bitmap.c
@@ -238,32 +238,32 @@ static void test_createbitmap(void)
 
     hr = IWICImagingFactory_CreateBitmap(factory, 3, 3, &GUID_WICPixelFormat24bppBGR,
         WICBitmapCacheOnLoad, &bitmap);
-    ok(hr == S_OK, "IWICImagingFactory_CreateBitmap failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICImagingFactory_CreateBitmap failed hr=%lx\n", hr);
 
     if (FAILED(hr))
         return;
 
     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-    ok(hr == S_OK, "IWICImagingFactory_CreatePalette failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICImagingFactory_CreatePalette failed hr=%lx\n", hr);
 
     /* Palette is unavailable until explicitly set */
     hr = IWICBitmap_CopyPalette(bitmap, palette);
-    ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "IWICBitmap_CopyPalette failed hr=%x\n", hr);
+    ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "IWICBitmap_CopyPalette failed hr=%lx\n", hr);
 
     hr = IWICPalette_InitializePredefined(palette, WICBitmapPaletteTypeFixedGray256, FALSE);
-    ok(hr == S_OK, "IWICPalette_InitializePredefined failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICPalette_InitializePredefined failed hr=%lx\n", hr);
 
     hr = IWICBitmap_SetPalette(bitmap, palette);
-    ok(hr == S_OK, "IWICBitmap_SetPalette failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_SetPalette failed hr=%lx\n", hr);
 
     hr = IWICPalette_InitializePredefined(palette, WICBitmapPaletteTypeFixedGray4, FALSE);
-    ok(hr == S_OK, "IWICPalette_InitializePredefined failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICPalette_InitializePredefined failed hr=%lx\n", hr);
 
     hr = IWICBitmap_CopyPalette(bitmap, palette);
-    ok(hr == S_OK, "IWICBitmap_CopyPalette failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_CopyPalette failed hr=%lx\n", hr);
 
     hr = IWICPalette_GetType(palette, &palettetype);
-    ok(hr == S_OK, "IWICPalette_GetType failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICPalette_GetType failed hr=%lx\n", hr);
     ok(palettetype == WICBitmapPaletteTypeFixedGray256,
         "expected WICBitmapPaletteTypeFixedGray256, got %x\n", palettetype);
 
@@ -271,7 +271,7 @@ static void test_createbitmap(void)
 
     /* pixel data is initially zeroed */
     hr = IWICBitmap_CopyPixels(bitmap, NULL, 9, 27, returned_data);
-    ok(hr == S_OK, "IWICBitmap_CopyPixels failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_CopyPixels failed hr=%lx\n", hr);
 
     for (i=0; i<27; i++)
         ok(returned_data[i] == 0, "returned_data[%i] == %i\n", i, returned_data[i]);
@@ -281,36 +281,36 @@ static void test_createbitmap(void)
     rc.Width = 4;
     rc.Height = 3;
     hr = IWICBitmap_Lock(bitmap, &rc, WICBitmapLockRead, &lock);
-    ok(hr == E_INVALIDARG, "IWICBitmap_Lock failed hr=%x\n", hr);
+    ok(hr == E_INVALIDARG, "IWICBitmap_Lock failed hr=%lx\n", hr);
     if (SUCCEEDED(hr)) IWICBitmapLock_Release(lock);
 
     rc.Width = 3;
     rc.Height = 4;
     hr = IWICBitmap_Lock(bitmap, &rc, WICBitmapLockRead, &lock);
-    ok(hr == E_INVALIDARG, "IWICBitmap_Lock failed hr=%x\n", hr);
+    ok(hr == E_INVALIDARG, "IWICBitmap_Lock failed hr=%lx\n", hr);
     if (SUCCEEDED(hr)) IWICBitmapLock_Release(lock);
 
     rc.Height = 3;
     rc.X = 4;
     hr = IWICBitmap_Lock(bitmap, &rc, WICBitmapLockRead, &lock);
-    ok(hr == E_INVALIDARG, "IWICBitmap_Lock failed hr=%x\n", hr);
+    ok(hr == E_INVALIDARG, "IWICBitmap_Lock failed hr=%lx\n", hr);
     if (SUCCEEDED(hr)) IWICBitmapLock_Release(lock);
 
     rc.X = 0;
     rc.Y = 4;
     hr = IWICBitmap_Lock(bitmap, &rc, WICBitmapLockRead, &lock);
-    ok(hr == E_INVALIDARG, "IWICBitmap_Lock failed hr=%x\n", hr);
+    ok(hr == E_INVALIDARG, "IWICBitmap_Lock failed hr=%lx\n", hr);
     if (SUCCEEDED(hr)) IWICBitmapLock_Release(lock);
 
     /* NULL lock rect */
     hr = IWICBitmap_Lock(bitmap, NULL, WICBitmapLockRead, &lock);
-    ok(hr == S_OK || broken(hr == E_INVALIDARG) /* winxp */, "IWICBitmap_Lock failed hr=%x\n", hr);
+    ok(hr == S_OK || broken(hr == E_INVALIDARG) /* winxp */, "IWICBitmap_Lock failed hr=%lx\n", hr);
 
     if (SUCCEEDED(hr))
     {
         /* entire bitmap is locked */
         hr = IWICBitmapLock_GetSize(lock, &width, &height);
-        ok(hr == S_OK, "IWICBitmapLock_GetSize failed hr=%x\n", hr);
+        ok(hr == S_OK, "IWICBitmapLock_GetSize failed hr=%lx\n", hr);
         ok(width == 3, "got %d, expected 3\n", width);
         ok(height == 3, "got %d, expected 3\n", height);
 
@@ -322,38 +322,38 @@ static void test_createbitmap(void)
     /* lock with a valid rect */
     rc.Y = 0;
     hr = IWICBitmap_Lock(bitmap, &rc, WICBitmapLockRead, &lock);
-    ok(hr == S_OK, "IWICBitmap_Lock failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_Lock failed hr=%lx\n", hr);
     if (SUCCEEDED(hr))
     {
         hr = IWICBitmapLock_GetStride(lock, &lock_buffer_stride);
-        ok(hr == S_OK, "IWICBitmapLock_GetStride failed hr=%x\n", hr);
+        ok(hr == S_OK, "IWICBitmapLock_GetStride failed hr=%lx\n", hr);
         /* stride is divisible by 4 */
         ok(lock_buffer_stride == 12, "got %i, expected 12\n", lock_buffer_stride);
 
         hr = IWICBitmapLock_GetDataPointer(lock, &lock_buffer_size, &lock_buffer);
-        ok(hr == S_OK, "IWICBitmapLock_GetDataPointer failed hr=%x\n", hr);
+        ok(hr == S_OK, "IWICBitmapLock_GetDataPointer failed hr=%lx\n", hr);
         /* buffer size does not include padding from the last row */
         ok(lock_buffer_size == 33, "got %i, expected 33\n", lock_buffer_size);
         ok(lock_buffer != NULL, "got NULL data pointer\n");
         base_lock_buffer = lock_buffer;
 
         hr = IWICBitmapLock_GetPixelFormat(lock, &pixelformat);
-        ok(hr == S_OK, "IWICBitmapLock_GetPixelFormat failed hr=%x\n", hr);
+        ok(hr == S_OK, "IWICBitmapLock_GetPixelFormat failed hr=%lx\n", hr);
         ok(IsEqualGUID(&pixelformat, &GUID_WICPixelFormat24bppBGR), "unexpected pixel format\n");
 
         hr = IWICBitmapLock_GetSize(lock, &width, &height);
-        ok(hr == S_OK, "IWICBitmapLock_GetSize failed hr=%x\n", hr);
+        ok(hr == S_OK, "IWICBitmapLock_GetSize failed hr=%lx\n", hr);
         ok(width == 3, "got %d, expected 3\n", width);
         ok(height == 3, "got %d, expected 3\n", height);
 
         /* We can have multiple simultaneous read locks */
         hr = IWICBitmap_Lock(bitmap, &rc, WICBitmapLockRead, &lock2);
-        ok(hr == S_OK, "IWICBitmap_Lock failed hr=%x\n", hr);
+        ok(hr == S_OK, "IWICBitmap_Lock failed hr=%lx\n", hr);
 
         if (SUCCEEDED(hr))
         {
             hr = IWICBitmapLock_GetDataPointer(lock2, &lock_buffer_size, &lock_buffer);
-            ok(hr == S_OK, "IWICBitmapLock_GetDataPointer failed hr=%x\n", hr);
+            ok(hr == S_OK, "IWICBitmapLock_GetDataPointer failed hr=%lx\n", hr);
             ok(lock_buffer_size == 33, "got %i, expected 33\n", lock_buffer_size);
             ok(lock_buffer == base_lock_buffer, "got %p, expected %p\n", lock_buffer, base_lock_buffer);
 
@@ -364,7 +364,7 @@ static void test_createbitmap(void)
         {
             /* But not a read and a write lock */
             hr = IWICBitmap_Lock(bitmap, &rc, WICBitmapLockWrite, &lock2);
-            ok(hr == WINCODEC_ERR_ALREADYLOCKED, "IWICBitmap_Lock failed hr=%x\n", hr);
+            ok(hr == WINCODEC_ERR_ALREADYLOCKED, "IWICBitmap_Lock failed hr=%lx\n", hr);
         }
 
         /* But we don't need a write lock to write */
@@ -379,7 +379,7 @@ static void test_createbitmap(void)
 
     /* test that the data we wrote is returned by CopyPixels */
     hr = IWICBitmap_CopyPixels(bitmap, NULL, 9, 27, returned_data);
-    ok(hr == S_OK, "IWICBitmap_CopyPixels failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_CopyPixels failed hr=%lx\n", hr);
 
     for (i=0; i<27; i++)
         ok(returned_data[i] == bitmap_data[i], "returned_data[%i] == %i\n", i, returned_data[i]);
@@ -390,7 +390,7 @@ static void test_createbitmap(void)
     rc.Width = 1;
     rc.Height = 2;
     hr = IWICBitmap_Lock(bitmap, &rc, WICBitmapLockWrite, &lock);
-    ok(hr == S_OK, "IWICBitmap_Lock failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_Lock failed hr=%lx\n", hr);
 
     if (SUCCEEDED(hr))
     {
@@ -398,27 +398,27 @@ static void test_createbitmap(void)
         {
             /* Can't lock again while locked for writing */
             hr = IWICBitmap_Lock(bitmap, &rc, WICBitmapLockWrite, &lock2);
-            ok(hr == WINCODEC_ERR_ALREADYLOCKED, "IWICBitmap_Lock failed hr=%x\n", hr);
+            ok(hr == WINCODEC_ERR_ALREADYLOCKED, "IWICBitmap_Lock failed hr=%lx\n", hr);
 
             hr = IWICBitmap_Lock(bitmap, &rc, WICBitmapLockRead, &lock2);
-            ok(hr == WINCODEC_ERR_ALREADYLOCKED, "IWICBitmap_Lock failed hr=%x\n", hr);
+            ok(hr == WINCODEC_ERR_ALREADYLOCKED, "IWICBitmap_Lock failed hr=%lx\n", hr);
         }
 
         hr = IWICBitmapLock_GetStride(lock, &lock_buffer_stride);
-        ok(hr == S_OK, "IWICBitmapLock_GetStride failed hr=%x\n", hr);
+        ok(hr == S_OK, "IWICBitmapLock_GetStride failed hr=%lx\n", hr);
         ok(lock_buffer_stride == 12, "got %i, expected 12\n", lock_buffer_stride);
 
         hr = IWICBitmapLock_GetDataPointer(lock, &lock_buffer_size, &lock_buffer);
-        ok(hr == S_OK, "IWICBitmapLock_GetDataPointer failed hr=%x\n", hr);
+        ok(hr == S_OK, "IWICBitmapLock_GetDataPointer failed hr=%lx\n", hr);
         ok(lock_buffer_size == 15, "got %i, expected 15\n", lock_buffer_size);
         ok(lock_buffer == base_lock_buffer+6, "got %p, expected %p+6\n", lock_buffer, base_lock_buffer);
 
         hr = IWICBitmapLock_GetPixelFormat(lock, &pixelformat);
-        ok(hr == S_OK, "IWICBitmapLock_GetPixelFormat failed hr=%x\n", hr);
+        ok(hr == S_OK, "IWICBitmapLock_GetPixelFormat failed hr=%lx\n", hr);
         ok(IsEqualGUID(&pixelformat, &GUID_WICPixelFormat24bppBGR), "unexpected pixel format\n");
 
         hr = IWICBitmapLock_GetSize(lock, &width, &height);
-        ok(hr == S_OK, "IWICBitmapLock_GetSize failed hr=%x\n", hr);
+        ok(hr == S_OK, "IWICBitmapLock_GetSize failed hr=%lx\n", hr);
         ok(width == 1, "got %d, expected 1\n", width);
         ok(height == 2, "got %d, expected 2\n", height);
 
@@ -426,24 +426,24 @@ static void test_createbitmap(void)
     }
 
     hr = IWICBitmap_GetPixelFormat(bitmap, &pixelformat);
-    ok(hr == S_OK, "IWICBitmap_GetPixelFormat failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_GetPixelFormat failed hr=%lx\n", hr);
     ok(IsEqualGUID(&pixelformat, &GUID_WICPixelFormat24bppBGR), "unexpected pixel format\n");
 
     hr = IWICBitmap_GetResolution(bitmap, &dpix, &dpiy);
-    ok(hr == S_OK, "IWICBitmap_GetResolution failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_GetResolution failed hr=%lx\n", hr);
     ok(dpix == 0.0, "got %f, expected 0.0\n", dpix);
     ok(dpiy == 0.0, "got %f, expected 0.0\n", dpiy);
 
     hr = IWICBitmap_SetResolution(bitmap, 12.0, 34.0);
-    ok(hr == S_OK, "IWICBitmap_SetResolution failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_SetResolution failed hr=%lx\n", hr);
 
     hr = IWICBitmap_GetResolution(bitmap, &dpix, &dpiy);
-    ok(hr == S_OK, "IWICBitmap_GetResolution failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_GetResolution failed hr=%lx\n", hr);
     ok(dpix == 12.0, "got %f, expected 12.0\n", dpix);
     ok(dpiy == 34.0, "got %f, expected 34.0\n", dpiy);
 
     hr = IWICBitmap_GetSize(bitmap, &width, &height);
-    ok(hr == S_OK, "IWICBitmap_GetSize failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_GetSize failed hr=%lx\n", hr);
     ok(width == 3, "got %d, expected 3\n", width);
     ok(height == 3, "got %d, expected 3\n", height);
 
@@ -474,19 +474,19 @@ static void test_createbitmapfromsource(void)
 
     hr = IWICImagingFactory_CreateBitmap(factory, 3, 3, &GUID_WICPixelFormat24bppBGR,
         WICBitmapCacheOnLoad, &bitmap);
-    ok(hr == S_OK, "IWICImagingFactory_CreateBitmap failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICImagingFactory_CreateBitmap failed hr=%lx\n", hr);
 
     if (FAILED(hr))
         return;
 
     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-    ok(hr == S_OK, "IWICImagingFactory_CreatePalette failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICImagingFactory_CreatePalette failed hr=%lx\n", hr);
 
     hr = IWICPalette_InitializePredefined(palette, WICBitmapPaletteTypeFixedGray256, FALSE);
-    ok(hr == S_OK, "IWICPalette_InitializePredefined failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICPalette_InitializePredefined failed hr=%lx\n", hr);
 
     hr = IWICBitmap_SetPalette(bitmap, palette);
-    ok(hr == S_OK, "IWICBitmap_SetPalette failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_SetPalette failed hr=%lx\n", hr);
 
     IWICPalette_Release(palette);
 
@@ -494,15 +494,15 @@ static void test_createbitmapfromsource(void)
     rc.Width = 3;
     rc.Height = 3;
     hr = IWICBitmap_Lock(bitmap, &rc, WICBitmapLockWrite, &lock);
-    ok(hr == S_OK, "IWICBitmap_Lock failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_Lock failed hr=%lx\n", hr);
     if (SUCCEEDED(hr))
     {
         hr = IWICBitmapLock_GetStride(lock, &lock_buffer_stride);
-        ok(hr == S_OK, "IWICBitmapLock_GetStride failed hr=%x\n", hr);
+        ok(hr == S_OK, "IWICBitmapLock_GetStride failed hr=%lx\n", hr);
         ok(lock_buffer_stride == 12, "got %i, expected 12\n", lock_buffer_stride);
 
         hr = IWICBitmapLock_GetDataPointer(lock, &lock_buffer_size, &lock_buffer);
-        ok(hr == S_OK, "IWICBitmapLock_GetDataPointer failed hr=%x\n", hr);
+        ok(hr == S_OK, "IWICBitmapLock_GetDataPointer failed hr=%lx\n", hr);
         ok(lock_buffer_size == 33, "got %i, expected 33\n", lock_buffer_size);
         ok(lock_buffer != NULL, "got NULL data pointer\n");
 
@@ -513,55 +513,55 @@ static void test_createbitmapfromsource(void)
     }
 
     hr = IWICBitmap_SetResolution(bitmap, 12.0, 34.0);
-    ok(hr == S_OK, "IWICBitmap_SetResolution failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_SetResolution failed hr=%lx\n", hr);
 
     /* WICBitmapNoCache */
     hr = IWICImagingFactory_CreateBitmapFromSource(factory, (IWICBitmapSource *)bitmap,
         WICBitmapNoCache, &bitmap2);
-    ok(hr == S_OK, "IWICImagingFactory_CreateBitmapFromSource failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICImagingFactory_CreateBitmapFromSource failed hr=%lx\n", hr);
     ok(bitmap2 == bitmap, "Unexpected bitmap instance.\n");
 
     IWICBitmap_Release(bitmap2);
 
     bitmap2 = (void *)0xdeadbeef;
     hr = IWICImagingFactory_CreateBitmapFromSource(factory, &bitmapsource, WICBitmapNoCache, &bitmap2);
-    ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
     ok(bitmap2 == (void *)0xdeadbeef, "Unexpected pointer %p.\n", bitmap2);
 
     hr = IWICImagingFactory_CreateBitmapFromSource(factory, (IWICBitmapSource*)bitmap,
         WICBitmapCacheOnLoad, &bitmap2);
-    ok(hr == S_OK, "IWICImagingFactory_CreateBitmapFromSource failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICImagingFactory_CreateBitmapFromSource failed hr=%lx\n", hr);
 
     IWICBitmap_Release(bitmap);
 
     if (FAILED(hr)) return;
 
     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-    ok(hr == S_OK, "IWICImagingFactory_CreatePalette failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICImagingFactory_CreatePalette failed hr=%lx\n", hr);
 
     /* palette isn't copied for non-indexed formats? */
     hr = IWICBitmap_CopyPalette(bitmap2, palette);
-    ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "IWICBitmap_CopyPalette failed hr=%x\n", hr);
+    ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "IWICBitmap_CopyPalette failed hr=%lx\n", hr);
 
     IWICPalette_Release(palette);
 
     hr = IWICBitmap_CopyPixels(bitmap2, NULL, 9, 27, returned_data);
-    ok(hr == S_OK, "IWICBitmap_CopyPixels failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_CopyPixels failed hr=%lx\n", hr);
 
     for (i=0; i<27; i++)
         ok(returned_data[i] == bitmap_data[i], "returned_data[%i] == %i\n", i, returned_data[i]);
 
     hr = IWICBitmap_GetPixelFormat(bitmap2, &pixelformat);
-    ok(hr == S_OK, "IWICBitmap_GetPixelFormat failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_GetPixelFormat failed hr=%lx\n", hr);
     ok(IsEqualGUID(&pixelformat, &GUID_WICPixelFormat24bppBGR), "unexpected pixel format\n");
 
     hr = IWICBitmap_GetResolution(bitmap2, &dpix, &dpiy);
-    ok(hr == S_OK, "IWICBitmap_GetResolution failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_GetResolution failed hr=%lx\n", hr);
     ok(dpix == 12.0, "got %f, expected 12.0\n", dpix);
     ok(dpiy == 34.0, "got %f, expected 34.0\n", dpiy);
 
     hr = IWICBitmap_GetSize(bitmap2, &width, &height);
-    ok(hr == S_OK, "IWICBitmap_GetSize failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_GetSize failed hr=%lx\n", hr);
     ok(width == 3, "got %d, expected 3\n", width);
     ok(height == 3, "got %d, expected 3\n", height);
 
@@ -570,86 +570,86 @@ static void test_createbitmapfromsource(void)
     /* Ensure palette is copied for indexed formats */
     hr = IWICImagingFactory_CreateBitmap(factory, 3, 3, &GUID_WICPixelFormat4bppIndexed,
         WICBitmapCacheOnLoad, &bitmap);
-    ok(hr == S_OK, "IWICImagingFactory_CreateBitmap failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICImagingFactory_CreateBitmap failed hr=%lx\n", hr);
 
     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-    ok(hr == S_OK, "IWICImagingFactory_CreatePalette failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICImagingFactory_CreatePalette failed hr=%lx\n", hr);
 
     hr = IWICPalette_InitializePredefined(palette, WICBitmapPaletteTypeFixedGray256, FALSE);
-    ok(hr == S_OK, "IWICPalette_InitializePredefined failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICPalette_InitializePredefined failed hr=%lx\n", hr);
 
     hr = IWICBitmap_SetPalette(bitmap, palette);
-    ok(hr == S_OK, "IWICBitmap_SetPalette failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_SetPalette failed hr=%lx\n", hr);
 
     IWICPalette_Release(palette);
 
     hr = IWICImagingFactory_CreateBitmapFromSource(factory, (IWICBitmapSource*)bitmap,
         WICBitmapCacheOnLoad, &bitmap2);
-    ok(hr == S_OK, "IWICImagingFactory_CreateBitmapFromSource failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICImagingFactory_CreateBitmapFromSource failed hr=%lx\n", hr);
 
     IWICBitmap_Release(bitmap);
 
     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-    ok(hr == S_OK, "IWICImagingFactory_CreatePalette failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICImagingFactory_CreatePalette failed hr=%lx\n", hr);
 
     hr = IWICBitmap_CopyPalette(bitmap2, palette);
-    ok(hr == S_OK, "IWICBitmap_CopyPalette failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_CopyPalette failed hr=%lx\n", hr);
 
     hr = IWICPalette_GetColorCount(palette, &count);
-    ok(hr == S_OK, "IWICPalette_GetColorCount failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICPalette_GetColorCount failed hr=%lx\n", hr);
     ok(count == 256, "unexpected count %d\n", count);
 
     hr = IWICPalette_GetType(palette, &palette_type);
-    ok(hr == S_OK, "IWICPalette_GetType failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICPalette_GetType failed hr=%lx\n", hr);
     ok(palette_type == WICBitmapPaletteTypeFixedGray256, "unexpected palette type %d\n", palette_type);
 
     IWICPalette_Release(palette);
 
     hr = IWICBitmap_GetPixelFormat(bitmap2, &pixelformat);
-    ok(hr == S_OK, "IWICBitmap_GetPixelFormat failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_GetPixelFormat failed hr=%lx\n", hr);
     ok(IsEqualGUID(&pixelformat, &GUID_WICPixelFormat4bppIndexed), "unexpected pixel format\n");
 
     hr = IWICBitmap_GetSize(bitmap2, &width, &height);
-    ok(hr == S_OK, "IWICBitmap_GetSize failed hr=%x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_GetSize failed hr=%lx\n", hr);
     ok(width == 3, "got %d, expected 3\n", width);
     ok(height == 3, "got %d, expected 3\n", height);
 
     /* CreateBitmapFromSourceRect */
     hr = IWICImagingFactory_CreateBitmapFromSourceRect(factory, (IWICBitmapSource *)bitmap2, 0, 0, 16, 32, &bitmap);
-    ok(hr == S_OK, "Failed to create a bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to create a bitmap, hr %#lx.\n", hr);
     hr = IWICBitmap_GetSize(bitmap, &width, &height);
-    ok(hr == S_OK, "Failed to get bitmap size, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to get bitmap size, hr %#lx.\n", hr);
     ok(width == 3, "Unexpected width %u.\n", width);
     ok(height == 3, "Unexpected height %u.\n", height);
     IWICBitmap_Release(bitmap);
 
     hr = IWICImagingFactory_CreateBitmapFromSourceRect(factory, (IWICBitmapSource *)bitmap2, 0, 0, 1, 1, &bitmap);
-    ok(hr == S_OK, "Failed to create a bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to create a bitmap, hr %#lx.\n", hr);
     hr = IWICBitmap_GetSize(bitmap, &width, &height);
-    ok(hr == S_OK, "Failed to get bitmap size, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to get bitmap size, hr %#lx.\n", hr);
     ok(width == 1, "Unexpected width %u.\n", width);
     ok(height == 1, "Unexpected height %u.\n", height);
     IWICBitmap_Release(bitmap);
 
     hr = IWICImagingFactory_CreateBitmapFromSourceRect(factory, (IWICBitmapSource *)bitmap2, 2, 1, 16, 32, &bitmap);
-    ok(hr == S_OK, "Failed to create a bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to create a bitmap, hr %#lx.\n", hr);
     hr = IWICBitmap_GetSize(bitmap, &width, &height);
-    ok(hr == S_OK, "Failed to get bitmap size, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to get bitmap size, hr %#lx.\n", hr);
     ok(width == 1, "Unexpected width %u.\n", width);
     ok(height == 2, "Unexpected height %u.\n", height);
     IWICBitmap_Release(bitmap);
 
     hr = IWICImagingFactory_CreateBitmapFromSourceRect(factory, (IWICBitmapSource *)bitmap2, 0, 0, 0, 2, &bitmap);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
 
     hr = IWICImagingFactory_CreateBitmapFromSourceRect(factory, (IWICBitmapSource *)bitmap2, 0, 0, 2, 0, &bitmap);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
 
     hr = IWICImagingFactory_CreateBitmapFromSourceRect(factory, (IWICBitmapSource *)bitmap2, 1, 3, 16, 32, &bitmap);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
 
     hr = IWICImagingFactory_CreateBitmapFromSourceRect(factory, (IWICBitmapSource *)bitmap2, 3, 1, 16, 32, &bitmap);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
 
     IWICBitmap_Release(bitmap2);
 }
@@ -674,30 +674,30 @@ static void test_CreateBitmapFromMemory(void)
 
     hr = IWICImagingFactory_CreateBitmapFromMemory(factory, 3, 3, &GUID_WICPixelFormat24bppBGR,
                                                    0, 0, NULL, &bitmap);
-    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
 
     hr = IWICImagingFactory_CreateBitmapFromMemory(factory, 3, 3, &GUID_WICPixelFormat24bppBGR,
                                                    0, sizeof(data3x3), data3x3, &bitmap);
-    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
 
     hr = IWICImagingFactory_CreateBitmapFromMemory(factory, 3, 3, &GUID_WICPixelFormat24bppBGR,
                                                    6, sizeof(data3x3), data3x3, &bitmap);
-    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
 
     hr = IWICImagingFactory_CreateBitmapFromMemory(factory, 3, 3, &GUID_WICPixelFormat24bppBGR,
                                                    12, sizeof(data3x3), data3x3, &bitmap);
-    ok(hr == WINCODEC_ERR_INSUFFICIENTBUFFER, "expected WINCODEC_ERR_INSUFFICIENTBUFFER, got %#x\n", hr);
+    ok(hr == WINCODEC_ERR_INSUFFICIENTBUFFER, "expected WINCODEC_ERR_INSUFFICIENTBUFFER, got %#lx\n", hr);
 
     hr = IWICImagingFactory_CreateBitmapFromMemory(factory, 3, 3, &GUID_WICPixelFormat24bppBGR,
                                                    9, sizeof(data3x3) - 1, data3x3, &bitmap);
-    ok(hr == WINCODEC_ERR_INSUFFICIENTBUFFER, "expected WINCODEC_ERR_INSUFFICIENTBUFFER, got %#x\n", hr);
+    ok(hr == WINCODEC_ERR_INSUFFICIENTBUFFER, "expected WINCODEC_ERR_INSUFFICIENTBUFFER, got %#lx\n", hr);
 
     hr = IWICImagingFactory_CreateBitmapFromMemory(factory, 3, 3, &GUID_WICPixelFormat24bppBGR,
                                                    9, sizeof(data3x3), data3x3, &bitmap);
-    ok(hr == S_OK, "IWICImagingFactory_CreateBitmapFromMemory error %#x\n", hr);
+    ok(hr == S_OK, "IWICImagingFactory_CreateBitmapFromMemory error %#lx\n", hr);
 
     hr = IWICBitmap_GetSize(bitmap, &width, &height);
-    ok(hr == S_OK, "IWICBitmap_GetSize error %#x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_GetSize error %#lx\n", hr);
     ok(width == 3, "expected 3, got %u\n", width);
     ok(height == 3, "expected 3, got %u\n", height);
 
@@ -705,7 +705,7 @@ static void test_CreateBitmapFromMemory(void)
 
     memset(data, 0, sizeof(data));
     hr = IWICBitmap_CopyPixels(bitmap, NULL, 9, sizeof(data), data);
-    ok(hr == S_OK, "IWICBitmap_CopyPixels error %#x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_CopyPixels error %#lx\n", hr);
     for (i = 0; i < sizeof(data); i++)
         ok(data[i] == orig_data3x3[i], "%u: expected %u, got %u\n", i, data[i], data3x3[i]);
 
@@ -713,16 +713,16 @@ static void test_CreateBitmapFromMemory(void)
 
     hr = IWICImagingFactory_CreateBitmapFromMemory(factory, 3, 2, &GUID_WICPixelFormat24bppBGR,
                                                    13, sizeof(orig_data3x3), orig_data3x3, &bitmap);
-    ok(hr == S_OK, "IWICImagingFactory_CreateBitmapFromMemory error %#x\n", hr);
+    ok(hr == S_OK, "IWICImagingFactory_CreateBitmapFromMemory error %#lx\n", hr);
 
     hr = IWICBitmap_GetSize(bitmap, &width, &height);
-    ok(hr == S_OK, "IWICBitmap_GetSize error %#x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_GetSize error %#lx\n", hr);
     ok(width == 3, "expected 3, got %u\n", width);
     ok(height == 2, "expected 2, got %u\n", height);
 
     memset(data, 0, sizeof(data));
     hr = IWICBitmap_CopyPixels(bitmap, NULL, 13, sizeof(data), data);
-    ok(hr == S_OK, "IWICBitmap_CopyPixels error %#x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_CopyPixels error %#lx\n", hr);
     for (i = 0; i < sizeof(data); i++)
         ok(data[i] == data3x2[i], "%u: expected %u, got %u\n", i, data3x2[i], data[i]);
 
@@ -751,16 +751,16 @@ static void test_CreateBitmapFromHICON(void)
     DeleteObject(info.hbmMask);
 
     hr = IWICImagingFactory_CreateBitmapFromHICON(factory, 0, NULL);
-    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
 
     hr = IWICImagingFactory_CreateBitmapFromHICON(factory, 0, &bitmap);
-    ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_CURSOR_HANDLE), "expected ERROR_INVALID_CURSOR_HANDLE, got %#x\n", hr);
+    ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_CURSOR_HANDLE), "expected ERROR_INVALID_CURSOR_HANDLE, got %#lx\n", hr);
 
     hr = IWICImagingFactory_CreateBitmapFromHICON(factory, icon, NULL);
-    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
 
     hr = IWICImagingFactory_CreateBitmapFromHICON(factory, icon, &bitmap);
-    ok(hr == S_OK, "CreateBitmapFromHICON error %#x\n", hr);
+    ok(hr == S_OK, "CreateBitmapFromHICON error %#lx\n", hr);
     DestroyIcon(icon);
     if (hr != S_OK) return;
 
@@ -769,7 +769,7 @@ static void test_CreateBitmapFromHICON(void)
        "unexpected pixel format %s\n", wine_dbgstr_guid(&format));
 
     hr = IWICBitmap_GetSize(bitmap, &width, &height);
-    ok(hr == S_OK, "IWICBitmap_GetSize error %#x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_GetSize error %#lx\n", hr);
     ok(width == 16, "expected 16, got %u\n", width);
     ok(height == 16, "expected 16, got %u\n", height);
 
@@ -789,7 +789,7 @@ static void test_CreateBitmapFromHICON(void)
     DeleteObject(info.hbmMask);
 
     hr = IWICImagingFactory_CreateBitmapFromHICON(factory, icon, &bitmap);
-    ok(hr == S_OK, "CreateBitmapFromHICON error %#x\n", hr);
+    ok(hr == S_OK, "CreateBitmapFromHICON error %#lx\n", hr);
     DestroyIcon(icon);
 
     IWICBitmap_GetPixelFormat(bitmap, &format);
@@ -797,7 +797,7 @@ static void test_CreateBitmapFromHICON(void)
        "unexpected pixel format %s\n", wine_dbgstr_guid(&format));
 
     hr = IWICBitmap_GetSize(bitmap, &width, &height);
-    ok(hr == S_OK, "IWICBitmap_GetSize error %#x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_GetSize error %#lx\n", hr);
     ok(width == 16, "expected 16, got %u\n", width);
     ok(height == 16, "expected 16, got %u\n", height);
 
@@ -828,26 +828,26 @@ static void test_CreateBitmapFromHBITMAP(void)
     ok(hbmp != 0, "failed to create bitmap\n");
 
     hr = IWICImagingFactory_CreateBitmapFromHBITMAP(factory, 0, 0, WICBitmapIgnoreAlpha, &bitmap);
-    ok(hr == WINCODEC_ERR_WIN32ERROR || hr == 0x88980003 /*XP*/, "expected WINCODEC_ERR_WIN32ERROR, got %#x\n", hr);
+    ok(hr == WINCODEC_ERR_WIN32ERROR || hr == 0x88980003 /*XP*/, "expected WINCODEC_ERR_WIN32ERROR, got %#lx\n", hr);
 
     hr = IWICImagingFactory_CreateBitmapFromHBITMAP(factory, hbmp, 0, WICBitmapIgnoreAlpha, NULL);
-    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
 
     hr = IWICImagingFactory_CreateBitmapFromHBITMAP(factory, hbmp, 0, WICBitmapIgnoreAlpha, &bitmap);
-    ok(hr == S_OK, "CreateBitmapFromHBITMAP error %#x\n", hr);
+    ok(hr == S_OK, "CreateBitmapFromHBITMAP error %#lx\n", hr);
 
     IWICBitmap_GetPixelFormat(bitmap, &format);
     ok(IsEqualGUID(&format, &GUID_WICPixelFormat8bppIndexed),
        "unexpected pixel format %s\n", wine_dbgstr_guid(&format));
 
     hr = IWICBitmap_GetSize(bitmap, &width, &height);
-    ok(hr == S_OK, "IWICBitmap_GetSize error %#x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_GetSize error %#lx\n", hr);
     ok(width == 3, "expected 3, got %u\n", width);
     ok(height == 3, "expected 3, got %u\n", height);
 
     memset(data, 0, sizeof(data));
     hr = IWICBitmap_CopyPixels(bitmap, NULL, 4, sizeof(data), data);
-    ok(hr == S_OK, "IWICBitmap_CopyPixels error %#x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_CopyPixels error %#lx\n", hr);
     for (i = 0; i < sizeof(data); i++)
         ok(data[i] == data_8bpp_rgb_dib[i], "%u: expected %#x, got %#x\n", i, data_8bpp_rgb_dib[i], data[i]);
 
@@ -864,7 +864,7 @@ static void test_CreateBitmapFromHBITMAP(void)
 
     hbmp = create_dib(3, 3, 8, pal, data_8bpp_pal_dib);
     hr = IWICImagingFactory_CreateBitmapFromHBITMAP(factory, hbmp, hpal, WICBitmapIgnoreAlpha, &bitmap);
-    ok(hr == S_OK, "CreateBitmapFromHBITMAP error %#x\n", hr);
+    ok(hr == S_OK, "CreateBitmapFromHBITMAP error %#lx\n", hr);
 
     IWICBitmap_GetPixelFormat(bitmap, &format);
     todo_wine
@@ -872,21 +872,21 @@ static void test_CreateBitmapFromHBITMAP(void)
        "unexpected pixel format %s\n", wine_dbgstr_guid(&format));
 
     hr = IWICBitmap_GetSize(bitmap, &width, &height);
-    ok(hr == S_OK, "IWICBitmap_GetSize error %#x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_GetSize error %#lx\n", hr);
     ok(width == 3, "expected 3, got %u\n", width);
     ok(height == 3, "expected 3, got %u\n", height);
 
     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-    ok(hr == S_OK, "CreatePalette error %#x\n", hr);
+    ok(hr == S_OK, "CreatePalette error %#lx\n", hr);
     hr = IWICBitmap_CopyPalette(bitmap, palette);
-    ok(hr == S_OK, "CopyPalette error %#x\n", hr);
+    ok(hr == S_OK, "CopyPalette error %#lx\n", hr);
 
     hr = IWICPalette_GetType(palette, &type);
-    ok(hr == S_OK, "%u: GetType error %#x\n", i, hr);
+    ok(hr == S_OK, "%u: GetType error %#lx\n", i, hr);
     ok(type == WICBitmapPaletteTypeCustom, "expected WICBitmapPaletteTypeCustom, got %#x\n", type);
 
     hr = IWICPalette_GetColorCount(palette, &count);
-    ok(hr == S_OK, "GetColorCount error %#x\n", hr);
+    ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
     todo_wine
     ok(count == 16, "expected 16, got %u\n", count);
 
@@ -906,35 +906,35 @@ static void test_CreateBitmapFromHBITMAP(void)
 
     hbmp = create_dib(3, 3, 8, pal, data_8bpp_pal_dib);
     hr = IWICImagingFactory_CreateBitmapFromHBITMAP(factory, hbmp, hpal, WICBitmapIgnoreAlpha, &bitmap);
-    ok(hr == S_OK, "CreateBitmapFromHBITMAP error %#x\n", hr);
+    ok(hr == S_OK, "CreateBitmapFromHBITMAP error %#lx\n", hr);
 
     IWICBitmap_GetPixelFormat(bitmap, &format);
     ok(IsEqualGUID(&format, &GUID_WICPixelFormat8bppIndexed),
             "unexpected pixel format %s\n", wine_dbgstr_guid(&format));
 
     hr = IWICBitmap_GetSize(bitmap, &width, &height);
-    ok(hr == S_OK, "IWICBitmap_GetSize error %#x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_GetSize error %#lx\n", hr);
     ok(width == 3, "expected 3, got %u\n", width);
     ok(height == 3, "expected 3, got %u\n", height);
 
     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-    ok(hr == S_OK, "CreatePalette error %#x\n", hr);
+    ok(hr == S_OK, "CreatePalette error %#lx\n", hr);
     hr = IWICBitmap_CopyPalette(bitmap, palette);
-    ok(hr == S_OK, "CopyPalette error %#x\n", hr);
+    ok(hr == S_OK, "CopyPalette error %#lx\n", hr);
 
     hr = IWICPalette_GetType(palette, &type);
-    ok(hr == S_OK, "%u: GetType error %#x\n", i, hr);
+    ok(hr == S_OK, "%u: GetType error %#lx\n", i, hr);
     ok(type == WICBitmapPaletteTypeCustom, "expected WICBitmapPaletteTypeCustom, got %#x\n", type);
 
     hr = IWICPalette_GetColorCount(palette, &count);
-    ok(hr == S_OK, "GetColorCount error %#x\n", hr);
+    ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
     ok(count == 256, "expected 256, got %u\n", count);
 
     IWICPalette_Release(palette);
 
     memset(data, 0, sizeof(data));
     hr = IWICBitmap_CopyPixels(bitmap, NULL, 4, sizeof(data), data);
-    ok(hr == S_OK, "IWICBitmap_CopyPixels error %#x\n", hr);
+    ok(hr == S_OK, "IWICBitmap_CopyPixels error %#lx\n", hr);
     for (i = 0; i < sizeof(data); i++)
         todo_wine_if (data[i] != data_8bpp_pal_wic[i])
             ok(data[i] == data_8bpp_pal_wic[i], "%u: expected %#x, got %#x\n", i, data_8bpp_pal_wic[i], data[i]);
@@ -946,10 +946,10 @@ static void test_CreateBitmapFromHBITMAP(void)
     /* 32bpp alpha */
     hbmp = create_dib(2, 2, 32, NULL, NULL);
     hr = IWICImagingFactory_CreateBitmapFromHBITMAP(factory, hbmp, NULL, WICBitmapUseAlpha, &bitmap);
-    ok(hr == S_OK, "CreateBitmapFromHBITMAP error %#x\n", hr);
+    ok(hr == S_OK, "CreateBitmapFromHBITMAP error %#lx\n", hr);
 
     hr = IWICBitmap_GetPixelFormat(bitmap, &format);
-    ok(hr == S_OK, "GetPixelFormat error %#x\n", hr);
+    ok(hr == S_OK, "GetPixelFormat error %#lx\n", hr);
     ok(IsEqualGUID(&format, &GUID_WICPixelFormat32bppBGRA),
        "unexpected pixel format %s\n", wine_dbgstr_guid(&format));
 
@@ -957,10 +957,10 @@ static void test_CreateBitmapFromHBITMAP(void)
 
     /* 32bpp pre-multiplied alpha */
     hr = IWICImagingFactory_CreateBitmapFromHBITMAP(factory, hbmp, NULL, WICBitmapUsePremultipliedAlpha, &bitmap);
-    ok(hr == S_OK, "CreateBitmapFromHBITMAP error %#x\n", hr);
+    ok(hr == S_OK, "CreateBitmapFromHBITMAP error %#lx\n", hr);
 
     hr = IWICBitmap_GetPixelFormat(bitmap, &format);
-    ok(hr == S_OK, "GetPixelFormat error %#x\n", hr);
+    ok(hr == S_OK, "GetPixelFormat error %#lx\n", hr);
     ok(IsEqualGUID(&format, &GUID_WICPixelFormat32bppPBGRA),
        "unexpected pixel format %s\n", wine_dbgstr_guid(&format));
 
@@ -968,10 +968,10 @@ static void test_CreateBitmapFromHBITMAP(void)
 
     /* 32bpp no alpha */
     hr = IWICImagingFactory_CreateBitmapFromHBITMAP(factory, hbmp, NULL, WICBitmapIgnoreAlpha, &bitmap);
-    ok(hr == S_OK, "CreateBitmapFromHBITMAP error %#x\n", hr);
+    ok(hr == S_OK, "CreateBitmapFromHBITMAP error %#lx\n", hr);
 
     hr = IWICBitmap_GetPixelFormat(bitmap, &format);
-    ok(hr == S_OK, "GetPixelFormat error %#x\n", hr);
+    ok(hr == S_OK, "GetPixelFormat error %#lx\n", hr);
     ok(IsEqualGUID(&format, &GUID_WICPixelFormat32bppBGR),
        "unexpected pixel format %s\n", wine_dbgstr_guid(&format));
 
@@ -990,29 +990,29 @@ static void test_clipper(void)
 
     hr = IWICImagingFactory_CreateBitmap(factory, 10, 10, &GUID_WICPixelFormat24bppBGR,
         WICBitmapCacheOnLoad, &bitmap);
-    ok(hr == S_OK, "got 0x%08x\n", hr);
+    ok(hr == S_OK, "got 0x%08lx\n", hr);
 
     hr = IWICImagingFactory_CreateBitmapClipper(factory, &clipper);
-    ok(hr == S_OK, "got 0x%08x\n", hr);
+    ok(hr == S_OK, "got 0x%08lx\n", hr);
 
     rect.X = rect.Y = 0;
     rect.Width = rect.Height = 11;
     hr = IWICBitmapClipper_Initialize(clipper, (IWICBitmapSource*)bitmap, &rect);
-    ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+    ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
 
     rect.X = rect.Y = 5;
     rect.Width = rect.Height = 6;
     hr = IWICBitmapClipper_Initialize(clipper, (IWICBitmapSource*)bitmap, &rect);
-    ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+    ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
 
     rect.X = rect.Y = 5;
     rect.Width = rect.Height = 5;
     hr = IWICBitmapClipper_Initialize(clipper, (IWICBitmapSource*)bitmap, &rect);
-    ok(hr == S_OK, "got 0x%08x\n", hr);
+    ok(hr == S_OK, "got 0x%08lx\n", hr);
 
     width = height = 0;
     hr = IWICBitmapClipper_GetSize(clipper, &width, &height);
-    ok(hr == S_OK, "got 0x%08x\n", hr);
+    ok(hr == S_OK, "got 0x%08lx\n", hr);
     ok(width == 5, "got %d\n", width);
     ok(height == 5, "got %d\n", height);
 
@@ -1021,12 +1021,12 @@ static void test_clipper(void)
 
     /* CopyPixels */
     hr = IWICImagingFactory_CreateBitmapClipper(factory, &clipper);
-    ok(hr == S_OK, "got 0x%08x\n", hr);
+    ok(hr == S_OK, "got 0x%08lx\n", hr);
 
     rect.X = rect.Y = 5;
     rect.Width = rect.Height = 5;
     hr = IWICBitmapClipper_Initialize(clipper, &bitmapsource, &rect);
-    ok(hr == S_OK, "got 0x%08x\n", hr);
+    ok(hr == S_OK, "got 0x%08lx\n", hr);
 
     rect.X = rect.Y = 0;
     rect.Width = rect.Height = 2;
@@ -1036,7 +1036,7 @@ static void test_clipper(void)
     memset(&g_rect, 0, sizeof(g_rect));
     called_CopyPixels = FALSE;
     hr = IWICBitmapClipper_CopyPixels(clipper, &rect, 0, sizeof(buffer), buffer);
-    ok(hr == S_OK, "got 0x%08x\n", hr);
+    ok(hr == S_OK, "got 0x%08lx\n", hr);
     ok(called_CopyPixels, "CopyPixels not called\n");
     ok(g_rect.X == 5 && g_rect.Y == 5 && g_rect.Width == 2 && g_rect.Height == 2,
         "got wrong rectangle (%d,%d)-(%d,%d)\n", g_rect.X, g_rect.Y, g_rect.Width, g_rect.Height);
@@ -1049,7 +1049,7 @@ static void test_clipper(void)
     rect.Width = rect.Height = 5;
 
     hr = IWICBitmapClipper_CopyPixels(clipper, &rect, 0, sizeof(buffer), buffer);
-    ok(hr == S_OK, "got 0x%08x\n", hr);
+    ok(hr == S_OK, "got 0x%08lx\n", hr);
     ok(called_CopyPixels, "CopyPixels not called\n");
     ok(g_rect.X == 5 && g_rect.Y == 5 && g_rect.Width == 5 && g_rect.Height == 5,
         "got wrong rectangle (%d,%d)-(%d,%d)\n", g_rect.X, g_rect.Y, g_rect.Width, g_rect.Height);
@@ -1062,14 +1062,14 @@ static void test_clipper(void)
     rect.Width = rect.Height = 20;
 
     hr = IWICBitmapClipper_CopyPixels(clipper, &rect, 0, sizeof(buffer), buffer);
-    ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+    ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
     ok(!called_CopyPixels, "CopyPixels called\n");
 
     rect.X = rect.Y = 5;
     rect.Width = rect.Height = 5;
 
     hr = IWICBitmapClipper_CopyPixels(clipper, &rect, 0, sizeof(buffer), buffer);
-    ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+    ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
     ok(!called_CopyPixels, "CopyPixels called\n");
 
     /* null rectangle */
@@ -1077,7 +1077,7 @@ static void test_clipper(void)
     called_CopyPixels = FALSE;
 
     hr = IWICBitmapClipper_CopyPixels(clipper, NULL, 0, sizeof(buffer), buffer);
-    ok(hr == S_OK, "got 0x%08x\n", hr);
+    ok(hr == S_OK, "got 0x%08lx\n", hr);
     ok(called_CopyPixels, "CopyPixels not called\n");
     ok(g_rect.X == 5 && g_rect.Y == 5 && g_rect.Width == 5 && g_rect.Height == 5,
         "got wrong rectangle (%d,%d)-(%d,%d)\n", g_rect.X, g_rect.Y, g_rect.Width, g_rect.Height);
@@ -1109,7 +1109,7 @@ static void test_WICCreateBitmapFromSectionEx(void)
     GetSystemInfo(&sysinfo);
     hsection = CreateFileMappingW(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0,
                                   sysinfo.dwAllocationGranularity * 2, NULL);
-    ok(hsection != NULL, "CreateFileMapping failed %u\n", GetLastError());
+    ok(hsection != NULL, "CreateFileMapping failed %lu\n", GetLastError());
 
     memset(&info, 0, sizeof(info));
     info.bmiHeader.biSize        = sizeof(info.bmiHeader);
@@ -1124,20 +1124,20 @@ static void test_WICCreateBitmapFromSectionEx(void)
 
     hr = pWICCreateBitmapFromSectionEx(3, 3, &GUID_WICPixelFormat24bppBGR, hsection, 0, 0,
                                        WICSectionAccessLevelReadWrite, &bitmap);
-    ok(hr == S_OK, "WICCreateBitmapFromSectionEx returned %#x\n", hr);
+    ok(hr == S_OK, "WICCreateBitmapFromSectionEx returned %#lx\n", hr);
     IWICBitmap_Release(bitmap);
 
     /* non-zero offset, smaller than allocation granularity */
     hr = pWICCreateBitmapFromSectionEx(3, 3, &GUID_WICPixelFormat24bppBGR, hsection, 0, 0x100,
                                        WICSectionAccessLevelReadWrite, &bitmap);
-    ok(hr == S_OK, "WICCreateBitmapFromSectionEx returned %#x\n", hr);
+    ok(hr == S_OK, "WICCreateBitmapFromSectionEx returned %#lx\n", hr);
     IWICBitmap_Release(bitmap);
 
     /* offset larger than allocation granularity */
     hr = pWICCreateBitmapFromSectionEx(3, 3, &GUID_WICPixelFormat24bppBGR, hsection, 0,
                                        sysinfo.dwAllocationGranularity + 1,
                                        WICSectionAccessLevelReadWrite, &bitmap);
-    ok(hr == S_OK, "WICCreateBitmapFromSectionEx returned %#x\n", hr);
+    ok(hr == S_OK, "WICCreateBitmapFromSectionEx returned %#lx\n", hr);
     IWICBitmap_Release(bitmap);
     DeleteObject(hdib);
     CloseHandle(hsection);
@@ -1155,156 +1155,156 @@ static void test_bitmap_scaler(void)
     HRESULT hr;
 
     hr = IWICImagingFactory_CreateBitmap(factory, 4, 2, &GUID_WICPixelFormat24bppBGR, WICBitmapCacheOnLoad, &bitmap);
-    ok(hr == S_OK, "Failed to create a bitmap, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to create a bitmap, hr %#lx.\n", hr);
 
     hr = IWICBitmap_GetSize(bitmap, &width, &height);
-    ok(hr == S_OK, "Failed to get bitmap size, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to get bitmap size, hr %#lx.\n", hr);
     ok(width == 4, "Unexpected width %u.\n", width);
     ok(height == 2, "Unexpected height %u.\n", height);
 
     hr = IWICBitmap_GetResolution(bitmap, &res_x, &res_y);
-    ok(hr == S_OK, "Failed to get bitmap resolution, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to get bitmap resolution, hr %#lx.\n", hr);
     ok(res_x == 0.0 && res_y == 0.0, "Unexpected resolution %f x %f.\n", res_x, res_y);
 
     hr = IWICImagingFactory_CreateBitmapScaler(factory, &scaler);
-    ok(hr == S_OK, "Failed to create bitmap scaler, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to create bitmap scaler, hr %#lx.\n", hr);
 
     hr = IWICBitmapScaler_Initialize(scaler, NULL, 0, 0,
         WICBitmapInterpolationModeNearestNeighbor);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
 
     hr = IWICBitmapScaler_Initialize(scaler, (IWICBitmapSource *)bitmap, 0, 0,
         WICBitmapInterpolationModeNearestNeighbor);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
 
     hr = IWICBitmapScaler_GetSize(scaler, NULL, &height);
-    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr %#x.\n", hr);
+    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr %#lx.\n", hr);
 
     hr = IWICBitmapScaler_GetSize(scaler, &width, NULL);
-    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr %#x.\n", hr);
+    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr %#lx.\n", hr);
 
     hr = IWICBitmapScaler_GetResolution(scaler, NULL, NULL);
-    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr %#x.\n", hr);
+    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr %#lx.\n", hr);
 
     res_x = 0.1;
     hr = IWICBitmapScaler_GetResolution(scaler, &res_x, NULL);
-    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr %#x.\n", hr);
+    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr %#lx.\n", hr);
     ok(res_x == 0.1, "Unexpected resolution %f.\n", res_x);
 
     hr = IWICBitmapScaler_GetResolution(scaler, NULL, &res_y);
-    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr %#x.\n", hr);
+    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr %#lx.\n", hr);
 
     hr = IWICBitmapScaler_GetResolution(scaler, &res_x, &res_y);
-    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr %#x.\n", hr);
+    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr %#lx.\n", hr);
 
     hr = IWICBitmapScaler_GetPixelFormat(scaler, NULL);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
 
     memset(&pixel_format, 0, sizeof(pixel_format));
     hr = IWICBitmapScaler_GetPixelFormat(scaler, &pixel_format);
-    ok(hr == S_OK, "Failed to get pixel format, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to get pixel format, hr %#lx.\n", hr);
     ok(IsEqualGUID(&pixel_format, &GUID_WICPixelFormatDontCare), "Unexpected pixel format %s.\n",
         wine_dbgstr_guid(&pixel_format));
 
     width = 123;
     height = 321;
     hr = IWICBitmapScaler_GetSize(scaler, &width, &height);
-    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr %#x.\n", hr);
+    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr %#lx.\n", hr);
     ok(width == 123, "Unexpected width %u.\n", width);
     ok(height == 321, "Unexpected height %u.\n", height);
 
     hr = IWICBitmapScaler_CopyPalette(scaler, NULL);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
 
     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-    ok(hr == S_OK, "Failed to create a palette, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to create a palette, hr %#lx.\n", hr);
     hr = IWICBitmapScaler_CopyPalette(scaler, palette);
-    ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "Unexpected hr %#x.\n", hr);
+    ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "Unexpected hr %#lx.\n", hr);
     IWICPalette_Release(palette);
 
     hr = IWICBitmapScaler_Initialize(scaler, (IWICBitmapSource *)bitmap, 4, 0,
         WICBitmapInterpolationModeNearestNeighbor);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
 
     hr = IWICBitmapScaler_GetSize(scaler, &width, &height);
-    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr %#x.\n", hr);
+    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr %#lx.\n", hr);
 
     hr = IWICBitmapScaler_CopyPixels(scaler, NULL, 1, sizeof(buf), buf);
-    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr %#x.\n", hr);
+    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr %#lx.\n", hr);
 
     hr = IWICBitmapScaler_Initialize(scaler, (IWICBitmapSource *)bitmap, 0, 2,
         WICBitmapInterpolationModeNearestNeighbor);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
 
     hr = IWICBitmapScaler_GetSize(scaler, &width, &height);
-    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr %#x.\n", hr);
+    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr %#lx.\n", hr);
 
     hr = IWICBitmapScaler_Initialize(scaler, NULL, 8, 4,
         WICBitmapInterpolationModeNearestNeighbor);
-    ok(hr == E_INVALIDARG, "Failed to initialize bitmap scaler, hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Failed to initialize bitmap scaler, hr %#lx.\n", hr);
 
     hr = IWICBitmapScaler_Initialize(scaler, (IWICBitmapSource *)bitmap, 8, 4,
         WICBitmapInterpolationModeNearestNeighbor);
-    ok(hr == S_OK, "Failed to initialize bitmap scaler, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to initialize bitmap scaler, hr %#lx.\n", hr);
 
     hr = IWICBitmapScaler_Initialize(scaler, (IWICBitmapSource *)bitmap, 0, 4,
         WICBitmapInterpolationModeNearestNeighbor);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
 
     hr = IWICBitmapScaler_Initialize(scaler, (IWICBitmapSource *)bitmap, 8, 0,
         WICBitmapInterpolationModeNearestNeighbor);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
 
     hr = IWICBitmapScaler_Initialize(scaler, NULL, 8, 4, WICBitmapInterpolationModeNearestNeighbor);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
 
     hr = IWICBitmapScaler_Initialize(scaler, (IWICBitmapSource *)bitmap, 8, 4,
         WICBitmapInterpolationModeNearestNeighbor);
-    ok(hr == WINCODEC_ERR_WRONGSTATE, "Unexpected hr %#x.\n", hr);
+    ok(hr == WINCODEC_ERR_WRONGSTATE, "Unexpected hr %#lx.\n", hr);
 
     hr = IWICBitmapScaler_GetSize(scaler, &width, &height);
-    ok(hr == S_OK, "Failed to get scaler size, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to get scaler size, hr %#lx.\n", hr);
     ok(width == 8, "Unexpected width %u.\n", width);
     ok(height == 4, "Unexpected height %u.\n", height);
 
     hr = IWICBitmapScaler_GetSize(scaler, NULL, &height);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
 
     hr = IWICBitmapScaler_GetSize(scaler, &width, NULL);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
 
     hr = IWICBitmapScaler_GetSize(scaler, NULL, NULL);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
 
     hr = IWICBitmapScaler_GetPixelFormat(scaler, NULL);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
 
     memset(&pixel_format, 0, sizeof(pixel_format));
     hr = IWICBitmapScaler_GetPixelFormat(scaler, &pixel_format);
-    ok(hr == S_OK, "Failed to get pixel format, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to get pixel format, hr %#lx.\n", hr);
     ok(IsEqualGUID(&pixel_format, &GUID_WICPixelFormat24bppBGR), "Unexpected pixel format %s.\n",
         wine_dbgstr_guid(&pixel_format));
 
     hr = IWICBitmapScaler_GetResolution(scaler, NULL, NULL);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
 
     res_x = 0.1;
     hr = IWICBitmapScaler_GetResolution(scaler, &res_x, NULL);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
     ok(res_x == 0.1, "Unexpected resolution %f.\n", res_x);
 
     hr = IWICBitmapScaler_GetResolution(scaler, NULL, &res_y);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
 
     res_x = res_y = 1.0;
     hr = IWICBitmapScaler_GetResolution(scaler, &res_x, &res_y);
-    ok(hr == S_OK, "Failed to get scaler resolution, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to get scaler resolution, hr %#lx.\n", hr);
     ok(res_x == 0.0 && res_y == 0.0, "Unexpected resolution %f x %f.\n", res_x, res_y);
 
     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-    ok(hr == S_OK, "Failed to create a palette, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to create a palette, hr %#lx.\n", hr);
     hr = IWICBitmapScaler_CopyPalette(scaler, palette);
-    ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "Unexpected hr %#x.\n", hr);
+    ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "Unexpected hr %#lx.\n", hr);
     IWICPalette_Release(palette);
 
     IWICBitmapScaler_Release(scaler);
@@ -1336,125 +1336,125 @@ static void test_IMILBitmap(void)
     /* Bitmap */
     hr = IWICImagingFactory_CreateBitmap(factory, 1, 1, &GUID_WICPixelFormat24bppBGR,
                                          WICBitmapCacheOnDemand, &bitmap);
-    ok(hr == S_OK, "CreateBitmap error %#x\n", hr);
+    ok(hr == S_OK, "CreateBitmap error %#lx\n", hr);
 
-    ok(obj_refcount(bitmap) == 1, "ref count %d\n", obj_refcount(bitmap));
+    ok(obj_refcount(bitmap) == 1, "ref count %ld\n", obj_refcount(bitmap));
 
     hr = IWICBitmap_GetPixelFormat(bitmap, &format);
-    ok(hr == S_OK, "GetPixelFormat error %#x\n", hr);
+    ok(hr == S_OK, "GetPixelFormat error %#lx\n", hr);
     ok(IsEqualGUID(&format, &GUID_WICPixelFormat24bppBGR), "wrong format %s\n", wine_dbgstr_guid(&format));
 
     hr = IWICBitmap_GetResolution(bitmap, &dpix, &dpiy);
-    ok(hr == S_OK, "GetResolution error %#x\n", hr);
+    ok(hr == S_OK, "GetResolution error %#lx\n", hr);
     ok(dpix == 0.0, "got %f, expected 0.0\n", dpix);
     ok(dpiy == 0.0, "got %f, expected 0.0\n", dpiy);
 
     hr = IWICBitmap_SetResolution(bitmap, 12.0, 34.0);
-    ok(hr == S_OK, "SetResolution error %#x\n", hr);
+    ok(hr == S_OK, "SetResolution error %#lx\n", hr);
 
     hr = IWICBitmap_GetResolution(bitmap, &dpix, &dpiy);
-    ok(hr == S_OK, "GetResolution error %#x\n", hr);
+    ok(hr == S_OK, "GetResolution error %#lx\n", hr);
     ok(dpix == 12.0, "got %f, expected 12.0\n", dpix);
     ok(dpiy == 34.0, "got %f, expected 34.0\n", dpiy);
 
     hr = IWICBitmap_GetSize(bitmap, &width, &height);
-    ok(hr == S_OK, "GetSize error %#x\n", hr);
+    ok(hr == S_OK, "GetSize error %#lx\n", hr);
     ok(width == 1, "got %u, expected 1\n", width);
     ok(height == 1, "got %u, expected 1\n", height);
 
     hr = IWICBitmap_QueryInterface(bitmap, &IID_IMILBitmap, (void **)&mil_bitmap);
-    ok(hr == S_OK, "QueryInterface error %#x\n", hr);
+    ok(hr == S_OK, "QueryInterface error %#lx\n", hr);
 
-    ok(obj_refcount(bitmap) == 2, "ref count %d\n", obj_refcount(bitmap));
-    ok(obj_refcount(mil_bitmap) == 2, "ref count %d\n", obj_refcount(mil_bitmap));
+    ok(obj_refcount(bitmap) == 2, "ref count %ld\n", obj_refcount(bitmap));
+    ok(obj_refcount(mil_bitmap) == 2, "ref count %ld\n", obj_refcount(mil_bitmap));
 
     hr = IWICBitmap_QueryInterface(bitmap, &IID_IUnknown, (void **)&wic_unknown);
-    ok(hr == S_OK, "QueryInterface error %#x\n", hr);
+    ok(hr == S_OK, "QueryInterface error %#lx\n", hr);
 
     hr = mil_bitmap->lpVtbl->QueryInterface(mil_bitmap, &IID_IUnknown, (void **)&mil_unknown);
-    ok(hr == S_OK, "QueryInterface error %#x\n", hr);
+    ok(hr == S_OK, "QueryInterface error %#lx\n", hr);
     ok((void *)wic_unknown->lpVtbl == (void *)mil_unknown->lpVtbl, "wrong lpVtbl ptrs %p != %p\n", wic_unknown->lpVtbl, mil_unknown->lpVtbl);
 
     IUnknown_Release(wic_unknown);
     IUnknown_Release(mil_unknown);
 
     hr = IWICBitmap_QueryInterface(bitmap, &IID_IMILBitmapSource, (void **)&mil_source);
-    ok(hr == S_OK, "QueryInterface error %#x\n", hr);
+    ok(hr == S_OK, "QueryInterface error %#lx\n", hr);
     ok((void *)mil_source->lpVtbl == (void *)mil_bitmap->lpVtbl, "IMILBitmap->lpVtbl should be equal to IMILBitmapSource->lpVtbl\n");
 
-    ok(obj_refcount(bitmap) == 3, "ref count %d\n", obj_refcount(bitmap));
-    ok(obj_refcount(mil_bitmap) == 3, "ref count %d\n", obj_refcount(mil_bitmap));
-    ok(obj_refcount(mil_source) == 3, "ref count %d\n", obj_refcount(mil_source));
+    ok(obj_refcount(bitmap) == 3, "ref count %ld\n", obj_refcount(bitmap));
+    ok(obj_refcount(mil_bitmap) == 3, "ref count %ld\n", obj_refcount(mil_bitmap));
+    ok(obj_refcount(mil_source) == 3, "ref count %ld\n", obj_refcount(mil_source));
 
     hr = mil_source->lpVtbl->GetPixelFormat(mil_source, &MIL_format);
-    ok(hr == S_OK, "GetPixelFormat error %#x\n", hr);
+    ok(hr == S_OK, "GetPixelFormat error %#lx\n", hr);
     ok(MIL_format == 0x0c, "wrong format %d\n", MIL_format);
 
     hr = mil_source->lpVtbl->GetResolution(mil_source, &dpix, &dpiy);
-    ok(hr == S_OK, "GetResolution error %#x\n", hr);
+    ok(hr == S_OK, "GetResolution error %#lx\n", hr);
     ok(dpix == 12.0, "got %f, expected 12.0\n", dpix);
     ok(dpiy == 34.0, "got %f, expected 34.0\n", dpiy);
 
     hr = mil_source->lpVtbl->GetSize(mil_source, &width, &height);
-    ok(hr == S_OK, "GetSize error %#x\n", hr);
+    ok(hr == S_OK, "GetSize error %#lx\n", hr);
     ok(width == 1, "got %u, expected 1\n", width);
     ok(height == 1, "got %u, expected 1\n", height);
 
     /* Scaler */
     hr = IWICImagingFactory_CreateBitmapScaler(factory, &scaler);
-    ok(hr == S_OK, "CreateBitmapScaler error %#x\n", hr);
+    ok(hr == S_OK, "CreateBitmapScaler error %#lx\n", hr);
 
-    ok(obj_refcount(scaler) == 1, "ref count %d\n", obj_refcount(scaler));
+    ok(obj_refcount(scaler) == 1, "ref count %ld\n", obj_refcount(scaler));
 
     hr = IWICBitmapScaler_QueryInterface(scaler, &IID_IMILBitmapScaler, (void **)&mil_scaler);
-    ok(hr == S_OK, "QueryInterface error %#x\n", hr);
+    ok(hr == S_OK, "QueryInterface error %#lx\n", hr);
 
-    ok(obj_refcount(scaler) == 2, "ref count %d\n", obj_refcount(scaler));
-    ok(obj_refcount(mil_scaler) == 2, "ref count %d\n", obj_refcount(mil_scaler));
+    ok(obj_refcount(scaler) == 2, "ref count %ld\n", obj_refcount(scaler));
+    ok(obj_refcount(mil_scaler) == 2, "ref count %ld\n", obj_refcount(mil_scaler));
 
     hr = IWICBitmapScaler_QueryInterface(scaler, &IID_IUnknown, (void **)&wic_unknown);
-    ok(hr == S_OK, "QueryInterface error %#x\n", hr);
+    ok(hr == S_OK, "QueryInterface error %#lx\n", hr);
 
     hr = mil_scaler->lpVtbl->QueryInterface(mil_scaler, &IID_IUnknown, (void **)&mil_unknown);
-    ok(hr == S_OK, "QueryInterface error %#x\n", hr);
+    ok(hr == S_OK, "QueryInterface error %#lx\n", hr);
     ok((void *)wic_unknown->lpVtbl == (void *)mil_unknown->lpVtbl, "wrong lpVtbl ptrs %p != %p\n", wic_unknown->lpVtbl, mil_unknown->lpVtbl);
 
     IUnknown_Release(wic_unknown);
     IUnknown_Release(mil_unknown);
 
     hr = mil_scaler->lpVtbl->GetPixelFormat(mil_scaler, &MIL_format);
-    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "GetPixelFormat error %#x\n", hr);
+    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "GetPixelFormat error %#lx\n", hr);
 
     hr = mil_scaler->lpVtbl->GetResolution(mil_scaler, &dpix, &dpiy);
-    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "GetResolution error %#x\n", hr);
+    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "GetResolution error %#lx\n", hr);
 
     hr = mil_scaler->lpVtbl->GetSize(mil_scaler, &width, &height);
-    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "GetSize error %#x\n", hr);
+    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "GetSize error %#lx\n", hr);
 
     memset(buf, 0xde, sizeof(buf));
     hr = mil_scaler->lpVtbl->CopyPixels(mil_scaler, NULL, 3, sizeof(buf), buf);
-    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "CopyPixels error %#x\n", hr);
+    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "CopyPixels error %#lx\n", hr);
 
     hr = mil_scaler->lpVtbl->Initialize(mil_scaler, mil_source, 1, 1, 1);
-    ok(hr == S_OK, "Initialize error %#x\n", hr);
+    ok(hr == S_OK, "Initialize error %#lx\n", hr);
 
     hr = mil_scaler->lpVtbl->GetPixelFormat(mil_scaler, &MIL_format);
-    ok(hr == S_OK, "GetPixelFormat error %#x\n", hr);
+    ok(hr == S_OK, "GetPixelFormat error %#lx\n", hr);
     ok(MIL_format == 0x0c, "wrong format %d\n", MIL_format);
 
     hr = mil_scaler->lpVtbl->GetResolution(mil_scaler, &dpix, &dpiy);
-    ok(hr == S_OK, "GetResolution error %#x\n", hr);
+    ok(hr == S_OK, "GetResolution error %#lx\n", hr);
     ok(dpix == 12.0, "got %f, expected 12.0\n", dpix);
     ok(dpiy == 34.0, "got %f, expected 34.0\n", dpiy);
 
     hr = mil_scaler->lpVtbl->GetSize(mil_scaler, &width, &height);
-    ok(hr == S_OK, "GetSize error %#x\n", hr);
+    ok(hr == S_OK, "GetSize error %#lx\n", hr);
     ok(width == 1, "got %u, expected 1\n", width);
     ok(height == 1, "got %u, expected 1\n", height);
 
     memset(buf, 0xde, sizeof(buf));
     hr = mil_scaler->lpVtbl->CopyPixels(mil_scaler, NULL, 3, sizeof(buf), buf);
-    ok(hr == S_OK, "CopyPixels error %#x\n", hr);
+    ok(hr == S_OK, "CopyPixels error %#lx\n", hr);
     ok(buf[0] == 0 && buf[1] == 0 && buf[2] == 0 && buf[3] == 0xde,"wrong data: %02x %02x %02x %02x\n", buf[0], buf[1], buf[2], buf[3]);
 
     mil_scaler->lpVtbl->Release(mil_scaler);
@@ -1472,7 +1472,7 @@ START_TEST(bitmap)
 
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICImagingFactory, (void**)&factory);
-    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
+    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
 
     test_IMILBitmap();
     test_createbitmap();
diff --git a/dlls/windowscodecs/tests/bmpformat.c b/dlls/windowscodecs/tests/bmpformat.c
index 0e36f644c61..e21fa1ee035 100644
--- a/dlls/windowscodecs/tests/bmpformat.c
+++ b/dlls/windowscodecs/tests/bmpformat.c
@@ -75,7 +75,7 @@ static void test_decode_24bpp(void)
 
     hr = CoCreateInstance(&CLSID_WICBmpDecoder, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICBitmapDecoder, (void**)&decoder);
-    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
+    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
     if (FAILED(hr)) return;
 
     hbmpdata = GlobalAlloc(GMEM_MOVEABLE, sizeof(testbmp_24bpp));
@@ -87,11 +87,11 @@ static void test_decode_24bpp(void)
         GlobalUnlock(hbmpdata);
 
         hr = CreateStreamOnHGlobal(hbmpdata, FALSE, &bmpstream);
-        ok(SUCCEEDED(hr), "CreateStreamOnHGlobal failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "CreateStreamOnHGlobal failed, hr=%lx\n", hr);
         if (SUCCEEDED(hr))
         {
             hr = IWICBitmapDecoder_Initialize(decoder, bmpstream, WICDecodeMetadataCacheOnLoad);
-            ok(hr == S_OK || broken(hr == WINCODEC_ERR_BADIMAGE) /* XP */, "Initialize failed, hr=%x\n", hr);
+            ok(hr == S_OK || broken(hr == WINCODEC_ERR_BADIMAGE) /* XP */, "Initialize failed, hr=%lx\n", hr);
             if (FAILED(hr))
             {
                 win_skip("BMP decoder failed to initialize\n");
@@ -101,72 +101,72 @@ static void test_decode_24bpp(void)
             }
 
             hr = IWICBitmapDecoder_GetContainerFormat(decoder, &guidresult);
-            ok(SUCCEEDED(hr), "GetContainerFormat failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "GetContainerFormat failed, hr=%lx\n", hr);
             ok(IsEqualGUID(&guidresult, &GUID_ContainerFormatBmp), "unexpected container format\n");
 
             hr = IWICBitmapDecoder_GetMetadataQueryReader(decoder, &queryreader);
-            ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "expected WINCODEC_ERR_UNSUPPORTEDOPERATION, got %x\n", hr);
+            ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "expected WINCODEC_ERR_UNSUPPORTEDOPERATION, got %lx\n", hr);
 
             hr = IWICBitmapDecoder_GetColorContexts(decoder, 1, &colorcontext, &count);
-            ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "expected WINCODEC_ERR_UNSUPPORTEDOPERATION, got %x\n", hr);
+            ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "expected WINCODEC_ERR_UNSUPPORTEDOPERATION, got %lx\n", hr);
 
             hr = IWICBitmapDecoder_GetThumbnail(decoder, &thumbnail);
-            ok(hr == WINCODEC_ERR_CODECNOTHUMBNAIL, "expected WINCODEC_ERR_CODECNOTHUMBNAIL, got %x\n", hr);
+            ok(hr == WINCODEC_ERR_CODECNOTHUMBNAIL, "expected WINCODEC_ERR_CODECNOTHUMBNAIL, got %lx\n", hr);
 
             hr = IWICBitmapDecoder_GetPreview(decoder, &thumbnail);
-            ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "expected WINCODEC_ERR_UNSUPPORTEDOPERATION, got %x\n", hr);
+            ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "expected WINCODEC_ERR_UNSUPPORTEDOPERATION, got %lx\n", hr);
 
             hr = IWICBitmapDecoder_GetFrameCount(decoder, &count);
-            ok(SUCCEEDED(hr), "GetFrameCount failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "GetFrameCount failed, hr=%lx\n", hr);
             ok(count == 1, "unexpected count %u\n", count);
 
             hr = IWICBitmapDecoder_GetFrame(decoder, 1, &framedecode);
-            ok(hr == E_INVALIDARG || hr == WINCODEC_ERR_FRAMEMISSING, "GetFrame returned %x\n", hr);
+            ok(hr == E_INVALIDARG || hr == WINCODEC_ERR_FRAMEMISSING, "GetFrame returned %lx\n", hr);
 
             hr = IWICBitmapDecoder_GetFrame(decoder, 0, &framedecode);
-            ok(SUCCEEDED(hr), "GetFrame failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "GetFrame failed, hr=%lx\n", hr);
             if (SUCCEEDED(hr))
             {
                 IWICImagingFactory *factory;
                 IWICPalette *palette;
 
                 hr = IWICBitmapFrameDecode_GetSize(framedecode, &width, &height);
-                ok(SUCCEEDED(hr), "GetSize failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "GetSize failed, hr=%lx\n", hr);
                 ok(width == 2, "expected width=2, got %u\n", width);
                 ok(height == 3, "expected height=2, got %u\n", height);
 
                 hr = IWICBitmapFrameDecode_GetResolution(framedecode, &dpiX, &dpiY);
-                ok(SUCCEEDED(hr), "GetResolution failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "GetResolution failed, hr=%lx\n", hr);
                 ok(dpiX == 96.0, "expected dpiX=96.0, got %f\n", dpiX);
                 ok(dpiY == 96.0, "expected dpiY=96.0, got %f\n", dpiY);
 
                 hr = IWICBitmapFrameDecode_GetPixelFormat(framedecode, &guidresult);
-                ok(SUCCEEDED(hr), "GetPixelFormat failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "GetPixelFormat failed, hr=%lx\n", hr);
                 ok(IsEqualGUID(&guidresult, &GUID_WICPixelFormat24bppBGR), "unexpected pixel format\n");
 
                 hr = IWICBitmapFrameDecode_GetMetadataQueryReader(framedecode, &queryreader);
-                ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "expected WINCODEC_ERR_UNSUPPORTEDOPERATION, got %x\n", hr);
+                ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "expected WINCODEC_ERR_UNSUPPORTEDOPERATION, got %lx\n", hr);
 
                 hr = IWICBitmapFrameDecode_GetColorContexts(framedecode, 1, &colorcontext, &count);
-                ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "expected WINCODEC_ERR_UNSUPPORTEDOPERATION, got %x\n", hr);
+                ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "expected WINCODEC_ERR_UNSUPPORTEDOPERATION, got %lx\n", hr);
 
                 hr = IWICBitmapFrameDecode_GetThumbnail(framedecode, &thumbnail);
-                ok(hr == WINCODEC_ERR_CODECNOTHUMBNAIL, "expected WINCODEC_ERR_CODECNOTHUMBNAIL, got %x\n", hr);
+                ok(hr == WINCODEC_ERR_CODECNOTHUMBNAIL, "expected WINCODEC_ERR_CODECNOTHUMBNAIL, got %lx\n", hr);
 
                 hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
                     &IID_IWICImagingFactory, (void**)&factory);
-                ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
                 if (SUCCEEDED(hr))
                 {
                     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-                    ok(SUCCEEDED(hr), "CreatePalette failed, hr=%x\n", hr);
+                    ok(SUCCEEDED(hr), "CreatePalette failed, hr=%lx\n", hr);
                     if (SUCCEEDED(hr))
                     {
                         hr = IWICBitmapDecoder_CopyPalette(decoder, palette);
-                        ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "expected WINCODEC_ERR_PALETTEUNAVAILABLE, got %x\n", hr);
+                        ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "expected WINCODEC_ERR_PALETTEUNAVAILABLE, got %lx\n", hr);
 
                         hr = IWICBitmapFrameDecode_CopyPalette(framedecode, palette);
-                        ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "expected WINCODEC_ERR_PALETTEUNAVAILABLE, got %x\n", hr);
+                        ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "expected WINCODEC_ERR_PALETTEUNAVAILABLE, got %lx\n", hr);
 
                         IWICPalette_Release(palette);
                     }
@@ -179,39 +179,39 @@ static void test_decode_24bpp(void)
                 rc.Width = 3;
                 rc.Height = 3;
                 hr = IWICBitmapFrameDecode_CopyPixels(framedecode, &rc, 6, sizeof(imagedata), imagedata);
-                ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %x\n", hr);
+                ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %lx\n", hr);
 
                 rc.X = -1;
                 rc.Y = 0;
                 rc.Width = 2;
                 rc.Height = 3;
                 hr = IWICBitmapFrameDecode_CopyPixels(framedecode, &rc, 6, sizeof(imagedata), imagedata);
-                ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %x\n", hr);
+                ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %lx\n", hr);
 
                 rc.X = 0;
                 rc.Y = 0;
                 rc.Width = 2;
                 rc.Height = 3;
                 hr = IWICBitmapFrameDecode_CopyPixels(framedecode, &rc, 4, sizeof(imagedata), imagedata);
-                ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %x\n", hr);
+                ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %lx\n", hr);
 
                 rc.X = 0;
                 rc.Y = 0;
                 rc.Width = 2;
                 rc.Height = 3;
                 hr = IWICBitmapFrameDecode_CopyPixels(framedecode, &rc, 4, 5, imagedata);
-                ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %x\n", hr);
+                ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %lx\n", hr);
 
                 rc.X = 0;
                 rc.Y = 0;
                 rc.Width = 2;
                 rc.Height = 3;
                 hr = IWICBitmapFrameDecode_CopyPixels(framedecode, &rc, 6, sizeof(imagedata), imagedata);
-                ok(SUCCEEDED(hr), "CopyPixels failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "CopyPixels failed, hr=%lx\n", hr);
                 ok(!memcmp(imagedata, expected_imagedata, sizeof(imagedata)), "unexpected image data\n");
 
                 hr = IWICBitmapFrameDecode_CopyPixels(framedecode, NULL, 6, sizeof(imagedata), imagedata);
-                ok(SUCCEEDED(hr), "CopyPixels(rect=NULL) failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "CopyPixels(rect=NULL) failed, hr=%lx\n", hr);
                 ok(!memcmp(imagedata, expected_imagedata, sizeof(imagedata)), "unexpected image data\n");
 
                 IWICBitmapFrameDecode_Release(framedecode);
@@ -219,29 +219,29 @@ static void test_decode_24bpp(void)
 
             /* cannot initialize twice */
             hr = IWICBitmapDecoder_Initialize(decoder, bmpstream, WICDecodeMetadataCacheOnLoad);
-            ok(hr == WINCODEC_ERR_WRONGSTATE, "expected WINCODEC_ERR_WRONGSTATE, hr=%x\n", hr);
+            ok(hr == WINCODEC_ERR_WRONGSTATE, "expected WINCODEC_ERR_WRONGSTATE, hr=%lx\n", hr);
 
             /* cannot querycapability after initialize */
             hr = IWICBitmapDecoder_QueryCapability(decoder, bmpstream, &capability);
-            ok(hr == WINCODEC_ERR_WRONGSTATE, "expected WINCODEC_ERR_WRONGSTATE, hr=%x\n", hr);
+            ok(hr == WINCODEC_ERR_WRONGSTATE, "expected WINCODEC_ERR_WRONGSTATE, hr=%lx\n", hr);
 
             hr = CoCreateInstance(&CLSID_WICBmpDecoder, NULL, CLSCTX_INPROC_SERVER,
                 &IID_IWICBitmapDecoder, (void**)&decoder2);
-            ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
             if (SUCCEEDED(hr))
             {
                 hr = IWICBitmapDecoder_QueryCapability(decoder2, bmpstream, &capability);
-                ok(hr == S_OK, "QueryCapability failed, hr=%x\n", hr);
+                ok(hr == S_OK, "QueryCapability failed, hr=%lx\n", hr);
                 ok(capability == (WICBitmapDecoderCapabilityCanDecodeAllImages),
-                    "unexpected capabilities: %x\n", capability);
+                    "unexpected capabilities: %lx\n", capability);
 
                 /* cannot initialize after querycapability */
                 hr = IWICBitmapDecoder_Initialize(decoder2, bmpstream, WICDecodeMetadataCacheOnLoad);
-                ok(hr == WINCODEC_ERR_WRONGSTATE, "expected WINCODEC_ERR_WRONGSTATE, hr=%x\n", hr);
+                ok(hr == WINCODEC_ERR_WRONGSTATE, "expected WINCODEC_ERR_WRONGSTATE, hr=%lx\n", hr);
 
                 /* cannot querycapability twice */
                 hr = IWICBitmapDecoder_QueryCapability(decoder2, bmpstream, &capability);
-                ok(hr == WINCODEC_ERR_WRONGSTATE, "expected WINCODEC_ERR_WRONGSTATE, hr=%x\n", hr);
+                ok(hr == WINCODEC_ERR_WRONGSTATE, "expected WINCODEC_ERR_WRONGSTATE, hr=%lx\n", hr);
 
                 IWICBitmapDecoder_Release(decoder2);
             }
@@ -295,7 +295,7 @@ static void test_decode_1bpp(void)
 
     hr = CoCreateInstance(&CLSID_WICBmpDecoder, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICBitmapDecoder, (void**)&decoder);
-    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
+    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
     if (FAILED(hr)) return;
 
     hbmpdata = GlobalAlloc(GMEM_MOVEABLE, sizeof(testbmp_1bpp));
@@ -307,62 +307,62 @@ static void test_decode_1bpp(void)
         GlobalUnlock(hbmpdata);
 
         hr = CreateStreamOnHGlobal(hbmpdata, FALSE, &bmpstream);
-        ok(SUCCEEDED(hr), "CreateStreamOnHGlobal failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "CreateStreamOnHGlobal failed, hr=%lx\n", hr);
         if (SUCCEEDED(hr))
         {
             hr = IWICBitmapDecoder_Initialize(decoder, bmpstream, WICDecodeMetadataCacheOnLoad);
-            ok(hr == S_OK, "Initialize failed, hr=%x\n", hr);
+            ok(hr == S_OK, "Initialize failed, hr=%lx\n", hr);
 
             hr = IWICBitmapDecoder_GetContainerFormat(decoder, &guidresult);
-            ok(SUCCEEDED(hr), "GetContainerFormat failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "GetContainerFormat failed, hr=%lx\n", hr);
             ok(IsEqualGUID(&guidresult, &GUID_ContainerFormatBmp), "unexpected container format\n");
 
             hr = IWICBitmapDecoder_GetFrameCount(decoder, &count);
-            ok(SUCCEEDED(hr), "GetFrameCount failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "GetFrameCount failed, hr=%lx\n", hr);
             ok(count == 1, "unexpected count %u\n", count);
 
             hr = IWICBitmapDecoder_GetFrame(decoder, 0, &framedecode);
-            ok(SUCCEEDED(hr), "GetFrame failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "GetFrame failed, hr=%lx\n", hr);
             if (SUCCEEDED(hr))
             {
                 IWICImagingFactory *factory;
                 IWICPalette *palette;
 
                 hr = IWICBitmapFrameDecode_GetSize(framedecode, &width, &height);
-                ok(SUCCEEDED(hr), "GetSize failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "GetSize failed, hr=%lx\n", hr);
                 ok(width == 2, "expected width=2, got %u\n", width);
                 ok(height == 2, "expected height=2, got %u\n", height);
 
                 hr = IWICBitmapFrameDecode_GetResolution(framedecode, &dpiX, &dpiY);
-                ok(SUCCEEDED(hr), "GetResolution failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "GetResolution failed, hr=%lx\n", hr);
                 ok(dpiX == 96.0, "expected dpiX=96.0, got %f\n", dpiX);
                 ok(dpiY == 96.0, "expected dpiY=96.0, got %f\n", dpiY);
 
                 hr = IWICBitmapFrameDecode_GetPixelFormat(framedecode, &guidresult);
-                ok(SUCCEEDED(hr), "GetPixelFormat failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "GetPixelFormat failed, hr=%lx\n", hr);
                 ok(IsEqualGUID(&guidresult, &GUID_WICPixelFormat1bppIndexed), "unexpected pixel format\n");
 
                 hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
                     &IID_IWICImagingFactory, (void**)&factory);
-                ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
                 if (SUCCEEDED(hr))
                 {
                     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-                    ok(SUCCEEDED(hr), "CreatePalette failed, hr=%x\n", hr);
+                    ok(SUCCEEDED(hr), "CreatePalette failed, hr=%lx\n", hr);
                     if (SUCCEEDED(hr))
                     {
                         hr = IWICBitmapDecoder_CopyPalette(decoder, palette);
-                        ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "expected WINCODEC_ERR_PALETTEUNAVAILABLE, got %x\n", hr);
+                        ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "expected WINCODEC_ERR_PALETTEUNAVAILABLE, got %lx\n", hr);
 
                         hr = IWICBitmapFrameDecode_CopyPalette(framedecode, palette);
-                        ok(SUCCEEDED(hr), "CopyPalette failed, hr=%x\n", hr);
+                        ok(SUCCEEDED(hr), "CopyPalette failed, hr=%lx\n", hr);
 
                         hr = IWICPalette_GetColorCount(palette, &count);
-                        ok(SUCCEEDED(hr), "GetColorCount failed, hr=%x\n", hr);
+                        ok(SUCCEEDED(hr), "GetColorCount failed, hr=%lx\n", hr);
                         ok(count == 2, "expected count=2, got %u\n", count);
 
                         hr = IWICPalette_GetColors(palette, 2, palettedata, &count);
-                        ok(SUCCEEDED(hr), "GetColorCount failed, hr=%x\n", hr);
+                        ok(SUCCEEDED(hr), "GetColorCount failed, hr=%lx\n", hr);
                         ok(count == 2, "expected count=2, got %u\n", count);
                         ok(!memcmp(palettedata, expected_palettedata, sizeof(palettedata)), "unexpected palette data\n");
 
@@ -377,7 +377,7 @@ static void test_decode_1bpp(void)
                 rc.Width = 2;
                 rc.Height = 2;
                 hr = IWICBitmapFrameDecode_CopyPixels(framedecode, &rc, 1, sizeof(imagedata), imagedata);
-                ok(SUCCEEDED(hr), "CopyPixels failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "CopyPixels failed, hr=%lx\n", hr);
                 ok(!memcmp(imagedata, expected_imagedata, sizeof(imagedata)), "unexpected image data\n");
 
                 IWICBitmapFrameDecode_Release(framedecode);
@@ -385,13 +385,13 @@ static void test_decode_1bpp(void)
 
             hr = CoCreateInstance(&CLSID_WICBmpDecoder, NULL, CLSCTX_INPROC_SERVER,
                 &IID_IWICBitmapDecoder, (void**)&decoder2);
-            ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
             if (SUCCEEDED(hr))
             {
                 hr = IWICBitmapDecoder_QueryCapability(decoder2, bmpstream, &capability);
-                ok(hr == S_OK, "QueryCapability failed, hr=%x\n", hr);
+                ok(hr == S_OK, "QueryCapability failed, hr=%lx\n", hr);
                 ok(capability == (WICBitmapDecoderCapabilityCanDecodeAllImages),
-                    "unexpected capabilities: %x\n", capability);
+                    "unexpected capabilities: %lx\n", capability);
                 IWICBitmapDecoder_Release(decoder2);
             }
 
@@ -454,7 +454,7 @@ static void test_decode_4bpp(void)
 
     hr = CoCreateInstance(&CLSID_WICBmpDecoder, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICBitmapDecoder, (void**)&decoder);
-    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
+    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
     if (FAILED(hr)) return;
 
     hbmpdata = GlobalAlloc(GMEM_MOVEABLE, sizeof(testbmp_4bpp));
@@ -466,62 +466,62 @@ static void test_decode_4bpp(void)
         GlobalUnlock(hbmpdata);
 
         hr = CreateStreamOnHGlobal(hbmpdata, FALSE, &bmpstream);
-        ok(SUCCEEDED(hr), "CreateStreamOnHGlobal failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "CreateStreamOnHGlobal failed, hr=%lx\n", hr);
         if (SUCCEEDED(hr))
         {
             hr = IWICBitmapDecoder_Initialize(decoder, bmpstream, WICDecodeMetadataCacheOnLoad);
-            ok(hr == S_OK, "Initialize failed, hr=%x\n", hr);
+            ok(hr == S_OK, "Initialize failed, hr=%lx\n", hr);
 
             hr = IWICBitmapDecoder_GetContainerFormat(decoder, &guidresult);
-            ok(SUCCEEDED(hr), "GetContainerFormat failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "GetContainerFormat failed, hr=%lx\n", hr);
             ok(IsEqualGUID(&guidresult, &GUID_ContainerFormatBmp), "unexpected container format\n");
 
             hr = IWICBitmapDecoder_GetFrameCount(decoder, &count);
-            ok(SUCCEEDED(hr), "GetFrameCount failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "GetFrameCount failed, hr=%lx\n", hr);
             ok(count == 1, "unexpected count %u\n", count);
 
             hr = IWICBitmapDecoder_GetFrame(decoder, 0, &framedecode);
-            ok(SUCCEEDED(hr), "GetFrame failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "GetFrame failed, hr=%lx\n", hr);
             if (SUCCEEDED(hr))
             {
                 IWICImagingFactory *factory;
                 IWICPalette *palette;
 
                 hr = IWICBitmapFrameDecode_GetSize(framedecode, &width, &height);
-                ok(SUCCEEDED(hr), "GetSize failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "GetSize failed, hr=%lx\n", hr);
                 ok(width == 2, "expected width=2, got %u\n", width);
                 ok(height == 2, "expected height=2, got %u\n", height);
 
                 hr = IWICBitmapFrameDecode_GetResolution(framedecode, &dpiX, &dpiY);
-                ok(SUCCEEDED(hr), "GetResolution failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "GetResolution failed, hr=%lx\n", hr);
                 ok(fabs(dpiX - 254.0) < 0.01, "expected dpiX=96.0, got %f\n", dpiX);
                 ok(fabs(dpiY - 508.0) < 0.01, "expected dpiY=96.0, got %f\n", dpiY);
 
                 hr = IWICBitmapFrameDecode_GetPixelFormat(framedecode, &guidresult);
-                ok(SUCCEEDED(hr), "GetPixelFormat failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "GetPixelFormat failed, hr=%lx\n", hr);
                 ok(IsEqualGUID(&guidresult, &GUID_WICPixelFormat4bppIndexed), "unexpected pixel format\n");
 
                 hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
                     &IID_IWICImagingFactory, (void**)&factory);
-                ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
                 if (SUCCEEDED(hr))
                 {
                     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-                    ok(SUCCEEDED(hr), "CreatePalette failed, hr=%x\n", hr);
+                    ok(SUCCEEDED(hr), "CreatePalette failed, hr=%lx\n", hr);
                     if (SUCCEEDED(hr))
                     {
                         hr = IWICBitmapDecoder_CopyPalette(decoder, palette);
-                        ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "expected WINCODEC_ERR_PALETTEUNAVAILABLE, got %x\n", hr);
+                        ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "expected WINCODEC_ERR_PALETTEUNAVAILABLE, got %lx\n", hr);
 
                         hr = IWICBitmapFrameDecode_CopyPalette(framedecode, palette);
-                        ok(SUCCEEDED(hr), "CopyPalette failed, hr=%x\n", hr);
+                        ok(SUCCEEDED(hr), "CopyPalette failed, hr=%lx\n", hr);
 
                         hr = IWICPalette_GetColorCount(palette, &count);
-                        ok(SUCCEEDED(hr), "GetColorCount failed, hr=%x\n", hr);
+                        ok(SUCCEEDED(hr), "GetColorCount failed, hr=%lx\n", hr);
                         ok(count == 5, "expected count=5, got %u\n", count);
 
                         hr = IWICPalette_GetColors(palette, 5, palettedata, &count);
-                        ok(SUCCEEDED(hr), "GetColorCount failed, hr=%x\n", hr);
+                        ok(SUCCEEDED(hr), "GetColorCount failed, hr=%lx\n", hr);
                         ok(count == 5, "expected count=5, got %u\n", count);
                         ok(!memcmp(palettedata, expected_palettedata, sizeof(palettedata)), "unexpected palette data\n");
 
@@ -536,7 +536,7 @@ static void test_decode_4bpp(void)
                 rc.Width = 2;
                 rc.Height = 2;
                 hr = IWICBitmapFrameDecode_CopyPixels(framedecode, &rc, 1, sizeof(imagedata), imagedata);
-                ok(SUCCEEDED(hr), "CopyPixels failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "CopyPixels failed, hr=%lx\n", hr);
                 ok(!memcmp(imagedata, expected_imagedata, sizeof(imagedata)), "unexpected image data\n");
 
                 IWICBitmapFrameDecode_Release(framedecode);
@@ -544,13 +544,13 @@ static void test_decode_4bpp(void)
 
             hr = CoCreateInstance(&CLSID_WICBmpDecoder, NULL, CLSCTX_INPROC_SERVER,
                 &IID_IWICBitmapDecoder, (void**)&decoder2);
-            ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
             if (SUCCEEDED(hr))
             {
                 hr = IWICBitmapDecoder_QueryCapability(decoder2, bmpstream, &capability);
-                ok(hr == S_OK, "QueryCapability failed, hr=%x\n", hr);
+                ok(hr == S_OK, "QueryCapability failed, hr=%lx\n", hr);
                 ok(capability == (WICBitmapDecoderCapabilityCanDecodeAllImages),
-                    "unexpected capabilities: %x\n", capability);
+                    "unexpected capabilities: %lx\n", capability);
                 IWICBitmapDecoder_Release(decoder2);
             }
 
@@ -634,7 +634,7 @@ static void test_decode_rle8(void)
 
     hr = CoCreateInstance(&CLSID_WICBmpDecoder, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICBitmapDecoder, (void**)&decoder);
-    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
+    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
     if (FAILED(hr)) return;
 
     hbmpdata = GlobalAlloc(GMEM_MOVEABLE, sizeof(testbmp_rle8));
@@ -646,62 +646,62 @@ static void test_decode_rle8(void)
         GlobalUnlock(hbmpdata);
 
         hr = CreateStreamOnHGlobal(hbmpdata, FALSE, &bmpstream);
-        ok(SUCCEEDED(hr), "CreateStreamOnHGlobal failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "CreateStreamOnHGlobal failed, hr=%lx\n", hr);
         if (SUCCEEDED(hr))
         {
             hr = IWICBitmapDecoder_Initialize(decoder, bmpstream, WICDecodeMetadataCacheOnLoad);
-            ok(hr == S_OK, "Initialize failed, hr=%x\n", hr);
+            ok(hr == S_OK, "Initialize failed, hr=%lx\n", hr);
 
             hr = IWICBitmapDecoder_GetContainerFormat(decoder, &guidresult);
-            ok(SUCCEEDED(hr), "GetContainerFormat failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "GetContainerFormat failed, hr=%lx\n", hr);
             ok(IsEqualGUID(&guidresult, &GUID_ContainerFormatBmp), "unexpected container format\n");
 
             hr = IWICBitmapDecoder_GetFrameCount(decoder, &count);
-            ok(SUCCEEDED(hr), "GetFrameCount failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "GetFrameCount failed, hr=%lx\n", hr);
             ok(count == 1, "unexpected count %u\n", count);
 
             hr = IWICBitmapDecoder_GetFrame(decoder, 0, &framedecode);
-            ok(SUCCEEDED(hr), "GetFrame failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "GetFrame failed, hr=%lx\n", hr);
             if (SUCCEEDED(hr))
             {
                 IWICImagingFactory *factory;
                 IWICPalette *palette;
 
                 hr = IWICBitmapFrameDecode_GetSize(framedecode, &width, &height);
-                ok(SUCCEEDED(hr), "GetSize failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "GetSize failed, hr=%lx\n", hr);
                 ok(width == 8, "expected width=8, got %u\n", width);
                 ok(height == 8, "expected height=8, got %u\n", height);
 
                 hr = IWICBitmapFrameDecode_GetResolution(framedecode, &dpiX, &dpiY);
-                ok(SUCCEEDED(hr), "GetResolution failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "GetResolution failed, hr=%lx\n", hr);
                 ok(fabs(dpiX - 72.0) < 0.01, "expected dpiX=96.0, got %f\n", dpiX);
                 ok(fabs(dpiY - 72.0) < 0.01, "expected dpiY=96.0, got %f\n", dpiY);
 
                 hr = IWICBitmapFrameDecode_GetPixelFormat(framedecode, &guidresult);
-                ok(SUCCEEDED(hr), "GetPixelFormat failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "GetPixelFormat failed, hr=%lx\n", hr);
                 ok(IsEqualGUID(&guidresult, &GUID_WICPixelFormat32bppBGR), "unexpected pixel format\n");
 
                 hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
                     &IID_IWICImagingFactory, (void**)&factory);
-                ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
                 if (SUCCEEDED(hr))
                 {
                     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-                    ok(SUCCEEDED(hr), "CreatePalette failed, hr=%x\n", hr);
+                    ok(SUCCEEDED(hr), "CreatePalette failed, hr=%lx\n", hr);
                     if (SUCCEEDED(hr))
                     {
                         hr = IWICBitmapDecoder_CopyPalette(decoder, palette);
-                        ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "expected WINCODEC_ERR_PALETTEUNAVAILABLE, got %x\n", hr);
+                        ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "expected WINCODEC_ERR_PALETTEUNAVAILABLE, got %lx\n", hr);
 
                         hr = IWICBitmapFrameDecode_CopyPalette(framedecode, palette);
-                        ok(SUCCEEDED(hr), "CopyPalette failed, hr=%x\n", hr);
+                        ok(SUCCEEDED(hr), "CopyPalette failed, hr=%lx\n", hr);
 
                         hr = IWICPalette_GetColorCount(palette, &count);
-                        ok(SUCCEEDED(hr), "GetColorCount failed, hr=%x\n", hr);
+                        ok(SUCCEEDED(hr), "GetColorCount failed, hr=%lx\n", hr);
                         ok(count == 17, "expected count=17, got %u\n", count);
 
                         hr = IWICPalette_GetColors(palette, 17, palettedata, &count);
-                        ok(SUCCEEDED(hr), "GetColorCount failed, hr=%x\n", hr);
+                        ok(SUCCEEDED(hr), "GetColorCount failed, hr=%lx\n", hr);
                         ok(count == 17, "expected count=17, got %u\n", count);
                         ok(!memcmp(palettedata, expected_palettedata, sizeof(palettedata)), "unexpected palette data\n");
 
@@ -716,7 +716,7 @@ static void test_decode_rle8(void)
                 rc.Width = 8;
                 rc.Height = 8;
                 hr = IWICBitmapFrameDecode_CopyPixels(framedecode, &rc, 32, sizeof(imagedata), (BYTE*)imagedata);
-                ok(SUCCEEDED(hr), "CopyPixels failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "CopyPixels failed, hr=%lx\n", hr);
                 ok(!memcmp(imagedata, expected_imagedata, sizeof(imagedata)), "unexpected image data\n");
 
                 IWICBitmapFrameDecode_Release(framedecode);
@@ -724,13 +724,13 @@ static void test_decode_rle8(void)
 
             hr = CoCreateInstance(&CLSID_WICBmpDecoder, NULL, CLSCTX_INPROC_SERVER,
                 &IID_IWICBitmapDecoder, (void**)&decoder2);
-            ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
             if (SUCCEEDED(hr))
             {
                 hr = IWICBitmapDecoder_QueryCapability(decoder2, bmpstream, &capability);
-                ok(hr == S_OK, "QueryCapability failed, hr=%x\n", hr);
+                ok(hr == S_OK, "QueryCapability failed, hr=%lx\n", hr);
                 ok(capability == (WICBitmapDecoderCapabilityCanDecodeAllImages),
-                    "unexpected capabilities: %x\n", capability);
+                    "unexpected capabilities: %lx\n", capability);
                 IWICBitmapDecoder_Release(decoder2);
             }
 
@@ -801,7 +801,7 @@ static void test_decode_rle4(void)
 
     hr = CoCreateInstance(&CLSID_WICBmpDecoder, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICBitmapDecoder, (void**)&decoder);
-    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
+    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
     if (FAILED(hr)) return;
 
     hbmpdata = GlobalAlloc(GMEM_MOVEABLE, sizeof(testbmp_rle4));
@@ -813,62 +813,62 @@ static void test_decode_rle4(void)
         GlobalUnlock(hbmpdata);
 
         hr = CreateStreamOnHGlobal(hbmpdata, FALSE, &bmpstream);
-        ok(SUCCEEDED(hr), "CreateStreamOnHGlobal failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "CreateStreamOnHGlobal failed, hr=%lx\n", hr);
         if (SUCCEEDED(hr))
         {
             hr = IWICBitmapDecoder_Initialize(decoder, bmpstream, WICDecodeMetadataCacheOnLoad);
-            ok(hr == S_OK, "Initialize failed, hr=%x\n", hr);
+            ok(hr == S_OK, "Initialize failed, hr=%lx\n", hr);
 
             hr = IWICBitmapDecoder_GetContainerFormat(decoder, &guidresult);
-            ok(SUCCEEDED(hr), "GetContainerFormat failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "GetContainerFormat failed, hr=%lx\n", hr);
             ok(IsEqualGUID(&guidresult, &GUID_ContainerFormatBmp), "unexpected container format\n");
 
             hr = IWICBitmapDecoder_GetFrameCount(decoder, &count);
-            ok(SUCCEEDED(hr), "GetFrameCount failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "GetFrameCount failed, hr=%lx\n", hr);
             ok(count == 1, "unexpected count %u\n", count);
 
             hr = IWICBitmapDecoder_GetFrame(decoder, 0, &framedecode);
-            ok(SUCCEEDED(hr), "GetFrame failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "GetFrame failed, hr=%lx\n", hr);
             if (SUCCEEDED(hr))
             {
                 IWICImagingFactory *factory;
                 IWICPalette *palette;
 
                 hr = IWICBitmapFrameDecode_GetSize(framedecode, &width, &height);
-                ok(SUCCEEDED(hr), "GetSize failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "GetSize failed, hr=%lx\n", hr);
                 ok(width == 8, "expected width=8, got %u\n", width);
                 ok(height == 8, "expected height=8, got %u\n", height);
 
                 hr = IWICBitmapFrameDecode_GetResolution(framedecode, &dpiX, &dpiY);
-                ok(SUCCEEDED(hr), "GetResolution failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "GetResolution failed, hr=%lx\n", hr);
                 ok(fabs(dpiX - 72.0) < 0.01, "expected dpiX=96.0, got %f\n", dpiX);
                 ok(fabs(dpiY - 72.0) < 0.01, "expected dpiY=96.0, got %f\n", dpiY);
 
                 hr = IWICBitmapFrameDecode_GetPixelFormat(framedecode, &guidresult);
-                ok(SUCCEEDED(hr), "GetPixelFormat failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "GetPixelFormat failed, hr=%lx\n", hr);
                 ok(IsEqualGUID(&guidresult, &GUID_WICPixelFormat32bppBGR), "unexpected pixel format\n");
 
                 hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
                     &IID_IWICImagingFactory, (void**)&factory);
-                ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
                 if (SUCCEEDED(hr))
                 {
                     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-                    ok(SUCCEEDED(hr), "CreatePalette failed, hr=%x\n", hr);
+                    ok(SUCCEEDED(hr), "CreatePalette failed, hr=%lx\n", hr);
                     if (SUCCEEDED(hr))
                     {
                         hr = IWICBitmapDecoder_CopyPalette(decoder, palette);
-                        ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "expected WINCODEC_ERR_PALETTEUNAVAILABLE, got %x\n", hr);
+                        ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "expected WINCODEC_ERR_PALETTEUNAVAILABLE, got %lx\n", hr);
 
                         hr = IWICBitmapFrameDecode_CopyPalette(framedecode, palette);
-                        ok(SUCCEEDED(hr), "CopyPalette failed, hr=%x\n", hr);
+                        ok(SUCCEEDED(hr), "CopyPalette failed, hr=%lx\n", hr);
 
                         hr = IWICPalette_GetColorCount(palette, &count);
-                        ok(SUCCEEDED(hr), "GetColorCount failed, hr=%x\n", hr);
+                        ok(SUCCEEDED(hr), "GetColorCount failed, hr=%lx\n", hr);
                         ok(count == 6, "expected count=6, got %u\n", count);
 
                         hr = IWICPalette_GetColors(palette, 6, palettedata, &count);
-                        ok(SUCCEEDED(hr), "GetColorCount failed, hr=%x\n", hr);
+                        ok(SUCCEEDED(hr), "GetColorCount failed, hr=%lx\n", hr);
                         ok(count == 6, "expected count=6, got %u\n", count);
                         ok(!memcmp(palettedata, expected_palettedata, sizeof(palettedata)), "unexpected palette data\n");
 
@@ -883,7 +883,7 @@ static void test_decode_rle4(void)
                 rc.Width = 8;
                 rc.Height = 8;
                 hr = IWICBitmapFrameDecode_CopyPixels(framedecode, &rc, 32, sizeof(imagedata), (BYTE*)imagedata);
-                ok(SUCCEEDED(hr), "CopyPixels failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "CopyPixels failed, hr=%lx\n", hr);
                 ok(!memcmp(imagedata, expected_imagedata, sizeof(imagedata)), "unexpected image data\n");
 
                 IWICBitmapFrameDecode_Release(framedecode);
@@ -891,13 +891,13 @@ static void test_decode_rle4(void)
 
             hr = CoCreateInstance(&CLSID_WICBmpDecoder, NULL, CLSCTX_INPROC_SERVER,
                 &IID_IWICBitmapDecoder, (void**)&decoder2);
-            ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
             if (SUCCEEDED(hr))
             {
                 hr = IWICBitmapDecoder_QueryCapability(decoder2, bmpstream, &capability);
-                ok(hr == S_OK, "QueryCapability failed, hr=%x\n", hr);
+                ok(hr == S_OK, "QueryCapability failed, hr=%lx\n", hr);
                 ok(capability == (WICBitmapDecoderCapabilityCanDecodeAllImages),
-                    "unexpected capabilities: %x\n", capability);
+                    "unexpected capabilities: %lx\n", capability);
                 IWICBitmapDecoder_Release(decoder2);
             }
 
@@ -928,31 +928,31 @@ static void test_componentinfo(void)
 
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICImagingFactory, (void**)&factory);
-    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
+    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
     if (SUCCEEDED(hr))
     {
         hr = IWICImagingFactory_CreateComponentInfo(factory, &CLSID_WICBmpDecoder, &info);
-        ok(SUCCEEDED(hr), "CreateComponentInfo failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "CreateComponentInfo failed, hr=%lx\n", hr);
         if (SUCCEEDED(hr))
         {
             hr = IWICComponentInfo_GetComponentType(info, &type);
-            ok(SUCCEEDED(hr), "GetComponentType failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "GetComponentType failed, hr=%lx\n", hr);
             ok(type == WICDecoder, "got %i, expected WICDecoder\n", type);
 
             hr = IWICComponentInfo_QueryInterface(info, &IID_IWICBitmapDecoderInfo, (void**)&decoderinfo);
-            ok(SUCCEEDED(hr), "QueryInterface failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "QueryInterface failed, hr=%lx\n", hr);
             if (SUCCEEDED(hr))
             {
                 pattern_count = 0;
                 pattern_size = 0;
                 hr = IWICBitmapDecoderInfo_GetPatterns(decoderinfo, 0, NULL, &pattern_count, &pattern_size);
-                ok(SUCCEEDED(hr), "GetPatterns failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "GetPatterns failed, hr=%lx\n", hr);
                 ok(pattern_count != 0, "pattern count is 0\n");
                 ok(pattern_size > pattern_count * sizeof(WICBitmapPattern), "size=%i, count=%i\n", pattern_size, pattern_count);
 
                 patterns = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, pattern_size);
                 hr = IWICBitmapDecoderInfo_GetPatterns(decoderinfo, pattern_size, patterns, &pattern_count, &pattern_size);
-                ok(SUCCEEDED(hr), "GetPatterns failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "GetPatterns failed, hr=%lx\n", hr);
                 ok(pattern_count != 0, "pattern count is 0\n");
                 ok(pattern_size > pattern_count * sizeof(WICBitmapPattern), "size=%i, count=%i\n", pattern_size, pattern_count);
                 ok(patterns[0].Length != 0, "pattern length is 0\n");
@@ -961,16 +961,16 @@ static void test_componentinfo(void)
 
                 pattern_size -= 1;
                 hr = IWICBitmapDecoderInfo_GetPatterns(decoderinfo, pattern_size, patterns, &pattern_count, &pattern_size);
-                ok(hr == WINCODEC_ERR_INSUFFICIENTBUFFER, "GetPatterns returned %x, expected WINCODEC_ERR_INSUFFICIENTBUFFER\n", hr);
+                ok(hr == WINCODEC_ERR_INSUFFICIENTBUFFER, "GetPatterns returned %lx, expected WINCODEC_ERR_INSUFFICIENTBUFFER\n", hr);
 
                 HeapFree(GetProcessHeap(), 0, patterns);
 
                 hr = IWICBitmapDecoderInfo_CreateInstance(decoderinfo, &decoder);
-                ok(SUCCEEDED(hr), "CreateInstance failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "CreateInstance failed, hr=%lx\n", hr);
                 if (SUCCEEDED(hr))
                 {
                     hr = IWICBitmapDecoder_GetContainerFormat(decoder, &guidresult);
-                    ok(SUCCEEDED(hr), "GetContainerFormat failed, hr=%x\n", hr);
+                    ok(SUCCEEDED(hr), "GetContainerFormat failed, hr=%lx\n", hr);
                     ok(IsEqualGUID(&guidresult, &GUID_ContainerFormatBmp), "unexpected container format\n");
 
                     IWICBitmapDecoder_Release(decoder);
@@ -985,12 +985,12 @@ static void test_componentinfo(void)
                     GlobalUnlock(hbmpdata);
 
                     hr = CreateStreamOnHGlobal(hbmpdata, FALSE, &bmpstream);
-                    ok(SUCCEEDED(hr), "CreateStreamOnHGlobal failed, hr=%x\n", hr);
+                    ok(SUCCEEDED(hr), "CreateStreamOnHGlobal failed, hr=%lx\n", hr);
                     if (SUCCEEDED(hr))
                     {
                         boolresult = 0;
                         hr = IWICBitmapDecoderInfo_MatchesPattern(decoderinfo, bmpstream, &boolresult);
-                        ok(SUCCEEDED(hr), "MatchesPattern failed, hr=%x\n", hr);
+                        ok(SUCCEEDED(hr), "MatchesPattern failed, hr=%lx\n", hr);
                         ok(boolresult, "pattern not matched\n");
 
                         IStream_Release(bmpstream);
@@ -1021,7 +1021,7 @@ static void test_createfromstream(void)
 
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICImagingFactory, (void**)&factory);
-    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
+    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
     if (FAILED(hr)) return;
 
     hbmpdata = GlobalAlloc(GMEM_MOVEABLE, sizeof(testbmp_1bpp));
@@ -1033,16 +1033,16 @@ static void test_createfromstream(void)
         GlobalUnlock(hbmpdata);
 
         hr = CreateStreamOnHGlobal(hbmpdata, FALSE, &bmpstream);
-        ok(SUCCEEDED(hr), "CreateStreamOnHGlobal failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "CreateStreamOnHGlobal failed, hr=%lx\n", hr);
         if (SUCCEEDED(hr))
         {
             hr = IWICImagingFactory_CreateDecoderFromStream(factory, bmpstream,
                 NULL, WICDecodeMetadataCacheOnDemand, &decoder);
-            ok(SUCCEEDED(hr), "CreateDecoderFromStream failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "CreateDecoderFromStream failed, hr=%lx\n", hr);
             if (SUCCEEDED(hr))
             {
                 hr = IWICBitmapDecoder_GetContainerFormat(decoder, &guidresult);
-                ok(SUCCEEDED(hr), "GetContainerFormat failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "GetContainerFormat failed, hr=%lx\n", hr);
                 ok(IsEqualGUID(&guidresult, &GUID_ContainerFormatBmp), "unexpected container format\n");
 
                 IWICBitmapDecoder_Release(decoder);
@@ -1065,20 +1065,20 @@ static void test_create_decoder(void)
 
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICImagingFactory, (void **)&factory);
-    ok(hr == S_OK, "CoCreateInstance error %#x\n", hr);
+    ok(hr == S_OK, "CoCreateInstance error %#lx\n", hr);
 
     hr = IWICImagingFactory_CreateDecoder(factory, NULL, NULL, NULL);
-    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
 
     hr = IWICImagingFactory_CreateDecoder(factory, NULL, NULL, &decoder);
-    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
 
     hr = IWICImagingFactory_CreateDecoder(factory, &GUID_ContainerFormatBmp, NULL, &decoder);
-    ok(hr == S_OK, "CreateDecoder error %#x\n", hr);
+    ok(hr == S_OK, "CreateDecoder error %#lx\n", hr);
     IWICBitmapDecoder_Release(decoder);
 
     hr = IWICImagingFactory_CreateDecoder(factory, &GUID_ContainerFormatBmp, &GUID_VendorMicrosoft, &decoder);
-    ok(hr == S_OK, "CreateDecoder error %#x\n", hr);
+    ok(hr == S_OK, "CreateDecoder error %#lx\n", hr);
     IWICBitmapDecoder_Release(decoder);
 
     IWICImagingFactory_Release(factory);
@@ -1104,77 +1104,77 @@ static void test_writesource_palette(void)
 
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICImagingFactory, (void **)&factory);
-    ok(hr == S_OK, "CoCreateInstance error %#x\n", hr);
+    ok(hr == S_OK, "CoCreateInstance error %#lx\n", hr);
 
     /* Encoder with palette set */
     hr = IWICImagingFactory_CreateBitmap(factory, 1, 1, &GUID_WICPixelFormat1bppIndexed,
         WICBitmapCacheOnDemand, &bitmap);
-    ok(hr == S_OK, "CreateBitmap error %#x\n", hr);
+    ok(hr == S_OK, "CreateBitmap error %#lx\n", hr);
 
     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-    ok(hr == S_OK, "CreatePalette error %#x\n", hr);
+    ok(hr == S_OK, "CreatePalette error %#lx\n", hr);
 
     hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
-    ok(hr == S_OK, "CreateStream error %#x\n", hr);
+    ok(hr == S_OK, "CreateStream error %#lx\n", hr);
 
     hr = IWICImagingFactory_CreateEncoder(factory, &GUID_ContainerFormatBmp, &GUID_VendorMicrosoft, &encoder);
-    ok(hr == S_OK, "CreateDecoder error %#x\n", hr);
+    ok(hr == S_OK, "CreateDecoder error %#lx\n", hr);
 
     hr = IWICBitmapEncoder_Initialize(encoder, stream, WICBitmapEncoderNoCache);
-    ok(hr == S_OK, "IWICBitmapEncoder_Initialize error %#x\n", hr);
+    ok(hr == S_OK, "IWICBitmapEncoder_Initialize error %#lx\n", hr);
 
     hr = IWICBitmapEncoder_CreateNewFrame(encoder, &frame_encode, &encode_options);
-    ok(hr == S_OK, "CreateNewFrame error %#x\n", hr);
+    ok(hr == S_OK, "CreateNewFrame error %#lx\n", hr);
 
     hr = IWICBitmapFrameEncode_Initialize(frame_encode, encode_options);
-    ok(hr == S_OK, "IWICBitmapFrameEncode_Initialize error %#x\n", hr);
+    ok(hr == S_OK, "IWICBitmapFrameEncode_Initialize error %#lx\n", hr);
 
     IPropertyBag2_Release(encode_options);
 
     hr = IWICBitmapFrameEncode_SetSize(frame_encode, 1, 1);
-    ok(hr == S_OK, "SetSize error %#x\n", hr);
+    ok(hr == S_OK, "SetSize error %#lx\n", hr);
 
     pixelformat = GUID_WICPixelFormat1bppIndexed;
     hr = IWICBitmapFrameEncode_SetPixelFormat(frame_encode, &pixelformat);
-    ok(hr == S_OK, "SetPixelFormat error %#x\n", hr);
+    ok(hr == S_OK, "SetPixelFormat error %#lx\n", hr);
     ok(!memcmp(&pixelformat, &GUID_WICPixelFormat1bppIndexed, sizeof(pixelformat)), "pixel format changed\n");
 
     hr = IWICPalette_InitializeCustom(palette, encode_palette, 2);
-    ok(hr == S_OK, "InitializeCustom error %#x\n", hr);
+    ok(hr == S_OK, "InitializeCustom error %#lx\n", hr);
 
     hr = IWICBitmapFrameEncode_SetPalette(frame_encode, palette);
-    ok(hr == S_OK, "SetPalette error %#x\n", hr);
+    ok(hr == S_OK, "SetPalette error %#lx\n", hr);
 
     hr = IWICPalette_InitializeCustom(palette, source_palette, 2);
-    ok(hr == S_OK, "InitializeCustom error %#x\n", hr);
+    ok(hr == S_OK, "InitializeCustom error %#lx\n", hr);
 
     hr = IWICBitmap_SetPalette(bitmap, palette);
-    ok(hr == S_OK, "SetPalette error %#x\n", hr);
+    ok(hr == S_OK, "SetPalette error %#lx\n", hr);
 
     hr = IWICBitmapFrameEncode_WriteSource(frame_encode, (IWICBitmapSource*)bitmap, NULL);
-    ok(hr == S_OK, "WriteSource error %#x\n", hr);
+    ok(hr == S_OK, "WriteSource error %#lx\n", hr);
 
     hr = IWICBitmapFrameEncode_Commit(frame_encode);
-    ok(hr == S_OK, "Commit error %#x\n", hr);
+    ok(hr == S_OK, "Commit error %#lx\n", hr);
 
     IWICBitmapFrameEncode_Release(frame_encode);
 
     hr = IWICBitmapEncoder_Commit(encoder);
-    ok(hr == S_OK, "Commit error %#x\n", hr);
+    ok(hr == S_OK, "Commit error %#lx\n", hr);
 
     IWICBitmapEncoder_Release(encoder);
 
     hr = IWICImagingFactory_CreateDecoderFromStream(factory, stream, NULL, WICDecodeMetadataCacheOnLoad, &decoder);
-    ok(hr == S_OK, "CreateDecoderFromStream error %#x\n", hr);
+    ok(hr == S_OK, "CreateDecoderFromStream error %#lx\n", hr);
 
     hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame_decode);
-    ok(hr == S_OK, "GetFrame error %#x\n", hr);
+    ok(hr == S_OK, "GetFrame error %#lx\n", hr);
 
     hr = IWICBitmapFrameDecode_CopyPalette(frame_decode, palette);
-    ok(hr == S_OK, "CopyPalette error %#x\n", hr);
+    ok(hr == S_OK, "CopyPalette error %#lx\n", hr);
 
     hr = IWICPalette_GetColors(palette, 2, result_palette, &result_colors);
-    ok(hr == S_OK, "GetColors error %#x\n", hr);
+    ok(hr == S_OK, "GetColors error %#lx\n", hr);
     ok(result_colors == 2, "Got %i colors\n", result_colors);
     ok(result_palette[0] == encode_palette[0], "Unexpected palette entry: %x\n", result_palette[0]);
     ok(result_palette[1] == encode_palette[1], "Unexpected palette entry: %x\n", result_palette[0]);
@@ -1185,35 +1185,35 @@ static void test_writesource_palette(void)
 
     /* Encoder with no palette set */
     hr = IWICImagingFactory_CreateEncoder(factory, &GUID_ContainerFormatBmp, &GUID_VendorMicrosoft, &encoder);
-    ok(hr == S_OK, "CreateDecoder error %#x\n", hr);
+    ok(hr == S_OK, "CreateDecoder error %#lx\n", hr);
 
     hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
-    ok(hr == S_OK, "CreateStream error %#x\n", hr);
+    ok(hr == S_OK, "CreateStream error %#lx\n", hr);
 
     hr = IWICBitmapEncoder_Initialize(encoder, stream, WICBitmapEncoderNoCache);
-    ok(hr == S_OK, "IWICBitmapEncoder_Initialize error %#x\n", hr);
+    ok(hr == S_OK, "IWICBitmapEncoder_Initialize error %#lx\n", hr);
 
     hr = IWICBitmapEncoder_CreateNewFrame(encoder, &frame_encode, &encode_options);
-    ok(hr == S_OK, "CreateNewFrame error %#x\n", hr);
+    ok(hr == S_OK, "CreateNewFrame error %#lx\n", hr);
 
     hr = IWICBitmapFrameEncode_Initialize(frame_encode, encode_options);
-    ok(hr == S_OK, "IWICBitmapFrameEncode_Initialize error %#x\n", hr);
+    ok(hr == S_OK, "IWICBitmapFrameEncode_Initialize error %#lx\n", hr);
 
     IPropertyBag2_Release(encode_options);
 
     hr = IWICBitmapFrameEncode_SetSize(frame_encode, 1, 1);
-    ok(hr == S_OK, "SetSize error %#x\n", hr);
+    ok(hr == S_OK, "SetSize error %#lx\n", hr);
 
     pixelformat = GUID_WICPixelFormat1bppIndexed;
     hr = IWICBitmapFrameEncode_SetPixelFormat(frame_encode, &pixelformat);
-    ok(hr == S_OK, "SetPixelFormat error %#x\n", hr);
+    ok(hr == S_OK, "SetPixelFormat error %#lx\n", hr);
     ok(!memcmp(&pixelformat, &GUID_WICPixelFormat1bppIndexed, sizeof(pixelformat)), "pixel format changed\n");
 
     hr = IWICPalette_InitializeCustom(palette, source_palette, 2);
-    ok(hr == S_OK, "InitializeCustom error %#x\n", hr);
+    ok(hr == S_OK, "InitializeCustom error %#lx\n", hr);
 
     hr = IWICBitmap_SetPalette(bitmap, palette);
-    ok(hr == S_OK, "SetPalette error %#x\n", hr);
+    ok(hr == S_OK, "SetPalette error %#lx\n", hr);
 
     hr = IWICBitmapFrameEncode_WriteSource(frame_encode, (IWICBitmapSource*)bitmap, NULL);
     if (hr == WINCODEC_ERR_PALETTEUNAVAILABLE)
@@ -1227,29 +1227,29 @@ static void test_writesource_palette(void)
         IWICImagingFactory_Release(factory);
         return;
     }
-    ok(hr == S_OK, "WriteSource error %#x\n", hr);
+    ok(hr == S_OK, "WriteSource error %#lx\n", hr);
 
     hr = IWICBitmapFrameEncode_Commit(frame_encode);
-    ok(hr == S_OK, "Commit error %#x\n", hr);
+    ok(hr == S_OK, "Commit error %#lx\n", hr);
 
     IWICBitmapFrameEncode_Release(frame_encode);
 
     hr = IWICBitmapEncoder_Commit(encoder);
-    ok(hr == S_OK, "Commit error %#x\n", hr);
+    ok(hr == S_OK, "Commit error %#lx\n", hr);
 
     IWICBitmapEncoder_Release(encoder);
 
     hr = IWICImagingFactory_CreateDecoderFromStream(factory, stream, NULL, WICDecodeMetadataCacheOnLoad, &decoder);
-    ok(hr == S_OK, "CreateDecoderFromStream error %#x\n", hr);
+    ok(hr == S_OK, "CreateDecoderFromStream error %#lx\n", hr);
 
     hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame_decode);
-    ok(hr == S_OK, "GetFrame error %#x\n", hr);
+    ok(hr == S_OK, "GetFrame error %#lx\n", hr);
 
     hr = IWICBitmapFrameDecode_CopyPalette(frame_decode, palette);
-    ok(hr == S_OK, "CopyPalette error %#x\n", hr);
+    ok(hr == S_OK, "CopyPalette error %#lx\n", hr);
 
     hr = IWICPalette_GetColors(palette, 2, result_palette, &result_colors);
-    ok(hr == S_OK, "GetColors error %#x\n", hr);
+    ok(hr == S_OK, "GetColors error %#lx\n", hr);
     ok(result_colors == 2, "Got %i colors\n", result_colors);
     ok(result_palette[0] == source_palette[0], "Unexpected palette entry: %x\n", result_palette[0]);
     ok(result_palette[1] == source_palette[1], "Unexpected palette entry: %x\n", result_palette[0]);
diff --git a/dlls/windowscodecs/tests/converter.c b/dlls/windowscodecs/tests/converter.c
index ca26b5204bc..9159141d6e5 100644
--- a/dlls/windowscodecs/tests/converter.c
+++ b/dlls/windowscodecs/tests/converter.c
@@ -227,7 +227,7 @@ static void CreateTestBitmap(const bitmap_data *data, BitmapTestSrc **This)
 static void DeleteTestBitmap(BitmapTestSrc *This)
 {
     ok(This->IWICBitmapSource_iface.lpVtbl == &BitmapTestSrc_Vtbl, "test bitmap %p deleted with incorrect vtable\n", This);
-    ok(This->ref == 1, "test bitmap %p deleted with %i references instead of 1\n", This, This->ref);
+    ok(This->ref == 1, "test bitmap %p deleted with %li references instead of 1\n", This, This->ref);
     HeapFree(GetProcessHeap(), 0, This);
 }
 
@@ -335,17 +335,17 @@ static void compare_bitmap_data(const struct bitmap_data *src, const struct bitm
     HRESULT hr;
 
     hr = IWICBitmapSource_GetSize(source, &width, &height);
-    ok(SUCCEEDED(hr), "GetSize(%s) failed, hr=%x\n", name, hr);
+    ok(SUCCEEDED(hr), "GetSize(%s) failed, hr=%lx\n", name, hr);
     ok(width == expect->width, "expecting %u, got %u (%s)\n", expect->width, width, name);
     ok(height == expect->height, "expecting %u, got %u (%s)\n", expect->height, height, name);
 
     hr = IWICBitmapSource_GetResolution(source, &xres, &yres);
-    ok(SUCCEEDED(hr), "GetResolution(%s) failed, hr=%x\n", name, hr);
+    ok(SUCCEEDED(hr), "GetResolution(%s) failed, hr=%lx\n", name, hr);
     ok(fabs(xres - expect->xres) < 0.02, "expecting %0.2f, got %0.2f (%s)\n", expect->xres, xres, name);
     ok(fabs(yres - expect->yres) < 0.02, "expecting %0.2f, got %0.2f (%s)\n", expect->yres, yres, name);
 
     hr = IWICBitmapSource_GetPixelFormat(source, &dst_pixelformat);
-    ok(SUCCEEDED(hr), "GetPixelFormat(%s) failed, hr=%x\n", name, hr);
+    ok(SUCCEEDED(hr), "GetPixelFormat(%s) failed, hr=%lx\n", name, hr);
     ok(IsEqualGUID(&dst_pixelformat, expect->format), "got unexpected pixel format %s (%s)\n", wine_dbgstr_guid(&dst_pixelformat), name);
 
     prc.X = 0;
@@ -359,7 +359,7 @@ static void compare_bitmap_data(const struct bitmap_data *src, const struct bitm
     converted_bits = HeapAlloc(GetProcessHeap(), 0, buffersize);
     memset(converted_bits, 0xaa, buffersize);
     hr = IWICBitmapSource_CopyPixels(source, &prc, stride, buffersize, converted_bits);
-    ok(SUCCEEDED(hr), "CopyPixels(%s) failed, hr=%x\n", name, hr);
+    ok(SUCCEEDED(hr), "CopyPixels(%s) failed, hr=%lx\n", name, hr);
 
     /* The result of conversion of color to indexed formats depends on
      * optimized palette generation implementation. We either need to
@@ -371,7 +371,7 @@ static void compare_bitmap_data(const struct bitmap_data *src, const struct bitm
     /* Test with NULL rectangle - should copy the whole bitmap */
     memset(converted_bits, 0xaa, buffersize);
     hr = IWICBitmapSource_CopyPixels(source, NULL, stride, buffersize, converted_bits);
-    ok(SUCCEEDED(hr), "CopyPixels(%s,rc=NULL) failed, hr=%x\n", name, hr);
+    ok(SUCCEEDED(hr), "CopyPixels(%s,rc=NULL) failed, hr=%lx\n", name, hr);
     /* see comment above */
     if (!(!is_indexed_format(src->format) && is_indexed_format(expect->format)))
         ok(compare_bits(expect, buffersize, converted_bits), "unexpected pixel data (%s)\n", name);
@@ -589,7 +589,7 @@ static void test_conversion(const struct bitmap_data *src, const struct bitmap_d
     hr = WICConvertBitmapSource(dst->format, &src_obj->IWICBitmapSource_iface, &dst_bitmap);
     todo_wine_if (todo)
         ok(hr == S_OK ||
-           broken(hr == E_INVALIDARG || hr == WINCODEC_ERR_COMPONENTNOTFOUND) /* XP */, "WICConvertBitmapSource(%s) failed, hr=%x\n", name, hr);
+           broken(hr == E_INVALIDARG || hr == WINCODEC_ERR_COMPONENTNOTFOUND) /* XP */, "WICConvertBitmapSource(%s) failed, hr=%lx\n", name, hr);
 
     if (hr == S_OK)
     {
@@ -611,7 +611,7 @@ static void test_invalid_conversion(void)
 
     /* convert to a non-pixel-format GUID */
     hr = WICConvertBitmapSource(&GUID_VendorMicrosoft, &src_obj->IWICBitmapSource_iface, &dst_bitmap);
-    ok(hr == WINCODEC_ERR_COMPONENTNOTFOUND, "WICConvertBitmapSource returned %x\n", hr);
+    ok(hr == WINCODEC_ERR_COMPONENTNOTFOUND, "WICConvertBitmapSource returned %lx\n", hr);
 
     DeleteTestBitmap(src_obj);
 }
@@ -627,18 +627,18 @@ static void test_default_converter(void)
 
     hr = CoCreateInstance(&CLSID_WICDefaultFormatConverter, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICFormatConverter, (void**)&converter);
-    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
+    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
     if (SUCCEEDED(hr))
     {
         hr = IWICFormatConverter_CanConvert(converter, &GUID_WICPixelFormat32bppBGRA,
             &GUID_WICPixelFormat32bppBGR, &can_convert);
-        ok(SUCCEEDED(hr), "CanConvert returned %x\n", hr);
+        ok(SUCCEEDED(hr), "CanConvert returned %lx\n", hr);
         ok(can_convert, "expected TRUE, got %i\n", can_convert);
 
         hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
             &GUID_WICPixelFormat32bppBGR, WICBitmapDitherTypeNone, NULL, 0.0,
             WICBitmapPaletteTypeCustom);
-        ok(SUCCEEDED(hr), "Initialize returned %x\n", hr);
+        ok(SUCCEEDED(hr), "Initialize returned %lx\n", hr);
 
         if (SUCCEEDED(hr))
             compare_bitmap_data(&testdata_32bppBGRA, &testdata_32bppBGR, (IWICBitmapSource*)converter, "default converter");
@@ -660,18 +660,18 @@ static void test_converter_4bppGray(void)
 
     hr = CoCreateInstance(&CLSID_WICDefaultFormatConverter, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICFormatConverter, (void**)&converter);
-    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
+    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
     if (SUCCEEDED(hr))
     {
         hr = IWICFormatConverter_CanConvert(converter, &GUID_WICPixelFormat32bppBGRA,
             &GUID_WICPixelFormat4bppGray, &can_convert);
-        ok(SUCCEEDED(hr), "CanConvert returned %x\n", hr);
+        ok(SUCCEEDED(hr), "CanConvert returned %lx\n", hr);
         todo_wine ok(can_convert, "expected TRUE, got %i\n", can_convert);
 
         hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
             &GUID_WICPixelFormat4bppGray, WICBitmapDitherTypeNone, NULL, 0.0,
             WICBitmapPaletteTypeCustom);
-        todo_wine ok(SUCCEEDED(hr), "Initialize returned %x\n", hr);
+        todo_wine ok(SUCCEEDED(hr), "Initialize returned %lx\n", hr);
 
         if (SUCCEEDED(hr))
             compare_bitmap_data(&testdata_32bppBGRA, &testdata_4bppGray, (IWICBitmapSource*)converter, "4bppGray converter");
@@ -693,18 +693,18 @@ static void test_converter_8bppGray(void)
 
     hr = CoCreateInstance(&CLSID_WICDefaultFormatConverter, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICFormatConverter, (void**)&converter);
-    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
+    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
     if (SUCCEEDED(hr))
     {
         hr = IWICFormatConverter_CanConvert(converter, &GUID_WICPixelFormat32bppBGRA,
             &GUID_WICPixelFormat8bppGray, &can_convert);
-        ok(SUCCEEDED(hr), "CanConvert returned %x\n", hr);
+        ok(SUCCEEDED(hr), "CanConvert returned %lx\n", hr);
         ok(can_convert, "expected TRUE, got %i\n", can_convert);
 
         hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
             &GUID_WICPixelFormat8bppGray, WICBitmapDitherTypeNone, NULL, 0.0,
             WICBitmapPaletteTypeCustom);
-        ok(SUCCEEDED(hr), "Initialize returned %x\n", hr);
+        ok(SUCCEEDED(hr), "Initialize returned %lx\n", hr);
 
         if (SUCCEEDED(hr))
             compare_bitmap_data(&testdata_32bppBGRA, &testdata_8bppGray, (IWICBitmapSource*)converter, "8bppGray converter");
@@ -803,13 +803,13 @@ static void test_specific_encoder_properties(IPropertyBag2 *options, const prope
         {
             ok(all_props[idx].vt == data[i].var_type, "Property %s has unexpected vt type, vt=%i\n",
                wine_dbgstr_w(data[i].name), all_props[idx].vt);
-            ok(all_props[idx].dwType == PROPBAG2_TYPE_DATA, "Property %s has unexpected dw type, vt=%i\n",
+            ok(all_props[idx].dwType == PROPBAG2_TYPE_DATA, "Property %s has unexpected dw type, vt=%li\n",
                wine_dbgstr_w(data[i].name), all_props[idx].dwType);
             ok(all_props[idx].cfType == 0, "Property %s has unexpected cf type, vt=%i\n",
                wine_dbgstr_w(data[i].name), all_props[idx].cfType);
         }
 
-        ok(SUCCEEDED(hr), "Reading property %s from bag failed, hr=%x\n",
+        ok(SUCCEEDED(hr), "Reading property %s from bag failed, hr=%lx\n",
            wine_dbgstr_w(data[i].name), hr);
 
         if (SUCCEEDED(hr))
@@ -855,16 +855,16 @@ static void test_encoder_properties(const CLSID* clsid_encoder, IPropertyBag2 *o
     /* CountProperties */
     {
         hr = IPropertyBag2_CountProperties(options, &cProperties);
-        ok(SUCCEEDED(hr), "Reading property count, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "Reading property count, hr=%lx\n", hr);
     }
 
     /* GetPropertyInfo */
     {
         hr = IPropertyBag2_GetPropertyInfo(options, cProperties, 1, all_props, &cProperties2);
-        ok(hr == WINCODEC_ERR_VALUEOUTOFRANGE, "IPropertyBag2::GetPropertyInfo - iProperty out of bounce handled wrong, hr=%x\n", hr);
+        ok(hr == WINCODEC_ERR_VALUEOUTOFRANGE, "IPropertyBag2::GetPropertyInfo - iProperty out of bounce handled wrong, hr=%lx\n", hr);
 
         hr = IPropertyBag2_GetPropertyInfo(options, 0, cProperties+1, all_props, &cProperties2);
-        ok(hr == WINCODEC_ERR_VALUEOUTOFRANGE, "IPropertyBag2::GetPropertyInfo - cProperty out of bounce handled wrong, hr=%x\n", hr);
+        ok(hr == WINCODEC_ERR_VALUEOUTOFRANGE, "IPropertyBag2::GetPropertyInfo - cProperty out of bounce handled wrong, hr=%lx\n", hr);
 
         if (cProperties == 0) /* GetPropertyInfo can be called for zero items on Windows 8 but not on Windows 7 (wine behaves like Win8) */
         {
@@ -874,7 +874,7 @@ static void test_encoder_properties(const CLSID* clsid_encoder, IPropertyBag2 *o
         else
         {
             hr = IPropertyBag2_GetPropertyInfo(options, 0, min(64, cProperties), all_props, &cProperties2);
-            ok(SUCCEEDED(hr), "Reading infos from property bag failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "Reading infos from property bag failed, hr=%lx\n", hr);
         }
 
         if (FAILED(hr))
@@ -911,10 +911,10 @@ static void load_stream(IUnknown *reader, IStream *stream)
 #endif
 
     hr = IUnknown_QueryInterface(reader, &IID_IWICPersistStream, (void **)&persist);
-    ok(hr == S_OK, "QueryInterface failed, hr=%x\n", hr);
+    ok(hr == S_OK, "QueryInterface failed, hr=%lx\n", hr);
 
     hr = IWICPersistStream_LoadEx(persist, stream, NULL, persist_options);
-    ok(hr == S_OK, "LoadEx failed, hr=%x\n", hr);
+    ok(hr == S_OK, "LoadEx failed, hr=%lx\n", hr);
 
     IWICPersistStream_Release(persist);
 }
@@ -944,23 +944,23 @@ static void check_tiff_format(IStream *stream, const WICPixelFormatGUID *format)
 
     memset(&tiff, 0, sizeof(tiff));
     hr = IStream_Read(stream, &tiff, sizeof(tiff), NULL);
-    ok(hr == S_OK, "IStream_Read error %#x\n", hr);
+    ok(hr == S_OK, "IStream_Read error %#lx\n", hr);
     ok(tiff.byte_order == MAKEWORD('I','I') || tiff.byte_order == MAKEWORD('M','M'),
        "wrong TIFF byte order mark %02x\n", tiff.byte_order);
     ok(tiff.version == 42, "wrong TIFF version %u\n", tiff.version);
 
     pos.QuadPart = tiff.dir_offset;
     hr = IStream_Seek(stream, pos, SEEK_SET, NULL);
-    ok(hr == S_OK, "IStream_Seek error %#x\n", hr);
+    ok(hr == S_OK, "IStream_Seek error %#lx\n", hr);
 
     hr = CoCreateInstance(&CLSID_WICIfdMetadataReader, NULL, CLSCTX_INPROC_SERVER,
                           &IID_IWICMetadataReader, (void **)&reader);
-    ok(hr == S_OK, "CoCreateInstance error %#x\n", hr);
+    ok(hr == S_OK, "CoCreateInstance error %#lx\n", hr);
 
     load_stream((IUnknown *)reader, stream);
 
     hr = IWICMetadataReader_GetCount(reader, &count);
-    ok(hr == S_OK, "GetCount error %#x\n", hr);
+    ok(hr == S_OK, "GetCount error %#lx\n", hr);
     ok(count != 0, "wrong count %u\n", count);
 
     for (i = 0; i < ARRAY_SIZE(tag); i++)
@@ -972,7 +972,7 @@ static void check_tiff_format(IStream *stream, const WICPixelFormatGUID *format)
         U(id).uiVal = tag[i].id;
         hr = IWICMetadataReader_GetValue(reader, NULL, &id, &value);
         ok(hr == S_OK || (tag[i].id == 0x140 && hr == WINCODEC_ERR_PROPERTYNOTFOUND),
-           "GetValue(%04x) error %#x\n", tag[i].id, hr);
+           "GetValue(%04x) error %#lx\n", tag[i].id, hr);
         if (hr == S_OK)
         {
             ok(value.vt == VT_UI2 || value.vt == VT_UI4 || value.vt == (VT_UI2 | VT_VECTOR), "wrong vt: %d\n", value.vt);
@@ -1047,62 +1047,62 @@ static void check_bmp_format(IStream *stream, const WICPixelFormatGUID *format)
     BITMAPV5HEADER bih;
 
     hr = IStream_Read(stream, &bfh, sizeof(bfh), NULL);
-    ok(hr == S_OK, "IStream_Read error %#x\n", hr);
+    ok(hr == S_OK, "IStream_Read error %#lx\n", hr);
 
     ok(bfh.bfType == 0x4d42, "wrong BMP signature %02x\n", bfh.bfType);
     ok(bfh.bfReserved1 == 0, "wrong bfReserved1 %02x\n", bfh.bfReserved1);
     ok(bfh.bfReserved2 == 0, "wrong bfReserved2 %02x\n", bfh.bfReserved2);
 
     hr = IStream_Read(stream, &bih, sizeof(bih), NULL);
-    ok(hr == S_OK, "IStream_Read error %#x\n", hr);
+    ok(hr == S_OK, "IStream_Read error %#lx\n", hr);
 
     if (IsEqualGUID(format, &GUID_WICPixelFormat1bppIndexed))
     {
-        ok(bfh.bfOffBits == 0x0436, "wrong bfOffBits %08x\n", bfh.bfOffBits);
+        ok(bfh.bfOffBits == 0x0436, "wrong bfOffBits %08lx\n", bfh.bfOffBits);
 
-        ok(bih.bV5Width == 32, "wrong width %u\n", bih.bV5Width);
-        ok(bih.bV5Height == 2, "wrong height %u\n", bih.bV5Height);
+        ok(bih.bV5Width == 32, "wrong width %lu\n", bih.bV5Width);
+        ok(bih.bV5Height == 2, "wrong height %lu\n", bih.bV5Height);
 
         ok(bih.bV5Planes == 1, "wrong Planes %d\n", bih.bV5Planes);
         ok(bih.bV5BitCount == 1, "wrong BitCount %d\n", bih.bV5BitCount);
-        ok(bih.bV5ClrUsed == 256, "wrong ClrUsed %d\n", bih.bV5ClrUsed);
-        ok(bih.bV5ClrImportant == 256, "wrong ClrImportant %d\n", bih.bV5ClrImportant);
+        ok(bih.bV5ClrUsed == 256, "wrong ClrUsed %ld\n", bih.bV5ClrUsed);
+        ok(bih.bV5ClrImportant == 256, "wrong ClrImportant %ld\n", bih.bV5ClrImportant);
     }
     else if (IsEqualGUID(format, &GUID_WICPixelFormat4bppIndexed))
     {
-        ok(bfh.bfOffBits == 0x0436, "wrong bfOffBits %08x\n", bfh.bfOffBits);
+        ok(bfh.bfOffBits == 0x0436, "wrong bfOffBits %08lx\n", bfh.bfOffBits);
 
-        ok(bih.bV5Width == 32, "wrong width %u\n", bih.bV5Width);
-        ok(bih.bV5Height == 2, "wrong height %u\n", bih.bV5Height);
+        ok(bih.bV5Width == 32, "wrong width %lu\n", bih.bV5Width);
+        ok(bih.bV5Height == 2, "wrong height %lu\n", bih.bV5Height);
 
         ok(bih.bV5Planes == 1, "wrong Planes %d\n", bih.bV5Planes);
         ok(bih.bV5BitCount == 4, "wrong BitCount %d\n", bih.bV5BitCount);
-        ok(bih.bV5ClrUsed == 256, "wrong ClrUsed %d\n", bih.bV5ClrUsed);
-        ok(bih.bV5ClrImportant == 256, "wrong ClrImportant %d\n", bih.bV5ClrImportant);
+        ok(bih.bV5ClrUsed == 256, "wrong ClrUsed %ld\n", bih.bV5ClrUsed);
+        ok(bih.bV5ClrImportant == 256, "wrong ClrImportant %ld\n", bih.bV5ClrImportant);
     }
     else if (IsEqualGUID(format, &GUID_WICPixelFormat8bppIndexed))
     {
-        ok(bfh.bfOffBits == 0x0436, "wrong bfOffBits %08x\n", bfh.bfOffBits);
+        ok(bfh.bfOffBits == 0x0436, "wrong bfOffBits %08lx\n", bfh.bfOffBits);
 
-        ok(bih.bV5Width == 32, "wrong width %u\n", bih.bV5Width);
-        ok(bih.bV5Height == 2, "wrong height %u\n", bih.bV5Height);
+        ok(bih.bV5Width == 32, "wrong width %lu\n", bih.bV5Width);
+        ok(bih.bV5Height == 2, "wrong height %lu\n", bih.bV5Height);
 
         ok(bih.bV5Planes == 1, "wrong Planes %d\n", bih.bV5Planes);
         ok(bih.bV5BitCount == 8, "wrong BitCount %d\n", bih.bV5BitCount);
-        ok(bih.bV5ClrUsed == 256, "wrong ClrUsed %d\n", bih.bV5ClrUsed);
-        ok(bih.bV5ClrImportant == 256, "wrong ClrImportant %d\n", bih.bV5ClrImportant);
+        ok(bih.bV5ClrUsed == 256, "wrong ClrUsed %ld\n", bih.bV5ClrUsed);
+        ok(bih.bV5ClrImportant == 256, "wrong ClrImportant %ld\n", bih.bV5ClrImportant);
     }
     else if (IsEqualGUID(format, &GUID_WICPixelFormat32bppBGR))
     {
-        ok(bfh.bfOffBits == 0x0036, "wrong bfOffBits %08x\n", bfh.bfOffBits);
+        ok(bfh.bfOffBits == 0x0036, "wrong bfOffBits %08lx\n", bfh.bfOffBits);
 
-        ok(bih.bV5Width == 32, "wrong width %u\n", bih.bV5Width);
-        ok(bih.bV5Height == 2, "wrong height %u\n", bih.bV5Height);
+        ok(bih.bV5Width == 32, "wrong width %lu\n", bih.bV5Width);
+        ok(bih.bV5Height == 2, "wrong height %lu\n", bih.bV5Height);
 
         ok(bih.bV5Planes == 1, "wrong Planes %d\n", bih.bV5Planes);
         ok(bih.bV5BitCount == 32, "wrong BitCount %d\n", bih.bV5BitCount);
-        ok(bih.bV5ClrUsed == 0, "wrong ClrUsed %d\n", bih.bV5ClrUsed);
-        ok(bih.bV5ClrImportant == 0, "wrong ClrImportant %d\n", bih.bV5ClrImportant);
+        ok(bih.bV5ClrUsed == 0, "wrong ClrUsed %ld\n", bih.bV5ClrUsed);
+        ok(bih.bV5ClrImportant == 0, "wrong ClrImportant %ld\n", bih.bV5ClrImportant);
     }
     else
         ok(0, "unknown BMP pixel format %s\n", wine_dbgstr_guid(format));
@@ -1135,7 +1135,7 @@ static void check_png_format(IStream *stream, const WICPixelFormatGUID *format)
 
     memset(&png, 0, sizeof(png));
     hr = IStream_Read(stream, &png, sizeof(png), NULL);
-    ok(hr == S_OK, "IStream_Read error %#x\n", hr);
+    ok(hr == S_OK, "IStream_Read error %#lx\n", hr);
 
     ok(!memcmp(png.png_sig, png_sig, sizeof(png_sig)), "expected PNG signature\n");
     ok(!memcmp(png.ihdr_sig, png_IHDR, sizeof(png_IHDR)), "expected PNG IHDR\n");
@@ -1233,7 +1233,7 @@ static void check_gif_format(IStream *stream, const WICPixelFormatGUID *format)
 
     memset(&lsd, 0, sizeof(lsd));
     hr = IStream_Read(stream, &lsd, sizeof(lsd), NULL);
-    ok(hr == S_OK, "IStream_Read error %#x\n", hr);
+    ok(hr == S_OK, "IStream_Read error %#lx\n", hr);
 
     ok(!memcmp(lsd.signature, "GIF89a", 6), "wrong GIF signature %.6s\n", lsd.signature);
 
@@ -1251,7 +1251,7 @@ static void check_bitmap_format(IStream *stream, const CLSID *encoder, const WIC
 
     pos.QuadPart = 0;
     hr = IStream_Seek(stream, pos, SEEK_SET, (ULARGE_INTEGER *)&pos);
-    ok(hr == S_OK, "IStream_Seek error %#x\n", hr);
+    ok(hr == S_OK, "IStream_Seek error %#lx\n", hr);
 
     if (IsEqualGUID(encoder, &CLSID_WICPngEncoder))
         check_png_format(stream, format);
@@ -1265,7 +1265,7 @@ static void check_bitmap_format(IStream *stream, const CLSID *encoder, const WIC
         ok(0, "unknown encoder %s\n", wine_dbgstr_guid(encoder));
 
     hr = IStream_Seek(stream, pos, SEEK_SET, NULL);
-    ok(hr == S_OK, "IStream_Seek error %#x\n", hr);
+    ok(hr == S_OK, "IStream_Seek error %#lx\n", hr);
 }
 
 struct setting {
@@ -1281,7 +1281,7 @@ static void _expect_ref(IUnknown* obj, ULONG ref, int line)
     ULONG rc;
     IUnknown_AddRef(obj);
     rc = IUnknown_Release(obj);
-    ok_(__FILE__,line)(rc == ref, "expected refcount %d, got %d\n", ref, rc);
+    ok_(__FILE__,line)(rc == ref, "expected refcount %ld, got %ld\n", ref, rc);
 }
 
 static void test_set_frame_palette(IWICBitmapFrameEncode *frameencode)
@@ -1292,28 +1292,28 @@ static void test_set_frame_palette(IWICBitmapFrameEncode *frameencode)
 
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICComponentFactory, (void **)&factory);
-    ok(hr == S_OK, "CoCreateInstance failed, hr=%x\n", hr);
+    ok(hr == S_OK, "CoCreateInstance failed, hr=%lx\n", hr);
 
     hr = IWICBitmapFrameEncode_SetPalette(frameencode, NULL);
-    ok(hr == E_INVALIDARG, "SetPalette failed, hr=%x\n", hr);
+    ok(hr == E_INVALIDARG, "SetPalette failed, hr=%lx\n", hr);
 
     hr = IWICComponentFactory_CreatePalette(factory, &palette);
-    ok(hr == S_OK, "CreatePalette failed, hr=%x\n", hr);
+    ok(hr == S_OK, "CreatePalette failed, hr=%lx\n", hr);
 
     hr = IWICBitmapFrameEncode_SetPalette(frameencode, palette);
     todo_wine
-    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr=%x\n", hr);
+    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr=%lx\n", hr);
 
     hr = IWICPalette_InitializePredefined(palette, WICBitmapPaletteTypeFixedHalftone256, FALSE);
-    ok(hr == S_OK, "InitializePredefined failed, hr=%x\n", hr);
+    ok(hr == S_OK, "InitializePredefined failed, hr=%lx\n", hr);
 
     EXPECT_REF(palette, 1);
     hr = IWICBitmapFrameEncode_SetPalette(frameencode, palette);
-    ok(hr == S_OK, "SetPalette failed, hr=%x\n", hr);
+    ok(hr == S_OK, "SetPalette failed, hr=%lx\n", hr);
     EXPECT_REF(palette, 1);
 
     hr = IWICBitmapFrameEncode_SetPalette(frameencode, NULL);
-    ok(hr == E_INVALIDARG, "SetPalette failed, hr=%x\n", hr);
+    ok(hr == E_INVALIDARG, "SetPalette failed, hr=%lx\n", hr);
 
     IWICPalette_Release(palette);
     IWICComponentFactory_Release(factory);
@@ -1339,13 +1339,13 @@ static void test_multi_encoder_impl(const struct bitmap_data **srcs, const CLSID
 
     hr = CoCreateInstance(clsid_encoder, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICBitmapEncoder, (void **)&encoder);
-    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
+    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
 
     hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
-    ok(SUCCEEDED(hr), "CreateStreamOnHGlobal failed, hr=%x\n", hr);
+    ok(SUCCEEDED(hr), "CreateStreamOnHGlobal failed, hr=%lx\n", hr);
 
     hr = IWICBitmapEncoder_GetContainerFormat(encoder, NULL);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
 
     if (IsEqualGUID(clsid_encoder, &CLSID_WICPngEncoder))
         container_format = &GUID_ContainerFormatPng;
@@ -1364,16 +1364,16 @@ static void test_multi_encoder_impl(const struct bitmap_data **srcs, const CLSID
     {
         memset(&guid, 0, sizeof(guid));
         hr = IWICBitmapEncoder_GetContainerFormat(encoder, &guid);
-        ok(SUCCEEDED(hr), "Failed to get container format, hr %#x.\n", hr);
+        ok(SUCCEEDED(hr), "Failed to get container format, hr %#lx.\n", hr);
         ok(IsEqualGUID(container_format, &guid), "Unexpected container format %s.\n", wine_dbgstr_guid(&guid));
     }
 
     hr = IWICBitmapEncoder_Initialize(encoder, stream, WICBitmapEncoderNoCache);
-    ok(SUCCEEDED(hr), "Initialize failed, hr=%x\n", hr);
+    ok(SUCCEEDED(hr), "Initialize failed, hr=%lx\n", hr);
 
     /* Encoder options are optional. */
     hr = IWICBitmapEncoder_CreateNewFrame(encoder, &frameencode, NULL);
-    ok(SUCCEEDED(hr), "Failed to create encode frame, hr %#x.\n", hr);
+    ok(SUCCEEDED(hr), "Failed to create encode frame, hr %#lx.\n", hr);
 
     IStream_Release(stream);
     IWICBitmapEncoder_Release(encoder);
@@ -1381,7 +1381,7 @@ static void test_multi_encoder_impl(const struct bitmap_data **srcs, const CLSID
 
     hr = CoCreateInstance(clsid_encoder, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICBitmapEncoder, (void**)&encoder);
-    ok(SUCCEEDED(hr), "CoCreateInstance(%s) failed, hr=%x\n", wine_dbgstr_guid(clsid_encoder), hr);
+    ok(SUCCEEDED(hr), "CoCreateInstance(%s) failed, hr=%lx\n", wine_dbgstr_guid(clsid_encoder), hr);
     if (SUCCEEDED(hr))
     {
         hglobal = GlobalAlloc(GMEM_MOVEABLE, 0);
@@ -1389,7 +1389,7 @@ static void test_multi_encoder_impl(const struct bitmap_data **srcs, const CLSID
         if (hglobal)
         {
             hr = CreateStreamOnHGlobal(hglobal, TRUE, &stream);
-            ok(SUCCEEDED(hr), "CreateStreamOnHGlobal failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "CreateStreamOnHGlobal failed, hr=%lx\n", hr);
         }
 
         if (hglobal && SUCCEEDED(hr))
@@ -1397,19 +1397,19 @@ static void test_multi_encoder_impl(const struct bitmap_data **srcs, const CLSID
             if (palette)
             {
                 hr = IWICBitmapEncoder_SetPalette(encoder, palette);
-                ok(hr == WINCODEC_ERR_NOTINITIALIZED, "wrong error %#x (%s)\n", hr, name);
+                ok(hr == WINCODEC_ERR_NOTINITIALIZED, "wrong error %#lx (%s)\n", hr, name);
             }
 
             hr = IWICBitmapEncoder_Initialize(encoder, stream, WICBitmapEncoderNoCache);
-            ok(SUCCEEDED(hr), "Initialize failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "Initialize failed, hr=%lx\n", hr);
 
             if (palette)
             {
                 hr = IWICBitmapEncoder_SetPalette(encoder, palette);
                 if (IsEqualGUID(clsid_encoder, &CLSID_WICGifEncoder))
-                    ok(hr == S_OK, "SetPalette failed, hr=%#x\n", hr);
+                    ok(hr == S_OK, "SetPalette failed, hr=%#lx\n", hr);
                 else
-                    ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "wrong error %#x\n", hr);
+                    ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "wrong error %#lx\n", hr);
                 hr = S_OK;
             }
 
@@ -1419,7 +1419,7 @@ static void test_multi_encoder_impl(const struct bitmap_data **srcs, const CLSID
                 CreateTestBitmap(srcs[i], &src_obj);
 
                 hr = IWICBitmapEncoder_CreateNewFrame(encoder, &frameencode, &options);
-                ok(SUCCEEDED(hr), "CreateFrame failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "CreateFrame failed, hr=%lx\n", hr);
                 if (SUCCEEDED(hr))
                 {
                     ok(options != NULL, "Encoder initialization has not created an property bag\n");
@@ -1442,22 +1442,22 @@ static void test_multi_encoder_impl(const struct bitmap_data **srcs, const CLSID
                             V_UNKNOWN(&var) = settings[j].value;
 
                             hr = IPropertyBag2_Write(options, 1, &propbag, &var);
-                            ok(SUCCEEDED(hr), "Writing property %s failed, hr=%x\n", wine_dbgstr_w(settings[j].name), hr);
+                            ok(SUCCEEDED(hr), "Writing property %s failed, hr=%lx\n", wine_dbgstr_w(settings[j].name), hr);
                         }
                     }
 
                     if (palette)
                     {
                         hr = IWICBitmapFrameEncode_SetPalette(frameencode, palette);
-                        ok(hr == WINCODEC_ERR_NOTINITIALIZED, "wrong error %#x\n", hr);
+                        ok(hr == WINCODEC_ERR_NOTINITIALIZED, "wrong error %#lx\n", hr);
                     }
 
                     hr = IWICBitmapFrameEncode_Initialize(frameencode, options);
-                    ok(SUCCEEDED(hr), "Initialize failed, hr=%x\n", hr);
+                    ok(SUCCEEDED(hr), "Initialize failed, hr=%lx\n", hr);
 
                     memcpy(&pixelformat, srcs[i]->format, sizeof(GUID));
                     hr = IWICBitmapFrameEncode_SetPixelFormat(frameencode, &pixelformat);
-                    ok(SUCCEEDED(hr), "SetPixelFormat failed, hr=%x\n", hr);
+                    ok(SUCCEEDED(hr), "SetPixelFormat failed, hr=%lx\n", hr);
                     ok(IsEqualGUID(&pixelformat, dsts[i]->format) ||
                        (IsEqualGUID(clsid_encoder, &CLSID_WICTiffEncoder) && srcs[i]->bpp == 2 && IsEqualGUID(&pixelformat, &GUID_WICPixelFormat4bppIndexed)) ||
                        (IsEqualGUID(clsid_encoder, &CLSID_WICBmpEncoder) && srcs[i]->bpp == 2 && IsEqualGUID(&pixelformat, &GUID_WICPixelFormat4bppIndexed)),
@@ -1466,7 +1466,7 @@ static void test_multi_encoder_impl(const struct bitmap_data **srcs, const CLSID
                     if (set_size)
                     {
                         hr = IWICBitmapFrameEncode_SetSize(frameencode, srcs[i]->width, srcs[i]->height);
-                        ok(hr == S_OK, "SetSize failed, hr=%x\n", hr);
+                        ok(hr == S_OK, "SetSize failed, hr=%lx\n", hr);
                     }
 
                     if (IsEqualGUID(clsid_encoder, &CLSID_WICPngEncoder))
@@ -1475,30 +1475,30 @@ static void test_multi_encoder_impl(const struct bitmap_data **srcs, const CLSID
                     if (palette)
                     {
                         hr = IWICBitmapFrameEncode_SetPalette(frameencode, palette);
-                        ok(SUCCEEDED(hr), "SetPalette failed, hr=%x (%s)\n", hr, name);
+                        ok(SUCCEEDED(hr), "SetPalette failed, hr=%lx (%s)\n", hr, name);
                     }
 
                     hr = IWICBitmapFrameEncode_WriteSource(frameencode, &src_obj->IWICBitmapSource_iface, rc);
                     if (rc && (rc->Width <= 0 || rc->Height <= 0))
                     {
                         /* WriteSource fails but WriteSource_Proxy succeeds. */
-                        ok(hr == E_INVALIDARG, "WriteSource should fail, hr=%x (%s)\n", hr, name);
+                        ok(hr == E_INVALIDARG, "WriteSource should fail, hr=%lx (%s)\n", hr, name);
                         hr = IWICBitmapFrameEncode_WriteSource_Proxy(frameencode, &src_obj->IWICBitmapSource_iface, rc);
                         if (!set_size && rc->Width < 0)
                             todo_wine
                             ok(hr == WINCODEC_ERR_SOURCERECTDOESNOTMATCHDIMENSIONS,
-                               "WriteSource_Proxy(%dx%d) got unexpected hr %x (%s)\n", rc->Width, rc->Height, hr, name);
+                               "WriteSource_Proxy(%dx%d) got unexpected hr %lx (%s)\n", rc->Width, rc->Height, hr, name);
                         else
-                            ok(hr == S_OK, "WriteSource_Proxy failed, %dx%d, hr=%x (%s)\n", rc->Width, rc->Height, hr, name);
+                            ok(hr == S_OK, "WriteSource_Proxy failed, %dx%d, hr=%lx (%s)\n", rc->Width, rc->Height, hr, name);
                     }
                     else
                     {
                         if (rc)
-                            ok(SUCCEEDED(hr), "WriteSource(%dx%d) failed, hr=%x (%s)\n", rc->Width, rc->Height, hr, name);
+                            ok(SUCCEEDED(hr), "WriteSource(%dx%d) failed, hr=%lx (%s)\n", rc->Width, rc->Height, hr, name);
                         else
                             todo_wine_if((IsEqualGUID(clsid_encoder, &CLSID_WICTiffEncoder) && srcs[i]->bpp == 2) ||
                                          (IsEqualGUID(clsid_encoder, &CLSID_WICBmpEncoder)  && srcs[i]->bpp == 2))
-                            ok(hr == S_OK, "WriteSource(NULL) failed, hr=%x (%s)\n", hr, name);
+                            ok(hr == S_OK, "WriteSource(NULL) failed, hr=%lx (%s)\n", hr, name);
 
                     }
 
@@ -1507,9 +1507,9 @@ static void test_multi_encoder_impl(const struct bitmap_data **srcs, const CLSID
                         hr = IWICBitmapFrameEncode_Commit(frameencode);
                         if (!set_size && rc && rc->Height < 0)
                             todo_wine
-                            ok(hr == WINCODEC_ERR_UNEXPECTEDSIZE, "Commit got unexpected hr %x (%s)\n", hr, name);
+                            ok(hr == WINCODEC_ERR_UNEXPECTEDSIZE, "Commit got unexpected hr %lx (%s)\n", hr, name);
                         else
-                            ok(hr == S_OK, "Commit failed, hr=%x (%s)\n", hr, name);
+                            ok(hr == S_OK, "Commit failed, hr=%lx (%s)\n", hr, name);
                     }
 
                     IWICBitmapFrameEncode_Release(frameencode);
@@ -1531,7 +1531,7 @@ static void test_multi_encoder_impl(const struct bitmap_data **srcs, const CLSID
             if (SUCCEEDED(hr))
             {
                 hr = IWICBitmapEncoder_Commit(encoder);
-                ok(SUCCEEDED(hr), "Commit failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "Commit failed, hr=%lx\n", hr);
 
                 if (IsEqualGUID(&pixelformat, dsts[0]->format))
                     check_bitmap_format(stream, clsid_encoder, dsts[0]->format);
@@ -1541,7 +1541,7 @@ static void test_multi_encoder_impl(const struct bitmap_data **srcs, const CLSID
             {
                 hr = CoCreateInstance(clsid_decoder, NULL, CLSCTX_INPROC_SERVER,
                     &IID_IWICBitmapDecoder, (void**)&decoder);
-                ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
             }
 
             if (SUCCEEDED(hr))
@@ -1549,57 +1549,57 @@ static void test_multi_encoder_impl(const struct bitmap_data **srcs, const CLSID
                 IWICPalette *frame_palette;
 
                 hr = IWICImagingFactory_CreatePalette(factory, &frame_palette);
-                ok(hr == S_OK, "CreatePalette error %#x\n", hr);
+                ok(hr == S_OK, "CreatePalette error %#lx\n", hr);
 
                 hr = IWICBitmapDecoder_CopyPalette(decoder, frame_palette);
                 if (IsEqualGUID(clsid_decoder, &CLSID_WICGifDecoder))
-                    ok(hr == WINCODEC_ERR_WRONGSTATE, "wrong error %#x\n", hr);
+                    ok(hr == WINCODEC_ERR_WRONGSTATE, "wrong error %#lx\n", hr);
                 else
-                    ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "wrong error %#x\n", hr);
+                    ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "wrong error %#lx\n", hr);
 
                 hr = IWICBitmapDecoder_Initialize(decoder, stream, WICDecodeMetadataCacheOnDemand);
-                ok(SUCCEEDED(hr), "Initialize failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "Initialize failed, hr=%lx\n", hr);
 
                 hr = IWICBitmapDecoder_CopyPalette(decoder, frame_palette);
                 if (IsEqualGUID(clsid_decoder, &CLSID_WICGifDecoder))
-                    ok(hr == S_OK || broken(hr == WINCODEC_ERR_FRAMEMISSING) /* XP */, "CopyPalette failed, hr=%#x\n", hr);
+                    ok(hr == S_OK || broken(hr == WINCODEC_ERR_FRAMEMISSING) /* XP */, "CopyPalette failed, hr=%#lx\n", hr);
                 else
-                    ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "wrong error %#x\n", hr);
+                    ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "wrong error %#lx\n", hr);
 
                 hr = S_OK;
                 i=0;
                 while (SUCCEEDED(hr) && dsts[i])
                 {
                     hr = IWICBitmapDecoder_GetFrame(decoder, i, &framedecode);
-                    ok(SUCCEEDED(hr), "GetFrame failed, hr=%x (%s)\n", hr, name);
+                    ok(SUCCEEDED(hr), "GetFrame failed, hr=%lx (%s)\n", hr, name);
 
                     if (SUCCEEDED(hr))
                     {
                         hr = IWICBitmapFrameDecode_GetPixelFormat(framedecode, &pixelformat);
-                        ok(hr == S_OK, "GetPixelFormat) failed, hr=%x (%s)\n", hr, name);
+                        ok(hr == S_OK, "GetPixelFormat) failed, hr=%lx (%s)\n", hr, name);
                         if (IsEqualGUID(&pixelformat, dsts[i]->format))
                             compare_bitmap_data(srcs[i], dsts[i], (IWICBitmapSource*)framedecode, name);
 
                         hr = IWICBitmapFrameDecode_CopyPalette(framedecode, frame_palette);
                         if (winetest_debug > 1)
-                            trace("%s, bpp %d, %s, hr %#x\n", name, dsts[i]->bpp, wine_dbgstr_guid(dsts[i]->format), hr);
+                            trace("%s, bpp %d, %s, hr %#lx\n", name, dsts[i]->bpp, wine_dbgstr_guid(dsts[i]->format), hr);
                         if (dsts[i]->bpp > 8 || IsEqualGUID(dsts[i]->format, &GUID_WICPixelFormatBlackWhite))
-                            ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "wrong error %#x\n", hr);
+                            ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "wrong error %#lx\n", hr);
                         else
                         {
                             UINT count, ret;
                             WICColor colors[256];
 
-                            ok(hr == S_OK, "CopyPalette error %#x (%s)\n", hr, name);
+                            ok(hr == S_OK, "CopyPalette error %#lx (%s)\n", hr, name);
 
                             count = 0;
                             hr = IWICPalette_GetColorCount(frame_palette, &count);
-                            ok(hr == S_OK, "GetColorCount error %#x\n", hr);
+                            ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
 
                             memset(colors, 0, sizeof(colors));
                             ret = 0;
                             hr = IWICPalette_GetColors(frame_palette, count, colors, &ret);
-                            ok(hr == S_OK, "GetColors error %#x\n", hr);
+                            ok(hr == S_OK, "GetColors error %#lx\n", hr);
                             ok(ret == count, "expected %u, got %u\n", count, ret);
                             if (IsEqualGUID(clsid_decoder, &CLSID_WICPngDecoder))
                             {
@@ -1702,7 +1702,7 @@ static void test_encoder(const struct bitmap_data *src, const CLSID* clsid_encod
     HRESULT hr;
 
     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-    ok(hr == S_OK, "CreatePalette error %#x\n", hr);
+    ok(hr == S_OK, "CreatePalette error %#lx\n", hr);
 
     memset(colors, 0, sizeof(colors));
     colors[0] = 0x11111111;
@@ -1712,7 +1712,7 @@ static void test_encoder(const struct bitmap_data *src, const CLSID* clsid_encod
     colors[4] = 0x55555555;
     /* TIFF decoder fails to decode a 8bpp frame if palette has less than 256 colors */
     hr = IWICPalette_InitializeCustom(palette, colors, 256);
-    ok(hr == S_OK, "InitializeCustom error %#x\n", hr);
+    ok(hr == S_OK, "InitializeCustom error %#lx\n", hr);
 
     srcs[0] = src;
     srcs[1] = NULL;
@@ -1782,102 +1782,102 @@ static void test_converter_8bppIndexed(void)
     CreateTestBitmap(&testdata_24bppBGR, &src_obj);
 
     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-    ok(hr == S_OK, "CreatePalette error %#x\n", hr);
+    ok(hr == S_OK, "CreatePalette error %#lx\n", hr);
     count = 0xdeadbeef;
     hr = IWICPalette_GetColorCount(palette, &count);
-    ok(hr == S_OK, "GetColorCount error %#x\n", hr);
+    ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
     ok(count == 0, "expected 0, got %u\n", count);
 
     /* NULL palette + Custom type */
     hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
-    ok(hr == S_OK, "CreateFormatConverter error %#x\n", hr);
+    ok(hr == S_OK, "CreateFormatConverter error %#lx\n", hr);
     hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
                                         &GUID_WICPixelFormat24bppBGR, WICBitmapDitherTypeNone,
                                         NULL, 0.0, WICBitmapPaletteTypeCustom);
-    ok(hr == S_OK, "Initialize error %#x\n", hr);
+    ok(hr == S_OK, "Initialize error %#lx\n", hr);
     hr = IWICFormatConverter_CopyPalette(converter, palette);
-    ok(hr == 0xdeadbeef, "unexpected error %#x\n", hr);
+    ok(hr == 0xdeadbeef, "unexpected error %#lx\n", hr);
     hr = IWICFormatConverter_CopyPixels(converter, NULL, 32 * 3, sizeof(buf), buf);
-    ok(hr == S_OK, "CopyPixels error %#x\n", hr);
+    ok(hr == S_OK, "CopyPixels error %#lx\n", hr);
     IWICFormatConverter_Release(converter);
 
     /* NULL palette + Custom type */
     hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
-    ok(hr == S_OK, "CreateFormatConverter error %#x\n", hr);
+    ok(hr == S_OK, "CreateFormatConverter error %#lx\n", hr);
     hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
                                         &GUID_WICPixelFormat8bppIndexed, WICBitmapDitherTypeNone,
                                         NULL, 0.0, WICBitmapPaletteTypeCustom);
-    ok(hr == E_INVALIDARG, "unexpected error %#x\n", hr);
+    ok(hr == E_INVALIDARG, "unexpected error %#lx\n", hr);
     hr = IWICFormatConverter_CopyPalette(converter, palette);
-    ok(hr == WINCODEC_ERR_WRONGSTATE, "unexpected error %#x\n", hr);
+    ok(hr == WINCODEC_ERR_WRONGSTATE, "unexpected error %#lx\n", hr);
     hr = IWICFormatConverter_CopyPixels(converter, NULL, 32, sizeof(buf), buf);
-    ok(hr == WINCODEC_ERR_WRONGSTATE, "unexpected error %#x\n", hr);
+    ok(hr == WINCODEC_ERR_WRONGSTATE, "unexpected error %#lx\n", hr);
     IWICFormatConverter_Release(converter);
 
     hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
-    ok(hr == S_OK, "CreateFormatConverter error %#x\n", hr);
+    ok(hr == S_OK, "CreateFormatConverter error %#lx\n", hr);
     hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
                                         &GUID_WICPixelFormat4bppIndexed, WICBitmapDitherTypeNone,
                                         NULL, 0.0, WICBitmapPaletteTypeCustom);
-    ok(hr == E_INVALIDARG, "unexpected error %#x\n", hr);
+    ok(hr == E_INVALIDARG, "unexpected error %#lx\n", hr);
     IWICFormatConverter_Release(converter);
 
     hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
-    ok(hr == S_OK, "CreateFormatConverter error %#x\n", hr);
+    ok(hr == S_OK, "CreateFormatConverter error %#lx\n", hr);
     hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
                                         &GUID_WICPixelFormat2bppIndexed, WICBitmapDitherTypeNone,
                                         NULL, 0.0, WICBitmapPaletteTypeCustom);
-    ok(hr == E_INVALIDARG, "unexpected error %#x\n", hr);
+    ok(hr == E_INVALIDARG, "unexpected error %#lx\n", hr);
     IWICFormatConverter_Release(converter);
 
     hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
-    ok(hr == S_OK, "CreateFormatConverter error %#x\n", hr);
+    ok(hr == S_OK, "CreateFormatConverter error %#lx\n", hr);
     hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
                                         &GUID_WICPixelFormat1bppIndexed, WICBitmapDitherTypeNone,
                                         NULL, 0.0, WICBitmapPaletteTypeCustom);
-    ok(hr == E_INVALIDARG, "unexpected error %#x\n", hr);
+    ok(hr == E_INVALIDARG, "unexpected error %#lx\n", hr);
     IWICFormatConverter_Release(converter);
 
     hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
-    ok(hr == S_OK, "CreateFormatConverter error %#x\n", hr);
+    ok(hr == S_OK, "CreateFormatConverter error %#lx\n", hr);
     hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
                                         &GUID_WICPixelFormat1bppIndexed, WICBitmapDitherTypeNone,
                                         NULL, 0.0, WICBitmapPaletteTypeMedianCut);
-    todo_wine ok(hr == S_OK, "unexpected error %#x\n", hr);
+    todo_wine ok(hr == S_OK, "unexpected error %#lx\n", hr);
     IWICFormatConverter_Release(converter);
 
     hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
-    ok(hr == S_OK, "CreateFormatConverter error %#x\n", hr);
+    ok(hr == S_OK, "CreateFormatConverter error %#lx\n", hr);
     hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
                                         &GUID_WICPixelFormat1bppIndexed, WICBitmapDitherTypeNone,
                                         NULL, 0.0, WICBitmapPaletteTypeFixedBW);
-    todo_wine ok(hr == S_OK, "unexpected error %#x\n", hr);
+    todo_wine ok(hr == S_OK, "unexpected error %#lx\n", hr);
     IWICFormatConverter_Release(converter);
 
     hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
-    ok(hr == S_OK, "CreateFormatConverter error %#x\n", hr);
+    ok(hr == S_OK, "CreateFormatConverter error %#lx\n", hr);
     hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
                                         &GUID_WICPixelFormat1bppIndexed, WICBitmapDitherTypeNone,
                                         NULL, 0.0, WICBitmapPaletteTypeFixedHalftone8);
-    todo_wine ok(hr == E_INVALIDARG, "unexpected error %#x\n", hr);
+    todo_wine ok(hr == E_INVALIDARG, "unexpected error %#lx\n", hr);
     IWICFormatConverter_Release(converter);
 
     /* empty palette + Custom type */
     hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
-    ok(hr == S_OK, "CreateFormatConverter error %#x\n", hr);
+    ok(hr == S_OK, "CreateFormatConverter error %#lx\n", hr);
     hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
                                         &GUID_WICPixelFormat8bppIndexed, WICBitmapDitherTypeNone,
                                         palette, 0.0, WICBitmapPaletteTypeCustom);
-    ok(hr == S_OK, "Initialize error %#x\n", hr);
+    ok(hr == S_OK, "Initialize error %#lx\n", hr);
     hr = IWICFormatConverter_CopyPalette(converter, palette);
-    ok(hr == S_OK, "CopyPalette error %#x\n", hr);
+    ok(hr == S_OK, "CopyPalette error %#lx\n", hr);
     count = 0xdeadbeef;
     hr = IWICPalette_GetColorCount(palette, &count);
-    ok(hr == S_OK, "GetColorCount error %#x\n", hr);
+    ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
     ok(count == 0, "expected 0, got %u\n", count);
     memset(buf, 0xaa, sizeof(buf));
     hr = IWICFormatConverter_CopyPixels(converter, NULL, 32, sizeof(buf), buf);
-    ok(hr == S_OK, "CopyPixels error %#x\n", hr);
+    ok(hr == S_OK, "CopyPixels error %#lx\n", hr);
     count = 0;
     for (i = 0; i < 32 * 2; i++)
         if (buf[i] != 0) count++;
@@ -1886,19 +1886,19 @@ static void test_converter_8bppIndexed(void)
 
     /* NULL palette + Predefined type */
     hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
-    ok(hr == S_OK, "CreateFormatConverter error %#x\n", hr);
+    ok(hr == S_OK, "CreateFormatConverter error %#lx\n", hr);
     hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
                                         &GUID_WICPixelFormat8bppIndexed, WICBitmapDitherTypeNone,
                                         NULL, 0.0, WICBitmapPaletteTypeFixedGray16);
-    ok(hr == S_OK, "Initialize error %#x\n", hr);
+    ok(hr == S_OK, "Initialize error %#lx\n", hr);
     hr = IWICFormatConverter_CopyPalette(converter, palette);
-    ok(hr == S_OK, "CopyPalette error %#x\n", hr);
+    ok(hr == S_OK, "CopyPalette error %#lx\n", hr);
     count = 0xdeadbeef;
     hr = IWICPalette_GetColorCount(palette, &count);
-    ok(hr == S_OK, "GetColorCount error %#x\n", hr);
+    ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
     ok(count == 16, "expected 16, got %u\n", count);
     hr = IWICFormatConverter_CopyPixels(converter, NULL, 32, sizeof(buf), buf);
-    ok(hr == S_OK, "CopyPixels error %#x\n", hr);
+    ok(hr == S_OK, "CopyPixels error %#lx\n", hr);
     count = 0;
     for (i = 0; i < 32 * 2; i++)
         if (buf[i] != 0) count++;
@@ -1907,19 +1907,19 @@ static void test_converter_8bppIndexed(void)
 
     /* not empty palette + Predefined type */
     hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
-    ok(hr == S_OK, "CreateFormatConverter error %#x\n", hr);
+    ok(hr == S_OK, "CreateFormatConverter error %#lx\n", hr);
     hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
                                         &GUID_WICPixelFormat8bppIndexed, WICBitmapDitherTypeNone,
                                         palette, 0.0, WICBitmapPaletteTypeFixedHalftone64);
-    ok(hr == S_OK, "Initialize error %#x\n", hr);
+    ok(hr == S_OK, "Initialize error %#lx\n", hr);
     hr = IWICFormatConverter_CopyPalette(converter, palette);
-    ok(hr == S_OK, "CopyPalette error %#x\n", hr);
+    ok(hr == S_OK, "CopyPalette error %#lx\n", hr);
     count = 0xdeadbeef;
     hr = IWICPalette_GetColorCount(palette, &count);
-    ok(hr == S_OK, "GetColorCount error %#x\n", hr);
+    ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
     ok(count == 16, "expected 16, got %u\n", count);
     hr = IWICFormatConverter_CopyPixels(converter, NULL, 32, sizeof(buf), buf);
-    ok(hr == S_OK, "CopyPixels error %#x\n", hr);
+    ok(hr == S_OK, "CopyPixels error %#lx\n", hr);
     count = 0;
     for (i = 0; i < 32 * 2; i++)
         if (buf[i] != 0) count++;
@@ -1928,19 +1928,19 @@ static void test_converter_8bppIndexed(void)
 
     /* not empty palette + MedianCut type */
     hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
-    ok(hr == S_OK, "CreateFormatConverter error %#x\n", hr);
+    ok(hr == S_OK, "CreateFormatConverter error %#lx\n", hr);
     hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
                                         &GUID_WICPixelFormat8bppIndexed, WICBitmapDitherTypeNone,
                                         palette, 0.0, WICBitmapPaletteTypeMedianCut);
-    ok(hr == S_OK, "Initialize error %#x\n", hr);
+    ok(hr == S_OK, "Initialize error %#lx\n", hr);
     hr = IWICFormatConverter_CopyPalette(converter, palette);
-    ok(hr == S_OK, "CopyPalette error %#x\n", hr);
+    ok(hr == S_OK, "CopyPalette error %#lx\n", hr);
     count = 0xdeadbeef;
     hr = IWICPalette_GetColorCount(palette, &count);
-    ok(hr == S_OK, "GetColorCount error %#x\n", hr);
+    ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
     ok(count == 16, "expected 16, got %u\n", count);
     hr = IWICFormatConverter_CopyPixels(converter, NULL, 32, sizeof(buf), buf);
-    ok(hr == S_OK, "CopyPixels error %#x\n", hr);
+    ok(hr == S_OK, "CopyPixels error %#lx\n", hr);
     count = 0;
     for (i = 0; i < 32 * 2; i++)
         if (buf[i] != 0) count++;
@@ -1949,21 +1949,21 @@ static void test_converter_8bppIndexed(void)
 
     /* NULL palette + MedianCut type */
     hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
-    ok(hr == S_OK, "CreateFormatConverter error %#x\n", hr);
+    ok(hr == S_OK, "CreateFormatConverter error %#lx\n", hr);
     hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
                                         &GUID_WICPixelFormat8bppIndexed, WICBitmapDitherTypeNone,
                                         NULL, 0.0, WICBitmapPaletteTypeMedianCut);
-    ok(hr == S_OK || broken(hr == E_INVALIDARG) /* XP */, "Initialize error %#x\n", hr);
+    ok(hr == S_OK || broken(hr == E_INVALIDARG) /* XP */, "Initialize error %#lx\n", hr);
     if (hr == S_OK)
     {
         hr = IWICFormatConverter_CopyPalette(converter, palette);
-        ok(hr == S_OK, "CopyPalette error %#x\n", hr);
+        ok(hr == S_OK, "CopyPalette error %#lx\n", hr);
         count = 0xdeadbeef;
         hr = IWICPalette_GetColorCount(palette, &count);
-        ok(hr == S_OK, "GetColorCount error %#x\n", hr);
+        ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
         ok(count == 8, "expected 8, got %u\n", count);
         hr = IWICFormatConverter_CopyPixels(converter, NULL, 32, sizeof(buf), buf);
-        ok(hr == S_OK, "CopyPixels error %#x\n", hr);
+        ok(hr == S_OK, "CopyPixels error %#lx\n", hr);
         count = 0;
         for (i = 0; i < 32 * 2; i++)
             if (buf[i] != 0) count++;
@@ -1983,7 +1983,7 @@ START_TEST(converter)
 
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
                           &IID_IWICImagingFactory, (void **)&factory);
-    ok(hr == S_OK, "failed to create factory: %#x\n", hr);
+    ok(hr == S_OK, "failed to create factory: %#lx\n", hr);
 
     test_conversion(&testdata_24bppRGB, &testdata_1bppIndexed, "24bppRGB -> 1bppIndexed", TRUE);
     test_conversion(&testdata_24bppRGB, &testdata_2bppIndexed, "24bppRGB -> 2bppIndexed", TRUE);
diff --git a/dlls/windowscodecs/tests/ddsformat.c b/dlls/windowscodecs/tests/ddsformat.c
index 92b87eee191..fc07fd7222c 100644
--- a/dlls/windowscodecs/tests/ddsformat.c
+++ b/dlls/windowscodecs/tests/ddsformat.c
@@ -464,11 +464,11 @@ static IWICStream *create_stream(const void *image_data, UINT image_size)
     IWICStream *stream = NULL;
 
     hr = IWICImagingFactory_CreateStream(factory, &stream);
-    ok(hr == S_OK, "CreateStream failed, hr %#x\n", hr);
+    ok(hr == S_OK, "CreateStream failed, hr %#lx\n", hr);
     if (hr != S_OK) goto fail;
 
     hr = IWICStream_InitializeFromMemory(stream, (BYTE *)image_data, image_size);
-    ok(hr == S_OK, "InitializeFromMemory failed, hr %#x\n", hr);
+    ok(hr == S_OK, "InitializeFromMemory failed, hr %#lx\n", hr);
     if (hr != S_OK) goto fail;
 
     return stream;
@@ -493,7 +493,7 @@ static IWICBitmapDecoder *create_decoder(void)
 
     memset(&guidresult, 0, sizeof(guidresult));
     hr = IWICBitmapDecoder_GetContainerFormat(decoder, &guidresult);
-    ok(hr == S_OK, "GetContainerFormat failed, hr %#x\n", hr);
+    ok(hr == S_OK, "GetContainerFormat failed, hr %#lx\n", hr);
     ok(IsEqualGUID(&guidresult, &GUID_ContainerFormatDds),
        "Got unexpected container format %s\n", debugstr_guid(&guidresult));
 
@@ -517,7 +517,7 @@ static IWICBitmapEncoder *create_encoder(void)
     memset(&guidresult, 0, sizeof(guidresult));
 
     hr = IWICBitmapEncoder_GetContainerFormat(encoder, &guidresult);
-    ok(hr == S_OK, "GetContainerFormat failed, hr %#x\n", hr);
+    ok(hr == S_OK, "GetContainerFormat failed, hr %#lx\n", hr);
 
     ok(IsEqualGUID(&guidresult, &GUID_ContainerFormatDds),
        "Got unexpected container format %s\n", debugstr_guid(&guidresult));
@@ -531,15 +531,15 @@ static HRESULT init_decoder(IWICBitmapDecoder *decoder, IWICStream *stream, HRES
     IWICWineDecoder *wine_decoder;
 
     hr = IWICBitmapDecoder_Initialize(decoder, (IStream*)stream, WICDecodeMetadataCacheOnDemand);
-    ok(hr == expected, "Expected hr %#x, got %#x\n", expected, hr);
+    ok(hr == expected, "Expected hr %#lx, got %#lx\n", expected, hr);
 
     if (hr != S_OK && wine_init) {
         hr = IWICBitmapDecoder_QueryInterface(decoder, &IID_IWICWineDecoder, (void **)&wine_decoder);
-        ok(hr == S_OK || broken(hr != S_OK), "QueryInterface failed, hr %#x\n", hr);
+        ok(hr == S_OK || broken(hr != S_OK), "QueryInterface failed, hr %#lx\n", hr);
 
         if (hr == S_OK) {
             hr = IWICWineDecoder_Initialize(wine_decoder, (IStream*)stream, WICDecodeMetadataCacheOnDemand);
-            ok(hr == S_OK, "Initialize failed, hr %#x\n", hr);
+            ok(hr == S_OK, "Initialize failed, hr %#lx\n", hr);
         }
     }
 
@@ -566,17 +566,17 @@ static HRESULT create_and_init_encoder(BYTE *image_buffer, UINT buffer_size, WIC
     if (!*stream) goto fail;
 
     hr = IWICBitmapEncoder_Initialize(*encoder, (IStream *)*stream, WICBitmapEncoderNoCache);
-    ok(hr == S_OK, "Initialize failed, hr %#x\n", hr);
+    ok(hr == S_OK, "Initialize failed, hr %#lx\n", hr);
     if (hr != S_OK) goto fail;
 
     hr = IWICBitmapEncoder_QueryInterface(*encoder, &IID_IWICDdsEncoder, (void **)&dds);
-    ok(hr == S_OK, "QueryInterface failed, hr %#x\n", hr);
+    ok(hr == S_OK, "QueryInterface failed, hr %#lx\n", hr);
     if (hr != S_OK) goto fail;
 
     if (params)
     {
         hr = IWICDdsEncoder_SetParameters(dds, params);
-        ok(hr == S_OK, "SetParameters failed, hr %#x\n", hr);
+        ok(hr == S_OK, "SetParameters failed, hr %#lx\n", hr);
         if (hr != S_OK) goto fail;
     }
 
@@ -808,33 +808,33 @@ static void test_dds_decoder_global_properties(IWICBitmapDecoder *decoder)
     UINT count;
 
     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-    ok(hr == S_OK, "CreatePalette failed, hr %#x\n", hr);
+    ok(hr == S_OK, "CreatePalette failed, hr %#lx\n", hr);
     if (hr == S_OK) {
         hr = IWICBitmapDecoder_CopyPalette(decoder, palette);
-        ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "CopyPalette got unexpected hr %#x\n", hr);
+        ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "CopyPalette got unexpected hr %#lx\n", hr);
         hr = IWICBitmapDecoder_CopyPalette(decoder, NULL);
-        ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "CopyPalette got unexpected hr %#x\n", hr);
+        ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "CopyPalette got unexpected hr %#lx\n", hr);
     }
 
     hr = IWICBitmapDecoder_GetMetadataQueryReader(decoder, &metadata_reader);
-    todo_wine ok (hr == S_OK, "GetMetadataQueryReader got unexpected hr %#x\n", hr);
+    todo_wine ok (hr == S_OK, "GetMetadataQueryReader got unexpected hr %#lx\n", hr);
     hr = IWICBitmapDecoder_GetMetadataQueryReader(decoder, NULL);
-    ok(hr == E_INVALIDARG, "GetMetadataQueryReader got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "GetMetadataQueryReader got unexpected hr %#lx\n", hr);
 
     hr = IWICBitmapDecoder_GetPreview(decoder, &preview);
-    ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "GetPreview got unexpected hr %#x\n", hr);
+    ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "GetPreview got unexpected hr %#lx\n", hr);
     hr = IWICBitmapDecoder_GetPreview(decoder, NULL);
-    ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "GetPreview got unexpected hr %#x\n", hr);
+    ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "GetPreview got unexpected hr %#lx\n", hr);
 
     hr = IWICBitmapDecoder_GetColorContexts(decoder, 1, &color_context, &count);
-    ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "GetColorContexts got unexpected hr %#x\n", hr);
+    ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "GetColorContexts got unexpected hr %#lx\n", hr);
     hr = IWICBitmapDecoder_GetColorContexts(decoder, 1, NULL, NULL);
-    ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "GetColorContexts got unexpected hr %#x\n", hr);
+    ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "GetColorContexts got unexpected hr %#lx\n", hr);
 
     hr = IWICBitmapDecoder_GetThumbnail(decoder, &thumnail);
-    ok(hr == WINCODEC_ERR_CODECNOTHUMBNAIL, "GetThumbnail got unexpected hr %#x\n", hr);
+    ok(hr == WINCODEC_ERR_CODECNOTHUMBNAIL, "GetThumbnail got unexpected hr %#lx\n", hr);
     hr = IWICBitmapDecoder_GetThumbnail(decoder, NULL);
-    ok(hr == WINCODEC_ERR_CODECNOTHUMBNAIL, "GetThumbnail got unexpected hr %#x\n", hr);
+    ok(hr == WINCODEC_ERR_CODECNOTHUMBNAIL, "GetThumbnail got unexpected hr %#lx\n", hr);
 
     if (palette) IWICPalette_Release(palette);
     if (metadata_reader) IWICMetadataQueryReader_Release(metadata_reader);
@@ -865,18 +865,18 @@ static void test_dds_decoder_image_parameters(void)
         if (!decoder) goto next;
 
         hr = IWICBitmapDecoder_QueryInterface(decoder, &IID_IWICDdsDecoder, (void **)&dds_decoder);
-        ok(hr == S_OK, "QueryInterface failed, hr %#x\n", hr);
+        ok(hr == S_OK, "QueryInterface failed, hr %#lx\n", hr);
         if (hr != S_OK) goto next;
 
         hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count);
-        ok(hr == WINCODEC_ERR_WRONGSTATE, "GetFrameCount got unexpected hr %#x\n", hr);
+        ok(hr == WINCODEC_ERR_WRONGSTATE, "GetFrameCount got unexpected hr %#lx\n", hr);
         hr = IWICBitmapDecoder_GetFrameCount(decoder, NULL);
-        ok(hr == E_INVALIDARG, "GetFrameCount got unexpected hr %#x\n", hr);
+        ok(hr == E_INVALIDARG, "GetFrameCount got unexpected hr %#lx\n", hr);
 
         hr = IWICDdsDecoder_GetParameters(dds_decoder, &parameters);
-        ok(hr == WINCODEC_ERR_WRONGSTATE, "GetParameters got unexpected hr %#x\n", hr);
+        ok(hr == WINCODEC_ERR_WRONGSTATE, "GetParameters got unexpected hr %#lx\n", hr);
         hr = IWICDdsDecoder_GetParameters(dds_decoder, NULL);
-        ok(hr == E_INVALIDARG, "GetParameters got unexpected hr %#x\n", hr);
+        ok(hr == E_INVALIDARG, "GetParameters got unexpected hr %#lx\n", hr);
 
         if (test_data[i].init_hr != S_OK && !test_data[i].wine_init) continue;
 
@@ -891,16 +891,16 @@ static void test_dds_decoder_image_parameters(void)
         }
 
         hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count);
-        ok(hr == S_OK, "GetFrameCount failed, hr %#x\n", hr);
+        ok(hr == S_OK, "GetFrameCount failed, hr %#lx\n", hr);
         if (hr == S_OK) {
             ok(frame_count == test_data[i].expected_frame_count, "Expected frame count %u, got %u\n",
                test_data[i].expected_frame_count, frame_count);
         }
         hr = IWICBitmapDecoder_GetFrameCount(decoder, NULL);
-        ok(hr == E_INVALIDARG, "GetParameters got unexpected hr %#x\n", hr);
+        ok(hr == E_INVALIDARG, "GetParameters got unexpected hr %#lx\n", hr);
 
         hr = IWICDdsDecoder_GetParameters(dds_decoder, &parameters);
-        ok(hr == S_OK, "GetParameters failed, hr %#x\n", hr);
+        ok(hr == S_OK, "GetParameters failed, hr %#lx\n", hr);
         if (hr == S_OK) {
             ok(parameters.Width == test_data[i].expected_parameters.Width,
                "Expected Width %u, got %u\n", test_data[i].expected_parameters.Width, parameters.Width);
@@ -920,7 +920,7 @@ static void test_dds_decoder_image_parameters(void)
                "Expected AlphaMode %#x, got %#x\n", test_data[i].expected_parameters.AlphaMode, parameters.AlphaMode);
         }
         hr = IWICDdsDecoder_GetParameters(dds_decoder, NULL);
-        ok(hr == E_INVALIDARG, "GetParameters got unexpected hr %#x\n", hr);
+        ok(hr == E_INVALIDARG, "GetParameters got unexpected hr %#lx\n", hr);
 
     next:
         if (decoder) IWICBitmapDecoder_Release(decoder);
@@ -943,13 +943,13 @@ static void test_dds_decoder_frame_properties(IWICBitmapFrameDecode *frame_decod
     /* frame size tests */
 
     hr = IWICBitmapFrameDecode_GetSize(frame_decode, NULL, NULL);
-    ok(hr == E_INVALIDARG, "GetSize got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "GetSize got unexpected hr %#lx\n", hr);
     hr = IWICBitmapFrameDecode_GetSize(frame_decode, NULL, &height);
-    ok(hr == E_INVALIDARG, "GetSize got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "GetSize got unexpected hr %#lx\n", hr);
     hr = IWICBitmapFrameDecode_GetSize(frame_decode, &width, NULL);
-    ok(hr == E_INVALIDARG, "GetSize got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "GetSize got unexpected hr %#lx\n", hr);
     hr = IWICBitmapFrameDecode_GetSize(frame_decode, &width, &height);
-    ok(hr == S_OK, "GetSize failed, hr %#x\n", hr);
+    ok(hr == S_OK, "GetSize failed, hr %#lx\n", hr);
     if (hr != S_OK) return;
 
     depth = params->Depth;
@@ -977,9 +977,9 @@ static void test_dds_decoder_frame_properties(IWICBitmapFrameDecode *frame_decod
     }
 
     hr = IWICDdsFrameDecode_GetFormatInfo(dds_frame, NULL);
-    ok(hr == E_INVALIDARG, "GetFormatInfo got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "GetFormatInfo got unexpected hr %#lx\n", hr);
     hr = IWICDdsFrameDecode_GetFormatInfo(dds_frame, &format_info);
-    ok(hr == S_OK, "GetFormatInfo failed, hr %#x\n", hr);
+    ok(hr == S_OK, "GetFormatInfo failed, hr %#lx\n", hr);
     if (hr != S_OK) return;
 
     ok(format_info.DxgiFormat == test->expected_parameters.DxgiFormat,
@@ -999,13 +999,13 @@ static void test_dds_decoder_frame_properties(IWICBitmapFrameDecode *frame_decod
     /* size in blocks tests */
 
     hr = IWICDdsFrameDecode_GetSizeInBlocks(dds_frame, NULL, NULL);
-    ok(hr == E_INVALIDARG, "GetSizeInBlocks got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "GetSizeInBlocks got unexpected hr %#lx\n", hr);
     hr = IWICDdsFrameDecode_GetSizeInBlocks(dds_frame, NULL, &height_in_blocks);
-    ok(hr == E_INVALIDARG, "GetSizeInBlocks got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "GetSizeInBlocks got unexpected hr %#lx\n", hr);
     hr = IWICDdsFrameDecode_GetSizeInBlocks(dds_frame, &width_in_blocks, NULL);
-    ok(hr == E_INVALIDARG, "GetSizeInBlocks got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "GetSizeInBlocks got unexpected hr %#lx\n", hr);
     hr = IWICDdsFrameDecode_GetSizeInBlocks(dds_frame, &width_in_blocks, &height_in_blocks);
-    ok(hr == S_OK, "GetSizeInBlocks failed, hr %#x\n", hr);
+    ok(hr == S_OK, "GetSizeInBlocks failed, hr %#lx\n", hr);
     if (hr != S_OK) return;
 
     expected_width_in_blocks = (expected_width + expected_block_width - 1) / expected_block_width;
@@ -1018,9 +1018,9 @@ static void test_dds_decoder_frame_properties(IWICBitmapFrameDecode *frame_decod
     /* pixel format tests */
 
     hr = IWICBitmapFrameDecode_GetPixelFormat(frame_decode, NULL);
-    ok(hr == E_INVALIDARG, "GetPixelFormat got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "GetPixelFormat got unexpected hr %#lx\n", hr);
     hr = IWICBitmapFrameDecode_GetPixelFormat(frame_decode, &pixel_format);
-    ok(hr == S_OK, "GetPixelFormat failed, hr %#x\n", hr);
+    ok(hr == S_OK, "GetPixelFormat failed, hr %#lx\n", hr);
     if (hr != S_OK) return;
     ok(IsEqualGUID(&pixel_format, test->expected_pixel_format),
        "Expected pixel format %s, got %s\n",
@@ -1042,16 +1042,16 @@ static void test_dds_decoder_frame_data(IWICBitmapFrameDecode* frame, IWICDdsFra
     int slice_index;
 
     hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &pixel_format);
-    ok(hr == S_OK, "GetPixelFormat failed, hr %#x\n", hr);
+    ok(hr == S_OK, "GetPixelFormat failed, hr %#lx\n", hr);
     if (hr != S_OK) return;
     hr = IWICBitmapFrameDecode_GetSize(frame, &frame_width, &frame_height);
-    ok(hr == S_OK, "GetSize failed, hr %#x\n", hr);
+    ok(hr == S_OK, "GetSize failed, hr %#lx\n", hr);
     if (hr != S_OK) return;
     hr = IWICDdsFrameDecode_GetFormatInfo(dds_frame, &format_info);
-    ok(hr == S_OK, "GetFormatInfo failed, hr %#x\n", hr);
+    ok(hr == S_OK, "GetFormatInfo failed, hr %#lx\n", hr);
     if (hr != S_OK) return;
     hr = IWICDdsFrameDecode_GetSizeInBlocks(dds_frame, &width_in_blocks, &height_in_blocks);
-    ok(hr == S_OK, "GetSizeInBlocks failed, hr %#x\n", hr);
+    ok(hr == S_OK, "GetSizeInBlocks failed, hr %#lx\n", hr);
     if (hr != S_OK) return;
     stride = rect.Width * format_info.BytesPerBlock;
     frame_stride = width_in_blocks * format_info.BytesPerBlock;
@@ -1060,47 +1060,47 @@ static void test_dds_decoder_frame_data(IWICBitmapFrameDecode* frame, IWICDdsFra
     /* CopyBlocks tests */
 
     hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, 0, 0, NULL);
-    ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#lx\n", hr);
 
     hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect_test_a, stride, sizeof(buffer), buffer);
-    ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#lx\n", hr);
     hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect_test_b, stride, sizeof(buffer), buffer);
-    ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#lx\n", hr);
     hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect_test_c, stride, sizeof(buffer), buffer);
-    ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#lx\n", hr);
     hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect_test_d, stride, sizeof(buffer), buffer);
-    ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#lx\n", hr);
 
     hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, frame_stride - 1, sizeof(buffer), buffer);
-    ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#lx\n", hr);
     hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, frame_stride * 2, sizeof(buffer), buffer);
-    ok(hr == S_OK, "CopyBlocks got unexpected hr %#x\n", hr);
+    ok(hr == S_OK, "CopyBlocks got unexpected hr %#lx\n", hr);
     hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, frame_stride, sizeof(buffer), buffer);
-    ok(hr == S_OK, "CopyBlocks got unexpected hr %#x\n", hr);
+    ok(hr == S_OK, "CopyBlocks got unexpected hr %#lx\n", hr);
     hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, frame_stride, frame_stride * height_in_blocks - 1, buffer);
-    ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#lx\n", hr);
     hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, frame_stride, frame_stride * height_in_blocks, buffer);
-    ok(hr == S_OK, "CopyBlocks got unexpected hr %#x\n", hr);
+    ok(hr == S_OK, "CopyBlocks got unexpected hr %#lx\n", hr);
 
     hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, 0, sizeof(buffer), buffer);
-    ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#lx\n", hr);
     hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, stride - 1, sizeof(buffer), buffer);
-    ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#lx\n", hr);
     hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, stride * 2, sizeof(buffer), buffer);
-    ok(hr == S_OK, "CopyBlocks got unexpected hr %#x\n", hr);
+    ok(hr == S_OK, "CopyBlocks got unexpected hr %#lx\n", hr);
 
     hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, stride, 0, buffer);
-    ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#lx\n", hr);
     hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, stride, 1, buffer);
     ok(hr == E_INVALIDARG || (hr == S_OK && test->expected_bytes_per_block == 1),
-       "CopyBlocks got unexpected hr %#x\n", hr);
+       "CopyBlocks got unexpected hr %#lx\n", hr);
     hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, stride, stride * rect.Height - 1, buffer);
-    ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#lx\n", hr);
     hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, stride, stride * rect.Height, buffer);
-    ok(hr == S_OK, "CopyBlocks got unexpected hr %#x\n", hr);
+    ok(hr == S_OK, "CopyBlocks got unexpected hr %#lx\n", hr);
 
     hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, stride, sizeof(buffer), NULL);
-    ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#lx\n", hr);
 
     block_offset = 128; /* DDS magic and header */
     if (has_extended_header(test->data)) block_offset += 20; /* DDS extended header */
@@ -1125,14 +1125,14 @@ static void test_dds_decoder_frame_data(IWICBitmapFrameDecode* frame, IWICDdsFra
 
     memset(buffer, 0, sizeof(buffer));
     hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, stride, sizeof(buffer), buffer);
-    ok(hr == S_OK, "CopyBlocks failed, hr %#x\n", hr);
+    ok(hr == S_OK, "CopyBlocks failed, hr %#lx\n", hr);
     if (hr != S_OK) return;
     ok(!memcmp(test->data + block_offset, buffer, format_info.BytesPerBlock),
        "Block data mismatch\n");
 
     memset(buffer, 0, sizeof(buffer));
     hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, frame_stride, sizeof(buffer), buffer);
-    ok(hr == S_OK, "CopyBlocks failed, hr %#x\n", hr);
+    ok(hr == S_OK, "CopyBlocks failed, hr %#lx\n", hr);
     if (hr != S_OK) return;
     ok(!memcmp(test->data + block_offset, buffer, frame_size),
        "Block data mismatch\n");
@@ -1141,7 +1141,7 @@ static void test_dds_decoder_frame_data(IWICBitmapFrameDecode* frame, IWICDdsFra
     memset(pixels, 0, sizeof(pixels));
     copy_pixels(test->data + block_offset, frame_stride, pixels, frame_stride * 2, frame_size);
     hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, frame_stride * 2, sizeof(buffer), buffer);
-    ok(hr == S_OK, "CopyBlocks failed, hr %#x\n", hr);
+    ok(hr == S_OK, "CopyBlocks failed, hr %#lx\n", hr);
     if (hr != S_OK) return;
     ok(!memcmp(pixels, buffer, frame_size),
        "Block data mismatch\n");
@@ -1154,47 +1154,47 @@ static void test_dds_decoder_frame_data(IWICBitmapFrameDecode* frame, IWICDdsFra
     frame_size = frame_stride * frame_height;
 
     hr = IWICBitmapFrameDecode_CopyPixels(frame, NULL, 0, 0, NULL);
-    ok(hr == E_INVALIDARG, "CopyPixels got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "CopyPixels got unexpected hr %#lx\n", hr);
 
     hr = IWICBitmapFrameDecode_CopyPixels(frame, &rect_test_a, stride, sizeof(buffer), buffer);
-    ok(hr == E_INVALIDARG, "CopyPixels got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "CopyPixels got unexpected hr %#lx\n", hr);
     hr = IWICBitmapFrameDecode_CopyPixels(frame, &rect_test_b, stride, sizeof(buffer), buffer);
-    ok(hr == E_INVALIDARG, "CopyPixels got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "CopyPixels got unexpected hr %#lx\n", hr);
     hr = IWICBitmapFrameDecode_CopyPixels(frame, &rect_test_c, stride, sizeof(buffer), buffer);
-    ok(hr == E_INVALIDARG, "CopyPixels got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "CopyPixels got unexpected hr %#lx\n", hr);
     hr = IWICBitmapFrameDecode_CopyPixels(frame, &rect_test_d, stride, sizeof(buffer), buffer);
-    ok(hr == E_INVALIDARG, "CopyPixels got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "CopyPixels got unexpected hr %#lx\n", hr);
 
     hr = IWICBitmapFrameDecode_CopyPixels(frame, NULL, frame_stride - 1, sizeof(buffer), buffer);
-    ok(hr == E_INVALIDARG, "CopyPixels got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "CopyPixels got unexpected hr %#lx\n", hr);
     hr = IWICBitmapFrameDecode_CopyPixels(frame, NULL, frame_stride * 2, sizeof(buffer), buffer);
-    ok(hr == S_OK, "CopyPixels got unexpected hr %#x\n", hr);
+    ok(hr == S_OK, "CopyPixels got unexpected hr %#lx\n", hr);
     hr = IWICBitmapFrameDecode_CopyPixels(frame, NULL, frame_stride, sizeof(buffer), buffer);
-    ok(hr == S_OK, "CopyPixels got unexpected hr %#x\n", hr);
+    ok(hr == S_OK, "CopyPixels got unexpected hr %#lx\n", hr);
     hr = IWICBitmapFrameDecode_CopyPixels(frame, NULL, frame_stride, frame_stride * frame_height - 1, buffer);
-    ok(hr == WINCODEC_ERR_INSUFFICIENTBUFFER, "CopyPixels got unexpected hr %#x\n", hr);
+    ok(hr == WINCODEC_ERR_INSUFFICIENTBUFFER, "CopyPixels got unexpected hr %#lx\n", hr);
     hr = IWICBitmapFrameDecode_CopyPixels(frame, NULL, frame_stride, frame_stride * frame_height, buffer);
-    ok(hr == S_OK, "CopyPixels got unexpected hr %#x\n", hr);
+    ok(hr == S_OK, "CopyPixels got unexpected hr %#lx\n", hr);
 
     hr = IWICBitmapFrameDecode_CopyPixels(frame, &rect, 0, sizeof(buffer), buffer);
-    ok(hr == E_INVALIDARG, "CopyPixels got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "CopyPixels got unexpected hr %#lx\n", hr);
     hr = IWICBitmapFrameDecode_CopyPixels(frame, &rect, stride - 1, sizeof(buffer), buffer);
-    ok(hr == E_INVALIDARG, "CopyPixels got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "CopyPixels got unexpected hr %#lx\n", hr);
     hr = IWICBitmapFrameDecode_CopyPixels(frame, &rect, stride * 2, sizeof(buffer), buffer);
-    ok(hr == S_OK, "CopyPixels got unexpected hr %#x\n", hr);
+    ok(hr == S_OK, "CopyPixels got unexpected hr %#lx\n", hr);
 
     hr = IWICBitmapFrameDecode_CopyPixels(frame, &rect, stride, 0, buffer);
-    ok(hr == WINCODEC_ERR_INSUFFICIENTBUFFER, "CopyPixels got unexpected hr %#x\n", hr);
+    ok(hr == WINCODEC_ERR_INSUFFICIENTBUFFER, "CopyPixels got unexpected hr %#lx\n", hr);
     hr = IWICBitmapFrameDecode_CopyPixels(frame, &rect, stride, 1, buffer);
     ok(hr == WINCODEC_ERR_INSUFFICIENTBUFFER || (hr == S_OK && test->expected_bytes_per_block == 1),
-       "CopyPixels got unexpected hr %#x\n", hr);
+       "CopyPixels got unexpected hr %#lx\n", hr);
     hr = IWICBitmapFrameDecode_CopyPixels(frame, &rect, stride, stride * rect.Height - 1, buffer);
-    ok(hr == WINCODEC_ERR_INSUFFICIENTBUFFER, "CopyPixels got unexpected hr %#x\n", hr);
+    ok(hr == WINCODEC_ERR_INSUFFICIENTBUFFER, "CopyPixels got unexpected hr %#lx\n", hr);
     hr = IWICBitmapFrameDecode_CopyPixels(frame, &rect, stride, stride * rect.Height, buffer);
-    ok(hr == S_OK, "CopyPixels got unexpected hr %#x\n", hr);
+    ok(hr == S_OK, "CopyPixels got unexpected hr %#lx\n", hr);
 
     hr = IWICBitmapFrameDecode_CopyPixels(frame, &rect, stride, sizeof(buffer), NULL);
-    ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#lx\n", hr);
 
     memset(buffer, 0, sizeof(pixels));
     if (is_compressed(format_info.DxgiFormat)) {
@@ -1206,7 +1206,7 @@ static void test_dds_decoder_frame_data(IWICBitmapFrameDecode* frame, IWICDdsFra
 
     memset(buffer, 0, sizeof(buffer));
     hr = IWICBitmapFrameDecode_CopyPixels(frame, &rect, stride, sizeof(buffer), buffer);
-    ok(hr == S_OK, "CopyPixels failed, hr %#x\n", hr);
+    ok(hr == S_OK, "CopyPixels failed, hr %#lx\n", hr);
     if (hr == S_OK) {
         if (is_compressed(format_info.DxgiFormat)) {
             ok(color_buffer_match((DWORD *)pixels, (DWORD *)buffer, 1), "Pixels mismatch\n");
@@ -1217,7 +1217,7 @@ static void test_dds_decoder_frame_data(IWICBitmapFrameDecode* frame, IWICDdsFra
 
     memset(buffer, 0, sizeof(buffer));
     hr = IWICBitmapFrameDecode_CopyPixels(frame, NULL, frame_stride, sizeof(buffer), buffer);
-    ok(hr == S_OK, "CopyPixels failed, hr %#x\n", hr);
+    ok(hr == S_OK, "CopyPixels failed, hr %#lx\n", hr);
     if (hr == S_OK) {
         if (is_compressed(format_info.DxgiFormat)) {
             ok(color_buffer_match((DWORD *)pixels, (DWORD *)buffer, frame_size / (bpp / 8)), "Pixels mismatch\n");
@@ -1235,13 +1235,13 @@ static void test_dds_decoder_frame(IWICBitmapDecoder *decoder, struct test_data
     WICDdsParameters params;
 
     hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count);
-    ok(hr == S_OK, "GetFrameCount failed, hr %#x\n", hr);
+    ok(hr == S_OK, "GetFrameCount failed, hr %#lx\n", hr);
     if (hr != S_OK) return;
     hr = IWICBitmapDecoder_QueryInterface(decoder, &IID_IWICDdsDecoder, (void **)&dds_decoder);
-    ok(hr == S_OK, "QueryInterface failed, hr %#x\n", hr);
+    ok(hr == S_OK, "QueryInterface failed, hr %#lx\n", hr);
     if (hr != S_OK) goto end;
     hr = IWICDdsDecoder_GetParameters(dds_decoder, &params);
-    ok(hr == S_OK, "GetParameters failed, hr %#x\n", hr);
+    ok(hr == S_OK, "GetParameters failed, hr %#lx\n", hr);
     if (hr != S_OK) goto end;
 
     if (test->expected_parameters.Dimension == WICDdsTextureCube) params.ArraySize *= 6;
@@ -1254,10 +1254,10 @@ static void test_dds_decoder_frame(IWICBitmapDecoder *decoder, struct test_data
         winetest_push_context("Frame %u", j);
 
         hr = IWICBitmapDecoder_GetFrame(decoder, j, &frame_decode);
-        ok(hr == S_OK, "GetFrame failed, hr %#x\n", hr);
+        ok(hr == S_OK, "GetFrame failed, hr %#lx\n", hr);
         if (hr != S_OK) goto next;
         hr = IWICBitmapFrameDecode_QueryInterface(frame_decode, &IID_IWICDdsFrameDecode, (void **)&dds_frame);
-        ok(hr == S_OK, "QueryInterface failed, hr %#x\n", hr);
+        ok(hr == S_OK, "QueryInterface failed, hr %#lx\n", hr);
         if (hr != S_OK) goto next;
 
         test_dds_decoder_frame_properties(frame_decode, dds_frame, frame_count, &params, test, j);
@@ -1331,11 +1331,11 @@ static void test_dds_encoder_initialize(void)
 
     hr = IWICBitmapEncoder_Initialize(encoder, (IStream *)stream, 0xdeadbeef);
     todo_wine
-    ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "Initialize got unexpected hr %#x\n", hr);
+    ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "Initialize got unexpected hr %#lx\n", hr);
 
     hr = IWICBitmapEncoder_Initialize(encoder, (IStream *)stream, WICBitmapEncoderNoCache);
     todo_wine
-    ok(hr == E_INVALIDARG, "Initialize got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "Initialize got unexpected hr %#lx\n", hr);
 
     IWICBitmapEncoder_Release(encoder);
 
@@ -1345,10 +1345,10 @@ static void test_dds_encoder_initialize(void)
     if (!encoder) goto end;
 
     hr = IWICBitmapEncoder_Initialize(encoder, NULL, WICBitmapEncoderNoCache);
-    ok(hr == E_INVALIDARG, "Initialize got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "Initialize got unexpected hr %#lx\n", hr);
 
     hr = IWICBitmapEncoder_Initialize(encoder, (IStream *)stream, WICBitmapEncoderNoCache);
-    ok(hr == S_OK, "Initialize failed, hr %#x\n", hr);
+    ok(hr == S_OK, "Initialize failed, hr %#lx\n", hr);
 
     IWICBitmapEncoder_Release(encoder);
 
@@ -1358,10 +1358,10 @@ static void test_dds_encoder_initialize(void)
     if (!encoder) goto end;
 
     hr = IWICBitmapEncoder_Initialize(encoder, (IStream *)stream, WICBitmapEncoderNoCache);
-    ok(hr == S_OK, "Initialize failed, hr %#x\n", hr);
+    ok(hr == S_OK, "Initialize failed, hr %#lx\n", hr);
 
     hr = IWICBitmapEncoder_Initialize(encoder, (IStream *)stream, WICBitmapEncoderNoCache);
-    ok(hr == WINCODEC_ERR_WRONGSTATE, "Initialize got unexpected hr %#x\n", hr);
+    ok(hr == WINCODEC_ERR_WRONGSTATE, "Initialize got unexpected hr %#lx\n", hr);
 
 end:
     if (stream) IWICStream_Release(stream);
@@ -1383,10 +1383,10 @@ static void test_dds_encoder_params(void)
     if (hr != S_OK) goto end;
 
     hr = IWICDdsEncoder_GetParameters(dds_encoder, NULL);
-    ok(hr == E_INVALIDARG, "GetParameters got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "GetParameters got unexpected hr %#lx\n", hr);
 
     hr = IWICDdsEncoder_GetParameters(dds_encoder, &params);
-    ok(hr == S_OK, "GetParameters failed, hr %#x\n", hr);
+    ok(hr == S_OK, "GetParameters failed, hr %#lx\n", hr);
     if (hr != S_OK) goto end;
 
     /* default DDS parameters for encoder */
@@ -1400,10 +1400,10 @@ static void test_dds_encoder_params(void)
     ok(params.AlphaMode  == WICDdsAlphaModeUnknown, "Got unexpected AlphaMode %#x\n",  params.AlphaMode);
 
     hr = IWICDdsEncoder_SetParameters(dds_encoder, NULL);
-    ok(hr == E_INVALIDARG, "SetParameters got unexpected hr %#x\n", hr);
+    ok(hr == E_INVALIDARG, "SetParameters got unexpected hr %#lx\n", hr);
 
     hr = IWICDdsEncoder_SetParameters(dds_encoder, &params_set);
-    ok(hr == S_OK, "SetParameters failed, hr %#x\n", hr);
+    ok(hr == S_OK, "SetParameters failed, hr %#lx\n", hr);
     if (hr != S_OK) goto end;
 
     IWICDdsEncoder_GetParameters(dds_encoder, &params);
@@ -1430,7 +1430,7 @@ static void test_dds_encoder_params(void)
         hr = IWICDdsEncoder_SetParameters(dds_encoder, &test_data[i].expected_parameters);
         todo_wine_if(test_data[i].init_hr != S_OK)
         ok((hr == S_OK && test_data[i].init_hr == S_OK) || hr == WINCODEC_ERR_BADHEADER,
-           "Test %u: SetParameters got unexpected hr %#x\n", i, hr);
+           "Test %u: SetParameters got unexpected hr %#lx\n", i, hr);
     }
 
 end:
@@ -1453,25 +1453,25 @@ static void test_dds_encoder_create_frame(void)
     if (hr != S_OK) goto end;
 
     hr = IWICBitmapEncoder_CreateNewFrame(encoder, &frame0, NULL);
-    ok(hr == S_OK, "CreateNewFrame failed, hr %#x\n", hr);
+    ok(hr == S_OK, "CreateNewFrame failed, hr %#lx\n", hr);
     hr = IWICBitmapEncoder_CreateNewFrame(encoder, &frame1, NULL);
-    ok(hr == WINCODEC_ERR_WRONGSTATE, "CreateNewFrame got unexpected hr %#x\n", hr);
+    ok(hr == WINCODEC_ERR_WRONGSTATE, "CreateNewFrame got unexpected hr %#lx\n", hr);
 
     IWICBitmapFrameEncode_Release(frame0);
     hr = IWICBitmapEncoder_CreateNewFrame(encoder, &frame1, NULL);
-    ok(hr == WINCODEC_ERR_WRONGSTATE, "CreateNewFrame got unexpected hr %#x\n", hr);
+    ok(hr == WINCODEC_ERR_WRONGSTATE, "CreateNewFrame got unexpected hr %#lx\n", hr);
 
     release_encoder(encoder, dds_encoder, stream);
 
     create_and_init_encoder(buffer, sizeof(buffer), &params, &encoder, &dds_encoder, &stream);
     hr = IWICDdsEncoder_CreateNewFrame(dds_encoder, &frame0, &array_index, &mip_level, &slice_index);
-    ok(hr == S_OK, "CreateNewFrame failed, hr %#x\n", hr);
+    ok(hr == S_OK, "CreateNewFrame failed, hr %#lx\n", hr);
     IWICBitmapFrameEncode_Release(frame0);
     release_encoder(encoder, dds_encoder, stream);
 
     create_and_init_encoder(buffer, sizeof(buffer), &params, &encoder, &dds_encoder, &stream);
     hr = IWICDdsEncoder_CreateNewFrame(dds_encoder, &frame0, NULL, NULL, NULL);
-    ok(hr == S_OK, "CreateNewFrame failed, hr %#x\n", hr);
+    ok(hr == S_OK, "CreateNewFrame failed, hr %#lx\n", hr);
     IWICBitmapFrameEncode_Release(frame0);
 
 end:
@@ -1526,7 +1526,7 @@ static void test_dds_encoder_pixel_format(void)
         IWICBitmapEncoder_CreateNewFrame(encoder, &frame, NULL);
 
         hr = IWICBitmapFrameEncode_SetPixelFormat(frame, &format);
-        ok(hr == WINCODEC_ERR_NOTINITIALIZED, "SetPixelFormat got unexpected hr %#x\n", hr);
+        ok(hr == WINCODEC_ERR_NOTINITIALIZED, "SetPixelFormat got unexpected hr %#lx\n", hr);
 
         IWICBitmapFrameEncode_Initialize(frame, NULL);
 
@@ -1536,7 +1536,7 @@ static void test_dds_encoder_pixel_format(void)
 
             format = *(test_formats[j]);
             hr = IWICBitmapFrameEncode_SetPixelFormat(frame, &format);
-            ok(hr == S_OK, "SetPixelFormat failed, hr %#x\n", hr);
+            ok(hr == S_OK, "SetPixelFormat failed, hr %#lx\n", hr);
             ok(IsEqualGUID(&format, &GUID_WICPixelFormat32bppBGRA),
                "Got unexpected GUID %s\n", debugstr_guid(&format));
 
@@ -1563,7 +1563,7 @@ START_TEST(ddsformat)
 
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
                           &IID_IWICImagingFactory, (void **)&factory);
-    ok(hr == S_OK, "CoCreateInstance failed, hr %#x\n", hr);
+    ok(hr == S_OK, "CoCreateInstance failed, hr %#lx\n", hr);
     if (hr != S_OK) goto end;
 
     test_dds_decoder();
diff --git a/dlls/windowscodecs/tests/gifformat.c b/dlls/windowscodecs/tests/gifformat.c
index 05affadca4d..8488f486a11 100644
--- a/dlls/windowscodecs/tests/gifformat.c
+++ b/dlls/windowscodecs/tests/gifformat.c
@@ -93,7 +93,7 @@ static IStream *create_stream(const void *image_data, UINT image_size)
     GlobalUnlock(hmem);
 
     hr = CreateStreamOnHGlobal(hmem, TRUE, &stream);
-    ok(hr == S_OK, "CreateStreamOnHGlobal error %#x\n", hr);
+    ok(hr == S_OK, "CreateStreamOnHGlobal error %#lx\n", hr);
 
     return stream;
 }
@@ -110,10 +110,10 @@ static IWICBitmapDecoder *create_decoder(const void *image_data, UINT image_size
     if (!stream) return NULL;
 
     hr = IWICImagingFactory_CreateDecoderFromStream(factory, stream, NULL, 0, &decoder);
-    ok(hr == S_OK, "CreateDecoderFromStream error %#x\n", hr);
+    ok(hr == S_OK, "CreateDecoderFromStream error %#lx\n", hr);
 
     hr = IWICBitmapDecoder_GetContainerFormat(decoder, &format);
-    ok(hr == S_OK, "GetContainerFormat error %#x\n", hr);
+    ok(hr == S_OK, "GetContainerFormat error %#lx\n", hr);
     ok(IsEqualGUID(&format, &GUID_ContainerFormatGif),
        "wrong container format %s\n", wine_dbgstr_guid(&format));
 
@@ -137,18 +137,18 @@ static void test_global_gif_palette(void)
     ok(decoder != 0, "Failed to load GIF image data\n");
 
     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-    ok(hr == S_OK, "CreatePalette error %#x\n", hr);
+    ok(hr == S_OK, "CreatePalette error %#lx\n", hr);
 
     /* global palette */
     hr = IWICBitmapDecoder_CopyPalette(decoder, palette);
-    ok(hr == S_OK, "CopyPalette error %#x\n", hr);
+    ok(hr == S_OK, "CopyPalette error %#lx\n", hr);
 
     hr = IWICPalette_GetColorCount(palette, &count);
-    ok(hr == S_OK, "GetColorCount error %#x\n", hr);
+    ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
     ok(count == 4, "expected 4, got %u\n", count);
 
     hr = IWICPalette_GetColors(palette, count, color, &ret);
-    ok(hr == S_OK, "GetColors error %#x\n", hr);
+    ok(hr == S_OK, "GetColors error %#lx\n", hr);
     ok(ret == count, "expected %u, got %u\n", count, ret);
     ok(color[0] == 0xff010203, "expected 0xff010203, got %#x\n", color[0]);
     ok(color[1] == 0x00040506, "expected 0x00040506, got %#x\n", color[1]);
@@ -157,22 +157,22 @@ static void test_global_gif_palette(void)
 
     /* frame palette */
     hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
-    ok(hr == S_OK, "GetFrame error %#x\n", hr);
+    ok(hr == S_OK, "GetFrame error %#lx\n", hr);
 
     hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format);
-    ok(hr == S_OK, "GetPixelFormat error %#x\n", hr);
+    ok(hr == S_OK, "GetPixelFormat error %#lx\n", hr);
     ok(IsEqualGUID(&format, &GUID_WICPixelFormat8bppIndexed),
        "wrong pixel format %s\n", wine_dbgstr_guid(&format));
 
     hr = IWICBitmapFrameDecode_CopyPalette(frame, palette);
-    ok(hr == S_OK, "CopyPalette error %#x\n", hr);
+    ok(hr == S_OK, "CopyPalette error %#lx\n", hr);
 
     hr = IWICPalette_GetColorCount(palette, &count);
-    ok(hr == S_OK, "GetColorCount error %#x\n", hr);
+    ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
     ok(count == 4, "expected 4, got %u\n", count);
 
     hr = IWICPalette_GetColors(palette, count, color, &ret);
-    ok(hr == S_OK, "GetColors error %#x\n", hr);
+    ok(hr == S_OK, "GetColors error %#lx\n", hr);
     ok(ret == count, "expected %u, got %u\n", count, ret);
     ok(color[0] == 0xff010203, "expected 0xff010203, got %#x\n", color[0]);
     ok(color[1] == 0x00040506, "expected 0x00040506, got %#x\n", color[1]);
@@ -199,21 +199,21 @@ static void test_global_gif_palette_2frames(void)
 
     /* active frame 0, GCE transparent index 1 */
     hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
-    ok(hr == S_OK, "GetFrame error %#x\n", hr);
+    ok(hr == S_OK, "GetFrame error %#lx\n", hr);
 
     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-    ok(hr == S_OK, "CreatePalette error %#x\n", hr);
+    ok(hr == S_OK, "CreatePalette error %#lx\n", hr);
 
     /* global palette */
     hr = IWICBitmapDecoder_CopyPalette(decoder, palette);
-    ok(hr == S_OK, "CopyPalette error %#x\n", hr);
+    ok(hr == S_OK, "CopyPalette error %#lx\n", hr);
 
     hr = IWICPalette_GetColorCount(palette, &count);
-    ok(hr == S_OK, "GetColorCount error %#x\n", hr);
+    ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
     ok(count == 4, "expected 4, got %u\n", count);
 
     hr = IWICPalette_GetColors(palette, count, color, &ret);
-    ok(hr == S_OK, "GetColors error %#x\n", hr);
+    ok(hr == S_OK, "GetColors error %#lx\n", hr);
     ok(ret == count, "expected %u, got %u\n", count, ret);
     ok(color[0] == 0xff010203, "expected 0xff010203, got %#x\n", color[0]);
     ok(color[1] == 0x00040506, "expected 0x00040506, got %#x\n", color[1]);
@@ -222,19 +222,19 @@ static void test_global_gif_palette_2frames(void)
 
     /* frame 0 palette */
     hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format);
-    ok(hr == S_OK, "GetPixelFormat error %#x\n", hr);
+    ok(hr == S_OK, "GetPixelFormat error %#lx\n", hr);
     ok(IsEqualGUID(&format, &GUID_WICPixelFormat8bppIndexed),
        "wrong pixel format %s\n", wine_dbgstr_guid(&format));
 
     hr = IWICBitmapFrameDecode_CopyPalette(frame, palette);
-    ok(hr == S_OK, "CopyPalette error %#x\n", hr);
+    ok(hr == S_OK, "CopyPalette error %#lx\n", hr);
 
     hr = IWICPalette_GetColorCount(palette, &count);
-    ok(hr == S_OK, "GetColorCount error %#x\n", hr);
+    ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
     ok(count == 4, "expected 4, got %u\n", count);
 
     hr = IWICPalette_GetColors(palette, count, color, &ret);
-    ok(hr == S_OK, "GetColors error %#x\n", hr);
+    ok(hr == S_OK, "GetColors error %#lx\n", hr);
     ok(ret == count, "expected %u, got %u\n", count, ret);
     ok(color[0] == 0xff010203, "expected 0xff010203, got %#x\n", color[0]);
     ok(color[1] == 0x00040506, "expected 0x00040506, got %#x\n", color[1]);
@@ -245,18 +245,18 @@ static void test_global_gif_palette_2frames(void)
 
     /* active frame 1, GCE transparent index 2 */
     hr = IWICBitmapDecoder_GetFrame(decoder, 1, &frame);
-    ok(hr == S_OK, "GetFrame error %#x\n", hr);
+    ok(hr == S_OK, "GetFrame error %#lx\n", hr);
 
     /* global palette */
     hr = IWICBitmapDecoder_CopyPalette(decoder, palette);
-    ok(hr == S_OK, "CopyPalette error %#x\n", hr);
+    ok(hr == S_OK, "CopyPalette error %#lx\n", hr);
 
     hr = IWICPalette_GetColorCount(palette, &count);
-    ok(hr == S_OK, "GetColorCount error %#x\n", hr);
+    ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
     ok(count == 4, "expected 4, got %u\n", count);
 
     hr = IWICPalette_GetColors(palette, count, color, &ret);
-    ok(hr == S_OK, "GetColors error %#x\n", hr);
+    ok(hr == S_OK, "GetColors error %#lx\n", hr);
     ok(ret == count, "expected %u, got %u\n", count, ret);
     ok(color[0] == 0xff010203, "expected 0xff010203, got %#x\n", color[0]);
     ok(color[1] == 0xff040506 || broken(color[1] == 0x00040506) /* XP */, "expected 0xff040506, got %#x\n", color[1]);
@@ -265,19 +265,19 @@ static void test_global_gif_palette_2frames(void)
 
     /* frame 1 palette */
     hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format);
-    ok(hr == S_OK, "GetPixelFormat error %#x\n", hr);
+    ok(hr == S_OK, "GetPixelFormat error %#lx\n", hr);
     ok(IsEqualGUID(&format, &GUID_WICPixelFormat8bppIndexed),
        "wrong pixel format %s\n", wine_dbgstr_guid(&format));
 
     hr = IWICBitmapFrameDecode_CopyPalette(frame, palette);
-    ok(hr == S_OK, "CopyPalette error %#x\n", hr);
+    ok(hr == S_OK, "CopyPalette error %#lx\n", hr);
 
     hr = IWICPalette_GetColorCount(palette, &count);
-    ok(hr == S_OK, "GetColorCount error %#x\n", hr);
+    ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
     ok(count == 4, "expected 4, got %u\n", count);
 
     hr = IWICPalette_GetColors(palette, count, color, &ret);
-    ok(hr == S_OK, "GetColors error %#x\n", hr);
+    ok(hr == S_OK, "GetColors error %#lx\n", hr);
     ok(ret == count, "expected %u, got %u\n", count, ret);
     ok(color[0] == 0xff010203, "expected 0xff010203, got %#x\n", color[0]);
     ok(color[1] == 0xff040506, "expected 0xff040506, got %#x\n", color[1]);
@@ -304,24 +304,24 @@ static void test_local_gif_palette(void)
     ok(decoder != 0, "Failed to load GIF image data\n");
 
     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-    ok(hr == S_OK, "CreatePalette error %#x\n", hr);
+    ok(hr == S_OK, "CreatePalette error %#lx\n", hr);
 
     /* global palette */
     hr = IWICBitmapDecoder_CopyPalette(decoder, palette);
-    ok(hr == S_OK || broken(hr == WINCODEC_ERR_FRAMEMISSING), "CopyPalette %#x\n", hr);
+    ok(hr == S_OK || broken(hr == WINCODEC_ERR_FRAMEMISSING), "CopyPalette %#lx\n", hr);
     if (hr == S_OK)
     {
         type = -1;
         hr = IWICPalette_GetType(palette, &type);
-        ok(hr == S_OK, "GetType error %#x\n", hr);
+        ok(hr == S_OK, "GetType error %#lx\n", hr);
         ok(type == WICBitmapPaletteTypeCustom, "expected WICBitmapPaletteTypeCustom, got %#x\n", type);
 
         hr = IWICPalette_GetColorCount(palette, &count);
-        ok(hr == S_OK, "GetColorCount error %#x\n", hr);
+        ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
         ok(count == 256, "expected 256, got %u\n", count);
 
         hr = IWICPalette_GetColors(palette, count, color, &ret);
-        ok(hr == S_OK, "GetColors error %#x\n", hr);
+        ok(hr == S_OK, "GetColors error %#lx\n", hr);
         ok(ret == count, "expected %u, got %u\n", count, ret);
         ok(color[0] == 0xff000000, "expected 0xff000000, got %#x\n", color[0]);
         ok(color[1] == 0x00ffffff, "expected 0x00ffffff, got %#x\n", color[1]);
@@ -332,27 +332,27 @@ static void test_local_gif_palette(void)
 
     /* frame palette */
     hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
-    ok(hr == S_OK, "GetFrame error %#x\n", hr);
+    ok(hr == S_OK, "GetFrame error %#lx\n", hr);
 
     hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format);
-    ok(hr == S_OK, "GetPixelFormat error %#x\n", hr);
+    ok(hr == S_OK, "GetPixelFormat error %#lx\n", hr);
     ok(IsEqualGUID(&format, &GUID_WICPixelFormat8bppIndexed),
        "wrong pixel format %s\n", wine_dbgstr_guid(&format));
 
     hr = IWICBitmapFrameDecode_CopyPalette(frame, palette);
-    ok(hr == S_OK, "CopyPalette error %#x\n", hr);
+    ok(hr == S_OK, "CopyPalette error %#lx\n", hr);
 
     hr = IWICPalette_GetColorCount(palette, &count);
-    ok(hr == S_OK, "GetColorCount error %#x\n", hr);
+    ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
     ok(count == 4, "expected 4, got %u\n", count);
 
     type = -1;
     hr = IWICPalette_GetType(palette, &type);
-    ok(hr == S_OK, "GetType error %#x\n", hr);
+    ok(hr == S_OK, "GetType error %#lx\n", hr);
     ok(type == WICBitmapPaletteTypeCustom, "expected WICBitmapPaletteTypeCustom, got %#x\n", type);
 
     hr = IWICPalette_GetColors(palette, count, color, &ret);
-    ok(hr == S_OK, "GetColors error %#x\n", hr);
+    ok(hr == S_OK, "GetColors error %#lx\n", hr);
     ok(ret == count, "expected %u, got %u\n", count, ret);
     ok(color[0] == 0xff010203, "expected 0xff010203, got %#x\n", color[0]);
     ok(color[1] == 0x00040506, "expected 0x00040506, got %#x\n", color[1]);
@@ -379,32 +379,32 @@ static void test_gif_frame_sizes(void)
     ok(decoder != 0, "Failed to load GIF image data\n");
 
     hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
-    ok(hr == S_OK, "GetFrame error %#x\n", hr);
+    ok(hr == S_OK, "GetFrame error %#lx\n", hr);
 
     hr = IWICBitmapFrameDecode_GetSize(frame, &width, &height);
-    ok(hr == S_OK, "GetSize error %x\n", hr);
+    ok(hr == S_OK, "GetSize error %lx\n", hr);
     ok(width == 2, "width = %d\n", width);
     ok(height == 2, "height = %d\n", height);
 
     memset(buf, 0xfe, sizeof(buf));
     hr = IWICBitmapFrameDecode_CopyPixels(frame, NULL, 4, sizeof(buf), buf);
-    ok(hr == S_OK, "CopyPixels error %x\n", hr);
+    ok(hr == S_OK, "CopyPixels error %lx\n", hr);
     ok(!memcmp(buf, frame0, sizeof(buf)), "buf = %x %x %x %x %x %x %x %x\n",
             buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7]);
 
     IWICBitmapFrameDecode_Release(frame);
 
     hr = IWICBitmapDecoder_GetFrame(decoder, 1, &frame);
-    ok(hr == S_OK, "GetFrame error %#x\n", hr);
+    ok(hr == S_OK, "GetFrame error %#lx\n", hr);
 
     hr = IWICBitmapFrameDecode_GetSize(frame, &width, &height);
-    ok(hr == S_OK, "GetSize error %x\n", hr);
+    ok(hr == S_OK, "GetSize error %lx\n", hr);
     ok(width == 2, "width = %d\n", width);
     ok(height == 1, "height = %d\n", height);
 
     memset(buf, 0xfe, sizeof(buf));
     hr = IWICBitmapFrameDecode_CopyPixels(frame, NULL, 4, sizeof(buf), buf);
-    ok(hr == S_OK, "CopyPixels error %x\n", hr);
+    ok(hr == S_OK, "CopyPixels error %lx\n", hr);
     ok(!memcmp(buf, frame1, sizeof(buf)), "buf = %x %x %x %x %x %x %x %x\n",
             buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7]);
 
@@ -448,9 +448,9 @@ static void test_truncated_gif(void)
     if (!stream) return;
 
     hr = IWICImagingFactory_CreateDecoderFromStream(factory, stream, NULL, 0, &decoder);
-    ok(hr == S_OK, "CreateDecoderFromStream error %#x\n", hr);
+    ok(hr == S_OK, "CreateDecoderFromStream error %#lx\n", hr);
     hr = IWICBitmapDecoder_GetContainerFormat(decoder, &format);
-    ok(hr == S_OK, "GetContainerFormat error %#x\n", hr);
+    ok(hr == S_OK, "GetContainerFormat error %#lx\n", hr);
     ok(IsEqualGUID(&format, &GUID_ContainerFormatGif),
        "wrong container format %s\n", wine_dbgstr_guid(&format));
     IWICBitmapDecoder_Release(decoder);
@@ -459,9 +459,9 @@ static void test_truncated_gif(void)
     stream = create_stream(gif_with_trailer_2, sizeof(gif_with_trailer_2));
     if (!stream) return;
     hr = IWICImagingFactory_CreateDecoderFromStream(factory, stream, NULL, 0, &decoder);
-    ok(hr == S_OK, "CreateDecoderFromStream error %#x\n", hr);
+    ok(hr == S_OK, "CreateDecoderFromStream error %#lx\n", hr);
     hr = IWICBitmapDecoder_GetContainerFormat(decoder, &format);
-    ok(hr == S_OK, "GetContainerFormat error %#x\n", hr);
+    ok(hr == S_OK, "GetContainerFormat error %#lx\n", hr);
     ok(IsEqualGUID(&format, &GUID_ContainerFormatGif),
        "wrong container format %s\n", wine_dbgstr_guid(&format));
     IWICBitmapDecoder_Release(decoder);
@@ -470,9 +470,9 @@ static void test_truncated_gif(void)
     stream = create_stream(gif_without_trailer_1, sizeof(gif_without_trailer_1));
     if (!stream) return;
     hr = IWICImagingFactory_CreateDecoderFromStream(factory, stream, NULL, 0, &decoder);
-    ok(hr == S_OK, "CreateDecoderFromStream error %#x\n", hr);
+    ok(hr == S_OK, "CreateDecoderFromStream error %#lx\n", hr);
     hr = IWICBitmapDecoder_GetContainerFormat(decoder, &format);
-    ok(hr == S_OK, "GetContainerFormat error %#x\n", hr);
+    ok(hr == S_OK, "GetContainerFormat error %#lx\n", hr);
     ok(IsEqualGUID(&format, &GUID_ContainerFormatGif),
        "wrong container format %s\n", wine_dbgstr_guid(&format));
     IWICBitmapDecoder_Release(decoder);
@@ -481,9 +481,9 @@ static void test_truncated_gif(void)
     stream = create_stream(gif_without_trailer_2, sizeof(gif_without_trailer_2));
     if (!stream) return;
     hr = IWICImagingFactory_CreateDecoderFromStream(factory, stream, NULL, 0, &decoder);
-    ok(hr == S_OK, "CreateDecoderFromStream error %#x\n", hr);
+    ok(hr == S_OK, "CreateDecoderFromStream error %#lx\n", hr);
     hr = IWICBitmapDecoder_GetContainerFormat(decoder, &format);
-    ok(hr == S_OK, "GetContainerFormat error %#x\n", hr);
+    ok(hr == S_OK, "GetContainerFormat error %#lx\n", hr);
     ok(IsEqualGUID(&format, &GUID_ContainerFormatGif),
        "wrong container format %s\n", wine_dbgstr_guid(&format));
     IWICBitmapDecoder_Release(decoder);
@@ -509,38 +509,38 @@ static void test_gif_notrailer(void)
 
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICImagingFactory, (void**)&factory);
-    ok(hr == S_OK, "CoCreateInstance failed, hr=%x\n", hr);
+    ok(hr == S_OK, "CoCreateInstance failed, hr=%lx\n", hr);
     if (FAILED(hr)) return;
 
     hr = IWICImagingFactory_CreateStream(factory, &gifstream);
-    ok(hr == S_OK, "CreateStream failed, hr=%x\n", hr);
+    ok(hr == S_OK, "CreateStream failed, hr=%lx\n", hr);
     if (SUCCEEDED(hr))
     {
         hr = IWICStream_InitializeFromMemory(gifstream, gifimage_notrailer,
             sizeof(gifimage_notrailer));
-        ok(hr == S_OK, "InitializeFromMemory failed, hr=%x\n", hr);
+        ok(hr == S_OK, "InitializeFromMemory failed, hr=%lx\n", hr);
 
         if (SUCCEEDED(hr))
         {
             hr = CoCreateInstance(&CLSID_WICGifDecoder, NULL, CLSCTX_INPROC_SERVER,
                 &IID_IWICBitmapDecoder, (void**)&decoder);
-            ok(hr == S_OK, "CoCreateInstance failed, hr=%x\n", hr);
+            ok(hr == S_OK, "CoCreateInstance failed, hr=%lx\n", hr);
         }
 
         if (SUCCEEDED(hr))
         {
             hr = IWICBitmapDecoder_Initialize(decoder, (IStream*)gifstream,
                 WICDecodeMetadataCacheOnDemand);
-            ok(hr == S_OK, "Initialize failed, hr=%x\n", hr);
+            ok(hr == S_OK, "Initialize failed, hr=%lx\n", hr);
 
             if (SUCCEEDED(hr))
             {
                 hr = IWICBitmapDecoder_GetFrame(decoder, 0, &framedecode);
-                ok(hr == S_OK, "GetFrame failed, hr=%x\n", hr);
+                ok(hr == S_OK, "GetFrame failed, hr=%lx\n", hr);
                 if (SUCCEEDED(hr))
                 {
                     hr = IWICBitmapFrameDecode_GetResolution(framedecode, &dpiX, &dpiY);
-                    ok(SUCCEEDED(hr), "GetResolution failed, hr=%x\n", hr);
+                    ok(SUCCEEDED(hr), "GetResolution failed, hr=%lx\n", hr);
                     ok(dpiX == 48.0, "expected dpiX=48.0, got %f\n", dpiX);
                     ok(dpiY == 96.0, "expected dpiY=96.0, got %f\n", dpiY);
 
@@ -551,7 +551,7 @@ static void test_gif_notrailer(void)
             if (SUCCEEDED(hr))
             {
                 hr = IWICBitmapDecoder_GetFrameCount(decoder, &framecount);
-                ok(hr == S_OK, "GetFrameCount failed, hr=%x\n", hr);
+                ok(hr == S_OK, "GetFrameCount failed, hr=%lx\n", hr);
                 ok(framecount == 1, "framecount=%u\n", framecount);
             }
 
@@ -571,7 +571,7 @@ START_TEST(gifformat)
     CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
                           &IID_IWICImagingFactory, (void **)&factory);
-    ok(hr == S_OK, "CoCreateInstance error %#x\n", hr);
+    ok(hr == S_OK, "CoCreateInstance error %#lx\n", hr);
     if (FAILED(hr)) return;
 
     test_global_gif_palette();
@@ -585,7 +585,7 @@ START_TEST(gifformat)
 
     /* run the same tests with no COM initialization */
     hr = WICCreateImagingFactory_Proxy(WINCODEC_SDK_VERSION, &factory);
-    ok(hr == S_OK, "WICCreateImagingFactory_Proxy error %#x\n", hr);
+    ok(hr == S_OK, "WICCreateImagingFactory_Proxy error %#lx\n", hr);
 
     test_global_gif_palette();
     test_global_gif_palette_2frames();
diff --git a/dlls/windowscodecs/tests/icoformat.c b/dlls/windowscodecs/tests/icoformat.c
index 36cc970bf3c..71a9dd88f04 100644
--- a/dlls/windowscodecs/tests/icoformat.c
+++ b/dlls/windowscodecs/tests/icoformat.c
@@ -143,21 +143,21 @@ static void test_ico_data_(void *data, DWORD data_size, HRESULT init_hr, int tod
 
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICImagingFactory, (void**)&factory);
-    ok(hr == S_OK, "CoCreateInstance failed, hr=%x\n", hr);
+    ok(hr == S_OK, "CoCreateInstance failed, hr=%lx\n", hr);
     if (FAILED(hr)) return;
 
     hr = IWICImagingFactory_CreateStream(factory, &icostream);
-    ok(hr == S_OK, "CreateStream failed, hr=%x\n", hr);
+    ok(hr == S_OK, "CreateStream failed, hr=%lx\n", hr);
     if (SUCCEEDED(hr))
     {
         hr = IWICStream_InitializeFromMemory(icostream, data, data_size);
-        ok(hr == S_OK, "InitializeFromMemory failed, hr=%x\n", hr);
+        ok(hr == S_OK, "InitializeFromMemory failed, hr=%lx\n", hr);
 
         if (SUCCEEDED(hr))
         {
             hr = CoCreateInstance(&CLSID_WICIcoDecoder, NULL, CLSCTX_INPROC_SERVER,
                 &IID_IWICBitmapDecoder, (void**)&decoder);
-            ok(hr == S_OK, "CoCreateInstance failed, hr=%x\n", hr);
+            ok(hr == S_OK, "CoCreateInstance failed, hr=%lx\n", hr);
         }
 
         if (SUCCEEDED(hr))
@@ -165,12 +165,12 @@ static void test_ico_data_(void *data, DWORD data_size, HRESULT init_hr, int tod
             hr = IWICBitmapDecoder_Initialize(decoder, (IStream*)icostream,
                 WICDecodeMetadataCacheOnDemand);
             todo_wine_if(todo)
-            ok_(__FILE__, line)(hr == init_hr, "Initialize failed, hr=%x\n", hr);
+            ok_(__FILE__, line)(hr == init_hr, "Initialize failed, hr=%lx\n", hr);
 
             if (SUCCEEDED(hr))
             {
                 hr = IWICBitmapDecoder_GetFrame(decoder, 0, &framedecode);
-                ok(hr == S_OK, "GetFrame failed, hr=%x\n", hr);
+                ok(hr == S_OK, "GetFrame failed, hr=%lx\n", hr);
             }
 
             if (SUCCEEDED(hr))
@@ -180,16 +180,16 @@ static void test_ico_data_(void *data, DWORD data_size, HRESULT init_hr, int tod
 
                 width = height = 0;
                 hr = IWICBitmapFrameDecode_GetSize(framedecode, &width, &height);
-                ok(hr == S_OK, "GetFrameSize failed, hr=%x\n", hr);
+                ok(hr == S_OK, "GetFrameSize failed, hr=%lx\n", hr);
                 ok(width == 16 && height == 16, "framesize=%ux%u\n", width, height);
 
                 hr = IWICBitmapFrameDecode_GetThumbnail(framedecode, &thumbnail);
-                ok(hr == S_OK, "GetThumbnail failed, hr=%x\n", hr);
+                ok(hr == S_OK, "GetThumbnail failed, hr=%lx\n", hr);
                 if (hr == S_OK)
                 {
                     width = height = 0;
                     hr = IWICBitmapSource_GetSize(thumbnail, &width, &height);
-                    ok(hr == S_OK, "GetFrameSize failed, hr=%x\n", hr);
+                    ok(hr == S_OK, "GetFrameSize failed, hr=%lx\n", hr);
                     ok(width == 16 && height == 16, "framesize=%ux%u\n", width, height);
                     IWICBitmapSource_Release(thumbnail);
                 }
diff --git a/dlls/windowscodecs/tests/info.c b/dlls/windowscodecs/tests/info.c
index 31416f3d8f1..843794f8efb 100644
--- a/dlls/windowscodecs/tests/info.c
+++ b/dlls/windowscodecs/tests/info.c
@@ -35,7 +35,7 @@ static HRESULT get_component_info(const GUID *clsid, IWICComponentInfo **result)
 
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICImagingFactory, (void**)&factory);
-    ok(hr == S_OK, "CoCreateInstance failed, hr=%x\n", hr);
+    ok(hr == S_OK, "CoCreateInstance failed, hr=%lx\n", hr);
     if (FAILED(hr)) return hr;
 
     hr = IWICImagingFactory_CreateComponentInfo(factory, clsid, result);
@@ -133,22 +133,22 @@ static void test_decoder_info(void)
             win_skip("DDS decoder is not supported\n");
             continue;
         }
-        ok(SUCCEEDED(hr), "Failed to create decoder, hr %#x.\n", hr);
+        ok(SUCCEEDED(hr), "Failed to create decoder, hr %#lx.\n", hr);
 
         decoder_info = NULL;
         hr = IWICBitmapDecoder_GetDecoderInfo(decoder, &decoder_info);
         ok(hr == S_OK || broken(IsEqualCLSID(&CLSID_WICBmpDecoder, test->clsid) && FAILED(hr)) /* Fails on Windows */,
-            "%u: failed to get decoder info, hr %#x.\n", i, hr);
+            "%u: failed to get decoder info, hr %#lx.\n", i, hr);
 
         if (hr == S_OK)
         {
             decoder_info2 = NULL;
             hr = IWICBitmapDecoder_GetDecoderInfo(decoder, &decoder_info2);
-            ok(hr == S_OK, "Failed to get decoder info, hr %#x.\n", hr);
+            ok(hr == S_OK, "Failed to get decoder info, hr %#lx.\n", hr);
             ok(decoder_info == decoder_info2, "Unexpected decoder info instance.\n");
 
             hr = IWICBitmapDecoderInfo_QueryInterface(decoder_info, &IID_IWICBitmapDecoder, (void **)&decoder2);
-            ok(hr == E_NOINTERFACE, "Unexpected hr %#x.\n", hr);
+            ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr);
 
             IWICBitmapDecoderInfo_Release(decoder_info);
             IWICBitmapDecoderInfo_Release(decoder_info2);
@@ -159,123 +159,123 @@ static void test_decoder_info(void)
         MultiByteToWideChar(CP_ACP, 0, test->extensions, -1, extensionsW, ARRAY_SIZE(extensionsW));
 
         hr = get_component_info(test->clsid, &info);
-        ok(hr == S_OK, "CreateComponentInfo failed, hr=%x\n", hr);
+        ok(hr == S_OK, "CreateComponentInfo failed, hr=%lx\n", hr);
 
         hr = IWICComponentInfo_QueryInterface(info, &IID_IWICBitmapDecoderInfo, (void **)&decoder_info);
-        ok(hr == S_OK, "QueryInterface failed, hr=%x\n", hr);
+        ok(hr == S_OK, "QueryInterface failed, hr=%lx\n", hr);
 
         hr = IWICBitmapDecoderInfo_GetCLSID(decoder_info, NULL);
-        ok(hr == E_INVALIDARG, "GetCLSID failed, hr=%x\n", hr);
+        ok(hr == E_INVALIDARG, "GetCLSID failed, hr=%lx\n", hr);
 
         hr = IWICBitmapDecoderInfo_GetCLSID(decoder_info, &clsid);
-        ok(hr == S_OK, "GetCLSID failed, hr=%x\n", hr);
+        ok(hr == S_OK, "GetCLSID failed, hr=%lx\n", hr);
         ok(IsEqualGUID(test->clsid, &clsid), "GetCLSID returned wrong result\n");
 
         hr = IWICBitmapDecoderInfo_GetMimeTypes(decoder_info, 0, NULL, NULL);
-        ok(hr == E_INVALIDARG, "GetMimeType failed, hr=%x\n", hr);
+        ok(hr == E_INVALIDARG, "GetMimeType failed, hr=%lx\n", hr);
 
         len = 0;
         hr = IWICBitmapDecoderInfo_GetMimeTypes(decoder_info, 1, NULL, &len);
-        ok(hr == E_INVALIDARG, "GetMimeType failed, hr=%x\n", hr);
+        ok(hr == E_INVALIDARG, "GetMimeType failed, hr=%lx\n", hr);
         todo_wine_if(test->todo)
         ok(len == lstrlenW(mimetypeW) + 1, "GetMimeType returned wrong len %i\n", len);
 
         hr = IWICBitmapDecoderInfo_GetMimeTypes(decoder_info, len, value, NULL);
-        ok(hr == E_INVALIDARG, "GetMimeType failed, hr=%x\n", hr);
+        ok(hr == E_INVALIDARG, "GetMimeType failed, hr=%lx\n", hr);
 
         len = 0;
         hr = IWICBitmapDecoderInfo_GetMimeTypes(decoder_info, 0, NULL, &len);
-        ok(hr == S_OK, "GetMimeType failed, hr=%x\n", hr);
+        ok(hr == S_OK, "GetMimeType failed, hr=%lx\n", hr);
         todo_wine_if(test->todo)
         ok(len == lstrlenW(mimetypeW) + 1, "GetMimeType returned wrong len %i\n", len);
 
         value[0] = 0;
         hr = IWICBitmapDecoderInfo_GetMimeTypes(decoder_info, len, value, &len);
-        ok(hr == S_OK, "GetMimeType failed, hr=%x\n", hr);
+        ok(hr == S_OK, "GetMimeType failed, hr=%lx\n", hr);
     todo_wine_if(test->todo) {
         ok(lstrcmpW(value, mimetypeW) == 0, "GetMimeType returned wrong value %s\n", wine_dbgstr_w(value));
         ok(len == lstrlenW(mimetypeW) + 1, "GetMimeType returned wrong len %i\n", len);
     }
         hr = IWICBitmapDecoderInfo_GetMimeTypes(decoder_info, 1, value, &len);
-        ok(hr == WINCODEC_ERR_INSUFFICIENTBUFFER, "GetMimeType failed, hr=%x\n", hr);
+        ok(hr == WINCODEC_ERR_INSUFFICIENTBUFFER, "GetMimeType failed, hr=%lx\n", hr);
         todo_wine_if(test->todo)
         ok(len == lstrlenW(mimetypeW) + 1, "GetMimeType returned wrong len %i\n", len);
 
         hr = IWICBitmapDecoderInfo_GetMimeTypes(decoder_info, 256, value, &len);
-        ok(hr == S_OK, "GetMimeType failed, hr=%x\n", hr);
+        ok(hr == S_OK, "GetMimeType failed, hr=%lx\n", hr);
     todo_wine_if(test->todo) {
         ok(lstrcmpW(value, mimetypeW) == 0, "GetMimeType returned wrong value %s\n", wine_dbgstr_w(value));
         ok(len == lstrlenW(mimetypeW) + 1, "GetMimeType returned wrong len %i\n", len);
     }
         num_formats = 0xdeadbeef;
         hr = IWICBitmapDecoderInfo_GetPixelFormats(decoder_info, 0, NULL, &num_formats);
-        ok(hr == S_OK, "GetPixelFormats failed, hr=%x\n", hr);
+        ok(hr == S_OK, "GetPixelFormats failed, hr=%lx\n", hr);
         ok((num_formats <= 21 && num_formats >= 1) ||
             broken(IsEqualCLSID(test->clsid, &CLSID_WICIcoDecoder) && num_formats == 0) /* WinXP */,
             "%u: got %d formats\n", i, num_formats);
 
         hr = IWICBitmapDecoderInfo_GetPixelFormats(decoder_info, 0, NULL, NULL);
-        ok(hr == E_INVALIDARG, "GetPixelFormats failed, hr=%x\n", hr);
+        ok(hr == E_INVALIDARG, "GetPixelFormats failed, hr=%lx\n", hr);
 
         count = 0xdeadbeef;
         hr = IWICBitmapDecoderInfo_GetPixelFormats(decoder_info, 0, pixelformats, &count);
-        ok(hr == S_OK, "GetPixelFormats failed, hr=%x\n", hr);
+        ok(hr == S_OK, "GetPixelFormats failed, hr=%lx\n", hr);
         ok(count == 0, "got %d formats\n", count);
 
         count = 0xdeadbeef;
         hr = IWICBitmapDecoderInfo_GetPixelFormats(decoder_info, 1, pixelformats, &count);
-        ok(hr == S_OK, "GetPixelFormats failed, hr=%x\n", hr);
+        ok(hr == S_OK, "GetPixelFormats failed, hr=%lx\n", hr);
         ok((count == 1) || broken(IsEqualCLSID(test->clsid, &CLSID_WICIcoDecoder) && count == 0) /* WinXP */,
             "%u: got %d formats\n", i, num_formats);
         ok(is_pixelformat(&pixelformats[0]), "got invalid pixel format\n");
 
         count = 0xdeadbeef;
         hr = IWICBitmapDecoderInfo_GetPixelFormats(decoder_info, num_formats, pixelformats, &count);
-        ok(hr == S_OK, "GetPixelFormats failed, hr=%x\n", hr);
+        ok(hr == S_OK, "GetPixelFormats failed, hr=%lx\n", hr);
         ok(count == num_formats, "got %d formats, expected %d\n", count, num_formats);
         for (j = 0; j < num_formats; j++)
             ok(is_pixelformat(&pixelformats[j]), "got invalid pixel format\n");
 
         hr = IWICBitmapDecoderInfo_GetPixelFormats(decoder_info, num_formats, pixelformats, NULL);
-        ok(hr == E_INVALIDARG, "GetPixelFormats failed, hr=%x\n", hr);
+        ok(hr == E_INVALIDARG, "GetPixelFormats failed, hr=%lx\n", hr);
 
         count = 0xdeadbeef;
         hr = IWICBitmapDecoderInfo_GetPixelFormats(decoder_info, ARRAY_SIZE(pixelformats),
                                                    pixelformats, &count);
-        ok(hr == S_OK, "GetPixelFormats failed, hr=%x\n", hr);
+        ok(hr == S_OK, "GetPixelFormats failed, hr=%lx\n", hr);
         ok(count == num_formats, "got %d formats, expected %d\n", count, num_formats);
 
         hr = IWICBitmapDecoderInfo_GetFileExtensions(decoder_info, 0, NULL, NULL);
-        ok(hr == E_INVALIDARG, "GetFileExtensions failed, hr=%x\n", hr);
+        ok(hr == E_INVALIDARG, "GetFileExtensions failed, hr=%lx\n", hr);
 
         hr = IWICBitmapDecoderInfo_GetFileExtensions(decoder_info, 1, NULL, &len);
-        ok(hr == E_INVALIDARG, "GetFileExtensions failed, hr=%x\n", hr);
+        ok(hr == E_INVALIDARG, "GetFileExtensions failed, hr=%lx\n", hr);
         todo_wine_if(test->todo && !IsEqualCLSID(test->clsid, &CLSID_WICTiffDecoder))
         ok(len == lstrlenW(extensionsW) + 1, "%u: GetFileExtensions returned wrong len %i\n", i, len);
 
         hr = IWICBitmapDecoderInfo_GetFileExtensions(decoder_info, len, value, NULL);
-        ok(hr == E_INVALIDARG, "GetFileExtensions failed, hr=%x\n", hr);
+        ok(hr == E_INVALIDARG, "GetFileExtensions failed, hr=%lx\n", hr);
 
         hr = IWICBitmapDecoderInfo_GetFileExtensions(decoder_info, 0, NULL, &len);
-        ok(hr == S_OK, "GetFileExtensions failed, hr=%x\n", hr);
+        ok(hr == S_OK, "GetFileExtensions failed, hr=%lx\n", hr);
         todo_wine_if(test->todo && !IsEqualCLSID(test->clsid, &CLSID_WICTiffDecoder))
         ok(len == lstrlenW(extensionsW) + 1, "GetFileExtensions returned wrong len %i\n", len);
 
         value[0] = 0;
         hr = IWICBitmapDecoderInfo_GetFileExtensions(decoder_info, len, value, &len);
-        ok(hr == S_OK, "GetFileExtensions failed, hr=%x\n", hr);
+        ok(hr == S_OK, "GetFileExtensions failed, hr=%lx\n", hr);
         todo_wine_if(test->todo)
         ok(lstrcmpW(value, extensionsW) == 0, "GetFileExtensions returned wrong value %s\n", wine_dbgstr_w(value));
         todo_wine_if(test->todo && !IsEqualCLSID(test->clsid, &CLSID_WICTiffDecoder))
         ok(len == lstrlenW(extensionsW) + 1, "GetFileExtensions returned wrong len %i\n", len);
 
         hr = IWICBitmapDecoderInfo_GetFileExtensions(decoder_info, 1, value, &len);
-        ok(hr == WINCODEC_ERR_INSUFFICIENTBUFFER, "GetFileExtensions failed, hr=%x\n", hr);
+        ok(hr == WINCODEC_ERR_INSUFFICIENTBUFFER, "GetFileExtensions failed, hr=%lx\n", hr);
         todo_wine_if(test->todo && !IsEqualCLSID(test->clsid, &CLSID_WICTiffDecoder))
         ok(len == lstrlenW(extensionsW) + 1, "GetFileExtensions returned wrong len %i\n", len);
 
         hr = IWICBitmapDecoderInfo_GetFileExtensions(decoder_info, 256, value, &len);
-        ok(hr == S_OK, "GetFileExtensions failed, hr=%x\n", hr);
+        ok(hr == S_OK, "GetFileExtensions failed, hr=%lx\n", hr);
         todo_wine_if(test->todo)
         ok(lstrcmpW(value, extensionsW) == 0, "GetFileExtensions returned wrong value %s\n", wine_dbgstr_w(value));
         todo_wine_if(test->todo && !IsEqualCLSID(test->clsid, &CLSID_WICTiffDecoder))
@@ -303,29 +303,29 @@ static void test_pixelformat_info(void)
     BOOL supportstransparency;
 
     hr = get_component_info(&GUID_WICPixelFormat32bppBGRA, &info);
-    ok(hr == S_OK, "CreateComponentInfo failed, hr=%x\n", hr);
+    ok(hr == S_OK, "CreateComponentInfo failed, hr=%lx\n", hr);
 
     if (FAILED(hr))
         return;
 
     hr = IWICComponentInfo_GetAuthor(info, 0, NULL, 0);
-    ok(hr == E_INVALIDARG, "GetAuthor failed, hr=%x\n", hr);
+    ok(hr == E_INVALIDARG, "GetAuthor failed, hr=%lx\n", hr);
 
     len = 0xdeadbeef;
     hr = IWICComponentInfo_GetAuthor(info, 0, NULL, &len);
-    ok(hr == S_OK, "GetAuthor failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetAuthor failed, hr=%lx\n", hr);
     ok(len < 255 && len > 0, "invalid length 0x%x\n", len);
     known_len = len;
 
     memset(value, 0xaa, 256 * sizeof(WCHAR));
     hr = IWICComponentInfo_GetAuthor(info, len-1, value, NULL);
-    ok(hr == E_INVALIDARG, "GetAuthor failed, hr=%x\n", hr);
+    ok(hr == E_INVALIDARG, "GetAuthor failed, hr=%lx\n", hr);
     ok(value[0] == 0xaaaa, "string modified\n");
 
     len = 0xdeadbeef;
     memset(value, 0xaa, 256 * sizeof(WCHAR));
     hr = IWICComponentInfo_GetAuthor(info, known_len-1, value, &len);
-    ok(hr == WINCODEC_ERR_INSUFFICIENTBUFFER, "GetAuthor failed, hr=%x\n", hr);
+    ok(hr == WINCODEC_ERR_INSUFFICIENTBUFFER, "GetAuthor failed, hr=%lx\n", hr);
     ok(len == known_len, "got length of 0x%x, expected 0x%x\n", len, known_len);
     ok(value[known_len-1] == 0xaaaa, "string modified past given length\n");
     ok(value[0] == 0xaaaa, "string modified\n");
@@ -333,7 +333,7 @@ static void test_pixelformat_info(void)
     len = 0xdeadbeef;
     memset(value, 0xaa, 256 * sizeof(WCHAR));
     hr = IWICComponentInfo_GetAuthor(info, known_len, value, &len);
-    ok(hr == S_OK, "GetAuthor failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetAuthor failed, hr=%lx\n", hr);
     ok(len == known_len, "got length of 0x%x, expected 0x%x\n", len, known_len);
     ok(value[known_len-1] == 0, "string not terminated at expected length\n");
     ok(value[known_len-2] != 0xaaaa, "string not modified at given length\n");
@@ -341,107 +341,107 @@ static void test_pixelformat_info(void)
     len = 0xdeadbeef;
     memset(value, 0xaa, 256 * sizeof(WCHAR));
     hr = IWICComponentInfo_GetAuthor(info, known_len+1, value, &len);
-    ok(hr == S_OK, "GetAuthor failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetAuthor failed, hr=%lx\n", hr);
     ok(len == known_len, "got length of 0x%x, expected 0x%x\n", len, known_len);
     ok(value[known_len] == 0xaaaa, "string modified past end\n");
     ok(value[known_len-1] == 0, "string not terminated at expected length\n");
     ok(value[known_len-2] != 0xaaaa, "string not modified at given length\n");
 
     hr = IWICComponentInfo_GetCLSID(info, NULL);
-    ok(hr == E_INVALIDARG, "GetCLSID failed, hr=%x\n", hr);
+    ok(hr == E_INVALIDARG, "GetCLSID failed, hr=%lx\n", hr);
 
     memset(&guid, 0xaa, sizeof(guid));
     hr = IWICComponentInfo_GetCLSID(info, &guid);
-    ok(hr == S_OK, "GetCLSID failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetCLSID failed, hr=%lx\n", hr);
     ok(IsEqualGUID(&guid, &GUID_WICPixelFormat32bppBGRA), "unexpected CLSID %s\n", wine_dbgstr_guid(&guid));
 
     hr = IWICComponentInfo_GetComponentType(info, NULL);
-    ok(hr == E_INVALIDARG, "GetComponentType failed, hr=%x\n", hr);
+    ok(hr == E_INVALIDARG, "GetComponentType failed, hr=%lx\n", hr);
 
     hr = IWICComponentInfo_GetComponentType(info, &componenttype);
-    ok(hr == S_OK, "GetComponentType failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetComponentType failed, hr=%lx\n", hr);
     ok(componenttype == WICPixelFormat, "unexpected component type 0x%x\n", componenttype);
 
     len = 0xdeadbeef;
     hr = IWICComponentInfo_GetFriendlyName(info, 0, NULL, &len);
-    ok(hr == S_OK, "GetFriendlyName failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetFriendlyName failed, hr=%lx\n", hr);
     ok(len < 255 && len > 0, "invalid length 0x%x\n", len);
 
     hr = IWICComponentInfo_GetSigningStatus(info, NULL);
-    ok(hr == E_INVALIDARG, "GetSigningStatus failed, hr=%x\n", hr);
+    ok(hr == E_INVALIDARG, "GetSigningStatus failed, hr=%lx\n", hr);
 
     hr = IWICComponentInfo_GetSigningStatus(info, &signing);
-    ok(hr == S_OK, "GetSigningStatus failed, hr=%x\n", hr);
-    ok(signing == WICComponentSigned, "unexpected signing status 0x%x\n", signing);
+    ok(hr == S_OK, "GetSigningStatus failed, hr=%lx\n", hr);
+    ok(signing == WICComponentSigned, "unexpected signing status 0x%lx\n", signing);
 
     len = 0xdeadbeef;
     hr = IWICComponentInfo_GetSpecVersion(info, 0, NULL, &len);
-    ok(hr == S_OK, "GetSpecVersion failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetSpecVersion failed, hr=%lx\n", hr);
     ok(len == 0, "invalid length 0x%x\n", len); /* spec version does not apply to pixel formats */
 
     memset(&guid, 0xaa, sizeof(guid));
     hr = IWICComponentInfo_GetVendorGUID(info, &guid);
-    ok(hr == S_OK, "GetVendorGUID failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetVendorGUID failed, hr=%lx\n", hr);
     ok(IsEqualGUID(&guid, &GUID_VendorMicrosoft) ||
        broken(IsEqualGUID(&guid, &GUID_NULL)) /* XP */, "unexpected GUID %s\n", wine_dbgstr_guid(&guid));
 
     len = 0xdeadbeef;
     hr = IWICComponentInfo_GetVersion(info, 0, NULL, &len);
-    ok(hr == S_OK, "GetVersion failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetVersion failed, hr=%lx\n", hr);
     ok(len == 0, "invalid length 0x%x\n", len); /* version does not apply to pixel formats */
 
     hr = IWICComponentInfo_QueryInterface(info, &IID_IWICPixelFormatInfo, (void**)&pixelformat_info);
-    ok(hr == S_OK, "QueryInterface failed, hr=%x\n", hr);
+    ok(hr == S_OK, "QueryInterface failed, hr=%lx\n", hr);
 
     if (SUCCEEDED(hr))
     {
         hr = IWICPixelFormatInfo_GetBitsPerPixel(pixelformat_info, NULL);
-        ok(hr == E_INVALIDARG, "GetBitsPerPixel failed, hr=%x\n", hr);
+        ok(hr == E_INVALIDARG, "GetBitsPerPixel failed, hr=%lx\n", hr);
 
         hr = IWICPixelFormatInfo_GetBitsPerPixel(pixelformat_info, &uiresult);
-        ok(hr == S_OK, "GetBitsPerPixel failed, hr=%x\n", hr);
+        ok(hr == S_OK, "GetBitsPerPixel failed, hr=%lx\n", hr);
         ok(uiresult == 32, "unexpected bpp %i\n", uiresult);
 
         hr = IWICPixelFormatInfo_GetChannelCount(pixelformat_info, &uiresult);
-        ok(hr == S_OK, "GetChannelCount failed, hr=%x\n", hr);
+        ok(hr == S_OK, "GetChannelCount failed, hr=%lx\n", hr);
         ok(uiresult == 4, "unexpected channel count %i\n", uiresult);
 
         hr = IWICPixelFormatInfo_GetChannelMask(pixelformat_info, 0, 0, NULL, NULL);
-        ok(hr == E_INVALIDARG, "GetChannelMask failed, hr=%x\n", hr);
+        ok(hr == E_INVALIDARG, "GetChannelMask failed, hr=%lx\n", hr);
 
         uiresult = 0xdeadbeef;
         hr = IWICPixelFormatInfo_GetChannelMask(pixelformat_info, 0, 0, NULL, &uiresult);
-        ok(hr == S_OK, "GetChannelMask failed, hr=%x\n", hr);
+        ok(hr == S_OK, "GetChannelMask failed, hr=%lx\n", hr);
         ok(uiresult == 4, "unexpected length %i\n", uiresult);
 
         memset(abbuffer, 0xaa, sizeof(abbuffer));
         hr = IWICPixelFormatInfo_GetChannelMask(pixelformat_info, 0, known_len, abbuffer, NULL);
-        ok(hr == E_INVALIDARG, "GetChannelMask failed, hr=%x\n", hr);
+        ok(hr == E_INVALIDARG, "GetChannelMask failed, hr=%lx\n", hr);
         ok(abbuffer[0] == 0xaa, "buffer modified\n");
 
         uiresult = 0xdeadbeef;
         memset(abbuffer, 0xaa, sizeof(abbuffer));
         hr = IWICPixelFormatInfo_GetChannelMask(pixelformat_info, 0, 3, abbuffer, &uiresult);
-        ok(hr == E_INVALIDARG, "GetChannelMask failed, hr=%x\n", hr);
+        ok(hr == E_INVALIDARG, "GetChannelMask failed, hr=%lx\n", hr);
         ok(abbuffer[0] == 0xaa, "buffer modified\n");
         ok(uiresult == 4, "unexpected length %i\n", uiresult);
 
         memset(abbuffer, 0xaa, sizeof(abbuffer));
         hr = IWICPixelFormatInfo_GetChannelMask(pixelformat_info, 0, 4, abbuffer, &uiresult);
-        ok(hr == S_OK, "GetChannelMask failed, hr=%x\n", hr);
-        ok(*((ULONG*)abbuffer) == 0xff, "unexpected mask 0x%x\n", *((ULONG*)abbuffer));
+        ok(hr == S_OK, "GetChannelMask failed, hr=%lx\n", hr);
+        ok(*((ULONG*)abbuffer) == 0xff, "unexpected mask 0x%lx\n", *((ULONG*)abbuffer));
         ok(uiresult == 4, "unexpected length %i\n", uiresult);
 
         memset(abbuffer, 0xaa, sizeof(abbuffer));
         hr = IWICPixelFormatInfo_GetChannelMask(pixelformat_info, 0, 5, abbuffer, &uiresult);
-        ok(hr == S_OK, "GetChannelMask failed, hr=%x\n", hr);
-        ok(*((ULONG*)abbuffer) == 0xff, "unexpected mask 0x%x\n", *((ULONG*)abbuffer));
+        ok(hr == S_OK, "GetChannelMask failed, hr=%lx\n", hr);
+        ok(*((ULONG*)abbuffer) == 0xff, "unexpected mask 0x%lx\n", *((ULONG*)abbuffer));
         ok(abbuffer[4] == 0xaa, "buffer modified past actual length\n");
         ok(uiresult == 4, "unexpected length %i\n", uiresult);
 
         memset(&guid, 0xaa, sizeof(guid));
         hr = IWICPixelFormatInfo_GetFormatGUID(pixelformat_info, &guid);
-        ok(hr == S_OK, "GetFormatGUID failed, hr=%x\n", hr);
+        ok(hr == S_OK, "GetFormatGUID failed, hr=%lx\n", hr);
         ok(IsEqualGUID(&guid, &GUID_WICPixelFormat32bppBGRA), "unexpected GUID %s\n", wine_dbgstr_guid(&guid));
 
         IWICPixelFormatInfo_Release(pixelformat_info);
@@ -454,19 +454,19 @@ static void test_pixelformat_info(void)
     else
     {
         hr = IWICPixelFormatInfo2_GetNumericRepresentation(pixelformat_info2, NULL);
-        ok(hr == E_INVALIDARG, "GetNumericRepresentation failed, hr=%x\n", hr);
+        ok(hr == E_INVALIDARG, "GetNumericRepresentation failed, hr=%lx\n", hr);
 
         numericrepresentation = 0xdeadbeef;
         hr = IWICPixelFormatInfo2_GetNumericRepresentation(pixelformat_info2, &numericrepresentation);
-        ok(hr == S_OK, "GetNumericRepresentation failed, hr=%x\n", hr);
+        ok(hr == S_OK, "GetNumericRepresentation failed, hr=%lx\n", hr);
         ok(numericrepresentation == WICPixelFormatNumericRepresentationUnsignedInteger, "unexpected numeric representation %i\n", numericrepresentation);
 
         hr = IWICPixelFormatInfo2_SupportsTransparency(pixelformat_info2, NULL);
-        ok(hr == E_INVALIDARG, "SupportsTransparency failed, hr=%x\n", hr);
+        ok(hr == E_INVALIDARG, "SupportsTransparency failed, hr=%lx\n", hr);
 
         supportstransparency = 0xdeadbeef;
         hr = IWICPixelFormatInfo2_SupportsTransparency(pixelformat_info2, &supportstransparency);
-        ok(hr == S_OK, "SupportsTransparency failed, hr=%x\n", hr);
+        ok(hr == S_OK, "SupportsTransparency failed, hr=%lx\n", hr);
         ok(supportstransparency == 1, "unexpected value %i\n", supportstransparency);
 
         IWICPixelFormatInfo2_Release(pixelformat_info2);
@@ -483,7 +483,7 @@ static DWORD WINAPI cache_across_threads_test(void *arg)
     CoInitialize(NULL);
 
     hr = get_component_info(&CLSID_WICUnknownMetadataReader, &info);
-    ok(hr == S_OK, "CreateComponentInfo failed, hr=%x\n", hr);
+    ok(hr == S_OK, "CreateComponentInfo failed, hr=%lx\n", hr);
     ok(info == arg, "unexpected info pointer %p\n", info);
     IWICComponentInfo_Release(info);
 
@@ -505,16 +505,16 @@ static void test_reader_info(void)
     WICMetadataPattern *patterns;
 
     hr = get_component_info(&CLSID_WICUnknownMetadataReader, &info2);
-    ok(hr == S_OK, "CreateComponentInfo failed, hr=%x\n", hr);
+    ok(hr == S_OK, "CreateComponentInfo failed, hr=%lx\n", hr);
     IWICComponentInfo_Release(info2);
 
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICImagingFactory, (void**)&factory);
-    ok(hr == S_OK, "CoCreateInstance failed, hr=%x\n", hr);
+    ok(hr == S_OK, "CoCreateInstance failed, hr=%lx\n", hr);
     if (FAILED(hr)) return;
 
     hr = IWICImagingFactory_CreateComponentInfo(factory, &CLSID_WICUnknownMetadataReader, &info);
-    ok(hr == S_OK, "CreateComponentInfo failed, hr=%x\n", hr);
+    ok(hr == S_OK, "CreateComponentInfo failed, hr=%lx\n", hr);
     ok(info == info2, "info != info2\n");
 
     thread = CreateThread(NULL, 0, cache_across_threads_test, info, 0, &tid);
@@ -522,36 +522,36 @@ static void test_reader_info(void)
     CloseHandle(thread);
 
     hr = IWICComponentInfo_QueryInterface(info, &IID_IWICMetadataReaderInfo, (void**)&reader_info);
-    ok(hr == S_OK, "QueryInterface failed, hr=%x\n", hr);
+    ok(hr == S_OK, "QueryInterface failed, hr=%lx\n", hr);
 
     hr = IWICMetadataReaderInfo_GetCLSID(reader_info, NULL);
-    ok(hr == E_INVALIDARG, "GetCLSID failed, hr=%x\n", hr);
+    ok(hr == E_INVALIDARG, "GetCLSID failed, hr=%lx\n", hr);
 
     hr = IWICMetadataReaderInfo_GetCLSID(reader_info, &clsid);
-    ok(hr == S_OK, "GetCLSID failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetCLSID failed, hr=%lx\n", hr);
     ok(IsEqualGUID(&CLSID_WICUnknownMetadataReader, &clsid), "GetCLSID returned wrong result\n");
 
     hr = IWICMetadataReaderInfo_GetMetadataFormat(reader_info, &clsid);
-    ok(hr == S_OK, "GetMetadataFormat failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetMetadataFormat failed, hr=%lx\n", hr);
     ok(IsEqualGUID(&GUID_MetadataFormatUnknown, &clsid), "GetMetadataFormat returned wrong result\n");
 
     hr = IWICMetadataReaderInfo_GetContainerFormats(reader_info, 0, NULL, NULL);
-    ok(hr == E_INVALIDARG, "GetContainerFormats failed, hr=%x\n", hr);
+    ok(hr == E_INVALIDARG, "GetContainerFormats failed, hr=%lx\n", hr);
 
     count = 0xdeadbeef;
     hr = IWICMetadataReaderInfo_GetContainerFormats(reader_info, 0, NULL, &count);
-    ok(hr == S_OK, "GetContainerFormats failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetContainerFormats failed, hr=%lx\n", hr);
     ok(count == 0, "unexpected count %d\n", count);
 
     hr = IWICMetadataReaderInfo_GetPatterns(reader_info, &GUID_ContainerFormatPng,
         0, NULL, NULL, NULL);
-    ok(hr == E_INVALIDARG, "GetPatterns failed, hr=%x\n", hr);
+    ok(hr == E_INVALIDARG, "GetPatterns failed, hr=%lx\n", hr);
 
     count = size = 0xdeadbeef;
     hr = IWICMetadataReaderInfo_GetPatterns(reader_info, &GUID_ContainerFormatPng,
         0, NULL, &count, &size);
     ok(hr == WINCODEC_ERR_COMPONENTNOTFOUND || broken(hr == S_OK) /* Windows XP */,
-        "GetPatterns failed, hr=%x\n", hr);
+        "GetPatterns failed, hr=%lx\n", hr);
     ok(count == 0xdeadbeef, "unexpected count %d\n", count);
     ok(size == 0xdeadbeef, "unexpected size %d\n", size);
 
@@ -561,7 +561,7 @@ static void test_reader_info(void)
 
     hr = IWICImagingFactory_CreateComponentInfo(factory, &CLSID_WICXMPStructMetadataReader, &info);
     todo_wine
-    ok(hr == S_OK, "CreateComponentInfo failed, hr=%x\n", hr);
+    ok(hr == S_OK, "CreateComponentInfo failed, hr=%lx\n", hr);
 
     if (FAILED(hr))
     {
@@ -570,49 +570,49 @@ static void test_reader_info(void)
     }
 
     hr = IWICComponentInfo_QueryInterface(info, &IID_IWICMetadataReaderInfo, (void**)&reader_info);
-    ok(hr == S_OK, "QueryInterface failed, hr=%x\n", hr);
+    ok(hr == S_OK, "QueryInterface failed, hr=%lx\n", hr);
 
     hr = IWICMetadataReaderInfo_GetCLSID(reader_info, NULL);
-    ok(hr == E_INVALIDARG, "GetCLSID failed, hr=%x\n", hr);
+    ok(hr == E_INVALIDARG, "GetCLSID failed, hr=%lx\n", hr);
 
     hr = IWICMetadataReaderInfo_GetCLSID(reader_info, &clsid);
-    ok(hr == S_OK, "GetCLSID failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetCLSID failed, hr=%lx\n", hr);
     ok(IsEqualGUID(&CLSID_WICXMPStructMetadataReader, &clsid), "GetCLSID returned wrong result\n");
 
     hr = IWICMetadataReaderInfo_GetMetadataFormat(reader_info, &clsid);
-    ok(hr == S_OK, "GetMetadataFormat failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetMetadataFormat failed, hr=%lx\n", hr);
     ok(IsEqualGUID(&GUID_MetadataFormatXMPStruct, &clsid), "GetMetadataFormat returned wrong result\n");
 
     hr = IWICMetadataReaderInfo_GetContainerFormats(reader_info, 0, NULL, NULL);
-    ok(hr == E_INVALIDARG, "GetContainerFormats failed, hr=%x\n", hr);
+    ok(hr == E_INVALIDARG, "GetContainerFormats failed, hr=%lx\n", hr);
 
     count = 0xdeadbeef;
     hr = IWICMetadataReaderInfo_GetContainerFormats(reader_info, 0, NULL, &count);
-    ok(hr == S_OK, "GetContainerFormats failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetContainerFormats failed, hr=%lx\n", hr);
     ok(count >= 2, "unexpected count %d\n", count);
 
     count = 0xdeadbeef;
     hr = IWICMetadataReaderInfo_GetContainerFormats(reader_info, 1, container_formats, &count);
-    ok(hr == S_OK, "GetContainerFormats failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetContainerFormats failed, hr=%lx\n", hr);
     ok(count == 1, "unexpected count %d\n", count);
 
     count = 0xdeadbeef;
     hr = IWICMetadataReaderInfo_GetContainerFormats(reader_info, 10, container_formats, &count);
-    ok(hr == S_OK, "GetContainerFormats failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetContainerFormats failed, hr=%lx\n", hr);
     ok(count == min(count, 10), "unexpected count %d\n", count);
 
     count = size = 0xdeadbeef;
     hr = IWICMetadataReaderInfo_GetPatterns(reader_info, &GUID_ContainerFormatPng,
         0, NULL, &count, &size);
     ok(hr == WINCODEC_ERR_COMPONENTNOTFOUND || broken(hr == S_OK) /* Windows XP */,
-        "GetPatterns failed, hr=%x\n", hr);
+        "GetPatterns failed, hr=%lx\n", hr);
     ok(count == 0xdeadbeef, "unexpected count %d\n", count);
     ok(size == 0xdeadbeef, "unexpected size %d\n", size);
 
     count = size = 0xdeadbeef;
     hr = IWICMetadataReaderInfo_GetPatterns(reader_info, &GUID_MetadataFormatXMP,
         0, NULL, &count, &size);
-    ok(hr == S_OK, "GetPatterns failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetPatterns failed, hr=%lx\n", hr);
     ok(count == 1, "unexpected count %d\n", count);
     ok(size > sizeof(WICMetadataPattern), "unexpected size %d\n", size);
 
@@ -623,14 +623,14 @@ static void test_reader_info(void)
         count = size = 0xdeadbeef;
         hr = IWICMetadataReaderInfo_GetPatterns(reader_info, &GUID_MetadataFormatXMP,
             size-1, patterns, &count, &size);
-        ok(hr == S_OK, "GetPatterns failed, hr=%x\n", hr);
+        ok(hr == S_OK, "GetPatterns failed, hr=%lx\n", hr);
         ok(count == 1, "unexpected count %d\n", count);
         ok(size > sizeof(WICMetadataPattern), "unexpected size %d\n", size);
 
         count = size = 0xdeadbeef;
         hr = IWICMetadataReaderInfo_GetPatterns(reader_info, &GUID_MetadataFormatXMP,
             size, patterns, &count, &size);
-        ok(hr == S_OK, "GetPatterns failed, hr=%x\n", hr);
+        ok(hr == S_OK, "GetPatterns failed, hr=%lx\n", hr);
         ok(count == 1, "unexpected count %d\n", count);
         ok(size == sizeof(WICMetadataPattern) + patterns->Length * 2, "unexpected size %d\n", size);
 
@@ -660,15 +660,15 @@ static void test_imagingfactory_interfaces(void)
     }
 
     hr = IWICImagingFactory2_QueryInterface(factory2, &IID_IWICComponentFactory, (void **)&component_factory);
-    ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+    ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
 
     hr = IWICComponentFactory_QueryInterface(component_factory, &IID_IWICImagingFactory, (void **)&factory);
-    ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+    ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
     ok(factory == (IWICImagingFactory *)component_factory, "Unexpected factory pointer.\n");
     IWICImagingFactory_Release(factory);
 
     hr = IWICImagingFactory2_QueryInterface(factory2, &IID_IWICImagingFactory, (void **)&factory);
-    ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+    ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
     ok(factory == (IWICImagingFactory *)component_factory, "Unexpected factory pointer.\n");
 
     IWICComponentFactory_Release(component_factory);
diff --git a/dlls/windowscodecs/tests/jpegformat.c b/dlls/windowscodecs/tests/jpegformat.c
index 341e42c28cd..e150174f98d 100644
--- a/dlls/windowscodecs/tests/jpegformat.c
+++ b/dlls/windowscodecs/tests/jpegformat.c
@@ -76,12 +76,12 @@ static void test_decode_adobe_cmyk(void)
 
     hr = CoCreateInstance(&CLSID_WICJpegDecoder, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICBitmapDecoder, (void**)&decoder);
-    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
+    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
     if (FAILED(hr)) return;
 
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICImagingFactory, (void **)&factory);
-    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
+    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
 
     hjpegdata = GlobalAlloc(GMEM_MOVEABLE, sizeof(jpeg_adobe_cmyk_1x5));
     ok(hjpegdata != 0, "GlobalAlloc failed\n");
@@ -92,31 +92,31 @@ static void test_decode_adobe_cmyk(void)
         GlobalUnlock(hjpegdata);
 
         hr = CreateStreamOnHGlobal(hjpegdata, FALSE, &jpegstream);
-        ok(SUCCEEDED(hr), "CreateStreamOnHGlobal failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "CreateStreamOnHGlobal failed, hr=%lx\n", hr);
         if (SUCCEEDED(hr))
         {
             hr = IWICBitmapDecoder_Initialize(decoder, jpegstream, WICDecodeMetadataCacheOnLoad);
-            ok(hr == S_OK, "Initialize failed, hr=%x\n", hr);
+            ok(hr == S_OK, "Initialize failed, hr=%lx\n", hr);
 
             hr = IWICBitmapDecoder_GetContainerFormat(decoder, &guidresult);
-            ok(SUCCEEDED(hr), "GetContainerFormat failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "GetContainerFormat failed, hr=%lx\n", hr);
             ok(IsEqualGUID(&guidresult, &GUID_ContainerFormatJpeg), "unexpected container format\n");
 
             hr = IWICBitmapDecoder_GetFrameCount(decoder, &count);
-            ok(SUCCEEDED(hr), "GetFrameCount failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "GetFrameCount failed, hr=%lx\n", hr);
             ok(count == 1, "unexpected count %u\n", count);
 
             hr = IWICBitmapDecoder_GetFrame(decoder, 0, &framedecode);
-            ok(SUCCEEDED(hr), "GetFrame failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "GetFrame failed, hr=%lx\n", hr);
             if (SUCCEEDED(hr))
             {
                 hr = IWICBitmapFrameDecode_GetSize(framedecode, &width, &height);
-                ok(SUCCEEDED(hr), "GetSize failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "GetSize failed, hr=%lx\n", hr);
                 ok(width == 1, "expected width=1, got %u\n", width);
                 ok(height == 5, "expected height=5, got %u\n", height);
 
                 hr = IWICBitmapFrameDecode_GetPixelFormat(framedecode, &guidresult);
-                ok(SUCCEEDED(hr), "GetPixelFormat failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "GetPixelFormat failed, hr=%lx\n", hr);
                 ok(IsEqualGUID(&guidresult, &GUID_WICPixelFormat32bppCMYK) ||
                     broken(IsEqualGUID(&guidresult, &GUID_WICPixelFormat24bppBGR)), /* xp/2003 */
                     "unexpected pixel format: %s\n", wine_dbgstr_guid(&guidresult));
@@ -126,20 +126,20 @@ static void test_decode_adobe_cmyk(void)
                 for(i=2; i>0; --i)
                 {
                     hr = IWICBitmapFrameDecode_CopyPixels(framedecode, NULL, 4, sizeof(imagedata), imagedata);
-                    ok(SUCCEEDED(hr), "CopyPixels failed, hr=%x\n", hr);
+                    ok(SUCCEEDED(hr), "CopyPixels failed, hr=%lx\n", hr);
                     ok(!memcmp(imagedata, expected_imagedata, sizeof(imagedata)) ||
                             broken(!memcmp(imagedata, expected_imagedata_24bpp, sizeof(expected_imagedata))), /* xp/2003 */
                             "unexpected image data\n");
                 }
 
                 hr = IWICImagingFactory_CreatePalette(factory, &palette);
-                ok(SUCCEEDED(hr), "CreatePalette failed, hr=%x\n", hr);
+                ok(SUCCEEDED(hr), "CreatePalette failed, hr=%lx\n", hr);
 
                 hr = IWICBitmapDecoder_CopyPalette(decoder, palette);
-                ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "Unexpected hr %#x.\n", hr);
+                ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "Unexpected hr %#lx.\n", hr);
 
                 hr = IWICBitmapFrameDecode_CopyPalette(framedecode, palette);
-                ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "Unexpected hr %#x.\n", hr);
+                ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "Unexpected hr %#lx.\n", hr);
 
                 IWICPalette_Release(palette);
 
diff --git a/dlls/windowscodecs/tests/metadata.c b/dlls/windowscodecs/tests/metadata.c
index 8eaf22a300c..2ec9eb645e8 100644
--- a/dlls/windowscodecs/tests/metadata.c
+++ b/dlls/windowscodecs/tests/metadata.c
@@ -37,7 +37,7 @@ DEFINE_GUID(IID_MdbrUnknown, 0x00240e6f,0x3f23,0x4432,0xb0,0xcc,0x48,0xd5,0xbb,0
 #define expect_blob(propvar, data, length) do { \
     ok((propvar).vt == VT_BLOB, "unexpected vt: %i\n", (propvar).vt); \
     if ((propvar).vt == VT_BLOB) { \
-        ok(U(propvar).blob.cbSize == (length), "expected size %u, got %u\n", (ULONG)(length), U(propvar).blob.cbSize); \
+        ok(U(propvar).blob.cbSize == (length), "expected size %lu, got %lu\n", (ULONG)(length), U(propvar).blob.cbSize); \
         if (U(propvar).blob.cbSize == (length)) { \
             ok(!memcmp(U(propvar).blob.pBlobData, (data), (length)), "unexpected data\n"); \
         } \
@@ -221,7 +221,7 @@ static IStream *create_stream(const char *data, int data_size)
     GlobalUnlock(hdata);
 
     hr = CreateStreamOnHGlobal(hdata, TRUE, &stream);
-    ok(hr == S_OK, "CreateStreamOnHGlobal failed, hr=%x\n", hr);
+    ok(hr == S_OK, "CreateStreamOnHGlobal failed, hr=%lx\n", hr);
 
     return stream;
 }
@@ -239,22 +239,22 @@ static void load_stream(IUnknown *reader, const char *data, int data_size, DWORD
         return;
 
     hr = IUnknown_QueryInterface(reader, &IID_IWICPersistStream, (void**)&persist);
-    ok(hr == S_OK, "QueryInterface failed, hr=%x\n", hr);
+    ok(hr == S_OK, "QueryInterface failed, hr=%lx\n", hr);
 
     if (SUCCEEDED(hr))
     {
         hr = IWICPersistStream_LoadEx(persist, stream, NULL, persist_options);
-        ok(hr == S_OK, "LoadEx failed, hr=%x\n", hr);
+        ok(hr == S_OK, "LoadEx failed, hr=%lx\n", hr);
 
         IWICPersistStream_Release(persist);
     }
 
     pos.QuadPart = 0;
     hr = IStream_Seek(stream, pos, SEEK_CUR, &cur_pos);
-    ok(hr == S_OK, "IStream_Seek error %#x\n", hr);
+    ok(hr == S_OK, "IStream_Seek error %#lx\n", hr);
     /* IFD metadata reader doesn't rewind the stream to the start */
     ok(cur_pos.QuadPart == 0 || cur_pos.QuadPart <= data_size,
-       "current stream pos is at %x/%x, data size %x\n", cur_pos.u.LowPart, cur_pos.u.HighPart, data_size);
+       "current stream pos is at %lx/%lx, data size %x\n", cur_pos.u.LowPart, cur_pos.u.HighPart, data_size);
 
     IStream_Release(stream);
 }
@@ -270,13 +270,13 @@ static void test_metadata_unknown(void)
 
     hr = CoCreateInstance(&CLSID_WICUnknownMetadataReader, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICMetadataReader, (void**)&reader);
-    ok(hr == S_OK, "CoCreateInstance failed, hr=%x\n", hr);
+    ok(hr == S_OK, "CoCreateInstance failed, hr=%lx\n", hr);
     if (FAILED(hr)) return;
 
     load_stream((IUnknown*)reader, metadata_unknown, sizeof(metadata_unknown), WICPersistOptionDefault);
 
     hr = IWICMetadataReader_GetEnumerator(reader, &enumerator);
-    ok(hr == S_OK, "GetEnumerator failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetEnumerator failed, hr=%lx\n", hr);
 
     if (SUCCEEDED(hr))
     {
@@ -285,8 +285,8 @@ static void test_metadata_unknown(void)
         PropVariantInit(&value);
 
         hr = IWICEnumMetadataItem_Next(enumerator, 1, &schema, &id, &value, &items_returned);
-        ok(hr == S_OK, "Next failed, hr=%x\n", hr);
-        ok(items_returned == 1, "unexpected item count %i\n", items_returned);
+        ok(hr == S_OK, "Next failed, hr=%lx\n", hr);
+        ok(items_returned == 1, "unexpected item count %li\n", items_returned);
 
         if (hr == S_OK && items_returned == 1)
         {
@@ -300,14 +300,14 @@ static void test_metadata_unknown(void)
         }
 
         hr = IWICEnumMetadataItem_Next(enumerator, 1, &schema, &id, &value, &items_returned);
-        ok(hr == S_FALSE, "Next failed, hr=%x\n", hr);
-        ok(items_returned == 0, "unexpected item count %i\n", items_returned);
+        ok(hr == S_FALSE, "Next failed, hr=%lx\n", hr);
+        ok(items_returned == 0, "unexpected item count %li\n", items_returned);
 
         IWICEnumMetadataItem_Release(enumerator);
     }
 
     hr = IWICMetadataReader_QueryInterface(reader, &IID_IWICMetadataBlockReader, (void**)&blockreader);
-    ok(hr == E_NOINTERFACE, "QueryInterface failed, hr=%x\n", hr);
+    ok(hr == E_NOINTERFACE, "QueryInterface failed, hr=%lx\n", hr);
 
     if (SUCCEEDED(hr))
         IWICMetadataBlockReader_Release(blockreader);
@@ -331,33 +331,33 @@ static void test_metadata_tEXt(void)
 
     hr = CoCreateInstance(&CLSID_WICPngTextMetadataReader, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICMetadataReader, (void**)&reader);
-    ok(hr == S_OK, "CoCreateInstance failed, hr=%x\n", hr);
+    ok(hr == S_OK, "CoCreateInstance failed, hr=%lx\n", hr);
     if (FAILED(hr)) return;
 
     hr = IWICMetadataReader_GetCount(reader, NULL);
-    ok(hr == E_INVALIDARG, "GetCount failed, hr=%x\n", hr);
+    ok(hr == E_INVALIDARG, "GetCount failed, hr=%lx\n", hr);
 
     hr = IWICMetadataReader_GetCount(reader, &count);
-    ok(hr == S_OK, "GetCount failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetCount failed, hr=%lx\n", hr);
     ok(count == 0, "unexpected count %i\n", count);
 
     load_stream((IUnknown*)reader, metadata_tEXt, sizeof(metadata_tEXt), WICPersistOptionDefault);
 
     hr = IWICMetadataReader_GetCount(reader, &count);
-    ok(hr == S_OK, "GetCount failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetCount failed, hr=%lx\n", hr);
     ok(count == 1, "unexpected count %i\n", count);
 
     hr = IWICMetadataReader_GetEnumerator(reader, NULL);
-    ok(hr == E_INVALIDARG, "GetEnumerator failed, hr=%x\n", hr);
+    ok(hr == E_INVALIDARG, "GetEnumerator failed, hr=%lx\n", hr);
 
     hr = IWICMetadataReader_GetEnumerator(reader, &enumerator);
-    ok(hr == S_OK, "GetEnumerator failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetEnumerator failed, hr=%lx\n", hr);
 
     if (SUCCEEDED(hr))
     {
         hr = IWICEnumMetadataItem_Next(enumerator, 1, &schema, &id, &value, &items_returned);
-        ok(hr == S_OK, "Next failed, hr=%x\n", hr);
-        ok(items_returned == 1, "unexpected item count %i\n", items_returned);
+        ok(hr == S_OK, "Next failed, hr=%lx\n", hr);
+        ok(items_returned == 1, "unexpected item count %li\n", items_returned);
 
         if (hr == S_OK && items_returned == 1)
         {
@@ -373,31 +373,31 @@ static void test_metadata_tEXt(void)
         }
 
         hr = IWICEnumMetadataItem_Next(enumerator, 1, &schema, &id, &value, &items_returned);
-        ok(hr == S_FALSE, "Next failed, hr=%x\n", hr);
-        ok(items_returned == 0, "unexpected item count %i\n", items_returned);
+        ok(hr == S_FALSE, "Next failed, hr=%lx\n", hr);
+        ok(items_returned == 0, "unexpected item count %li\n", items_returned);
 
         IWICEnumMetadataItem_Release(enumerator);
     }
 
     hr = IWICMetadataReader_GetMetadataFormat(reader, &format);
-    ok(hr == S_OK, "GetMetadataFormat failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetMetadataFormat failed, hr=%lx\n", hr);
     ok(IsEqualGUID(&format, &GUID_MetadataFormatChunktEXt), "unexpected format %s\n", wine_dbgstr_guid(&format));
 
     hr = IWICMetadataReader_GetMetadataFormat(reader, NULL);
-    ok(hr == E_INVALIDARG, "GetMetadataFormat failed, hr=%x\n", hr);
+    ok(hr == E_INVALIDARG, "GetMetadataFormat failed, hr=%lx\n", hr);
 
     id.vt = VT_LPSTR;
     U(id).pszVal = CoTaskMemAlloc(strlen("winetest") + 1);
     strcpy(U(id).pszVal, "winetest");
 
     hr = IWICMetadataReader_GetValue(reader, NULL, &id, NULL);
-    ok(hr == S_OK, "GetValue failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetValue failed, hr=%lx\n", hr);
 
     hr = IWICMetadataReader_GetValue(reader, &schema, NULL, &value);
-    ok(hr == E_INVALIDARG, "GetValue failed, hr=%x\n", hr);
+    ok(hr == E_INVALIDARG, "GetValue failed, hr=%lx\n", hr);
 
     hr = IWICMetadataReader_GetValue(reader, &schema, &id, &value);
-    ok(hr == S_OK, "GetValue failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetValue failed, hr=%lx\n", hr);
     ok(value.vt == VT_LPSTR, "unexpected vt: %i\n", id.vt);
     ok(!strcmp(U(value).pszVal, "value"), "unexpected value: %s\n", U(value).pszVal);
     PropVariantClear(&value);
@@ -405,31 +405,31 @@ static void test_metadata_tEXt(void)
     strcpy(U(id).pszVal, "test");
 
     hr = IWICMetadataReader_GetValue(reader, &schema, &id, &value);
-    ok(hr == WINCODEC_ERR_PROPERTYNOTFOUND, "GetValue failed, hr=%x\n", hr);
+    ok(hr == WINCODEC_ERR_PROPERTYNOTFOUND, "GetValue failed, hr=%lx\n", hr);
 
     PropVariantClear(&id);
 
     hr = IWICMetadataReader_GetValueByIndex(reader, 0, NULL, NULL, NULL);
-    ok(hr == S_OK, "GetValueByIndex failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetValueByIndex failed, hr=%lx\n", hr);
 
     hr = IWICMetadataReader_GetValueByIndex(reader, 0, &schema, NULL, NULL);
-    ok(hr == S_OK, "GetValueByIndex failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetValueByIndex failed, hr=%lx\n", hr);
     ok(schema.vt == VT_EMPTY, "unexpected vt: %i\n", schema.vt);
 
     hr = IWICMetadataReader_GetValueByIndex(reader, 0, NULL, &id, NULL);
-    ok(hr == S_OK, "GetValueByIndex failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetValueByIndex failed, hr=%lx\n", hr);
     ok(id.vt == VT_LPSTR, "unexpected vt: %i\n", id.vt);
     ok(!strcmp(U(id).pszVal, "winetest"), "unexpected id: %s\n", U(id).pszVal);
     PropVariantClear(&id);
 
     hr = IWICMetadataReader_GetValueByIndex(reader, 0, NULL, NULL, &value);
-    ok(hr == S_OK, "GetValueByIndex failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetValueByIndex failed, hr=%lx\n", hr);
     ok(value.vt == VT_LPSTR, "unexpected vt: %i\n", value.vt);
     ok(!strcmp(U(value).pszVal, "value"), "unexpected value: %s\n", U(value).pszVal);
     PropVariantClear(&value);
 
     hr = IWICMetadataReader_GetValueByIndex(reader, 1, NULL, NULL, NULL);
-    ok(hr == E_INVALIDARG, "GetValueByIndex failed, hr=%x\n", hr);
+    ok(hr == E_INVALIDARG, "GetValueByIndex failed, hr=%lx\n", hr);
 
     IWICMetadataReader_Release(reader);
 }
@@ -449,21 +449,21 @@ static void test_metadata_gAMA(void)
 
     hr = CoCreateInstance(&CLSID_WICPngGamaMetadataReader, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICMetadataReader, (void**)&reader);
-    ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG) /*winxp*/, "CoCreateInstance failed, hr=%x\n", hr);
+    ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG) /*winxp*/, "CoCreateInstance failed, hr=%lx\n", hr);
     if (FAILED(hr)) return;
 
     load_stream((IUnknown*)reader, metadata_gAMA, sizeof(metadata_gAMA), WICPersistOptionDefault);
 
     hr = IWICMetadataReader_GetMetadataFormat(reader, &format);
-    ok(hr == S_OK, "GetMetadataFormat failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetMetadataFormat failed, hr=%lx\n", hr);
     ok(IsEqualGUID(&format, &GUID_MetadataFormatChunkgAMA), "unexpected format %s\n", wine_dbgstr_guid(&format));
 
     hr = IWICMetadataReader_GetCount(reader, &count);
-    ok(hr == S_OK, "GetCount failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetCount failed, hr=%lx\n", hr);
     ok(count == 1, "unexpected count %i\n", count);
 
     hr = IWICMetadataReader_GetValueByIndex(reader, 0, &schema, &id, &value);
-    ok(hr == S_OK, "GetValue failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetValue failed, hr=%lx\n", hr);
 
     ok(schema.vt == VT_EMPTY, "unexpected vt: %i\n", schema.vt);
     PropVariantClear(&schema);
@@ -473,7 +473,7 @@ static void test_metadata_gAMA(void)
     PropVariantClear(&id);
 
     ok(value.vt == VT_UI4, "unexpected vt: %i\n", value.vt);
-    ok(U(value).ulVal == 33333, "unexpected value: %u\n", U(value).ulVal);
+    ok(U(value).ulVal == 33333, "unexpected value: %lu\n", U(value).ulVal);
     PropVariantClear(&value);
 
     IWICMetadataReader_Release(reader);
@@ -507,23 +507,23 @@ static void test_metadata_cHRM(void)
 
     hr = CoCreateInstance(&CLSID_WICPngChrmMetadataReader, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICMetadataReader, (void**)&reader);
-    ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG) /*winxp*/, "CoCreateInstance failed, hr=%x\n", hr);
+    ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG) /*winxp*/, "CoCreateInstance failed, hr=%lx\n", hr);
     if (FAILED(hr)) return;
 
     load_stream((IUnknown*)reader, metadata_cHRM, sizeof(metadata_cHRM), WICPersistOptionDefault);
 
     hr = IWICMetadataReader_GetMetadataFormat(reader, &format);
-    ok(hr == S_OK, "GetMetadataFormat failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetMetadataFormat failed, hr=%lx\n", hr);
     ok(IsEqualGUID(&format, &GUID_MetadataFormatChunkcHRM), "unexpected format %s\n", wine_dbgstr_guid(&format));
 
     hr = IWICMetadataReader_GetCount(reader, &count);
-    ok(hr == S_OK, "GetCount failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetCount failed, hr=%lx\n", hr);
     ok(count == 8, "unexpected count %i\n", count);
 
     for (i=0; i<8; i++)
     {
         hr = IWICMetadataReader_GetValueByIndex(reader, i, &schema, &id, &value);
-        ok(hr == S_OK, "GetValue failed, hr=%x\n", hr);
+        ok(hr == S_OK, "GetValue failed, hr=%lx\n", hr);
 
         ok(schema.vt == VT_EMPTY, "unexpected vt: %i\n", schema.vt);
         PropVariantClear(&schema);
@@ -533,7 +533,7 @@ static void test_metadata_cHRM(void)
         PropVariantClear(&id);
 
         ok(value.vt == VT_UI4, "unexpected vt: %i\n", value.vt);
-        ok(U(value).ulVal == expected_vals[i], "got %u, expected %u\n", U(value).ulVal, expected_vals[i]);
+        ok(U(value).ulVal == expected_vals[i], "got %lu, expected %lu\n", U(value).ulVal, expected_vals[i]);
         PropVariantClear(&value);
     }
 
@@ -665,10 +665,10 @@ static void compare_metadata(IWICMetadataReader *reader, const struct test_data
     ULONG items_returned, i;
 
     hr = IWICMetadataReader_GetEnumerator(reader, NULL);
-    ok(hr == E_INVALIDARG, "GetEnumerator error %#x\n", hr);
+    ok(hr == E_INVALIDARG, "GetEnumerator error %#lx\n", hr);
 
     hr = IWICMetadataReader_GetEnumerator(reader, &enumerator);
-    ok(hr == S_OK, "GetEnumerator error %#x\n", hr);
+    ok(hr == S_OK, "GetEnumerator error %#lx\n", hr);
 
     PropVariantInit(&schema);
     PropVariantInit(&id);
@@ -677,18 +677,18 @@ static void compare_metadata(IWICMetadataReader *reader, const struct test_data
     for (i = 0; i < count; i++)
     {
         hr = IWICEnumMetadataItem_Next(enumerator, 1, &schema, &id, &value, &items_returned);
-        ok(hr == S_OK, "Next error %#x\n", hr);
-        ok(items_returned == 1, "unexpected item count %u\n", items_returned);
+        ok(hr == S_OK, "Next error %#lx\n", hr);
+        ok(items_returned == 1, "unexpected item count %lu\n", items_returned);
 
-        ok(schema.vt == VT_EMPTY, "%u: unexpected vt: %u\n", i, schema.vt);
-        ok(id.vt == VT_UI2 || id.vt == VT_LPWSTR || id.vt == VT_EMPTY, "%u: unexpected vt: %u\n", i, id.vt);
+        ok(schema.vt == VT_EMPTY, "%lu: unexpected vt: %u\n", i, schema.vt);
+        ok(id.vt == VT_UI2 || id.vt == VT_LPWSTR || id.vt == VT_EMPTY, "%lu: unexpected vt: %u\n", i, id.vt);
         if (id.vt == VT_UI2)
-            ok(U(id).uiVal == td[i].id, "%u: expected id %#x, got %#x\n", i, td[i].id, U(id).uiVal);
+            ok(U(id).uiVal == td[i].id, "%lu: expected id %#lx, got %#x\n", i, td[i].id, U(id).uiVal);
         else if (id.vt == VT_LPWSTR)
             ok(!lstrcmpW(td[i].id_string, U(id).pwszVal),
-               "%u: expected %s, got %s\n", i, wine_dbgstr_w(td[i].id_string), wine_dbgstr_w(U(id).pwszVal));
+               "%lu: expected %s, got %s\n", i, wine_dbgstr_w(td[i].id_string), wine_dbgstr_w(U(id).pwszVal));
 
-        ok(value.vt == td[i].type, "%u: expected vt %#x, got %#x\n", i, td[i].type, value.vt);
+        ok(value.vt == td[i].type, "%lu: expected vt %#lx, got %#x\n", i, td[i].type, value.vt);
         if (value.vt & VT_VECTOR)
         {
             ULONG j;
@@ -696,37 +696,37 @@ static void compare_metadata(IWICMetadataReader *reader, const struct test_data
             {
             case VT_I1:
             case VT_UI1:
-                ok(td[i].count == U(value).caub.cElems, "%u: expected cElems %d, got %d\n", i, td[i].count, U(value).caub.cElems);
+                ok(td[i].count == U(value).caub.cElems, "%lu: expected cElems %d, got %ld\n", i, td[i].count, U(value).caub.cElems);
                 for (j = 0; j < U(value).caub.cElems; j++)
-                    ok(td[i].value[j] == U(value).caub.pElems[j], "%u: expected value[%d] %#x/%#x, got %#x\n", i, j, (ULONG)td[i].value[j], (ULONG)(td[i].value[j] >> 32), U(value).caub.pElems[j]);
+                    ok(td[i].value[j] == U(value).caub.pElems[j], "%lu: expected value[%ld] %#lx/%#lx, got %#x\n", i, j, (ULONG)td[i].value[j], (ULONG)(td[i].value[j] >> 32), U(value).caub.pElems[j]);
                 break;
             case VT_I2:
             case VT_UI2:
-                ok(td[i].count == U(value).caui.cElems, "%u: expected cElems %d, got %d\n", i, td[i].count, U(value).caui.cElems);
+                ok(td[i].count == U(value).caui.cElems, "%lu: expected cElems %d, got %ld\n", i, td[i].count, U(value).caui.cElems);
                 for (j = 0; j < U(value).caui.cElems; j++)
-                    ok(td[i].value[j] == U(value).caui.pElems[j], "%u: expected value[%d] %#x/%#x, got %#x\n", i, j, (ULONG)td[i].value[j], (ULONG)(td[i].value[j] >> 32), U(value).caui.pElems[j]);
+                    ok(td[i].value[j] == U(value).caui.pElems[j], "%lu: expected value[%ld] %#lx/%#lx, got %#x\n", i, j, (ULONG)td[i].value[j], (ULONG)(td[i].value[j] >> 32), U(value).caui.pElems[j]);
                 break;
             case VT_I4:
             case VT_UI4:
             case VT_R4:
-                ok(td[i].count == U(value).caul.cElems, "%u: expected cElems %d, got %d\n", i, td[i].count, U(value).caul.cElems);
+                ok(td[i].count == U(value).caul.cElems, "%lu: expected cElems %d, got %ld\n", i, td[i].count, U(value).caul.cElems);
                 for (j = 0; j < U(value).caul.cElems; j++)
-                    ok(td[i].value[j] == U(value).caul.pElems[j], "%u: expected value[%d] %#x/%#x, got %#x\n", i, j, (ULONG)td[i].value[j], (ULONG)(td[i].value[j] >> 32), U(value).caul.pElems[j]);
+                    ok(td[i].value[j] == U(value).caul.pElems[j], "%lu: expected value[%ld] %#lx/%#lx, got %#lx\n", i, j, (ULONG)td[i].value[j], (ULONG)(td[i].value[j] >> 32), U(value).caul.pElems[j]);
                 break;
             case VT_I8:
             case VT_UI8:
             case VT_R8:
-                ok(td[i].count == U(value).cauh.cElems, "%u: expected cElems %d, got %d\n", i, td[i].count, U(value).cauh.cElems);
+                ok(td[i].count == U(value).cauh.cElems, "%lu: expected cElems %d, got %ld\n", i, td[i].count, U(value).cauh.cElems);
                 for (j = 0; j < U(value).cauh.cElems; j++)
-                    ok(td[i].value[j] == U(value).cauh.pElems[j].QuadPart, "%u: expected value[%d] %08x/%08x, got %08x/%08x\n", i, j, (ULONG)td[i].value[j], (ULONG)(td[i].value[j] >> 32), U(value).cauh.pElems[j].u.LowPart, U(value).cauh.pElems[j].u.HighPart);
+                    ok(td[i].value[j] == U(value).cauh.pElems[j].QuadPart, "%lu: expected value[%ld] %08lx/%08lx, got %08lx/%08lx\n", i, j, (ULONG)td[i].value[j], (ULONG)(td[i].value[j] >> 32), U(value).cauh.pElems[j].u.LowPart, U(value).cauh.pElems[j].u.HighPart);
                 break;
             case VT_LPSTR:
-                ok(td[i].count == U(value).calpstr.cElems, "%u: expected cElems %d, got %d\n", i, td[i].count, U(value).caub.cElems);
+                ok(td[i].count == U(value).calpstr.cElems, "%lu: expected cElems %d, got %ld\n", i, td[i].count, U(value).caub.cElems);
                 for (j = 0; j < U(value).calpstr.cElems; j++)
-                    trace("%u: %s\n", j, U(value).calpstr.pElems[j]);
+                    trace("%lu: %s\n", j, U(value).calpstr.pElems[j]);
                 /* fall through to not handled message */
             default:
-                ok(0, "%u: array of type %d is not handled\n", i, value.vt & ~VT_VECTOR);
+                ok(0, "%lu: array of type %d is not handled\n", i, value.vt & ~VT_VECTOR);
                 break;
             }
         }
@@ -734,18 +734,18 @@ static void compare_metadata(IWICMetadataReader *reader, const struct test_data
         {
             ok(td[i].count == strlen(U(value).pszVal) ||
                broken(td[i].count == strlen(U(value).pszVal) + 1), /* before Win7 */
-               "%u: expected count %d, got %d\n", i, td[i].count, lstrlenA(U(value).pszVal));
+               "%lu: expected count %d, got %d\n", i, td[i].count, lstrlenA(U(value).pszVal));
             if (td[i].count == strlen(U(value).pszVal))
                 ok(!strcmp(td[i].string, U(value).pszVal),
-                   "%u: expected %s, got %s\n", i, td[i].string, U(value).pszVal);
+                   "%lu: expected %s, got %s\n", i, td[i].string, U(value).pszVal);
         }
         else if (value.vt == VT_BLOB)
         {
-            ok(td[i].count == U(value).blob.cbSize, "%u: expected count %d, got %d\n", i, td[i].count, U(value).blob.cbSize);
-            ok(!memcmp(td[i].string, U(value).blob.pBlobData, td[i].count), "%u: expected %s, got %s\n", i, td[i].string, U(value).blob.pBlobData);
+            ok(td[i].count == U(value).blob.cbSize, "%lu: expected count %d, got %ld\n", i, td[i].count, U(value).blob.cbSize);
+            ok(!memcmp(td[i].string, U(value).blob.pBlobData, td[i].count), "%lu: expected %s, got %s\n", i, td[i].string, U(value).blob.pBlobData);
         }
         else
-            ok(U(value).uhVal.QuadPart == td[i].value[0], "%u: expected value %#x/%#x got %#x/%#x\n",
+            ok(U(value).uhVal.QuadPart == td[i].value[0], "%lu: expected value %#x/%#x got %#lx/%#lx\n",
                i, (UINT)td[i].value[0], (UINT)(td[i].value[0] >> 32), U(value).uhVal.u.LowPart, U(value).uhVal.u.HighPart);
 
         PropVariantClear(&schema);
@@ -755,7 +755,7 @@ static void compare_metadata(IWICMetadataReader *reader, const struct test_data
 
     hr = IWICEnumMetadataItem_Next(enumerator, 1, &schema, &id, &value, &items_returned);
     ok(hr == S_FALSE, "Next should fail\n");
-    ok(items_returned == 0, "unexpected item count %u\n", items_returned);
+    ok(items_returned == 0, "unexpected item count %lu\n", items_returned);
 
     IWICEnumMetadataItem_Release(enumerator);
 }
@@ -811,19 +811,19 @@ static void test_metadata_IFD(void)
 
     hr = CoCreateInstance(&CLSID_WICIfdMetadataReader, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICMetadataReader, (void**)&reader);
-    ok(hr == S_OK, "CoCreateInstance error %#x\n", hr);
+    ok(hr == S_OK, "CoCreateInstance error %#lx\n", hr);
 
     hr = IWICMetadataReader_GetCount(reader, NULL);
-    ok(hr == E_INVALIDARG, "GetCount error %#x\n", hr);
+    ok(hr == E_INVALIDARG, "GetCount error %#lx\n", hr);
 
     hr = IWICMetadataReader_GetCount(reader, &count);
-    ok(hr == S_OK, "GetCount error %#x\n", hr);
+    ok(hr == S_OK, "GetCount error %#lx\n", hr);
     ok(count == 0, "unexpected count %u\n", count);
 
     load_stream((IUnknown*)reader, (const char *)&IFD_data, sizeof(IFD_data), persist_options);
 
     hr = IWICMetadataReader_GetCount(reader, &count);
-    ok(hr == S_OK, "GetCount error %#x\n", hr);
+    ok(hr == S_OK, "GetCount error %#lx\n", hr);
     ok(count == ARRAY_SIZE(td), "unexpected count %u\n", count);
 
     compare_metadata(reader, td, count);
@@ -839,92 +839,92 @@ static void test_metadata_IFD(void)
     byte_swap_ifd_data(IFD_data_swapped);
     load_stream((IUnknown *)reader, IFD_data_swapped, sizeof(IFD_data), persist_options);
     hr = IWICMetadataReader_GetCount(reader, &count);
-    ok(hr == S_OK, "GetCount error %#x\n", hr);
+    ok(hr == S_OK, "GetCount error %#lx\n", hr);
     ok(count == ARRAY_SIZE(td), "unexpected count %u\n", count);
     compare_metadata(reader, td, count);
     HeapFree(GetProcessHeap(), 0, IFD_data_swapped);
 
     hr = IWICMetadataReader_GetMetadataFormat(reader, &format);
-    ok(hr == S_OK, "GetMetadataFormat error %#x\n", hr);
+    ok(hr == S_OK, "GetMetadataFormat error %#lx\n", hr);
     ok(IsEqualGUID(&format, &GUID_MetadataFormatIfd), "unexpected format %s\n", wine_dbgstr_guid(&format));
 
     hr = IWICMetadataReader_GetMetadataFormat(reader, NULL);
     ok(hr == E_INVALIDARG, "GetMetadataFormat should fail\n");
 
     hr = IWICMetadataReader_GetValueByIndex(reader, 0, NULL, NULL, NULL);
-    ok(hr == S_OK, "GetValueByIndex error %#x\n", hr);
+    ok(hr == S_OK, "GetValueByIndex error %#lx\n", hr);
 
     PropVariantInit(&schema);
     PropVariantInit(&id);
     PropVariantInit(&value);
 
     hr = IWICMetadataReader_GetValueByIndex(reader, count - 1, NULL, NULL, NULL);
-    ok(hr == S_OK, "GetValueByIndex error %#x\n", hr);
+    ok(hr == S_OK, "GetValueByIndex error %#lx\n", hr);
 
     hr = IWICMetadataReader_GetValueByIndex(reader, 0, &schema, NULL, NULL);
-    ok(hr == S_OK, "GetValueByIndex error %#x\n", hr);
+    ok(hr == S_OK, "GetValueByIndex error %#lx\n", hr);
     ok(schema.vt == VT_EMPTY, "unexpected vt: %u\n", schema.vt);
 
     hr = IWICMetadataReader_GetValueByIndex(reader, count - 1, &schema, NULL, NULL);
-    ok(hr == S_OK, "GetValueByIndex error %#x\n", hr);
+    ok(hr == S_OK, "GetValueByIndex error %#lx\n", hr);
     ok(schema.vt == VT_EMPTY, "unexpected vt: %u\n", schema.vt);
 
     hr = IWICMetadataReader_GetValueByIndex(reader, 0, NULL, &id, NULL);
-    ok(hr == S_OK, "GetValueByIndex error %#x\n", hr);
+    ok(hr == S_OK, "GetValueByIndex error %#lx\n", hr);
     ok(id.vt == VT_UI2, "unexpected vt: %u\n", id.vt);
     ok(U(id).uiVal == 0xfe, "unexpected id: %#x\n", U(id).uiVal);
     PropVariantClear(&id);
 
     hr = IWICMetadataReader_GetValueByIndex(reader, 0, NULL, NULL, &value);
-    ok(hr == S_OK, "GetValueByIndex error %#x\n", hr);
+    ok(hr == S_OK, "GetValueByIndex error %#lx\n", hr);
     ok(value.vt == VT_UI2, "unexpected vt: %u\n", value.vt);
     ok(U(value).uiVal == 1, "unexpected id: %#x\n", U(value).uiVal);
     PropVariantClear(&value);
 
     hr = IWICMetadataReader_GetValueByIndex(reader, count, &schema, NULL, NULL);
-    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
 
     PropVariantInit(&schema);
     PropVariantInit(&id);
     PropVariantInit(&value);
 
     hr = IWICMetadataReader_GetValue(reader, &schema, &id, &value);
-    ok(hr == WINCODEC_ERR_PROPERTYNOTFOUND, "expected WINCODEC_ERR_PROPERTYNOTFOUND, got %#x\n", hr);
+    ok(hr == WINCODEC_ERR_PROPERTYNOTFOUND, "expected WINCODEC_ERR_PROPERTYNOTFOUND, got %#lx\n", hr);
 
     hr = IWICMetadataReader_GetValue(reader, NULL, &id, NULL);
-    ok(hr == WINCODEC_ERR_PROPERTYNOTFOUND, "expected WINCODEC_ERR_PROPERTYNOTFOUND, got %#x\n", hr);
+    ok(hr == WINCODEC_ERR_PROPERTYNOTFOUND, "expected WINCODEC_ERR_PROPERTYNOTFOUND, got %#lx\n", hr);
 
     hr = IWICMetadataReader_GetValue(reader, &schema, NULL, NULL);
-    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
 
     hr = IWICMetadataReader_GetValue(reader, &schema, &id, NULL);
-    ok(hr == WINCODEC_ERR_PROPERTYNOTFOUND, "expected WINCODEC_ERR_PROPERTYNOTFOUND, got %#x\n", hr);
+    ok(hr == WINCODEC_ERR_PROPERTYNOTFOUND, "expected WINCODEC_ERR_PROPERTYNOTFOUND, got %#lx\n", hr);
 
     hr = IWICMetadataReader_GetValue(reader, &schema, NULL, &value);
-    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
 
     id.vt = VT_UI2;
     U(id).uiVal = 0xf00e;
     hr = IWICMetadataReader_GetValue(reader, NULL, &id, NULL);
-    ok(hr == S_OK, "GetValue error %#x\n", hr);
+    ok(hr == S_OK, "GetValue error %#lx\n", hr);
 
     /* schema is ignored by Ifd metadata reader */
     schema.vt = VT_UI4;
     U(schema).ulVal = 0xdeadbeef;
     hr = IWICMetadataReader_GetValue(reader, &schema, &id, &value);
-    ok(hr == S_OK, "GetValue error %#x\n", hr);
+    ok(hr == S_OK, "GetValue error %#lx\n", hr);
     ok(value.vt == VT_LPSTR, "unexpected vt: %i\n", id.vt);
     ok(!strcmp(U(value).pszVal, "Hello World!"), "unexpected value: %s\n", U(value).pszVal);
     PropVariantClear(&value);
 
     hr = IWICMetadataReader_GetValue(reader, NULL, &id, &value);
-    ok(hr == S_OK, "GetValue error %#x\n", hr);
+    ok(hr == S_OK, "GetValue error %#lx\n", hr);
     ok(value.vt == VT_LPSTR, "unexpected vt: %i\n", id.vt);
     ok(!strcmp(U(value).pszVal, "Hello World!"), "unexpected value: %s\n", U(value).pszVal);
     PropVariantClear(&value);
 
     hr = IWICMetadataReader_QueryInterface(reader, &IID_IWICMetadataBlockReader, (void**)&blockreader);
-    ok(hr == E_NOINTERFACE, "QueryInterface failed, hr=%x\n", hr);
+    ok(hr == E_NOINTERFACE, "QueryInterface failed, hr=%lx\n", hr);
 
     if (SUCCEEDED(hr))
         IWICMetadataBlockReader_Release(blockreader);
@@ -941,18 +941,18 @@ static void test_metadata_Exif(void)
 
     hr = CoCreateInstance(&CLSID_WICExifMetadataReader, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICMetadataReader, (void**)&reader);
-    todo_wine ok(hr == S_OK, "CoCreateInstance error %#x\n", hr);
+    todo_wine ok(hr == S_OK, "CoCreateInstance error %#lx\n", hr);
     if (FAILED(hr)) return;
 
     hr = IWICMetadataReader_GetCount(reader, NULL);
-    ok(hr == E_INVALIDARG, "GetCount error %#x\n", hr);
+    ok(hr == E_INVALIDARG, "GetCount error %#lx\n", hr);
 
     hr = IWICMetadataReader_GetCount(reader, &count);
-    ok(hr == S_OK, "GetCount error %#x\n", hr);
+    ok(hr == S_OK, "GetCount error %#lx\n", hr);
     ok(count == 0, "unexpected count %u\n", count);
 
     hr = IWICMetadataReader_QueryInterface(reader, &IID_IWICMetadataBlockReader, (void**)&blockreader);
-    ok(hr == E_NOINTERFACE, "QueryInterface failed, hr=%x\n", hr);
+    ok(hr == E_NOINTERFACE, "QueryInterface failed, hr=%lx\n", hr);
 
     if (SUCCEEDED(hr))
         IWICMetadataBlockReader_Release(blockreader);
@@ -971,38 +971,38 @@ static void test_create_reader(void)
 
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICComponentFactory, (void**)&factory);
-    ok(hr == S_OK, "CoCreateInstance failed, hr=%x\n", hr);
+    ok(hr == S_OK, "CoCreateInstance failed, hr=%lx\n", hr);
 
     stream = create_stream(metadata_tEXt, sizeof(metadata_tEXt));
 
     hr = IWICComponentFactory_CreateMetadataReaderFromContainer(factory,
         NULL, NULL, WICPersistOptionDefault,
         stream, &reader);
-    ok(hr == E_INVALIDARG, "CreateMetadataReaderFromContainer failed, hr=%x\n", hr);
+    ok(hr == E_INVALIDARG, "CreateMetadataReaderFromContainer failed, hr=%lx\n", hr);
 
     hr = IWICComponentFactory_CreateMetadataReaderFromContainer(factory,
         &GUID_ContainerFormatPng, NULL, WICPersistOptionDefault,
         NULL, &reader);
-    ok(hr == E_INVALIDARG, "CreateMetadataReaderFromContainer failed, hr=%x\n", hr);
+    ok(hr == E_INVALIDARG, "CreateMetadataReaderFromContainer failed, hr=%lx\n", hr);
 
     hr = IWICComponentFactory_CreateMetadataReaderFromContainer(factory,
         &GUID_ContainerFormatPng, NULL, WICPersistOptionDefault,
         stream, NULL);
-    ok(hr == E_INVALIDARG, "CreateMetadataReaderFromContainer failed, hr=%x\n", hr);
+    ok(hr == E_INVALIDARG, "CreateMetadataReaderFromContainer failed, hr=%lx\n", hr);
 
     hr = IWICComponentFactory_CreateMetadataReaderFromContainer(factory,
         &GUID_ContainerFormatPng, NULL, WICPersistOptionDefault,
         stream, &reader);
-    ok(hr == S_OK, "CreateMetadataReaderFromContainer failed, hr=%x\n", hr);
+    ok(hr == S_OK, "CreateMetadataReaderFromContainer failed, hr=%lx\n", hr);
 
     if (SUCCEEDED(hr))
     {
         hr = IWICMetadataReader_GetCount(reader, &count);
-        ok(hr == S_OK, "GetCount failed, hr=%x\n", hr);
+        ok(hr == S_OK, "GetCount failed, hr=%lx\n", hr);
         ok(count == 1, "unexpected count %i\n", count);
 
         hr = IWICMetadataReader_GetMetadataFormat(reader, &format);
-        ok(hr == S_OK, "GetMetadataFormat failed, hr=%x\n", hr);
+        ok(hr == S_OK, "GetMetadataFormat failed, hr=%lx\n", hr);
         ok(IsEqualGUID(&format, &GUID_MetadataFormatChunktEXt), "unexpected format %s\n", wine_dbgstr_guid(&format));
 
         IWICMetadataReader_Release(reader);
@@ -1011,16 +1011,16 @@ static void test_create_reader(void)
     hr = IWICComponentFactory_CreateMetadataReaderFromContainer(factory,
         &GUID_ContainerFormatWmp, NULL, WICPersistOptionDefault,
         stream, &reader);
-    ok(hr == S_OK, "CreateMetadataReaderFromContainer failed, hr=%x\n", hr);
+    ok(hr == S_OK, "CreateMetadataReaderFromContainer failed, hr=%lx\n", hr);
 
     if (SUCCEEDED(hr))
     {
         hr = IWICMetadataReader_GetCount(reader, &count);
-        ok(hr == S_OK, "GetCount failed, hr=%x\n", hr);
+        ok(hr == S_OK, "GetCount failed, hr=%lx\n", hr);
         ok(count == 1, "unexpected count %i\n", count);
 
         hr = IWICMetadataReader_GetMetadataFormat(reader, &format);
-        ok(hr == S_OK, "GetMetadataFormat failed, hr=%x\n", hr);
+        ok(hr == S_OK, "GetMetadataFormat failed, hr=%lx\n", hr);
         ok(IsEqualGUID(&format, &GUID_MetadataFormatUnknown), "unexpected format %s\n", wine_dbgstr_guid(&format));
 
         IWICMetadataReader_Release(reader);
@@ -1055,60 +1055,60 @@ static void test_metadata_png(void)
 
     hr = CoCreateInstance(&CLSID_WICPngDecoder, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICBitmapDecoder, (void**)&decoder);
-    ok(hr == S_OK, "CoCreateInstance failed, hr=%x\n", hr);
+    ok(hr == S_OK, "CoCreateInstance failed, hr=%lx\n", hr);
 
     if (FAILED(hr)) return;
 
     stream = create_stream(pngimage, sizeof(pngimage));
 
     hr = IWICBitmapDecoder_Initialize(decoder, stream, WICDecodeMetadataCacheOnLoad);
-    ok(hr == S_OK, "Initialize failed, hr=%x\n", hr);
+    ok(hr == S_OK, "Initialize failed, hr=%lx\n", hr);
 
     hr = IWICBitmapDecoder_QueryInterface(decoder, &IID_IWICMetadataBlockReader, (void**)&blockreader);
-    ok(hr == E_NOINTERFACE, "QueryInterface failed, hr=%x\n", hr);
+    ok(hr == E_NOINTERFACE, "QueryInterface failed, hr=%lx\n", hr);
 
     hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
-    ok(hr == S_OK, "GetFrame failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetFrame failed, hr=%lx\n", hr);
 
     hr = IWICBitmapFrameDecode_QueryInterface(frame, &IID_IWICMetadataBlockReader, (void**)&blockreader);
-    ok(hr == S_OK, "QueryInterface failed, hr=%x\n", hr);
+    ok(hr == S_OK, "QueryInterface failed, hr=%lx\n", hr);
 
     if (SUCCEEDED(hr))
     {
         hr = IWICMetadataBlockReader_GetContainerFormat(blockreader, NULL);
-        ok(hr == E_INVALIDARG, "GetContainerFormat failed, hr=%x\n", hr);
+        ok(hr == E_INVALIDARG, "GetContainerFormat failed, hr=%lx\n", hr);
 
         hr = IWICMetadataBlockReader_GetContainerFormat(blockreader, &containerformat);
-        ok(hr == S_OK, "GetContainerFormat failed, hr=%x\n", hr);
+        ok(hr == S_OK, "GetContainerFormat failed, hr=%lx\n", hr);
         ok(IsEqualGUID(&containerformat, &GUID_ContainerFormatPng), "unexpected container format\n");
 
         hr = IWICMetadataBlockReader_GetCount(blockreader, NULL);
-        ok(hr == E_INVALIDARG, "GetCount failed, hr=%x\n", hr);
+        ok(hr == E_INVALIDARG, "GetCount failed, hr=%lx\n", hr);
 
         hr = IWICMetadataBlockReader_GetCount(blockreader, &count);
-        ok(hr == S_OK, "GetCount failed, hr=%x\n", hr);
+        ok(hr == S_OK, "GetCount failed, hr=%lx\n", hr);
         ok(count == 1, "unexpected count %d\n", count);
 
         if (0)
         {
             /* Crashes on Windows XP */
             hr = IWICMetadataBlockReader_GetReaderByIndex(blockreader, 0, NULL);
-            ok(hr == E_INVALIDARG, "GetReaderByIndex failed, hr=%x\n", hr);
+            ok(hr == E_INVALIDARG, "GetReaderByIndex failed, hr=%lx\n", hr);
         }
 
         hr = IWICMetadataBlockReader_GetReaderByIndex(blockreader, 0, &reader);
-        ok(hr == S_OK, "GetReaderByIndex failed, hr=%x\n", hr);
+        ok(hr == S_OK, "GetReaderByIndex failed, hr=%lx\n", hr);
 
         if (SUCCEEDED(hr))
         {
             hr = IWICMetadataReader_GetMetadataFormat(reader, &containerformat);
-            ok(hr == S_OK, "GetMetadataFormat failed, hr=%#x\n", hr);
+            ok(hr == S_OK, "GetMetadataFormat failed, hr=%#lx\n", hr);
             todo_wine ok(IsEqualGUID(&containerformat, &GUID_MetadataFormatChunktIME) ||
                broken(IsEqualGUID(&containerformat, &GUID_MetadataFormatUnknown)) /* Windows XP */,
                "unexpected container format\n");
 
             hr = IWICMetadataReader_GetCount(reader, &count);
-            ok(hr == S_OK, "GetCount error %#x\n", hr);
+            ok(hr == S_OK, "GetCount error %#lx\n", hr);
             todo_wine ok(count == 6 || broken(count == 1) /* XP */, "expected 6, got %u\n", count);
             if (count == 6)
                 compare_metadata(reader, td, count);
@@ -1117,20 +1117,20 @@ static void test_metadata_png(void)
         }
 
         hr = IWICMetadataBlockReader_GetReaderByIndex(blockreader, 1, &reader);
-        todo_wine ok(hr == WINCODEC_ERR_VALUEOUTOFRANGE, "GetReaderByIndex failed, hr=%x\n", hr);
+        todo_wine ok(hr == WINCODEC_ERR_VALUEOUTOFRANGE, "GetReaderByIndex failed, hr=%lx\n", hr);
 
         hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
             &IID_IWICComponentFactory, (void**)&factory);
-        ok(hr == S_OK, "CoCreateInstance failed, hr=%x\n", hr);
+        ok(hr == S_OK, "CoCreateInstance failed, hr=%lx\n", hr);
 
         hr = IWICComponentFactory_CreateQueryReaderFromBlockReader(factory, NULL, &queryreader);
-        ok(hr == E_INVALIDARG, "CreateQueryReaderFromBlockReader should have failed: %08x\n", hr);
+        ok(hr == E_INVALIDARG, "CreateQueryReaderFromBlockReader should have failed: %08lx\n", hr);
 
         hr = IWICComponentFactory_CreateQueryReaderFromBlockReader(factory, blockreader, NULL);
-        ok(hr == E_INVALIDARG, "CreateQueryReaderFromBlockReader should have failed: %08x\n", hr);
+        ok(hr == E_INVALIDARG, "CreateQueryReaderFromBlockReader should have failed: %08lx\n", hr);
 
         hr = IWICComponentFactory_CreateQueryReaderFromBlockReader(factory, blockreader, &queryreader);
-        ok(hr == S_OK, "CreateQueryReaderFromBlockReader failed: %08x\n", hr);
+        ok(hr == S_OK, "CreateQueryReaderFromBlockReader failed: %08lx\n", hr);
 
         IWICMetadataQueryReader_Release(queryreader);
 
@@ -1140,7 +1140,7 @@ static void test_metadata_png(void)
     }
 
     hr = IWICBitmapFrameDecode_GetMetadataQueryReader(frame, &queryreader);
-    ok(hr == S_OK, "GetMetadataQueryReader failed: %08x\n", hr);
+    ok(hr == S_OK, "GetMetadataQueryReader failed: %08lx\n", hr);
 
     if (SUCCEEDED(hr))
     {
@@ -1246,39 +1246,39 @@ static void test_metadata_gif(void)
 
     hr = CoCreateInstance(&CLSID_WICGifDecoder, NULL, CLSCTX_INPROC_SERVER,
                           &IID_IWICBitmapDecoder, (void **)&decoder);
-    ok(hr == S_OK, "CoCreateInstance error %#x\n", hr);
+    ok(hr == S_OK, "CoCreateInstance error %#lx\n", hr);
     hr = IWICBitmapDecoder_Initialize(decoder, stream, WICDecodeMetadataCacheOnLoad);
-    ok(hr == S_OK, "Initialize error %#x\n", hr);
+    ok(hr == S_OK, "Initialize error %#lx\n", hr);
 
     IStream_Release(stream);
 
     /* global metadata block */
     hr = IWICBitmapDecoder_QueryInterface(decoder, &IID_IWICMetadataBlockReader, (void **)&blockreader);
-    ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* before Win7 */, "QueryInterface error %#x\n", hr);
+    ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* before Win7 */, "QueryInterface error %#lx\n", hr);
 
     if (SUCCEEDED(hr))
     {
         hr = IWICMetadataBlockReader_GetContainerFormat(blockreader, &format);
-        ok(hr == S_OK, "GetContainerFormat error %#x\n", hr);
+        ok(hr == S_OK, "GetContainerFormat error %#lx\n", hr);
         ok(IsEqualGUID(&format, &GUID_ContainerFormatGif),
            "wrong container format %s\n", wine_dbgstr_guid(&format));
 
         hr = IWICMetadataBlockReader_GetCount(blockreader, &count);
-        ok(hr == S_OK, "GetCount error %#x\n", hr);
+        ok(hr == S_OK, "GetCount error %#lx\n", hr);
         ok(count == 1, "expected 1, got %u\n", count);
 
         hr = IWICMetadataBlockReader_GetReaderByIndex(blockreader, 0, &reader);
-        ok(hr == S_OK, "GetReaderByIndex error %#x\n", hr);
+        ok(hr == S_OK, "GetReaderByIndex error %#lx\n", hr);
 
         if (SUCCEEDED(hr))
         {
             hr = IWICMetadataReader_GetMetadataFormat(reader, &format);
-            ok(hr == S_OK, "GetMetadataFormat failed, hr=%#x\n", hr);
+            ok(hr == S_OK, "GetMetadataFormat failed, hr=%#lx\n", hr);
             ok(IsEqualGUID(&format, &GUID_MetadataFormatLSD), /* Logical Screen Descriptor */
                "wrong metadata format %s\n", wine_dbgstr_guid(&format));
 
             hr = IWICMetadataReader_GetCount(reader, &count);
-            ok(hr == S_OK, "GetCount error %#x\n", hr);
+            ok(hr == S_OK, "GetCount error %#lx\n", hr);
             ok(count == ARRAY_SIZE(gif_LSD), "unexpected count %u\n", count);
 
             compare_metadata(reader, gif_LSD, count);
@@ -1287,47 +1287,47 @@ static void test_metadata_gif(void)
         }
 
         hr = IWICMetadataBlockReader_GetReaderByIndex(blockreader, 1, &reader);
-        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
 
         IWICMetadataBlockReader_Release(blockreader);
     }
 
     /* frame metadata block */
     hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
-    ok(hr == S_OK, "GetFrame error %#x\n", hr);
+    ok(hr == S_OK, "GetFrame error %#lx\n", hr);
 
     hr = IWICBitmapFrameDecode_QueryInterface(frame, &IID_IWICMetadataBlockReader, (void **)&blockreader);
-    ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* before Win7 */, "QueryInterface error %#x\n", hr);
+    ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* before Win7 */, "QueryInterface error %#lx\n", hr);
 
     if (SUCCEEDED(hr))
     {
         hr = IWICMetadataBlockReader_GetContainerFormat(blockreader, NULL);
-        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
 
         hr = IWICMetadataBlockReader_GetContainerFormat(blockreader, &format);
-        ok(hr == S_OK, "GetContainerFormat error %#x\n", hr);
+        ok(hr == S_OK, "GetContainerFormat error %#lx\n", hr);
         ok(IsEqualGUID(&format, &GUID_ContainerFormatGif),
            "wrong container format %s\n", wine_dbgstr_guid(&format));
 
         hr = IWICMetadataBlockReader_GetCount(blockreader, NULL);
-        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
 
         hr = IWICMetadataBlockReader_GetCount(blockreader, &count);
-        ok(hr == S_OK, "GetCount error %#x\n", hr);
+        ok(hr == S_OK, "GetCount error %#lx\n", hr);
         ok(count == 1, "expected 1, got %u\n", count);
 
         hr = IWICMetadataBlockReader_GetReaderByIndex(blockreader, 0, &reader);
-        ok(hr == S_OK, "GetReaderByIndex error %#x\n", hr);
+        ok(hr == S_OK, "GetReaderByIndex error %#lx\n", hr);
 
         if (SUCCEEDED(hr))
         {
             hr = IWICMetadataReader_GetMetadataFormat(reader, &format);
-            ok(hr == S_OK, "GetMetadataFormat failed, hr=%#x\n", hr);
+            ok(hr == S_OK, "GetMetadataFormat failed, hr=%#lx\n", hr);
             ok(IsEqualGUID(&format, &GUID_MetadataFormatIMD), /* Image Descriptor */
                "wrong metadata format %s\n", wine_dbgstr_guid(&format));
 
             hr = IWICMetadataReader_GetCount(reader, &count);
-            ok(hr == S_OK, "GetCount error %#x\n", hr);
+            ok(hr == S_OK, "GetCount error %#lx\n", hr);
             ok(count == ARRAY_SIZE(gif_IMD), "unexpected count %u\n", count);
 
             compare_metadata(reader, gif_IMD, count);
@@ -1336,7 +1336,7 @@ static void test_metadata_gif(void)
         }
 
         hr = IWICMetadataBlockReader_GetReaderByIndex(blockreader, 1, &reader);
-        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
 
         IWICMetadataBlockReader_Release(blockreader);
     }
@@ -1349,39 +1349,39 @@ static void test_metadata_gif(void)
 
     hr = CoCreateInstance(&CLSID_WICGifDecoder, NULL, CLSCTX_INPROC_SERVER,
                           &IID_IWICBitmapDecoder, (void **)&decoder);
-    ok(hr == S_OK, "CoCreateInstance error %#x\n", hr);
+    ok(hr == S_OK, "CoCreateInstance error %#lx\n", hr);
     hr = IWICBitmapDecoder_Initialize(decoder, stream, WICDecodeMetadataCacheOnLoad);
-    ok(hr == S_OK, "Initialize error %#x\n", hr);
+    ok(hr == S_OK, "Initialize error %#lx\n", hr);
 
     IStream_Release(stream);
 
     /* global metadata block */
     hr = IWICBitmapDecoder_QueryInterface(decoder, &IID_IWICMetadataBlockReader, (void **)&blockreader);
-    ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* before Win7 */, "QueryInterface error %#x\n", hr);
+    ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* before Win7 */, "QueryInterface error %#lx\n", hr);
 
     if (SUCCEEDED(hr))
     {
         hr = IWICMetadataBlockReader_GetContainerFormat(blockreader, &format);
-        ok(hr == S_OK, "GetContainerFormat error %#x\n", hr);
+        ok(hr == S_OK, "GetContainerFormat error %#lx\n", hr);
         ok(IsEqualGUID(&format, &GUID_ContainerFormatGif),
            "wrong container format %s\n", wine_dbgstr_guid(&format));
 
         hr = IWICMetadataBlockReader_GetCount(blockreader, &count);
-        ok(hr == S_OK, "GetCount error %#x\n", hr);
+        ok(hr == S_OK, "GetCount error %#lx\n", hr);
         ok(count == 4, "expected 4, got %u\n", count);
 
         hr = IWICMetadataBlockReader_GetReaderByIndex(blockreader, 0, &reader);
-        ok(hr == S_OK, "GetReaderByIndex error %#x\n", hr);
+        ok(hr == S_OK, "GetReaderByIndex error %#lx\n", hr);
 
         if (SUCCEEDED(hr))
         {
             hr = IWICMetadataReader_GetMetadataFormat(reader, &format);
-            ok(hr == S_OK, "GetMetadataFormat failed, hr=%#x\n", hr);
+            ok(hr == S_OK, "GetMetadataFormat failed, hr=%#lx\n", hr);
             ok(IsEqualGUID(&format, &GUID_MetadataFormatLSD), /* Logical Screen Descriptor */
                "wrong metadata format %s\n", wine_dbgstr_guid(&format));
 
             hr = IWICMetadataReader_GetCount(reader, &count);
-            ok(hr == S_OK, "GetCount error %#x\n", hr);
+            ok(hr == S_OK, "GetCount error %#lx\n", hr);
             ok(count == ARRAY_SIZE(animated_gif_LSD), "unexpected count %u\n", count);
 
             compare_metadata(reader, animated_gif_LSD, count);
@@ -1390,17 +1390,17 @@ static void test_metadata_gif(void)
         }
 
         hr = IWICMetadataBlockReader_GetReaderByIndex(blockreader, 1, &reader);
-        ok(hr == S_OK, "GetReaderByIndex error %#x\n", hr);
+        ok(hr == S_OK, "GetReaderByIndex error %#lx\n", hr);
 
         if (SUCCEEDED(hr))
         {
             hr = IWICMetadataReader_GetMetadataFormat(reader, &format);
-            ok(hr == S_OK, "GetMetadataFormat failed, hr=%#x\n", hr);
+            ok(hr == S_OK, "GetMetadataFormat failed, hr=%#lx\n", hr);
             ok(IsEqualGUID(&format, &GUID_MetadataFormatAPE), /* Application Extension */
                "wrong metadata format %s\n", wine_dbgstr_guid(&format));
 
             hr = IWICMetadataReader_GetCount(reader, &count);
-            ok(hr == S_OK, "GetCount error %#x\n", hr);
+            ok(hr == S_OK, "GetCount error %#lx\n", hr);
             ok(count == ARRAY_SIZE(animated_gif_APE), "unexpected count %u\n", count);
 
             compare_metadata(reader, animated_gif_APE, count);
@@ -1409,17 +1409,17 @@ static void test_metadata_gif(void)
         }
 
         hr = IWICMetadataBlockReader_GetReaderByIndex(blockreader, 2, &reader);
-        ok(hr == S_OK, "GetReaderByIndex error %#x\n", hr);
+        ok(hr == S_OK, "GetReaderByIndex error %#lx\n", hr);
 
         if (SUCCEEDED(hr))
         {
             hr = IWICMetadataReader_GetMetadataFormat(reader, &format);
-            ok(hr == S_OK, "GetMetadataFormat failed, hr=%#x\n", hr);
+            ok(hr == S_OK, "GetMetadataFormat failed, hr=%#lx\n", hr);
             ok(IsEqualGUID(&format, &GUID_MetadataFormatGifComment), /* Comment Extension */
                "wrong metadata format %s\n", wine_dbgstr_guid(&format));
 
             hr = IWICMetadataReader_GetCount(reader, &count);
-            ok(hr == S_OK, "GetCount error %#x\n", hr);
+            ok(hr == S_OK, "GetCount error %#lx\n", hr);
             ok(count == ARRAY_SIZE(animated_gif_comment_1), "unexpected count %u\n", count);
 
             compare_metadata(reader, animated_gif_comment_1, count);
@@ -1428,17 +1428,17 @@ static void test_metadata_gif(void)
         }
 
         hr = IWICMetadataBlockReader_GetReaderByIndex(blockreader, 3, &reader);
-        ok(hr == S_OK, "GetReaderByIndex error %#x\n", hr);
+        ok(hr == S_OK, "GetReaderByIndex error %#lx\n", hr);
 
         if (SUCCEEDED(hr))
         {
             hr = IWICMetadataReader_GetMetadataFormat(reader, &format);
-            ok(hr == S_OK, "GetMetadataFormat failed, hr=%#x\n", hr);
+            ok(hr == S_OK, "GetMetadataFormat failed, hr=%#lx\n", hr);
             ok(IsEqualGUID(&format, &GUID_MetadataFormatUnknown),
                "wrong metadata format %s\n", wine_dbgstr_guid(&format));
 
             hr = IWICMetadataReader_GetCount(reader, &count);
-            ok(hr == S_OK, "GetCount error %#x\n", hr);
+            ok(hr == S_OK, "GetCount error %#lx\n", hr);
             ok(count == ARRAY_SIZE(animated_gif_plain_1), "unexpected count %u\n", count);
 
             compare_metadata(reader, animated_gif_plain_1, count);
@@ -1447,47 +1447,47 @@ static void test_metadata_gif(void)
         }
 
         hr = IWICMetadataBlockReader_GetReaderByIndex(blockreader, 4, &reader);
-        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
 
         IWICMetadataBlockReader_Release(blockreader);
     }
 
     /* frame metadata block */
     hr = IWICBitmapDecoder_GetFrame(decoder, 1, &frame);
-    ok(hr == S_OK, "GetFrame error %#x\n", hr);
+    ok(hr == S_OK, "GetFrame error %#lx\n", hr);
 
     hr = IWICBitmapFrameDecode_QueryInterface(frame, &IID_IWICMetadataBlockReader, (void **)&blockreader);
-    ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* before Win7 */, "QueryInterface error %#x\n", hr);
+    ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* before Win7 */, "QueryInterface error %#lx\n", hr);
 
     if (SUCCEEDED(hr))
     {
         hr = IWICMetadataBlockReader_GetContainerFormat(blockreader, NULL);
-        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
 
         hr = IWICMetadataBlockReader_GetContainerFormat(blockreader, &format);
-        ok(hr == S_OK, "GetContainerFormat error %#x\n", hr);
+        ok(hr == S_OK, "GetContainerFormat error %#lx\n", hr);
         ok(IsEqualGUID(&format, &GUID_ContainerFormatGif),
            "wrong container format %s\n", wine_dbgstr_guid(&format));
 
         hr = IWICMetadataBlockReader_GetCount(blockreader, NULL);
-        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
 
         hr = IWICMetadataBlockReader_GetCount(blockreader, &count);
-        ok(hr == S_OK, "GetCount error %#x\n", hr);
+        ok(hr == S_OK, "GetCount error %#lx\n", hr);
         ok(count == 4, "expected 4, got %u\n", count);
 
         hr = IWICMetadataBlockReader_GetReaderByIndex(blockreader, 0, &reader);
-        ok(hr == S_OK, "GetReaderByIndex error %#x\n", hr);
+        ok(hr == S_OK, "GetReaderByIndex error %#lx\n", hr);
 
         if (SUCCEEDED(hr))
         {
             hr = IWICMetadataReader_GetMetadataFormat(reader, &format);
-            ok(hr == S_OK, "GetMetadataFormat failed, hr=%#x\n", hr);
+            ok(hr == S_OK, "GetMetadataFormat failed, hr=%#lx\n", hr);
             ok(IsEqualGUID(&format, &GUID_MetadataFormatIMD), /* Image Descriptor */
                "wrong metadata format %s\n", wine_dbgstr_guid(&format));
 
             hr = IWICMetadataReader_GetCount(reader, &count);
-            ok(hr == S_OK, "GetCount error %#x\n", hr);
+            ok(hr == S_OK, "GetCount error %#lx\n", hr);
             ok(count == ARRAY_SIZE(animated_gif_IMD), "unexpected count %u\n", count);
 
             compare_metadata(reader, animated_gif_IMD, count);
@@ -1496,17 +1496,17 @@ static void test_metadata_gif(void)
         }
 
         hr = IWICMetadataBlockReader_GetReaderByIndex(blockreader, 1, &reader);
-        ok(hr == S_OK, "GetReaderByIndex error %#x\n", hr);
+        ok(hr == S_OK, "GetReaderByIndex error %#lx\n", hr);
 
         if (SUCCEEDED(hr))
         {
             hr = IWICMetadataReader_GetMetadataFormat(reader, &format);
-            ok(hr == S_OK, "GetMetadataFormat failed, hr=%#x\n", hr);
+            ok(hr == S_OK, "GetMetadataFormat failed, hr=%#lx\n", hr);
             ok(IsEqualGUID(&format, &GUID_MetadataFormatGifComment), /* Comment Extension */
                 "wrong metadata format %s\n", wine_dbgstr_guid(&format));
 
             hr = IWICMetadataReader_GetCount(reader, &count);
-            ok(hr == S_OK, "GetCount error %#x\n", hr);
+            ok(hr == S_OK, "GetCount error %#lx\n", hr);
             ok(count == ARRAY_SIZE(animated_gif_comment_2), "unexpected count %u\n", count);
 
             if (count == 1)
@@ -1516,17 +1516,17 @@ static void test_metadata_gif(void)
         }
 
         hr = IWICMetadataBlockReader_GetReaderByIndex(blockreader, 2, &reader);
-        ok(hr == S_OK, "GetReaderByIndex error %#x\n", hr);
+        ok(hr == S_OK, "GetReaderByIndex error %#lx\n", hr);
 
         if (SUCCEEDED(hr))
         {
             hr = IWICMetadataReader_GetMetadataFormat(reader, &format);
-            ok(hr == S_OK, "GetMetadataFormat failed, hr=%#x\n", hr);
+            ok(hr == S_OK, "GetMetadataFormat failed, hr=%#lx\n", hr);
             ok(IsEqualGUID(&format, &GUID_MetadataFormatUnknown),
                "wrong metadata format %s\n", wine_dbgstr_guid(&format));
 
             hr = IWICMetadataReader_GetCount(reader, &count);
-            ok(hr == S_OK, "GetCount error %#x\n", hr);
+            ok(hr == S_OK, "GetCount error %#lx\n", hr);
             ok(count == ARRAY_SIZE(animated_gif_plain_2), "unexpected count %u\n", count);
 
             compare_metadata(reader, animated_gif_plain_2, count);
@@ -1535,17 +1535,17 @@ static void test_metadata_gif(void)
         }
 
         hr = IWICMetadataBlockReader_GetReaderByIndex(blockreader, 3, &reader);
-        ok(hr == S_OK, "GetReaderByIndex error %#x\n", hr);
+        ok(hr == S_OK, "GetReaderByIndex error %#lx\n", hr);
 
         if (SUCCEEDED(hr))
         {
             hr = IWICMetadataReader_GetMetadataFormat(reader, &format);
-            ok(hr == S_OK, "GetMetadataFormat failed, hr=%#x\n", hr);
+            ok(hr == S_OK, "GetMetadataFormat failed, hr=%#lx\n", hr);
             ok(IsEqualGUID(&format, &GUID_MetadataFormatGCE), /* Graphic Control Extension */
                "wrong metadata format %s\n", wine_dbgstr_guid(&format));
 
             hr = IWICMetadataReader_GetCount(reader, &count);
-            ok(hr == S_OK, "GetCount error %#x\n", hr);
+            ok(hr == S_OK, "GetCount error %#lx\n", hr);
             ok(count == ARRAY_SIZE(animated_gif_GCE), "unexpected count %u\n", count);
 
             compare_metadata(reader, animated_gif_GCE, count);
@@ -1554,14 +1554,14 @@ static void test_metadata_gif(void)
         }
 
         hr = IWICMetadataBlockReader_GetReaderByIndex(blockreader, 4, &reader);
-        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
 
         IWICMetadataBlockReader_Release(blockreader);
     }
 
     hr = IWICBitmapDecoder_GetMetadataQueryReader(decoder, &queryreader);
     ok(hr == S_OK || broken(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION) /* before Vista */,
-       "GetMetadataQueryReader error %#x\n", hr);
+       "GetMetadataQueryReader error %#lx\n", hr);
     if (SUCCEEDED(hr))
     {
         static const struct
@@ -1596,14 +1596,14 @@ static void test_metadata_gif(void)
         IWICMetadataQueryReader *meta_reader;
 
         hr = IWICMetadataQueryReader_GetContainerFormat(queryreader, &format);
-        ok(hr == S_OK, "GetContainerFormat error %#x\n", hr);
+        ok(hr == S_OK, "GetContainerFormat error %#lx\n", hr);
         ok(IsEqualGUID(&format, &GUID_ContainerFormatGif),
            "wrong container format %s\n", wine_dbgstr_guid(&format));
 
         name[0] = 0;
         len = 0xdeadbeef;
         hr = IWICMetadataQueryReader_GetLocation(queryreader, 256, name, &len);
-        ok(hr == S_OK, "GetLocation error %#x\n", hr);
+        ok(hr == S_OK, "GetLocation error %#lx\n", hr);
         ok(len == 2, "expected 2, got %u\n", len);
         ok(!lstrcmpW(name, rootW), "expected '/', got %s\n", wine_dbgstr_w(name));
 
@@ -1616,21 +1616,21 @@ static void test_metadata_gif(void)
             MultiByteToWideChar(CP_ACP, 0, decoder_data[i].query, -1, queryW, 256);
 
             hr = IWICMetadataQueryReader_GetMetadataByName(queryreader, queryW, NULL);
-            ok(hr == decoder_data[i].hr, "GetMetadataByName(%s) returned %#x, expected %#x\n", wine_dbgstr_w(queryW), hr, decoder_data[i].hr);
+            ok(hr == decoder_data[i].hr, "GetMetadataByName(%s) returned %#lx, expected %#lx\n", wine_dbgstr_w(queryW), hr, decoder_data[i].hr);
 
             PropVariantInit(&value);
             hr = IWICMetadataQueryReader_GetMetadataByName(queryreader, queryW, &value);
-            ok(hr == decoder_data[i].hr, "GetMetadataByName(%s) returned %#x, expected %#x\n", wine_dbgstr_w(queryW), hr, decoder_data[i].hr);
+            ok(hr == decoder_data[i].hr, "GetMetadataByName(%s) returned %#lx, expected %#lx\n", wine_dbgstr_w(queryW), hr, decoder_data[i].hr);
             ok(value.vt == decoder_data[i].vt, "expected %#x, got %#x\n", decoder_data[i].vt, value.vt);
             if (hr == S_OK && value.vt == VT_UNKNOWN)
             {
                 hr = IUnknown_QueryInterface(value.punkVal, &IID_IWICMetadataQueryReader, (void **)&meta_reader);
-                ok(hr == S_OK, "QueryInterface error %#x\n", hr);
+                ok(hr == S_OK, "QueryInterface error %#lx\n", hr);
 
                 name[0] = 0;
                 len = 0xdeadbeef;
                 hr = IWICMetadataQueryReader_GetLocation(meta_reader, 256, name, &len);
-                ok(hr == S_OK, "GetLocation error %#x\n", hr);
+                ok(hr == S_OK, "GetLocation error %#lx\n", hr);
                 ok(len == lstrlenW(queryW) + 1, "expected %u, got %u\n", lstrlenW(queryW) + 1, len);
                 ok(!lstrcmpW(name, queryW), "expected %s, got %s\n", wine_dbgstr_w(queryW), wine_dbgstr_w(name));
 
@@ -1644,7 +1644,7 @@ static void test_metadata_gif(void)
                             trace("query: %s\n", wine_dbgstr_w(queryW + len - 1));
                         PropVariantClear(&value);
                         hr = IWICMetadataQueryReader_GetMetadataByName(meta_reader, queryW + len - 1, &value);
-                        ok(hr == decoder_data[j].hr, "GetMetadataByName(%s) returned %#x, expected %#x\n", wine_dbgstr_w(queryW + len - 1), hr, decoder_data[j].hr);
+                        ok(hr == decoder_data[j].hr, "GetMetadataByName(%s) returned %#lx, expected %#lx\n", wine_dbgstr_w(queryW + len - 1), hr, decoder_data[j].hr);
                         ok(value.vt == decoder_data[j].vt, "expected %#x, got %#x\n", decoder_data[j].vt, value.vt);
                     }
                 }
@@ -1660,7 +1660,7 @@ static void test_metadata_gif(void)
 
     hr = IWICBitmapFrameDecode_GetMetadataQueryReader(frame, &queryreader);
     ok(hr == S_OK || broken(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION) /* before Vista */,
-       "GetMetadataQueryReader error %#x\n", hr);
+       "GetMetadataQueryReader error %#lx\n", hr);
     if (SUCCEEDED(hr))
     {
         static const struct
@@ -1699,14 +1699,14 @@ static void test_metadata_gif(void)
         IWICMetadataQueryReader *meta_reader;
 
         hr = IWICMetadataQueryReader_GetContainerFormat(queryreader, &format);
-        ok(hr == S_OK, "GetContainerFormat error %#x\n", hr);
+        ok(hr == S_OK, "GetContainerFormat error %#lx\n", hr);
         ok(IsEqualGUID(&format, &GUID_ContainerFormatGif),
            "wrong container format %s\n", wine_dbgstr_guid(&format));
 
         name[0] = 0;
         len = 0xdeadbeef;
         hr = IWICMetadataQueryReader_GetLocation(queryreader, 256, name, &len);
-        ok(hr == S_OK, "GetLocation error %#x\n", hr);
+        ok(hr == S_OK, "GetLocation error %#lx\n", hr);
         ok(len == 2, "expected 2, got %u\n", len);
         ok(!lstrcmpW(name, rootW), "expected '/', got %s\n", wine_dbgstr_w(name));
 
@@ -1717,17 +1717,17 @@ static void test_metadata_gif(void)
             MultiByteToWideChar(CP_ACP, 0, frame_data[i].query, -1, queryW, 256);
             PropVariantInit(&value);
             hr = IWICMetadataQueryReader_GetMetadataByName(queryreader, queryW, &value);
-            ok(hr == frame_data[i].hr, "GetMetadataByName(%s) returned %#x, expected %#x\n", wine_dbgstr_w(queryW), hr, frame_data[i].hr);
+            ok(hr == frame_data[i].hr, "GetMetadataByName(%s) returned %#lx, expected %#lx\n", wine_dbgstr_w(queryW), hr, frame_data[i].hr);
             ok(value.vt == frame_data[i].vt, "expected %#x, got %#x\n", frame_data[i].vt, value.vt);
             if (hr == S_OK && value.vt == VT_UNKNOWN)
             {
                 hr = IUnknown_QueryInterface(value.punkVal, &IID_IWICMetadataQueryReader, (void **)&meta_reader);
-                ok(hr == S_OK, "QueryInterface error %#x\n", hr);
+                ok(hr == S_OK, "QueryInterface error %#lx\n", hr);
 
                 name[0] = 0;
                 len = 0xdeadbeef;
                 hr = IWICMetadataQueryReader_GetLocation(meta_reader, 256, name, &len);
-                ok(hr == S_OK, "GetLocation error %#x\n", hr);
+                ok(hr == S_OK, "GetLocation error %#lx\n", hr);
                 ok(len == lstrlenW(queryW) + 1, "expected %u, got %u\n", lstrlenW(queryW) + 1, len);
                 ok(!lstrcmpW(name, queryW), "expected %s, got %s\n", wine_dbgstr_w(queryW), wine_dbgstr_w(name));
 
@@ -1740,17 +1740,17 @@ static void test_metadata_gif(void)
         name[0] = 0;
         len = 0xdeadbeef;
         hr = WICMapGuidToShortName(&GUID_MetadataFormatIMD, 256, name, &len);
-        ok(hr == S_OK, "WICMapGuidToShortName error %#x\n", hr);
+        ok(hr == S_OK, "WICMapGuidToShortName error %#lx\n", hr);
         ok(!lstrcmpW(name, imgdescW), "wrong short name %s\n", wine_dbgstr_w(name));
 
         format = GUID_NULL;
         hr = WICMapShortNameToGuid(imgdescW, &format);
-        ok(hr == S_OK, "WICMapGuidToShortName error %#x\n", hr);
+        ok(hr == S_OK, "WICMapGuidToShortName error %#lx\n", hr);
         ok(IsEqualGUID(&format, &GUID_MetadataFormatIMD), "wrong guid %s\n", wine_dbgstr_guid(&format));
 
         format = GUID_NULL;
         hr = WICMapShortNameToGuid(ImgDescW, &format);
-        ok(hr == S_OK, "WICMapGuidToShortName error %#x\n", hr);
+        ok(hr == S_OK, "WICMapGuidToShortName error %#lx\n", hr);
         ok(IsEqualGUID(&format, &GUID_MetadataFormatIMD), "wrong guid %s\n", wine_dbgstr_guid(&format));
 
         lstrcpyW(queryW, guidW);
@@ -1760,7 +1760,7 @@ static void test_metadata_gif(void)
             trace("query: %s\n", wine_dbgstr_w(queryW));
         PropVariantInit(&value);
         hr = IWICMetadataQueryReader_GetMetadataByName(queryreader, queryW, &value);
-        ok(hr == S_OK, "GetMetadataByName(%s) error %#x\n", wine_dbgstr_w(queryW), hr);
+        ok(hr == S_OK, "GetMetadataByName(%s) error %#lx\n", wine_dbgstr_w(queryW), hr);
         ok(value.vt == VT_UNKNOWN, "expected VT_UNKNOWN, got %#x\n", value.vt);
         PropVariantClear(&value);
 
@@ -1801,7 +1801,7 @@ static void test_metadata_LSD(void)
     hr = CoCreateInstance(&CLSID_WICLSDMetadataReader, NULL, CLSCTX_INPROC_SERVER,
                           &IID_IWICMetadataReader, (void **)&reader);
     ok(hr == S_OK || broken(hr == E_NOINTERFACE || hr == REGDB_E_CLASSNOTREG) /* before Win7 */,
-       "CoCreateInstance error %#x\n", hr);
+       "CoCreateInstance error %#lx\n", hr);
 
     stream = create_stream(LSD_data, sizeof(LSD_data));
 
@@ -1809,13 +1809,13 @@ static void test_metadata_LSD(void)
     {
         pos.QuadPart = 6;
         hr = IStream_Seek(stream, pos, SEEK_SET, NULL);
-        ok(hr == S_OK, "IStream_Seek error %#x\n", hr);
+        ok(hr == S_OK, "IStream_Seek error %#lx\n", hr);
 
         hr = IUnknown_QueryInterface(reader, &IID_IWICPersistStream, (void **)&persist);
-        ok(hr == S_OK, "QueryInterface error %#x\n", hr);
+        ok(hr == S_OK, "QueryInterface error %#lx\n", hr);
 
         hr = IWICPersistStream_Load(persist, stream);
-        ok(hr == S_OK, "Load error %#x\n", hr);
+        ok(hr == S_OK, "Load error %#lx\n", hr);
 
         IWICPersistStream_Release(persist);
     }
@@ -1823,24 +1823,24 @@ static void test_metadata_LSD(void)
     if (SUCCEEDED(hr))
     {
         hr = IWICMetadataReader_GetCount(reader, &count);
-        ok(hr == S_OK, "GetCount error %#x\n", hr);
+        ok(hr == S_OK, "GetCount error %#lx\n", hr);
         ok(count == ARRAY_SIZE(td), "unexpected count %u\n", count);
 
         compare_metadata(reader, td, count);
 
         hr = IWICMetadataReader_GetMetadataFormat(reader, &format);
-        ok(hr == S_OK, "GetMetadataFormat error %#x\n", hr);
+        ok(hr == S_OK, "GetMetadataFormat error %#lx\n", hr);
         ok(IsEqualGUID(&format, &GUID_MetadataFormatLSD), "wrong format %s\n", wine_dbgstr_guid(&format));
 
         hr = IWICMetadataReader_GetMetadataHandlerInfo(reader, &info);
-        ok(hr == S_OK, "GetMetadataHandlerInfo error %#x\n", hr);
+        ok(hr == S_OK, "GetMetadataHandlerInfo error %#lx\n", hr);
 
         hr = IWICMetadataHandlerInfo_GetCLSID(info, &id);
-        ok(hr == S_OK, "GetCLSID error %#x\n", hr);
+        ok(hr == S_OK, "GetCLSID error %#lx\n", hr);
         ok(IsEqualGUID(&id, &CLSID_WICLSDMetadataReader), "wrong CLSID %s\n", wine_dbgstr_guid(&id));
 
         hr = IWICMetadataHandlerInfo_GetFriendlyName(info, 64, name, &dummy);
-        ok(hr == S_OK, "GetFriendlyName error %#x\n", hr);
+        ok(hr == S_OK, "GetFriendlyName error %#lx\n", hr);
         ok(lstrcmpW(name, LSD_name) == 0, "wrong LSD reader name %s\n", wine_dbgstr_w(name));
 
         IWICMetadataHandlerInfo_Release(info);
@@ -1879,7 +1879,7 @@ static void test_metadata_IMD(void)
     hr = CoCreateInstance(&CLSID_WICIMDMetadataReader, NULL, CLSCTX_INPROC_SERVER,
                           &IID_IWICMetadataReader, (void **)&reader);
     ok(hr == S_OK || broken(hr == E_NOINTERFACE || hr == REGDB_E_CLASSNOTREG) /* before Win7 */,
-       "CoCreateInstance error %#x\n", hr);
+       "CoCreateInstance error %#lx\n", hr);
 
     stream = create_stream(IMD_data, sizeof(IMD_data));
 
@@ -1887,13 +1887,13 @@ static void test_metadata_IMD(void)
     {
         pos.QuadPart = 12;
         hr = IStream_Seek(stream, pos, SEEK_SET, NULL);
-        ok(hr == S_OK, "IStream_Seek error %#x\n", hr);
+        ok(hr == S_OK, "IStream_Seek error %#lx\n", hr);
 
         hr = IUnknown_QueryInterface(reader, &IID_IWICPersistStream, (void **)&persist);
-        ok(hr == S_OK, "QueryInterface error %#x\n", hr);
+        ok(hr == S_OK, "QueryInterface error %#lx\n", hr);
 
         hr = IWICPersistStream_Load(persist, stream);
-        ok(hr == S_OK, "Load error %#x\n", hr);
+        ok(hr == S_OK, "Load error %#lx\n", hr);
 
         IWICPersistStream_Release(persist);
     }
@@ -1901,24 +1901,24 @@ static void test_metadata_IMD(void)
     if (SUCCEEDED(hr))
     {
         hr = IWICMetadataReader_GetCount(reader, &count);
-        ok(hr == S_OK, "GetCount error %#x\n", hr);
+        ok(hr == S_OK, "GetCount error %#lx\n", hr);
         ok(count == ARRAY_SIZE(td), "unexpected count %u\n", count);
 
         compare_metadata(reader, td, count);
 
         hr = IWICMetadataReader_GetMetadataFormat(reader, &format);
-        ok(hr == S_OK, "GetMetadataFormat error %#x\n", hr);
+        ok(hr == S_OK, "GetMetadataFormat error %#lx\n", hr);
         ok(IsEqualGUID(&format, &GUID_MetadataFormatIMD), "wrong format %s\n", wine_dbgstr_guid(&format));
 
         hr = IWICMetadataReader_GetMetadataHandlerInfo(reader, &info);
-        ok(hr == S_OK, "GetMetadataHandlerInfo error %#x\n", hr);
+        ok(hr == S_OK, "GetMetadataHandlerInfo error %#lx\n", hr);
 
         hr = IWICMetadataHandlerInfo_GetCLSID(info, &id);
-        ok(hr == S_OK, "GetCLSID error %#x\n", hr);
+        ok(hr == S_OK, "GetCLSID error %#lx\n", hr);
         ok(IsEqualGUID(&id, &CLSID_WICIMDMetadataReader), "wrong CLSID %s\n", wine_dbgstr_guid(&id));
 
         hr = IWICMetadataHandlerInfo_GetFriendlyName(info, 64, name, &dummy);
-        ok(hr == S_OK, "GetFriendlyName error %#x\n", hr);
+        ok(hr == S_OK, "GetFriendlyName error %#lx\n", hr);
         ok(lstrcmpW(name, IMD_name) == 0, "wrong IMD reader name %s\n", wine_dbgstr_w(name));
 
         IWICMetadataHandlerInfo_Release(info);
@@ -1954,7 +1954,7 @@ static void test_metadata_GCE(void)
     hr = CoCreateInstance(&CLSID_WICGCEMetadataReader, NULL, CLSCTX_INPROC_SERVER,
                           &IID_IWICMetadataReader, (void **)&reader);
     ok(hr == S_OK || broken(hr == E_NOINTERFACE || hr == REGDB_E_CLASSNOTREG) /* before Win7 */,
-       "CoCreateInstance error %#x\n", hr);
+       "CoCreateInstance error %#lx\n", hr);
 
     stream = create_stream(GCE_data, sizeof(GCE_data));
 
@@ -1962,13 +1962,13 @@ static void test_metadata_GCE(void)
     {
         pos.QuadPart = 12;
         hr = IStream_Seek(stream, pos, SEEK_SET, NULL);
-        ok(hr == S_OK, "IStream_Seek error %#x\n", hr);
+        ok(hr == S_OK, "IStream_Seek error %#lx\n", hr);
 
         hr = IUnknown_QueryInterface(reader, &IID_IWICPersistStream, (void **)&persist);
-        ok(hr == S_OK, "QueryInterface error %#x\n", hr);
+        ok(hr == S_OK, "QueryInterface error %#lx\n", hr);
 
         hr = IWICPersistStream_Load(persist, stream);
-        ok(hr == S_OK, "Load error %#x\n", hr);
+        ok(hr == S_OK, "Load error %#lx\n", hr);
 
         IWICPersistStream_Release(persist);
     }
@@ -1976,24 +1976,24 @@ static void test_metadata_GCE(void)
     if (SUCCEEDED(hr))
     {
         hr = IWICMetadataReader_GetCount(reader, &count);
-        ok(hr == S_OK, "GetCount error %#x\n", hr);
+        ok(hr == S_OK, "GetCount error %#lx\n", hr);
         ok(count == ARRAY_SIZE(td), "unexpected count %u\n", count);
 
         compare_metadata(reader, td, count);
 
         hr = IWICMetadataReader_GetMetadataFormat(reader, &format);
-        ok(hr == S_OK, "GetMetadataFormat error %#x\n", hr);
+        ok(hr == S_OK, "GetMetadataFormat error %#lx\n", hr);
         ok(IsEqualGUID(&format, &GUID_MetadataFormatGCE), "wrong format %s\n", wine_dbgstr_guid(&format));
 
         hr = IWICMetadataReader_GetMetadataHandlerInfo(reader, &info);
-        ok(hr == S_OK, "GetMetadataHandlerInfo error %#x\n", hr);
+        ok(hr == S_OK, "GetMetadataHandlerInfo error %#lx\n", hr);
 
         hr = IWICMetadataHandlerInfo_GetCLSID(info, &id);
-        ok(hr == S_OK, "GetCLSID error %#x\n", hr);
+        ok(hr == S_OK, "GetCLSID error %#lx\n", hr);
         ok(IsEqualGUID(&id, &CLSID_WICGCEMetadataReader), "wrong CLSID %s\n", wine_dbgstr_guid(&id));
 
         hr = IWICMetadataHandlerInfo_GetFriendlyName(info, 64, name, &dummy);
-        ok(hr == S_OK, "GetFriendlyName error %#x\n", hr);
+        ok(hr == S_OK, "GetFriendlyName error %#lx\n", hr);
         ok(lstrcmpW(name, GCE_name) == 0, "wrong GCE reader name %s\n", wine_dbgstr_w(name));
 
         IWICMetadataHandlerInfo_Release(info);
@@ -2031,17 +2031,17 @@ static void test_metadata_APE(void)
     hr = CoCreateInstance(&CLSID_WICAPEMetadataReader, NULL, CLSCTX_INPROC_SERVER,
                           &IID_IWICMetadataReader, (void **)&reader);
     ok(hr == S_OK || broken(hr == E_NOINTERFACE || hr == REGDB_E_CLASSNOTREG) /* before Win7 */,
-       "CoCreateInstance error %#x\n", hr);
+       "CoCreateInstance error %#lx\n", hr);
 
     stream = create_stream(APE_data, sizeof(APE_data));
 
     if (SUCCEEDED(hr))
     {
         hr = IUnknown_QueryInterface(reader, &IID_IWICPersistStream, (void **)&persist);
-        ok(hr == S_OK, "QueryInterface error %#x\n", hr);
+        ok(hr == S_OK, "QueryInterface error %#lx\n", hr);
 
         hr = IWICPersistStream_Load(persist, stream);
-        ok(hr == S_OK, "Load error %#x\n", hr);
+        ok(hr == S_OK, "Load error %#lx\n", hr);
 
         IWICPersistStream_Release(persist);
     }
@@ -2049,13 +2049,13 @@ static void test_metadata_APE(void)
     if (SUCCEEDED(hr))
     {
         hr = IWICMetadataReader_GetCount(reader, &count);
-        ok(hr == S_OK, "GetCount error %#x\n", hr);
+        ok(hr == S_OK, "GetCount error %#lx\n", hr);
         ok(count == ARRAY_SIZE(td), "unexpected count %u\n", count);
 
         compare_metadata(reader, td, count);
 
         hr = IWICMetadataReader_GetMetadataFormat(reader, &format);
-        ok(hr == S_OK, "GetMetadataFormat error %#x\n", hr);
+        ok(hr == S_OK, "GetMetadataFormat error %#lx\n", hr);
         ok(IsEqualGUID(&format, &GUID_MetadataFormatAPE), "wrong format %s\n", wine_dbgstr_guid(&format));
 
         PropVariantInit(&value);
@@ -2063,22 +2063,22 @@ static void test_metadata_APE(void)
         U(id).pwszVal = dataW;
 
         hr = IWICMetadataReader_GetValue(reader, NULL, &id, &value);
-        ok(hr == S_OK, "GetValue error %#x\n", hr);
+        ok(hr == S_OK, "GetValue error %#lx\n", hr);
         ok(value.vt == (VT_UI1|VT_VECTOR), "unexpected vt: %i\n", id.vt);
-        ok(td[1].count == U(value).caub.cElems, "expected cElems %d, got %d\n", td[1].count, U(value).caub.cElems);
+        ok(td[1].count == U(value).caub.cElems, "expected cElems %d, got %ld\n", td[1].count, U(value).caub.cElems);
         for (i = 0; i < U(value).caub.cElems; i++)
-            ok(td[1].value[i] == U(value).caub.pElems[i], "%u: expected value %#x/%#x, got %#x\n", i, (ULONG)td[1].value[i], (ULONG)(td[1].value[i] >> 32), U(value).caub.pElems[i]);
+            ok(td[1].value[i] == U(value).caub.pElems[i], "%u: expected value %#lx/%#lx, got %#x\n", i, (ULONG)td[1].value[i], (ULONG)(td[1].value[i] >> 32), U(value).caub.pElems[i]);
         PropVariantClear(&value);
 
         hr = IWICMetadataReader_GetMetadataHandlerInfo(reader, &info);
-        ok(hr == S_OK, "GetMetadataHandlerInfo error %#x\n", hr);
+        ok(hr == S_OK, "GetMetadataHandlerInfo error %#lx\n", hr);
 
         hr = IWICMetadataHandlerInfo_GetCLSID(info, &clsid);
-        ok(hr == S_OK, "GetCLSID error %#x\n", hr);
+        ok(hr == S_OK, "GetCLSID error %#lx\n", hr);
         ok(IsEqualGUID(&clsid, &CLSID_WICAPEMetadataReader), "wrong CLSID %s\n", wine_dbgstr_guid(&clsid));
 
         hr = IWICMetadataHandlerInfo_GetFriendlyName(info, 64, name, &dummy);
-        ok(hr == S_OK, "GetFriendlyName error %#x\n", hr);
+        ok(hr == S_OK, "GetFriendlyName error %#lx\n", hr);
         ok(lstrcmpW(name, APE_name) == 0, "wrong APE reader name %s\n", wine_dbgstr_w(name));
 
         IWICMetadataHandlerInfo_Release(info);
@@ -2115,17 +2115,17 @@ static void test_metadata_GIF_comment(void)
     hr = CoCreateInstance(&CLSID_WICGifCommentMetadataReader, NULL, CLSCTX_INPROC_SERVER,
                           &IID_IWICMetadataReader, (void **)&reader);
     ok(hr == S_OK || broken(hr == E_NOINTERFACE || hr == REGDB_E_CLASSNOTREG) /* before Win7 */,
-       "CoCreateInstance error %#x\n", hr);
+       "CoCreateInstance error %#lx\n", hr);
 
     stream = create_stream(GIF_comment_data, sizeof(GIF_comment_data));
 
     if (SUCCEEDED(hr))
     {
         hr = IUnknown_QueryInterface(reader, &IID_IWICPersistStream, (void **)&persist);
-        ok(hr == S_OK, "QueryInterface error %#x\n", hr);
+        ok(hr == S_OK, "QueryInterface error %#lx\n", hr);
 
         hr = IWICPersistStream_Load(persist, stream);
-        ok(hr == S_OK, "Load error %#x\n", hr);
+        ok(hr == S_OK, "Load error %#lx\n", hr);
 
         IWICPersistStream_Release(persist);
     }
@@ -2133,13 +2133,13 @@ static void test_metadata_GIF_comment(void)
     if (SUCCEEDED(hr))
     {
         hr = IWICMetadataReader_GetCount(reader, &count);
-        ok(hr == S_OK, "GetCount error %#x\n", hr);
+        ok(hr == S_OK, "GetCount error %#lx\n", hr);
         ok(count == ARRAY_SIZE(td), "unexpected count %u\n", count);
 
         compare_metadata(reader, td, count);
 
         hr = IWICMetadataReader_GetMetadataFormat(reader, &format);
-        ok(hr == S_OK, "GetMetadataFormat error %#x\n", hr);
+        ok(hr == S_OK, "GetMetadataFormat error %#lx\n", hr);
         ok(IsEqualGUID(&format, &GUID_MetadataFormatGifComment), "wrong format %s\n", wine_dbgstr_guid(&format));
 
         PropVariantInit(&value);
@@ -2147,20 +2147,20 @@ static void test_metadata_GIF_comment(void)
         U(id).pwszVal = text_entryW;
 
         hr = IWICMetadataReader_GetValue(reader, NULL, &id, &value);
-        ok(hr == S_OK, "GetValue error %#x\n", hr);
+        ok(hr == S_OK, "GetValue error %#lx\n", hr);
         ok(value.vt == VT_LPSTR, "unexpected vt: %i\n", id.vt);
         ok(!strcmp(U(value).pszVal, "Hello World!"), "unexpected value: %s\n", U(value).pszVal);
         PropVariantClear(&value);
 
         hr = IWICMetadataReader_GetMetadataHandlerInfo(reader, &info);
-        ok(hr == S_OK, "GetMetadataHandlerInfo error %#x\n", hr);
+        ok(hr == S_OK, "GetMetadataHandlerInfo error %#lx\n", hr);
 
         hr = IWICMetadataHandlerInfo_GetCLSID(info, &clsid);
-        ok(hr == S_OK, "GetCLSID error %#x\n", hr);
+        ok(hr == S_OK, "GetCLSID error %#lx\n", hr);
         ok(IsEqualGUID(&clsid, &CLSID_WICGifCommentMetadataReader), "wrong CLSID %s\n", wine_dbgstr_guid(&clsid));
 
         hr = IWICMetadataHandlerInfo_GetFriendlyName(info, 64, name, &dummy);
-        ok(hr == S_OK, "GetFriendlyName error %#x\n", hr);
+        ok(hr == S_OK, "GetFriendlyName error %#lx\n", hr);
         ok(lstrcmpW(name, GIF_comment_name) == 0, "wrong APE reader name %s\n", wine_dbgstr_w(name));
 
         IWICMetadataHandlerInfo_Release(info);
@@ -2181,50 +2181,50 @@ static void test_WICMapGuidToShortName(void)
     name[0] = 0;
     len = 0xdeadbeef;
     hr = WICMapGuidToShortName(&GUID_MetadataFormatUnknown, 8, name, &len);
-    ok(hr == S_OK, "got %#x\n", hr);
+    ok(hr == S_OK, "got %#lx\n", hr);
     ok(len == 8, "got %u\n", len);
     ok(!lstrcmpW(name, unknownW), "got %s\n", wine_dbgstr_w(name));
 
     name[0] = 0;
     hr = WICMapGuidToShortName(&GUID_MetadataFormatUnknown, 8, name, NULL);
-    ok(hr == S_OK, "got %#x\n", hr);
+    ok(hr == S_OK, "got %#lx\n", hr);
     ok(!lstrcmpW(name, unknownW), "got %s\n", wine_dbgstr_w(name));
 
     len = 0xdeadbeef;
     hr = WICMapGuidToShortName(&GUID_MetadataFormatUnknown, 8, NULL, &len);
-    ok(hr == S_OK, "got %#x\n", hr);
+    ok(hr == S_OK, "got %#lx\n", hr);
     ok(len == 8, "got %u\n", len);
 
     len = 0xdeadbeef;
     hr = WICMapGuidToShortName(&GUID_MetadataFormatUnknown, 0, NULL, &len);
-    ok(hr == S_OK, "got %#x\n", hr);
+    ok(hr == S_OK, "got %#lx\n", hr);
     ok(len == 8, "got %u\n", len);
 
     hr = WICMapGuidToShortName(&GUID_MetadataFormatUnknown, 0, NULL, NULL);
-    ok(hr == S_OK, "got %#x\n", hr);
+    ok(hr == S_OK, "got %#lx\n", hr);
 
     hr = WICMapGuidToShortName(&GUID_MetadataFormatUnknown, 8, NULL, NULL);
-    ok(hr == S_OK, "got %#x\n", hr);
+    ok(hr == S_OK, "got %#lx\n", hr);
 
     hr = WICMapGuidToShortName(&GUID_NULL, 0, NULL, NULL);
-    ok(hr == WINCODEC_ERR_PROPERTYNOTFOUND, "got %#x\n", hr);
+    ok(hr == WINCODEC_ERR_PROPERTYNOTFOUND, "got %#lx\n", hr);
 
     name[0] = 0;
     len = 0xdeadbeef;
     hr = WICMapGuidToShortName(&GUID_MetadataFormatUnknown, 4, name, &len);
-    ok(hr == HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), "got %#x\n", hr);
+    ok(hr == HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), "got %#lx\n", hr);
     ok(len == 0xdeadbeef, "got %u\n", len);
     ok(!lstrcmpW(name, unkW), "got %s\n", wine_dbgstr_w(name));
 
     name[0] = 0;
     len = 0xdeadbeef;
     hr = WICMapGuidToShortName(&GUID_MetadataFormatUnknown, 0, name, &len);
-    ok(hr == E_INVALIDARG, "got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "got %#lx\n", hr);
     ok(len == 0xdeadbeef, "got %u\n", len);
     ok(!name[0], "got %s\n", wine_dbgstr_w(name));
 
     hr = WICMapGuidToShortName(NULL, 8, name, NULL);
-    ok(hr == E_INVALIDARG, "got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "got %#lx\n", hr);
 }
 
 static void test_WICMapShortNameToGuid(void)
@@ -2237,28 +2237,28 @@ static void test_WICMapShortNameToGuid(void)
     GUID guid;
 
     hr = WICMapShortNameToGuid(NULL, NULL);
-    ok(hr == E_INVALIDARG, "got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "got %#lx\n", hr);
 
     hr = WICMapShortNameToGuid(NULL, &guid);
-    ok(hr == E_INVALIDARG, "got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "got %#lx\n", hr);
 
     hr = WICMapShortNameToGuid(unknownW, NULL);
-    ok(hr == E_INVALIDARG, "got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "got %#lx\n", hr);
 
     hr = WICMapShortNameToGuid(unkW, &guid);
-    ok(hr == WINCODEC_ERR_PROPERTYNOTFOUND, "got %#x\n", hr);
+    ok(hr == WINCODEC_ERR_PROPERTYNOTFOUND, "got %#lx\n", hr);
 
     hr = WICMapShortNameToGuid(unknownW, &guid);
-    ok(hr == S_OK, "got %#x\n", hr);
+    ok(hr == S_OK, "got %#lx\n", hr);
     ok(IsEqualGUID(&guid, &GUID_MetadataFormatUnknown), "got %s\n", wine_dbgstr_guid(&guid));
 
     hr = WICMapShortNameToGuid(xmpW, &guid);
-    ok(hr == S_OK, "got %#x\n", hr);
+    ok(hr == S_OK, "got %#lx\n", hr);
     ok(IsEqualGUID(&guid, &GUID_MetadataFormatXMP), "got %s\n", wine_dbgstr_guid(&guid));
 
     guid = GUID_NULL;
     hr = WICMapShortNameToGuid(XmPW, &guid);
-    ok(hr == S_OK, "got %#x\n", hr);
+    ok(hr == S_OK, "got %#lx\n", hr);
     ok(IsEqualGUID(&guid, &GUID_MetadataFormatXMP), "got %s\n", wine_dbgstr_guid(&guid));
 }
 
@@ -2378,56 +2378,56 @@ static void test_WICMapSchemaToName(void)
     WCHAR name[16];
 
     hr = WICMapSchemaToName(&GUID_MetadataFormatUnknown, NULL, 0, NULL, NULL);
-    ok(hr == E_INVALIDARG, "got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "got %#lx\n", hr);
 
     hr = WICMapSchemaToName(&GUID_MetadataFormatUnknown, schemaW, 0, NULL, NULL);
-    ok(hr == E_INVALIDARG, "got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "got %#lx\n", hr);
 
     hr = WICMapSchemaToName(&GUID_MetadataFormatUnknown, schemaW, 0, NULL, &len);
-    ok(hr == WINCODEC_ERR_PROPERTYNOTFOUND, "got %#x\n", hr);
+    ok(hr == WINCODEC_ERR_PROPERTYNOTFOUND, "got %#lx\n", hr);
 
     hr = WICMapSchemaToName(NULL, schemaW, 0, NULL, &len);
-    ok(hr == E_INVALIDARG, "got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "got %#lx\n", hr);
 
     hr = WICMapSchemaToName(&GUID_MetadataFormatXMP, schemaW, 0, NULL, NULL);
-    ok(hr == E_INVALIDARG, "got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "got %#lx\n", hr);
 
     len = 0xdeadbeef;
     hr = WICMapSchemaToName(&GUID_MetadataFormatXMP, schemaW, 0, NULL, &len);
-    ok(hr == S_OK, "got %#x\n", hr);
+    ok(hr == S_OK, "got %#lx\n", hr);
     ok(len == 4, "got %u\n", len);
 
     len = 0xdeadbeef;
     hr = WICMapSchemaToName(&GUID_MetadataFormatXMP, schemaW, 4, NULL, &len);
-    ok(hr == S_OK, "got %#x\n", hr);
+    ok(hr == S_OK, "got %#lx\n", hr);
     ok(len == 4, "got %u\n", len);
 
     len = 0xdeadbeef;
     hr = WICMapSchemaToName(&GUID_MetadataFormatXMP, SCHEMAW, 0, NULL, &len);
-    ok(hr == WINCODEC_ERR_PROPERTYNOTFOUND, "got %#x\n", hr);
+    ok(hr == WINCODEC_ERR_PROPERTYNOTFOUND, "got %#lx\n", hr);
     ok(len == 0xdeadbeef, "got %u\n", len);
 
     name[0] = 0;
     len = 0xdeadbeef;
     hr = WICMapSchemaToName(&GUID_MetadataFormatXMP, schemaW, 4, name, &len);
-    ok(hr == S_OK, "got %#x\n", hr);
+    ok(hr == S_OK, "got %#lx\n", hr);
     ok(len == 4, "got %u\n", len);
     ok(!lstrcmpW(name, xmpW), "got %s\n", wine_dbgstr_w(name));
 
     len = 0xdeadbeef;
     hr = WICMapSchemaToName(&GUID_MetadataFormatXMP, schemaW, 0, name, &len);
-    ok(hr == E_INVALIDARG, "got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "got %#lx\n", hr);
     ok(len == 0xdeadbeef, "got %u\n", len);
 
     name[0] = 0;
     len = 0xdeadbeef;
     hr = WICMapSchemaToName(&GUID_MetadataFormatXMP, schemaW, 3, name, &len);
-    ok(hr == HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), "got %#x\n", hr);
+    ok(hr == HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), "got %#lx\n", hr);
     ok(len == 0xdeadbeef, "got %u\n", len);
     ok(!lstrcmpW(name, xmW), "got %s\n", wine_dbgstr_w(name));
 
     hr = WICMapSchemaToName(&GUID_MetadataFormatXMP, schemaW, 4, name, NULL);
-    ok(hr == E_INVALIDARG, "got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "got %#lx\n", hr);
 
     /* Check whether modern schemas are supported */
     hr = WICMapSchemaToName(&GUID_MetadataFormatXMP, schema_list[0], 0, NULL, &len);
@@ -2966,17 +2966,17 @@ static void test_queryreader(void)
 
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
             &IID_IWICComponentFactory, (void **)&factory);
-    ok(hr == S_OK, "CoCreateInstance error %#x\n", hr);
+    ok(hr == S_OK, "CoCreateInstance error %#lx\n", hr);
 
     hr = IWICComponentFactory_CreateQueryReaderFromBlockReader(factory, &mdbr, &reader);
-    ok(hr == S_OK, "CreateQueryReaderFromBlockReader error %#x\n", hr);
+    ok(hr == S_OK, "CreateQueryReaderFromBlockReader error %#lx\n", hr);
 
     for (i = 0; i < ARRAY_SIZE(test_data); i++)
     {
         current_metadata = test_data[i].data;
 
         hr = IWICMetadataQueryReader_GetContainerFormat(reader, &format);
-        ok(hr == S_OK, "%u: GetContainerFormat error %#x\n", i, hr);
+        ok(hr == S_OK, "%u: GetContainerFormat error %#lx\n", i, hr);
         ok(IsEqualGUID(&format, test_data[i].data->container_format), "%u: expected %s, got %s\n",
            i, wine_dbgstr_guid(test_data[i].data->container_format), wine_dbgstr_guid(&format));
 
@@ -2984,7 +2984,7 @@ static void test_queryreader(void)
         PropVariantInit(&value);
         hr = IWICMetadataQueryReader_GetMetadataByName(reader, queryW, &value);
         todo_wine_if(test_data[i].todo)
-        ok(hr == test_data[i].hr, "%u: expected %#x, got %#x\n", i, test_data[i].hr, hr);
+        ok(hr == test_data[i].hr, "%u: expected %#lx, got %#lx\n", i, test_data[i].hr, hr);
         if (hr == S_OK)
         {
             ok(value.vt == test_data[i].vt, "%u: expected %u, got %u\n", i, test_data[i].vt, value.vt);
@@ -2997,44 +2997,44 @@ static void test_queryreader(void)
                     UINT len;
 
                     hr = IUnknown_QueryInterface(value.punkVal, &IID_IWICMetadataQueryReader, (void **)&new_reader);
-                    ok(hr == S_OK, "QueryInterface error %#x\n", hr);
+                    ok(hr == S_OK, "QueryInterface error %#lx\n", hr);
 
                     location[0] = 0;
                     len = 0xdeadbeef;
                     hr = IWICMetadataQueryReader_GetLocation(new_reader, 256, location, &len);
-                    ok(hr == S_OK, "GetLocation error %#x\n", hr);
+                    ok(hr == S_OK, "GetLocation error %#lx\n", hr);
                     ok(len == lstrlenW(queryW) + 1, "expected %u, got %u\n", lstrlenW(queryW) + 1, len);
                     ok(!lstrcmpW(location, queryW), "expected %s, got %s\n", wine_dbgstr_w(queryW), wine_dbgstr_w(location));
 
                     hr = IWICMetadataQueryReader_GetLocation(new_reader, 256, location, NULL);
-                    ok(hr == E_INVALIDARG, "got %#x\n", hr);
+                    ok(hr == E_INVALIDARG, "got %#lx\n", hr);
 
                     location[0] = 0;
                     len = 0xdeadbeef;
                     hr = IWICMetadataQueryReader_GetLocation(new_reader, 3, location, &len);
-                    ok(hr == WINCODEC_ERR_INSUFFICIENTBUFFER, "got %#x\n", hr);
+                    ok(hr == WINCODEC_ERR_INSUFFICIENTBUFFER, "got %#lx\n", hr);
                     ok(len == 0xdeadbeef, "got %u\n", len);
                     ok(!location[0], "got %s\n", wine_dbgstr_w(location));
 
                     location[0] = 0;
                     len = 0xdeadbeef;
                     hr = IWICMetadataQueryReader_GetLocation(new_reader, 0, location, &len);
-                    ok(hr == WINCODEC_ERR_INSUFFICIENTBUFFER, "got %#x\n", hr);
+                    ok(hr == WINCODEC_ERR_INSUFFICIENTBUFFER, "got %#lx\n", hr);
                     ok(len == 0xdeadbeef, "got %u\n", len);
                     ok(!location[0], "got %s\n", wine_dbgstr_w(location));
 
                     len = 0xdeadbeef;
                     hr = IWICMetadataQueryReader_GetLocation(new_reader, 0, NULL, &len);
-                    ok(hr == S_OK, "GetLocation error %#x\n", hr);
+                    ok(hr == S_OK, "GetLocation error %#lx\n", hr);
                     ok(len == lstrlenW(queryW) + 1, "expected %u, got %u\n", lstrlenW(queryW) + 1, len);
 
                     len = 0xdeadbeef;
                     hr = IWICMetadataQueryReader_GetLocation(new_reader, 3, NULL, &len);
-                    ok(hr == S_OK, "GetLocation error %#x\n", hr);
+                    ok(hr == S_OK, "GetLocation error %#lx\n", hr);
                     ok(len == lstrlenW(queryW) + 1, "expected %u, got %u\n", lstrlenW(queryW) + 1, len);
 
                     hr = IWICMetadataQueryReader_GetLocation(new_reader, 0, NULL, NULL);
-                    ok(hr == E_INVALIDARG, "got %#x\n", hr);
+                    ok(hr == E_INVALIDARG, "got %#lx\n", hr);
 
                     IWICMetadataQueryReader_Release(new_reader);
                     PropVariantClear(&value);
@@ -3092,7 +3092,7 @@ static void test_metadata_writer(void)
     {
         hr = CoCreateInstance(tests[i].rclsid, NULL, CLSCTX_INPROC_SERVER,
                 &IID_IWICBitmapEncoder, (void **)&encoder);
-        todo_wine_if(!tests[i].wine_supports_encoder) ok(hr == S_OK, "Got unexpected hr %#x, i %u.\n", hr, i);
+        todo_wine_if(!tests[i].wine_supports_encoder) ok(hr == S_OK, "Got unexpected hr %#lx, i %u.\n", hr, i);
         if (FAILED(hr))
             continue;
 
@@ -3100,34 +3100,34 @@ static void test_metadata_writer(void)
         querywriter = querywriter2 = NULL;
 
         hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
-        ok(hr == S_OK, "Got unexpected hr %#x, i %u.\n", hr, i);
+        ok(hr == S_OK, "Got unexpected hr %#lx, i %u.\n", hr, i);
         hr = IWICBitmapEncoder_Initialize(encoder, stream, WICBitmapEncoderNoCache);
-        ok(hr == S_OK, "Got unexpected hr %#x, i %u.\n", hr, i);
+        ok(hr == S_OK, "Got unexpected hr %#lx, i %u.\n", hr, i);
         hr = IWICBitmapEncoder_CreateNewFrame(encoder, &frameencode, NULL);
-        ok(hr == S_OK, "Got unexpected hr %#x, i %u.\n", hr, i);
+        ok(hr == S_OK, "Got unexpected hr %#lx, i %u.\n", hr, i);
 
         hr = IWICBitmapFrameEncode_QueryInterface(frameencode, &IID_IWICMetadataBlockWriter, (void**)&blockwriter);
-        ok(hr == (tests[i].metadata_supported ? S_OK : E_NOINTERFACE), "Got unexpected hr %#x, i %u.\n", hr, i);
+        ok(hr == (tests[i].metadata_supported ? S_OK : E_NOINTERFACE), "Got unexpected hr %#lx, i %u.\n", hr, i);
 
         hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
                 &IID_IWICComponentFactory, (void**)&factory);
-        ok(hr == S_OK, "Got unexpected hr %#x, i %u.\n", hr, i);
+        ok(hr == S_OK, "Got unexpected hr %#lx, i %u.\n", hr, i);
 
         hr = IWICComponentFactory_CreateQueryWriterFromBlockWriter(factory, blockwriter, &querywriter);
-        ok(hr == (tests[i].metadata_supported ? S_OK : E_INVALIDARG), "Got unexpected hr %#x, i %u.\n", hr, i);
+        ok(hr == (tests[i].metadata_supported ? S_OK : E_INVALIDARG), "Got unexpected hr %#lx, i %u.\n", hr, i);
 
         hr = IWICBitmapFrameEncode_GetMetadataQueryWriter(frameencode, &querywriter2);
         ok(hr == (tests[i].succeeds_uninitialized ? S_OK : WINCODEC_ERR_NOTINITIALIZED),
-                "Got unexpected hr %#x, i %u.\n", hr, i);
+                "Got unexpected hr %#lx, i %u.\n", hr, i);
         if (hr == S_OK)
             IWICMetadataQueryWriter_Release(querywriter2);
 
         hr = IWICBitmapFrameEncode_Initialize(frameencode, NULL);
-        ok(hr == S_OK, "Got unexpected hr %#x, i %u.\n", hr, i);
+        ok(hr == S_OK, "Got unexpected hr %#lx, i %u.\n", hr, i);
 
         hr = IWICBitmapFrameEncode_GetMetadataQueryWriter(frameencode, &querywriter2);
         ok(hr == (tests[i].metadata_supported ? S_OK : WINCODEC_ERR_UNSUPPORTEDOPERATION),
-                "Got unexpected hr %#x, i %u.\n", hr, i);
+                "Got unexpected hr %#lx, i %u.\n", hr, i);
 
         if (tests[i].metadata_supported)
             ok(querywriter2 != querywriter, "Got unexpected interfaces %p, %p, i %u.\n", querywriter, querywriter2, i);
@@ -3136,32 +3136,32 @@ static void test_metadata_writer(void)
         if (querywriter)
         {
             ref = get_refcount(querywriter);
-            ok(ref == 1, "Got unexpected ref %u, i %u.\n", ref, i);
+            ok(ref == 1, "Got unexpected ref %lu, i %u.\n", ref, i);
 
             hr = IWICMetadataQueryWriter_QueryInterface(querywriter, &IID_IEnumString, (void **)&enumstring);
-            ok(hr == E_NOINTERFACE, "Got unexpected hr %#x, i %u.\n", hr, i);
+            ok(hr == E_NOINTERFACE, "Got unexpected hr %#lx, i %u.\n", hr, i);
 
             hr = IWICMetadataQueryWriter_GetEnumerator(querywriter, &enumstring);
-            ok(hr == S_OK, "Got unexpected hr %#x, i %u.\n", hr, i);
+            ok(hr == S_OK, "Got unexpected hr %#lx, i %u.\n", hr, i);
 
             ref = get_refcount(querywriter);
-            ok(ref == 1, "Got unexpected ref %u, i %u.\n", ref, i);
+            ok(ref == 1, "Got unexpected ref %lu, i %u.\n", ref, i);
 
             hr = IEnumString_Skip(enumstring, 0);
-            ok(hr == S_OK, "Got unexpected hr %#x, i %u.\n", hr, i);
+            ok(hr == S_OK, "Got unexpected hr %#lx, i %u.\n", hr, i);
 
             count = 0xdeadbeef;
             hr = IEnumString_Next(enumstring, 0, NULL, &count);
-            ok(hr == E_INVALIDARG, "Got unexpected hr %#x, i %u.\n", hr, i);
-            ok(count == 0xdeadbeef, "Got unexpected count %u, i %u.\n", count, i);
+            ok(hr == E_INVALIDARG, "Got unexpected hr %#lx, i %u.\n", hr, i);
+            ok(count == 0xdeadbeef, "Got unexpected count %lu, i %u.\n", count, i);
 
             hr = IEnumString_Next(enumstring, 0, &olestring, &count);
-            ok(hr == S_OK || hr == WINCODEC_ERR_VALUEOUTOFRANGE, "Got unexpected hr %#x, i %u.\n", hr, i);
+            ok(hr == S_OK || hr == WINCODEC_ERR_VALUEOUTOFRANGE, "Got unexpected hr %#lx, i %u.\n", hr, i);
 
             count = 0xdeadbeef;
             hr = IEnumString_Next(enumstring, 1, &olestring, &count);
-            ok(hr == S_OK || hr == S_FALSE, "Got unexpected hr %#x, i %u.\n", hr, i);
-            ok((hr && !count) || (!hr && count == 1), "Got unexpected hr %#x, count %u, i %u.\n", hr, count, i);
+            ok(hr == S_OK || hr == S_FALSE, "Got unexpected hr %#lx, i %u.\n", hr, i);
+            ok((hr && !count) || (!hr && count == 1), "Got unexpected hr %#lx, count %lu, i %u.\n", hr, count, i);
             if (count)
             {
                 CoTaskMemFree(olestring);
@@ -3169,10 +3169,10 @@ static void test_metadata_writer(void)
                 /* IEnumString_Skip() crashes at least on Win7 when
                  * trying to skip past the string count. */
                 hr = IEnumString_Reset(enumstring);
-                ok(hr == S_OK, "Got unexpected hr %#x, i %u.\n", hr, i);
+                ok(hr == S_OK, "Got unexpected hr %#lx, i %u.\n", hr, i);
 
                 hr = IEnumString_Skip(enumstring, 1);
-                ok(hr == S_OK, "Got unexpected hr %#x, i %u.\n", hr, i);
+                ok(hr == S_OK, "Got unexpected hr %#lx, i %u.\n", hr, i);
             }
             IEnumString_Release(enumstring);
 
diff --git a/dlls/windowscodecs/tests/palette.c b/dlls/windowscodecs/tests/palette.c
index d07b936ca9e..85860b3d03b 100644
--- a/dlls/windowscodecs/tests/palette.c
+++ b/dlls/windowscodecs/tests/palette.c
@@ -40,165 +40,165 @@ static void test_custom_palette(void)
     BOOL boolresult;
 
     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-    ok(SUCCEEDED(hr), "CreatePalette failed, hr=%x\n", hr);
+    ok(SUCCEEDED(hr), "CreatePalette failed, hr=%lx\n", hr);
     if (SUCCEEDED(hr))
     {
         hr = IWICPalette_GetType(palette, &type);
-        ok(SUCCEEDED(hr), "GetType failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "GetType failed, hr=%lx\n", hr);
         ok(type == WICBitmapPaletteTypeCustom, "expected WICBitmapPaletteTypeCustom, got %x\n", type);
 
         hr = IWICPalette_GetColorCount(palette, &count);
-        ok(SUCCEEDED(hr), "GetColorCount failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "GetColorCount failed, hr=%lx\n", hr);
         ok(count == 0, "expected 0, got %u\n", count);
 
         hr = IWICPalette_GetColors(palette, 0, colors, &count);
-        ok(SUCCEEDED(hr), "GetColors failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "GetColors failed, hr=%lx\n", hr);
         ok(count == 0, "expected 0, got %u\n", count);
 
         hr = IWICPalette_GetColors(palette, 4, colors, &count);
-        ok(SUCCEEDED(hr), "GetColors failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "GetColors failed, hr=%lx\n", hr);
         ok(count == 0, "expected 0, got %u\n", count);
 
         memcpy(colors, initcolors, sizeof(initcolors));
         hr = IWICPalette_InitializeCustom(palette, colors, 4);
-        ok(SUCCEEDED(hr), "InitializeCustom failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "InitializeCustom failed, hr=%lx\n", hr);
 
         hr = IWICPalette_GetType(palette, &type);
-        ok(SUCCEEDED(hr), "GetType failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "GetType failed, hr=%lx\n", hr);
         ok(type == WICBitmapPaletteTypeCustom, "expected WICBitmapPaletteTypeCustom, got %x\n", type);
 
         hr = IWICPalette_GetColorCount(palette, &count);
-        ok(SUCCEEDED(hr), "GetColorCount failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "GetColorCount failed, hr=%lx\n", hr);
         ok(count == 4, "expected 4, got %u\n", count);
 
         memset(colors, 0, sizeof(colors));
         count = 0;
         hr = IWICPalette_GetColors(palette, 4, colors, &count);
-        ok(SUCCEEDED(hr), "GetColors failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "GetColors failed, hr=%lx\n", hr);
         ok(count == 4, "expected 4, got %u\n", count);
         ok(!memcmp(colors, initcolors, sizeof(colors)), "got unexpected palette data\n");
 
         memset(colors, 0, sizeof(colors));
         count = 0;
         hr = IWICPalette_GetColors(palette, 2, colors, &count);
-        ok(SUCCEEDED(hr), "GetColors failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "GetColors failed, hr=%lx\n", hr);
         ok(count == 2, "expected 2, got %u\n", count);
         ok(!memcmp(colors, initcolors, sizeof(WICColor)*2), "got unexpected palette data\n");
 
         count = 0;
         hr = IWICPalette_GetColors(palette, 6, colors, &count);
-        ok(SUCCEEDED(hr), "GetColors failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "GetColors failed, hr=%lx\n", hr);
         ok(count == 4, "expected 4, got %u\n", count);
 
         hr = IWICPalette_HasAlpha(palette, &boolresult);
-        ok(SUCCEEDED(hr), "HasAlpha failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "HasAlpha failed, hr=%lx\n", hr);
         ok(!boolresult, "expected FALSE, got TRUE\n");
 
         hr = IWICPalette_IsBlackWhite(palette, &boolresult);
-        ok(SUCCEEDED(hr), "IsBlackWhite failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "IsBlackWhite failed, hr=%lx\n", hr);
         ok(!boolresult, "expected FALSE, got TRUE\n");
 
         hr = IWICPalette_IsGrayscale(palette, &boolresult);
-        ok(SUCCEEDED(hr), "IsGrayscale failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "IsGrayscale failed, hr=%lx\n", hr);
         ok(!boolresult, "expected FALSE, got TRUE\n");
 
         hr = IWICImagingFactory_CreatePalette(factory, &palette2);
-        ok(SUCCEEDED(hr), "CreatePalette failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "CreatePalette failed, hr=%lx\n", hr);
 
         hr = IWICPalette_InitializeFromPalette(palette2, palette);
-        ok(SUCCEEDED(hr), "InitializeFromPalette failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "InitializeFromPalette failed, hr=%lx\n", hr);
 
         type = 0xdeadbeef;
         hr = IWICPalette_GetType(palette2, &type);
-        ok(SUCCEEDED(hr), "GetType failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "GetType failed, hr=%lx\n", hr);
         ok(type == WICBitmapPaletteTypeCustom, "expected WICBitmapPaletteTypeCustom, got %x\n", type);
 
         count = 0xdeadbeef;
         hr = IWICPalette_GetColorCount(palette2, &count);
-        ok(SUCCEEDED(hr), "GetColorCount failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "GetColorCount failed, hr=%lx\n", hr);
         ok(count == 4, "expected 4, got %u\n", count);
 
         memset(colors, 0, sizeof(colors));
         count = 0xdeadbeef;
         hr = IWICPalette_GetColors(palette2, 4, colors, &count);
-        ok(SUCCEEDED(hr), "GetColors failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "GetColors failed, hr=%lx\n", hr);
         ok(count == 4, "expected 4, got %u\n", count);
         ok(!memcmp(colors, initcolors, sizeof(colors)), "got unexpected palette data\n");
 
         /* try a palette with some alpha in it */
         colors[2] = 0x80ffffff;
         hr = IWICPalette_InitializeCustom(palette, colors, 4);
-        ok(SUCCEEDED(hr), "InitializeCustom failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "InitializeCustom failed, hr=%lx\n", hr);
 
         hr = IWICPalette_HasAlpha(palette, &boolresult);
-        ok(SUCCEEDED(hr), "HasAlpha failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "HasAlpha failed, hr=%lx\n", hr);
         ok(boolresult, "expected TRUE, got FALSE\n");
 
         /* setting to a 0-color palette is acceptable */
         hr = IWICPalette_InitializeCustom(palette, NULL, 0);
-        ok(SUCCEEDED(hr), "InitializeCustom failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "InitializeCustom failed, hr=%lx\n", hr);
 
         type = 0xdeadbeef;
         hr = IWICPalette_GetType(palette, &type);
-        ok(SUCCEEDED(hr), "GetType failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "GetType failed, hr=%lx\n", hr);
         ok(type == WICBitmapPaletteTypeCustom, "expected WICBitmapPaletteTypeCustom, got %x\n", type);
 
         count = 0xdeadbeef;
         hr = IWICPalette_GetColorCount(palette, &count);
-        ok(SUCCEEDED(hr), "GetColorCount failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "GetColorCount failed, hr=%lx\n", hr);
         ok(count == 0, "expected 0, got %u\n", count);
 
         count = 0xdeadbeef;
         hr = IWICPalette_GetColors(palette, 4, colors, &count);
-        ok(SUCCEEDED(hr), "GetColors failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "GetColors failed, hr=%lx\n", hr);
         ok(count == 0, "expected 0, got %u\n", count);
 
         hr = IWICPalette_InitializeFromPalette(palette2, palette);
-        ok(SUCCEEDED(hr), "InitializeFromPalette failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "InitializeFromPalette failed, hr=%lx\n", hr);
 
         type = 0xdeadbeef;
         hr = IWICPalette_GetType(palette2, &type);
-        ok(SUCCEEDED(hr), "GetType failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "GetType failed, hr=%lx\n", hr);
         ok(type == WICBitmapPaletteTypeCustom, "expected WICBitmapPaletteTypeCustom, got %x\n", type);
 
         count = 0xdeadbeef;
         hr = IWICPalette_GetColorCount(palette2, &count);
-        ok(SUCCEEDED(hr), "GetColorCount failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "GetColorCount failed, hr=%lx\n", hr);
         ok(count == 0, "expected 0, got %u\n", count);
 
         memset(colors, 0, sizeof(colors));
         count = 0xdeadbeef;
         hr = IWICPalette_GetColors(palette2, 4, colors, &count);
-        ok(SUCCEEDED(hr), "GetColors failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "GetColors failed, hr=%lx\n", hr);
         ok(count == 0, "expected 0, got %u\n", count);
 
         /* IWICPalette is paranoid about NULL pointers */
         hr = IWICPalette_GetType(palette, NULL);
-        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %x\n", hr);
+        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %lx\n", hr);
 
         hr = IWICPalette_GetColorCount(palette, NULL);
-        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %x\n", hr);
+        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %lx\n", hr);
 
         hr = IWICPalette_InitializeCustom(palette, NULL, 4);
-        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %x\n", hr);
+        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %lx\n", hr);
 
         hr = IWICPalette_GetColors(palette, 4, NULL, &count);
-        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %x\n", hr);
+        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %lx\n", hr);
 
         hr = IWICPalette_GetColors(palette, 4, colors, NULL);
-        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %x\n", hr);
+        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %lx\n", hr);
 
         hr = IWICPalette_HasAlpha(palette, NULL);
-        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %x\n", hr);
+        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %lx\n", hr);
 
         hr = IWICPalette_IsBlackWhite(palette, NULL);
-        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %x\n", hr);
+        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %lx\n", hr);
 
         hr = IWICPalette_IsGrayscale(palette, NULL);
-        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %x\n", hr);
+        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %lx\n", hr);
 
         hr = IWICPalette_InitializeFromPalette(palette, NULL);
-        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %x\n", hr);
+        ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %lx\n", hr);
 
         IWICPalette_Release(palette2);
         IWICPalette_Release(palette);
@@ -453,47 +453,47 @@ static void test_predefined_palette(void)
     WICColor color[256];
 
     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-    ok(hr == S_OK, "CreatePalette error %#x\n", hr);
+    ok(hr == S_OK, "CreatePalette error %#lx\n", hr);
     hr = IWICPalette_InitializePredefined(palette, WICBitmapPaletteTypeCustom, FALSE);
-    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
     hr = IWICPalette_InitializePredefined(palette, WICBitmapPaletteTypeMedianCut, FALSE);
-    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
     hr = IWICPalette_InitializePredefined(palette, 0x0f, FALSE);
-    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
     IWICPalette_Release(palette);
 
     for (i = 0; i < ARRAY_SIZE(td); i++)
     {
         hr = IWICImagingFactory_CreatePalette(factory, &palette);
-        ok(hr == S_OK, "%u: CreatePalette error %#x\n", i, hr);
+        ok(hr == S_OK, "%u: CreatePalette error %#lx\n", i, hr);
 
         hr = IWICPalette_InitializePredefined(palette, td[i].type, td[i].add_transparent);
-        ok(hr == S_OK, "%u: InitializePredefined error %#x\n", i, hr);
+        ok(hr == S_OK, "%u: InitializePredefined error %#lx\n", i, hr);
 
         bret = -1;
         hr = IWICPalette_IsBlackWhite(palette, &bret);
-        ok(hr == S_OK, "%u: IsBlackWhite error %#x\n", i, hr);
+        ok(hr == S_OK, "%u: IsBlackWhite error %#lx\n", i, hr);
         ok(bret == td[i].is_bw ||
            broken(td[i].type == WICBitmapPaletteTypeFixedBW && bret != td[i].is_bw), /* XP */
            "%u: expected %d, got %d\n",i, td[i].is_bw, bret);
 
         bret = -1;
         hr = IWICPalette_IsGrayscale(palette, &bret);
-        ok(hr == S_OK, "%u: IsGrayscale error %#x\n", i, hr);
+        ok(hr == S_OK, "%u: IsGrayscale error %#lx\n", i, hr);
         ok(bret == td[i].is_gray, "%u: expected %d, got %d\n", i, td[i].is_gray, bret);
 
         type = -1;
         hr = IWICPalette_GetType(palette, &type);
-        ok(hr == S_OK, "%u: GetType error %#x\n", i, hr);
+        ok(hr == S_OK, "%u: GetType error %#lx\n", i, hr);
         ok(type == td[i].type, "%u: expected %#x, got %#x\n", i, td[i].type, type);
 
         count = 0xdeadbeef;
         hr = IWICPalette_GetColorCount(palette, &count);
-        ok(hr == S_OK, "%u: GetColorCount error %#x\n", i, hr);
+        ok(hr == S_OK, "%u: GetColorCount error %#lx\n", i, hr);
         ok(count == td[i].count, "%u: expected %u, got %u\n", i, td[i].count, count);
 
         hr = IWICPalette_GetColors(palette, count, color, &ret);
-        ok(hr == S_OK, "%u: GetColors error %#x\n", i, hr);
+        ok(hr == S_OK, "%u: GetColors error %#lx\n", i, hr);
         ok(ret == count, "%u: expected %u, got %u\n", i, count, ret);
         if (ret == td[i].count)
         {
@@ -571,68 +571,68 @@ static void test_palette_from_bitmap(void)
 
     hr = IWICImagingFactory_CreateBitmapFromMemory(factory, width, height, &GUID_WICPixelFormat24bppRGB,
                                                    stride, stride * height, data, &bitmap);
-    ok(hr == S_OK, "CreateBitmapFromMemory error %#x\n", hr);
+    ok(hr == S_OK, "CreateBitmapFromMemory error %#lx\n", hr);
 
     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-    ok(hr == S_OK, "CreatePalette error %#x\n", hr);
+    ok(hr == S_OK, "CreatePalette error %#lx\n", hr);
 
     hr = IWICPalette_InitializeFromBitmap(palette, (IWICBitmapSource *)bitmap, 0, FALSE);
-    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
 
     hr = IWICPalette_InitializeFromBitmap(palette, (IWICBitmapSource *)bitmap, 1, FALSE);
-    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
 
     hr = IWICPalette_InitializeFromBitmap(palette, (IWICBitmapSource *)bitmap, 257, FALSE);
-    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
 
     hr = IWICPalette_InitializeFromBitmap(palette, NULL, 16, FALSE);
-    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
 
     hr = IWICPalette_InitializeFromBitmap(palette, (IWICBitmapSource *)bitmap, 2, FALSE);
-    ok(hr == S_OK, "InitializeFromBitmap error %#x\n", hr);
+    ok(hr == S_OK, "InitializeFromBitmap error %#lx\n", hr);
     count = 0;
     hr = IWICPalette_GetColorCount(palette, &count);
-    ok(hr == S_OK, "GetColorCount error %#x\n", hr);
+    ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
     ok(count == 2, "expected 2, got %u\n", count);
 
     hr = IWICPalette_InitializeFromBitmap(palette, (IWICBitmapSource *)bitmap, 2, TRUE);
-    ok(hr == S_OK, "InitializeFromBitmap error %#x\n", hr);
+    ok(hr == S_OK, "InitializeFromBitmap error %#lx\n", hr);
     count = 0;
     hr = IWICPalette_GetColorCount(palette, &count);
-    ok(hr == S_OK, "GetColorCount error %#x\n", hr);
+    ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
     ok(count == 2, "expected 2, got %u\n", count);
 
     /* without transparent color */
     hr = IWICPalette_InitializeFromBitmap(palette, (IWICBitmapSource *)bitmap, 16, FALSE);
-    ok(hr == S_OK, "InitializeFromBitmap error %#x\n", hr);
+    ok(hr == S_OK, "InitializeFromBitmap error %#lx\n", hr);
     type = -1;
     hr = IWICPalette_GetType(palette, &type);
-    ok(hr == S_OK, "GetType error %#x\n", hr);
+    ok(hr == S_OK, "GetType error %#lx\n", hr);
     ok(type == WICBitmapPaletteTypeCustom, "expected WICBitmapPaletteTypeCustom, got %#x\n", type);
     count = 0;
     hr = IWICPalette_GetColorCount(palette, &count);
-    ok(hr == S_OK, "GetColorCount error %#x\n", hr);
+    ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
     ok(count == 16, "expected 16, got %u\n", count);
     memset(color, 0, sizeof(color));
     hr = IWICPalette_GetColors(palette, count, color, &ret);
-    ok(hr == S_OK, "GetColors error %#x\n", hr);
+    ok(hr == S_OK, "GetColors error %#lx\n", hr);
     ok(ret == count, "expected %u, got %u\n", count, ret);
     ok(color[count - 1] != 0, "expected !0, got %08x\n", color[count - 1]);
 
     /* with transparent color */
     hr = IWICPalette_InitializeFromBitmap(palette, (IWICBitmapSource *)bitmap, 16, TRUE);
-    ok(hr == S_OK, "InitializeFromBitmap error %#x\n", hr);
+    ok(hr == S_OK, "InitializeFromBitmap error %#lx\n", hr);
     type = -1;
     hr = IWICPalette_GetType(palette, &type);
-    ok(hr == S_OK, "GetType error %#x\n", hr);
+    ok(hr == S_OK, "GetType error %#lx\n", hr);
     ok(type == WICBitmapPaletteTypeCustom, "expected WICBitmapPaletteTypeCustom, got %#x\n", type);
     count = 0;
     hr = IWICPalette_GetColorCount(palette, &count);
-    ok(hr == S_OK, "GetColorCount error %#x\n", hr);
+    ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
     ok(count == 16, "expected 16, got %u\n", count);
     memset(color, 0xff, sizeof(color));
     hr = IWICPalette_GetColors(palette, count, color, &ret);
-    ok(hr == S_OK, "GetColors error %#x\n", hr);
+    ok(hr == S_OK, "GetColors error %#lx\n", hr);
     ok(ret == count, "expected %u, got %u\n", count, ret);
     ok(color[count - 1] == 0, "expected 0, got %08x\n", color[count - 1]);
 
@@ -650,7 +650,7 @@ START_TEST(palette)
 
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
                           &IID_IWICImagingFactory, (void **)&factory);
-    ok(hr == S_OK, "CoCreateInstance error %#x\n", hr);
+    ok(hr == S_OK, "CoCreateInstance error %#lx\n", hr);
 
     test_custom_palette();
     test_predefined_palette();
diff --git a/dlls/windowscodecs/tests/pngformat.c b/dlls/windowscodecs/tests/pngformat.c
index 875e97cc320..1181ebbe369 100644
--- a/dlls/windowscodecs/tests/pngformat.c
+++ b/dlls/windowscodecs/tests/pngformat.c
@@ -294,7 +294,7 @@ static HRESULT create_decoder(const void *image_data, UINT image_size, IWICBitma
     if (hr == S_OK)
     {
         hr = IWICBitmapDecoder_GetContainerFormat(*decoder, &format);
-        ok(hr == S_OK, "GetContainerFormat error %#x\n", hr);
+        ok(hr == S_OK, "GetContainerFormat error %#lx\n", hr);
         ok(IsEqualGUID(&format, &GUID_ContainerFormatPng),
            "wrong container format %s\n", wine_dbgstr_guid(&format));
 
@@ -346,182 +346,182 @@ static void test_color_contexts(void)
     BOOL ret;
 
     hr = create_decoder(png_no_color_profile, sizeof(png_no_color_profile), &decoder);
-    ok(hr == S_OK, "Failed to load PNG image data %#x\n", hr);
+    ok(hr == S_OK, "Failed to load PNG image data %#lx\n", hr);
     if (hr != S_OK) return;
 
     /* global color context */
     hr = IWICBitmapDecoder_GetColorContexts(decoder, 0, NULL, NULL);
-    ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "GetColorContexts error %#x\n", hr);
+    ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "GetColorContexts error %#lx\n", hr);
 
     count = 0xdeadbeef;
     hr = IWICBitmapDecoder_GetColorContexts(decoder, 0, NULL, &count);
-    ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "GetColorContexts error %#x\n", hr);
+    ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "GetColorContexts error %#lx\n", hr);
     ok(count == 0xdeadbeef, "unexpected count %u\n", count);
 
     /* frame color context */
     hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
-    ok(hr == S_OK, "GetFrame error %#x\n", hr);
+    ok(hr == S_OK, "GetFrame error %#lx\n", hr);
 
     hr = IWICBitmapFrameDecode_GetColorContexts(frame, 0, NULL, NULL);
-    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
 
     count = 0xdeadbeef;
     hr = IWICBitmapFrameDecode_GetColorContexts(frame, 0, NULL, &count);
-    ok(hr == S_OK, "GetColorContexts error %#x\n", hr);
+    ok(hr == S_OK, "GetColorContexts error %#lx\n", hr);
     ok(!count, "unexpected count %u\n", count);
 
     IWICBitmapFrameDecode_Release(frame);
     IWICBitmapDecoder_Release(decoder);
 
     hr = create_decoder(png_color_profile, sizeof(png_color_profile), &decoder);
-    ok(hr == S_OK, "Failed to load PNG image data %#x\n", hr);
+    ok(hr == S_OK, "Failed to load PNG image data %#lx\n", hr);
     if (hr != S_OK) return;
 
     /* global color context */
     count = 0xdeadbeef;
     hr = IWICBitmapDecoder_GetColorContexts(decoder, 0, NULL, &count);
-    ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "GetColorContexts error %#x\n", hr);
+    ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "GetColorContexts error %#lx\n", hr);
     ok(count == 0xdeadbeef, "unexpected count %u\n", count);
 
     /* frame color context */
     hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
-    ok(hr == S_OK, "GetFrame error %#x\n", hr);
+    ok(hr == S_OK, "GetFrame error %#lx\n", hr);
 
     count = 0xdeadbeef;
     hr = IWICBitmapFrameDecode_GetColorContexts(frame, 0, NULL, &count);
-    ok(hr == S_OK, "GetColorContexts error %#x\n", hr);
+    ok(hr == S_OK, "GetColorContexts error %#lx\n", hr);
     ok(count == 1, "unexpected count %u\n", count);
 
     hr = IWICImagingFactory_CreateColorContext(factory, NULL);
-    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
 
     hr = IWICImagingFactory_CreateColorContext(factory, &context);
-    ok(hr == S_OK, "CreateColorContext error %#x\n", hr);
+    ok(hr == S_OK, "CreateColorContext error %#lx\n", hr);
 
     hr = IWICColorContext_GetType(context, NULL);
-    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
 
     type = 0xdeadbeef;
     hr = IWICColorContext_GetType(context, &type);
-    ok(hr == S_OK, "GetType error %#x\n", hr);
+    ok(hr == S_OK, "GetType error %#lx\n", hr);
     ok(type == WICColorContextUninitialized, "unexpected type %u\n", type);
 
     hr = IWICColorContext_GetProfileBytes(context, 0, NULL, NULL);
-    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "GetProfileBytes error %#x\n", hr);
+    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "GetProfileBytes error %#lx\n", hr);
 
     size = 0;
     hr = IWICColorContext_GetProfileBytes(context, 0, NULL, &size);
-    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "GetProfileBytes error %#x\n", hr);
+    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "GetProfileBytes error %#lx\n", hr);
     ok(!size, "unexpected size %u\n", size);
 
     hr = IWICColorContext_GetExifColorSpace(context, NULL);
-    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
 
     colorspace = 0xdeadbeef;
     hr = IWICColorContext_GetExifColorSpace(context, &colorspace);
-    ok(hr == S_OK, "GetExifColorSpace error %#x\n", hr);
+    ok(hr == S_OK, "GetExifColorSpace error %#lx\n", hr);
     ok(colorspace == 0xffffffff, "unexpected color space %u\n", colorspace);
 
     hr = IWICColorContext_InitializeFromExifColorSpace(context, 0);
-    ok(hr == S_OK, "InitializeFromExifColorSpace error %#x\n", hr);
+    ok(hr == S_OK, "InitializeFromExifColorSpace error %#lx\n", hr);
 
     hr = IWICColorContext_InitializeFromExifColorSpace(context, 1);
-    ok(hr == S_OK, "InitializeFromExifColorSpace error %#x\n", hr);
+    ok(hr == S_OK, "InitializeFromExifColorSpace error %#lx\n", hr);
 
     hr = IWICColorContext_InitializeFromExifColorSpace(context, 2);
-    ok(hr == S_OK, "InitializeFromExifColorSpace error %#x\n", hr);
+    ok(hr == S_OK, "InitializeFromExifColorSpace error %#lx\n", hr);
 
     colorspace = 0xdeadbeef;
     hr = IWICColorContext_GetExifColorSpace(context, &colorspace);
-    ok(hr == S_OK, "GetExifColorSpace error %#x\n", hr);
+    ok(hr == S_OK, "GetExifColorSpace error %#lx\n", hr);
     ok(colorspace == 2, "unexpected color space %u\n", colorspace);
 
     size = 0;
     hr = IWICColorContext_GetProfileBytes(context, 0, NULL, &size);
-    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "GetProfileBytes error %#x\n", hr);
+    ok(hr == WINCODEC_ERR_NOTINITIALIZED, "GetProfileBytes error %#lx\n", hr);
     ok(!size, "unexpected size %u\n", size);
 
     type = 0xdeadbeef;
     hr = IWICColorContext_GetType(context, &type);
-    ok(hr == S_OK, "GetType error %#x\n", hr);
+    ok(hr == S_OK, "GetType error %#lx\n", hr);
     ok(type == WICColorContextExifColorSpace, "unexpected type %u\n", type);
 
     hr = IWICBitmapFrameDecode_GetColorContexts(frame, count, &context, &count);
-    ok(hr == WINCODEC_ERR_WRONGSTATE, "GetColorContexts error %#x\n", hr);
+    ok(hr == WINCODEC_ERR_WRONGSTATE, "GetColorContexts error %#lx\n", hr);
 
     IWICColorContext_Release(context);
     IWICBitmapFrameDecode_Release(frame);
 
     hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
-    ok(hr == S_OK, "GetFrame error %#x\n", hr);
+    ok(hr == S_OK, "GetFrame error %#lx\n", hr);
 
     hr = IWICImagingFactory_CreateColorContext(factory, &context);
-    ok(hr == S_OK, "CreateColorContext error %#x\n", hr);
+    ok(hr == S_OK, "CreateColorContext error %#lx\n", hr);
 
     count = 1;
     hr = IWICBitmapFrameDecode_GetColorContexts(frame, count, &context, &count);
-    ok(hr == S_OK, "GetColorContexts error %#x\n", hr);
+    ok(hr == S_OK, "GetColorContexts error %#lx\n", hr);
 
     hr = IWICColorContext_GetProfileBytes(context, 0, NULL, NULL);
-    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+    ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr);
 
     size = 0;
     hr = IWICColorContext_GetProfileBytes(context, 0, NULL, &size);
-    ok(hr == S_OK, "GetProfileBytes error %#x\n", hr);
+    ok(hr == S_OK, "GetProfileBytes error %#lx\n", hr);
     ok(size, "unexpected size %u\n", size);
 
     buffer = HeapAlloc(GetProcessHeap(), 0, size);
     hr = IWICColorContext_GetProfileBytes(context, size, buffer, &size);
-    ok(hr == S_OK, "GetProfileBytes error %#x\n", hr);
+    ok(hr == S_OK, "GetProfileBytes error %#lx\n", hr);
 
     tmpfile = save_profile( buffer, size );
     HeapFree(GetProcessHeap(), 0, buffer);
 
     type = 0xdeadbeef;
     hr = IWICColorContext_GetType(context, &type);
-    ok(hr == S_OK, "GetType error %#x\n", hr);
+    ok(hr == S_OK, "GetType error %#lx\n", hr);
     ok(type == WICColorContextProfile, "unexpected type %u\n", type);
 
     colorspace = 0xdeadbeef;
     hr = IWICColorContext_GetExifColorSpace(context, &colorspace);
-    ok(hr == S_OK, "GetExifColorSpace error %#x\n", hr);
+    ok(hr == S_OK, "GetExifColorSpace error %#lx\n", hr);
     ok(colorspace == 0xffffffff, "unexpected color space %u\n", colorspace);
 
     hr = IWICColorContext_InitializeFromExifColorSpace(context, 1);
-    ok(hr == WINCODEC_ERR_WRONGSTATE, "InitializeFromExifColorSpace error %#x\n", hr);
+    ok(hr == WINCODEC_ERR_WRONGSTATE, "InitializeFromExifColorSpace error %#lx\n", hr);
 
     if (tmpfile)
     {
         hr = IWICColorContext_InitializeFromFilename(context, NULL);
-        ok(hr == E_INVALIDARG, "InitializeFromFilename error %#x\n", hr);
+        ok(hr == E_INVALIDARG, "InitializeFromFilename error %#lx\n", hr);
 
         hr = IWICColorContext_InitializeFromFilename(context, tmpfile);
-        ok(hr == S_OK, "InitializeFromFilename error %#x\n", hr);
+        ok(hr == S_OK, "InitializeFromFilename error %#lx\n", hr);
 
         ret = DeleteFileW(tmpfile);
-        ok(ret, "DeleteFileW failed %u\n", GetLastError());
+        ok(ret, "DeleteFileW failed %lu\n", GetLastError());
 
         type = 0xdeadbeef;
         hr = IWICColorContext_GetType(context, &type);
-        ok(hr == S_OK, "GetType error %#x\n", hr);
+        ok(hr == S_OK, "GetType error %#lx\n", hr);
         ok(type == WICColorContextProfile, "unexpected type %u\n", type);
 
         colorspace = 0xdeadbeef;
         hr = IWICColorContext_GetExifColorSpace(context, &colorspace);
-        ok(hr == S_OK, "GetExifColorSpace error %#x\n", hr);
+        ok(hr == S_OK, "GetExifColorSpace error %#lx\n", hr);
         ok(colorspace == 0xffffffff, "unexpected color space %u\n", colorspace);
 
         hr = IWICColorContext_InitializeFromExifColorSpace(context, 1);
-        ok(hr == WINCODEC_ERR_WRONGSTATE, "InitializeFromExifColorSpace error %#x\n", hr);
+        ok(hr == WINCODEC_ERR_WRONGSTATE, "InitializeFromExifColorSpace error %#lx\n", hr);
 
         size = 0;
         hr = IWICColorContext_GetProfileBytes(context, 0, NULL, &size);
-        ok(hr == S_OK, "GetProfileBytes error %#x\n", hr);
+        ok(hr == S_OK, "GetProfileBytes error %#lx\n", hr);
         ok(size, "unexpected size %u\n", size);
 
         buffer = HeapAlloc(GetProcessHeap(), 0, size);
         hr = IWICColorContext_GetProfileBytes(context, size, buffer, &size);
-        ok(hr == S_OK, "GetProfileBytes error %#x\n", hr);
+        ok(hr == S_OK, "GetProfileBytes error %#lx\n", hr);
 
         HeapFree(GetProcessHeap(), 0, buffer);
         HeapFree(GetProcessHeap(), 0, tmpfile);
@@ -562,28 +562,28 @@ static void test_png_palette(void)
     char *buf;
 
     hr = create_decoder(png_PLTE_tRNS, sizeof(png_PLTE_tRNS), &decoder);
-    ok(hr == S_OK, "Failed to load PNG image data %#x\n", hr);
+    ok(hr == S_OK, "Failed to load PNG image data %#lx\n", hr);
     if (hr != S_OK) return;
 
     hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
-    ok(hr == S_OK, "GetFrame error %#x\n", hr);
+    ok(hr == S_OK, "GetFrame error %#lx\n", hr);
 
     hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format);
-    ok(hr == S_OK, "GetPixelFormat error %#x\n", hr);
+    ok(hr == S_OK, "GetPixelFormat error %#lx\n", hr);
     ok(IsEqualGUID(&format, &GUID_WICPixelFormat1bppIndexed),
        "got wrong format %s\n", wine_dbgstr_guid(&format));
 
     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-    ok(hr == S_OK, "CreatePalette error %#x\n", hr);
+    ok(hr == S_OK, "CreatePalette error %#lx\n", hr);
     hr = IWICBitmapFrameDecode_CopyPalette(frame, palette);
-    ok(hr == S_OK, "CopyPalette error %#x\n", hr);
+    ok(hr == S_OK, "CopyPalette error %#lx\n", hr);
 
     hr = IWICPalette_GetColorCount(palette, &count);
-    ok(hr == S_OK, "GetColorCount error %#x\n", hr);
+    ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
     ok(count == 2, "expected 2, got %u\n", count);
 
     hr = IWICPalette_GetColors(palette, 256, color, &ret);
-    ok(hr == S_OK, "GetColors error %#x\n", hr);
+    ok(hr == S_OK, "GetColors error %#lx\n", hr);
     ok(ret == count, "expected %u, got %u\n", count, ret);
     ok(color[0] == 0xff010203, "expected 0xff010203, got %#x\n", color[0]);
     ok(color[1] == 0x00040506, "expected 0x00040506, got %#x\n", color[1]);
@@ -593,21 +593,21 @@ static void test_png_palette(void)
     IWICBitmapDecoder_Release(decoder);
 
     hr = create_decoder(png_gray_tRNS, sizeof(png_gray_tRNS), &decoder);
-    ok(hr == S_OK, "Failed to load PNG image data %#x\n", hr);
+    ok(hr == S_OK, "Failed to load PNG image data %#lx\n", hr);
     if (hr != S_OK) return;
 
     hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
-    ok(hr == S_OK, "GetFrame error %#x\n", hr);
+    ok(hr == S_OK, "GetFrame error %#lx\n", hr);
 
     hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format);
-    ok(hr == S_OK, "GetPixelFormat error %#x\n", hr);
+    ok(hr == S_OK, "GetPixelFormat error %#lx\n", hr);
     ok(IsEqualGUID(&format, &GUID_WICPixelFormat64bppRGBA),
        "got wrong format %s\n", wine_dbgstr_guid(&format));
 
     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-    ok(hr == S_OK, "CreatePalette error %#x\n", hr);
+    ok(hr == S_OK, "CreatePalette error %#lx\n", hr);
     hr = IWICBitmapFrameDecode_CopyPalette(frame, palette);
-    ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "CopyPalette error %#x\n", hr);
+    ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "CopyPalette error %#lx\n", hr);
 
     IWICPalette_Release(palette);
     IWICBitmapFrameDecode_Release(frame);
@@ -619,28 +619,28 @@ static void test_png_palette(void)
     buf[24] = 8; /* override bit depth */
 
     hr = create_decoder(buf, sizeof(png_gray_tRNS), &decoder);
-    ok(hr == S_OK, "Failed to load PNG image data %#x\n", hr);
+    ok(hr == S_OK, "Failed to load PNG image data %#lx\n", hr);
     if (hr != S_OK) return;
 
     hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
-    ok(hr == S_OK, "GetFrame error %#x\n", hr);
+    ok(hr == S_OK, "GetFrame error %#lx\n", hr);
 
     hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format);
-    ok(hr == S_OK, "GetPixelFormat error %#x\n", hr);
+    ok(hr == S_OK, "GetPixelFormat error %#lx\n", hr);
     ok(IsEqualGUID(&format, &GUID_WICPixelFormat8bppIndexed),
        "got wrong format %s\n", wine_dbgstr_guid(&format));
 
     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-    ok(hr == S_OK, "CreatePalette error %#x\n", hr);
+    ok(hr == S_OK, "CreatePalette error %#lx\n", hr);
     hr = IWICBitmapFrameDecode_CopyPalette(frame, palette);
-    ok(hr == S_OK, "CopyPalette error %#x\n", hr);
+    ok(hr == S_OK, "CopyPalette error %#lx\n", hr);
 
     hr = IWICPalette_GetColorCount(palette, &count);
-    ok(hr == S_OK, "GetColorCount error %#x\n", hr);
+    ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
     ok(count == 256, "expected 256, got %u\n", count);
 
     hr = IWICPalette_GetColors(palette, 256, color, &ret);
-    ok(hr == S_OK, "GetColors error %#x\n", hr);
+    ok(hr == S_OK, "GetColors error %#lx\n", hr);
     ok(ret == count, "expected %u, got %u\n", count, ret);
     ok(color[0] == 0x00000000, "expected 0x00000000, got %#x\n", color[0]);
     ok(color[1] == 0xff010101, "expected 0xff010101, got %#x\n", color[1]);
@@ -813,17 +813,17 @@ static void test_color_formats(void)
 
         hr = create_decoder(buf, sizeof(buf), &decoder);
         if (!is_valid_png_type_depth(td[i].color_type, td[i].bit_depth, TRUE))
-            ok(hr == WINCODEC_ERR_UNKNOWNIMAGEFORMAT, "%d: wrong error %#x\n", i, hr);
+            ok(hr == WINCODEC_ERR_UNKNOWNIMAGEFORMAT, "%d: wrong error %#lx\n", i, hr);
         else
             todo_wine_if(td[i].todo_load)
-            ok(hr == S_OK, "%d: Failed to load PNG image data (type %d, bpp %d) %#x\n", i, td[i].color_type, td[i].bit_depth, hr);
+            ok(hr == S_OK, "%d: Failed to load PNG image data (type %d, bpp %d) %#lx\n", i, td[i].color_type, td[i].bit_depth, hr);
         if (hr != S_OK) goto next_1;
 
         hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
-        ok(hr == S_OK, "GetFrame error %#x\n", hr);
+        ok(hr == S_OK, "GetFrame error %#lx\n", hr);
 
         hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format);
-        ok(hr == S_OK, "GetPixelFormat error %#x\n", hr);
+        ok(hr == S_OK, "GetPixelFormat error %#lx\n", hr);
         todo_wine_if(td[i].todo)
         ok(IsEqualGUID(&format, td[i].format_PLTE_tRNS),
            "PLTE+tRNS: expected %s, got %s (type %d, bpp %d)\n",
@@ -841,17 +841,17 @@ next_1:
 
         hr = create_decoder(buf, sizeof(buf), &decoder);
         if (!is_valid_png_type_depth(td[i].color_type, td[i].bit_depth, TRUE))
-            ok(hr == WINCODEC_ERR_UNKNOWNIMAGEFORMAT, "%d: wrong error %#x\n", i, hr);
+            ok(hr == WINCODEC_ERR_UNKNOWNIMAGEFORMAT, "%d: wrong error %#lx\n", i, hr);
         else
             todo_wine_if(td[i].todo_load)
-            ok(hr == S_OK, "%d: Failed to load PNG image data (type %d, bpp %d) %#x\n", i, td[i].color_type, td[i].bit_depth, hr);
+            ok(hr == S_OK, "%d: Failed to load PNG image data (type %d, bpp %d) %#lx\n", i, td[i].color_type, td[i].bit_depth, hr);
         if (hr != S_OK) goto next_2;
 
         hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
-        ok(hr == S_OK, "GetFrame error %#x\n", hr);
+        ok(hr == S_OK, "GetFrame error %#lx\n", hr);
 
         hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format);
-        ok(hr == S_OK, "GetPixelFormat error %#x\n", hr);
+        ok(hr == S_OK, "GetPixelFormat error %#lx\n", hr);
         ok(IsEqualGUID(&format, td[i].format_PLTE),
            "PLTE: expected %s, got %s (type %d, bpp %d)\n",
             wine_dbgstr_guid(td[i].format_PLTE), wine_dbgstr_guid(&format), td[i].color_type, td[i].bit_depth);
@@ -869,17 +869,17 @@ next_2:
 
         hr = create_decoder(buf, sizeof(buf), &decoder);
         if (!is_valid_png_type_depth(td[i].color_type, td[i].bit_depth, FALSE))
-            ok(hr == WINCODEC_ERR_UNKNOWNIMAGEFORMAT, "%d: wrong error %#x\n", i, hr);
+            ok(hr == WINCODEC_ERR_UNKNOWNIMAGEFORMAT, "%d: wrong error %#lx\n", i, hr);
         else
             todo_wine_if(td[i].todo_load)
-            ok(hr == S_OK, "%d: Failed to load PNG image data (type %d, bpp %d) %#x\n", i, td[i].color_type, td[i].bit_depth, hr);
+            ok(hr == S_OK, "%d: Failed to load PNG image data (type %d, bpp %d) %#lx\n", i, td[i].color_type, td[i].bit_depth, hr);
         if (hr != S_OK) goto next_3;
 
         hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
-        ok(hr == S_OK, "GetFrame error %#x\n", hr);
+        ok(hr == S_OK, "GetFrame error %#lx\n", hr);
 
         hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format);
-        ok(hr == S_OK, "GetPixelFormat error %#x\n", hr);
+        ok(hr == S_OK, "GetPixelFormat error %#lx\n", hr);
         ok(IsEqualGUID(&format, td[i].format),
            "expected %s, got %s (type %d, bpp %d)\n",
             wine_dbgstr_guid(td[i].format), wine_dbgstr_guid(&format), td[i].color_type, td[i].bit_depth);
@@ -896,17 +896,17 @@ next_3:
 
         hr = create_decoder(buf, sizeof(buf), &decoder);
         if (!is_valid_png_type_depth(td[i].color_type, td[i].bit_depth, FALSE))
-            ok(hr == WINCODEC_ERR_UNKNOWNIMAGEFORMAT, "%d: wrong error %#x\n", i, hr);
+            ok(hr == WINCODEC_ERR_UNKNOWNIMAGEFORMAT, "%d: wrong error %#lx\n", i, hr);
         else
             todo_wine_if(td[i].todo_load)
-            ok(hr == S_OK, "%d: Failed to load PNG image data (type %d, bpp %d) %#x\n", i, td[i].color_type, td[i].bit_depth, hr);
+            ok(hr == S_OK, "%d: Failed to load PNG image data (type %d, bpp %d) %#lx\n", i, td[i].color_type, td[i].bit_depth, hr);
         if (hr != S_OK) continue;
 
         hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
-        ok(hr == S_OK, "GetFrame error %#x\n", hr);
+        ok(hr == S_OK, "GetFrame error %#lx\n", hr);
 
         hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format);
-        ok(hr == S_OK, "GetPixelFormat error %#x\n", hr);
+        ok(hr == S_OK, "GetPixelFormat error %#lx\n", hr);
         todo_wine_if(td[i].todo)
         ok(IsEqualGUID(&format, td[i].format_PLTE_tRNS),
            "tRNS: expected %s, got %s (type %d, bpp %d)\n",
@@ -944,7 +944,7 @@ static void test_chunk_size(void)
     memcpy(png_8M_tEXt + sizeof(png_8M_tEXt) - sizeof(png_8M_tEXt_end), png_8M_tEXt_end, sizeof(png_8M_tEXt_end));
 
     hr = create_decoder(png_8M_tEXt, sizeof(png_8M_tEXt), &decoder);
-    ok(hr == S_OK, "Failed to load PNG image data %#x\n", hr);
+    ok(hr == S_OK, "Failed to load PNG image data %#lx\n", hr);
     if (hr != S_OK) return;
 
     IWICBitmapDecoder_Release(decoder);
@@ -957,7 +957,7 @@ START_TEST(pngformat)
     CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
                           &IID_IWICImagingFactory, (void **)&factory);
-    ok(hr == S_OK, "CoCreateInstance error %#x\n", hr);
+    ok(hr == S_OK, "CoCreateInstance error %#lx\n", hr);
     if (FAILED(hr)) return;
 
     test_color_contexts();
diff --git a/dlls/windowscodecs/tests/propertybag.c b/dlls/windowscodecs/tests/propertybag.c
index 55f5f655caf..c40c542960e 100644
--- a/dlls/windowscodecs/tests/propertybag.c
+++ b/dlls/windowscodecs/tests/propertybag.c
@@ -41,36 +41,36 @@ static void test_propertybag_getpropertyinfo(IPropertyBag2 *property, ULONG expe
     /* iProperty: Out of bounce */
     hr = IPropertyBag2_GetPropertyInfo(property, expected_count, 1, pb, &out_count);
     ok(hr == WINCODEC_ERR_VALUEOUTOFRANGE,
-       "GetPropertyInfo handled iProperty out of bounce wrong, hr=%x\n", hr);
+       "GetPropertyInfo handled iProperty out of bounce wrong, hr=%lx\n", hr);
 
     /* cProperty: Out of bounce */
     hr = IPropertyBag2_GetPropertyInfo(property, 0, expected_count+1, pb, &out_count);
     ok(hr == WINCODEC_ERR_VALUEOUTOFRANGE,
-       "GetPropertyInfo handled cProperty out of bounce wrong, hr=%x\n", hr);
+       "GetPropertyInfo handled cProperty out of bounce wrong, hr=%lx\n", hr);
 
     /* GetPropertyInfo can be called for zero items on Windows 8 but not on Windows 7 (wine behaves like Win8) */
     if (expected_count == 0)
         return;
 
     hr = IPropertyBag2_GetPropertyInfo(property, 0, expected_count, pb, &out_count);
-    ok(hr == S_OK, "GetPropertyInfo failed, hr=%x\n", hr);
+    ok(hr == S_OK, "GetPropertyInfo failed, hr=%lx\n", hr);
     if (FAILED(hr))
         return;
 
     ok(expected_count == out_count,
-       "GetPropertyInfo returned unexpected property count, %i != %i)\n",
+       "GetPropertyInfo returned unexpected property count, %li != %li)\n",
        expected_count, out_count);
 
     if(expected_count != 2)
         return;
 
     ok(pb[0].vt == VT_UI1, "Invalid variant type, pb[0].vt=%x\n", pb[0].vt);
-    ok(pb[0].dwType == PROPBAG2_TYPE_DATA, "Invalid variant type, pb[0].dwType=%x\n", pb[0].dwType);
+    ok(pb[0].dwType == PROPBAG2_TYPE_DATA, "Invalid variant type, pb[0].dwType=%lx\n", pb[0].dwType);
     ok(lstrcmpW(pb[0].pstrName, wszTestProperty1) == 0, "Invalid property name, pb[0].pstrName=%s\n", wine_dbgstr_w(pb[0].pstrName));
     CoTaskMemFree(pb[0].pstrName);
 
     ok(pb[1].vt == VT_R4, "Invalid variant type, pb[1].vt=%x\n", pb[1].vt);
-    ok(pb[1].dwType == PROPBAG2_TYPE_DATA, "Invalid variant type, pb[1].dwType=%x\n", pb[1].dwType);
+    ok(pb[1].dwType == PROPBAG2_TYPE_DATA, "Invalid variant type, pb[1].dwType=%lx\n", pb[1].dwType);
     ok(lstrcmpW(pb[1].pstrName, wszTestProperty2) == 0, "Invalid property name, pb[1].pstrName=%s\n", wine_dbgstr_w(pb[1].pstrName));
     CoTaskMemFree(pb[1].pstrName);
 }
@@ -81,15 +81,15 @@ static void test_propertybag_countproperties(IPropertyBag2 *property, ULONG expe
     HRESULT hr;
 
     hr = IPropertyBag2_CountProperties(property, NULL);
-    ok(hr == E_INVALIDARG, "CountProperties returned unexpected result, hr=%x\n", hr);
+    ok(hr == E_INVALIDARG, "CountProperties returned unexpected result, hr=%lx\n", hr);
 
     hr = IPropertyBag2_CountProperties(property, &count);
-    ok(hr == S_OK, "CountProperties failed, hr=%x\n", hr);
+    ok(hr == S_OK, "CountProperties failed, hr=%lx\n", hr);
 
     if (FAILED(hr))
         return;
 
-    ok(count == expected_count, "CountProperties returned invalid value, count=%i\n", count);
+    ok(count == expected_count, "CountProperties returned invalid value, count=%li\n", count);
 }
 
 static void test_propertybag_read(IPropertyBag2 *property)
@@ -103,17 +103,17 @@ static void test_propertybag_read(IPropertyBag2 *property)
     options[0].pstrName = (LPOLESTR)wszTestInvalidProperty;
     hr = IPropertyBag2_Read(property, 1, options, NULL, values, itm_hr);
     ok(hr == E_FAIL,
-       "Read for an unknown property did not fail with expected code, hr=%x\n", hr);
+       "Read for an unknown property did not fail with expected code, hr=%lx\n", hr);
 
     /* 2. One known property */
     options[0].pstrName = (LPOLESTR)wszTestProperty1;
     itm_hr[0] = E_FAIL;
     hr = IPropertyBag2_Read(property, 1, options, NULL, values, itm_hr);
-    ok(hr == S_OK, "Read failed, hr=%x\n", hr);
+    ok(hr == S_OK, "Read failed, hr=%lx\n", hr);
     if (SUCCEEDED(hr))
     {
         ok(itm_hr[0] == S_OK,
-           "Read failed, itm_hr[0]=%x\n", itm_hr[0]);
+           "Read failed, itm_hr[0]=%lx\n", itm_hr[0]);
         ok(V_VT(&values[0]) == VT_UI1,
            "Read failed, V_VT(&values[0])=%x\n", V_VT(&values[0]));
         ok(V_UNION(&values[0], bVal) == 12,
@@ -128,14 +128,14 @@ static void test_propertybag_read(IPropertyBag2 *property)
     itm_hr[0] = E_FAIL;
     itm_hr[1] = E_FAIL;
     hr = IPropertyBag2_Read(property, 2, options, NULL, values, itm_hr);
-    ok(hr == S_OK, "Read failed, hr=%x\n", hr);
+    ok(hr == S_OK, "Read failed, hr=%lx\n", hr);
     if (SUCCEEDED(hr))
     {
-        ok(itm_hr[0] == S_OK, "Read failed, itm_hr[0]=%x\n", itm_hr[0]);
+        ok(itm_hr[0] == S_OK, "Read failed, itm_hr[0]=%lx\n", itm_hr[0]);
         ok(V_VT(&values[0]) == VT_UI1, "Read failed, V_VT(&values[0])=%x\n", V_VT(&values[0]));
         ok(V_UNION(&values[0], bVal) == 12, "Read failed, &values[0]=%i\n", V_UNION(&values[0], bVal));
 
-        ok(itm_hr[1] == S_OK, "Read failed, itm_hr[1]=%x\n", itm_hr[1]);
+        ok(itm_hr[1] == S_OK, "Read failed, itm_hr[1]=%lx\n", itm_hr[1]);
         ok(V_VT(&values[1]) == VT_R4, "Read failed, V_VT(&values[1])=%x\n", V_VT(&values[1]));
         ok(V_UNION(&values[1], fltVal) == (float)3.14, "Read failed, &values[1]=%f\n", V_UNION(&values[1], fltVal));
 
@@ -160,12 +160,12 @@ static void test_propertybag_read(IPropertyBag2 *property)
     options[2].pstrName = (LPOLESTR)wszTestProperty2;
 
     hr = IPropertyBag2_Read(property, 3, options, NULL, values, itm_hr);
-    ok(hr == E_FAIL, "Read failed, hr=%x\n", hr);
+    ok(hr == E_FAIL, "Read failed, hr=%lx\n", hr);
     if (hr == E_FAIL)
     {
-        ok(itm_hr[0] == S_OK, "Read error code has unexpected value, itm_hr[0]=%x\n", itm_hr[0]);
-        ok(itm_hr[1] == -1,   "Read error code has unexpected value, itm_hr[1]=%x\n", itm_hr[1]);
-        ok(itm_hr[2] == -1,   "Read error code has unexpected value, itm_hr[2]=%x\n", itm_hr[2]);
+        ok(itm_hr[0] == S_OK, "Read error code has unexpected value, itm_hr[0]=%lx\n", itm_hr[0]);
+        ok(itm_hr[1] == -1,   "Read error code has unexpected value, itm_hr[1]=%lx\n", itm_hr[1]);
+        ok(itm_hr[2] == -1,   "Read error code has unexpected value, itm_hr[2]=%lx\n", itm_hr[2]);
 
         ok(V_VT(&values[0]) == VT_UI1,  "Read variant has unexpected type, V_VT(&values[0])=%x\n", V_VT(&values[0]));
         ok(V_VT(&values[1]) == VT_NULL, "Read variant has unexpected type, V_VT(&values[1])=%x\n", V_VT(&values[1]));
@@ -189,14 +189,14 @@ static void test_propertybag_write(IPropertyBag2 *property)
     /* 1. One unknown property */
     options[0].pstrName = (LPOLESTR)wszTestInvalidProperty;
     hr = IPropertyBag2_Write(property, 1, options, values);
-    ok(hr == E_FAIL, "Write for an unknown property did not fail with expected code, hr=%x\n", hr);
+    ok(hr == E_FAIL, "Write for an unknown property did not fail with expected code, hr=%lx\n", hr);
 
     /* 2. One property without correct type */
     options[0].pstrName = (LPOLESTR)wszTestProperty1;
     V_VT(&values[0]) = VT_UI1;
     V_UNION(&values[0], bVal) = 1;
     hr = IPropertyBag2_Write(property, 1, options, values);
-    ok(hr == S_OK, "Write for one property failed, hr=%x\n", hr);
+    ok(hr == S_OK, "Write for one property failed, hr=%lx\n", hr);
 
     /* 3. One property with mismatching type */
     options[0].pstrName = (LPOLESTR)wszTestProperty1;
@@ -204,14 +204,14 @@ static void test_propertybag_write(IPropertyBag2 *property)
     V_UNION(&values[0], bVal) = 2;
     hr = IPropertyBag2_Write(property, 1, options, values);
     ok(hr == WINCODEC_ERR_PROPERTYUNEXPECTEDTYPE,
-       "Write with mismatching type did not fail with expected code hr=%x\n", hr);
+       "Write with mismatching type did not fail with expected code hr=%lx\n", hr);
 
     /* 4. Reset one property to empty */
     options[0].pstrName = (LPOLESTR)wszTestProperty1;
     VariantClear(&values[0]);
     hr = IPropertyBag2_Write(property, 1, options, values);
     ok(hr == WINCODEC_ERR_PROPERTYUNEXPECTEDTYPE,
-       "Write to reset to empty value does not fail with expected code, hr=%x\n", hr);
+       "Write to reset to empty value does not fail with expected code, hr=%lx\n", hr);
 
     /* 5. Set two properties */
     options[0].pstrName = (LPOLESTR)wszTestProperty1;
@@ -221,7 +221,7 @@ static void test_propertybag_write(IPropertyBag2 *property)
     V_VT(&values[1]) = VT_R4;
     V_UNION(&values[1], fltVal) = (float)3.14;
     hr = IPropertyBag2_Write(property, 2, options, values);
-    ok(hr == S_OK, "Write for two properties failed, hr=%x\n", hr);
+    ok(hr == S_OK, "Write for two properties failed, hr=%lx\n", hr);
 }
 
 static void test_empty_propertybag(void)
@@ -232,11 +232,11 @@ static void test_empty_propertybag(void)
 
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
                           &IID_IWICComponentFactory, (void**)&factory);
-    ok(hr == S_OK, "CoCreateInstance failed, hr=%x\n", hr);
+    ok(hr == S_OK, "CoCreateInstance failed, hr=%lx\n", hr);
 
     hr = IWICComponentFactory_CreateEncoderPropertyBag(factory, NULL, 0, &property);
 
-    ok(hr == S_OK, "Creating EncoderPropertyBag failed, hr=%x\n", hr);
+    ok(hr == S_OK, "Creating EncoderPropertyBag failed, hr=%lx\n", hr);
     if (FAILED(hr)) return;
 
     test_propertybag_countproperties(property, 0);
@@ -260,11 +260,11 @@ static void test_filled_propertybag(void)
 
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
                           &IID_IWICComponentFactory, (void**)&factory);
-    ok(hr == S_OK, "CoCreateInstance failed, hr=%x\n", hr);
+    ok(hr == S_OK, "CoCreateInstance failed, hr=%lx\n", hr);
 
     hr = IWICComponentFactory_CreateEncoderPropertyBag(factory, opts, 2, &property);
 
-    ok(hr == S_OK, "Creating EncoderPropertyBag failed, hr=%x\n", hr);
+    ok(hr == S_OK, "Creating EncoderPropertyBag failed, hr=%lx\n", hr);
     if (FAILED(hr)) return;
 
     test_propertybag_countproperties(property, 2);
diff --git a/dlls/windowscodecs/tests/stream.c b/dlls/windowscodecs/tests/stream.c
index 247606ebf58..2a1b3e30928 100644
--- a/dlls/windowscodecs/tests/stream.c
+++ b/dlls/windowscodecs/tests/stream.c
@@ -31,7 +31,7 @@ static void _check_cur_pos(IStream *stream, ULONGLONG expected_pos, BOOL todo, u
 
     offset.QuadPart = 0;
     hr = IStream_Seek(stream, offset, STREAM_SEEK_CUR, &pos);
-    ok_(__FILE__, line)(hr == S_OK, "Failed to get current position, hr %#x.\n", hr);
+    ok_(__FILE__, line)(hr == S_OK, "Failed to get current position, hr %#lx.\n", hr);
     todo_wine_if(todo)
     ok_(__FILE__, line)(pos.QuadPart == expected_pos, "Unexpected stream position %s.\n",
         wine_dbgstr_longlong(pos.QuadPart));
@@ -69,12 +69,12 @@ static void test_StreamOnMemory(void)
 
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, &IID_IWICImagingFactory, (void**)&pFactory);
     if(FAILED(hr)) {
-        skip("CoCreateInstance returned with %#x, expected %#x\n", hr, S_OK);
+        skip("CoCreateInstance returned with %#lx, expected %#lx\n", hr, S_OK);
         return;
     }
 
     hr = IWICImagingFactory_CreateStream(pFactory, &pStream);
-    ok(hr == S_OK, "CreateStream returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "CreateStream returned with %#lx, expected %#lx\n", hr, S_OK);
     if(FAILED(hr)) {
         skip("Failed to create stream\n");
         return;
@@ -82,73 +82,73 @@ static void test_StreamOnMemory(void)
 
     /* InitializeFromMemory */
     hr = IWICStream_InitializeFromMemory(pStream, NULL, sizeof(Memory));   /* memory = NULL */
-    ok(hr == E_INVALIDARG, "InitializeFromMemory returned with %#x, expected %#x\n", hr, E_INVALIDARG);
+    ok(hr == E_INVALIDARG, "InitializeFromMemory returned with %#lx, expected %#lx\n", hr, E_INVALIDARG);
 
     hr = IWICStream_InitializeFromMemory(pStream, Memory, 0);   /* size = 0 */
-    ok(hr == S_OK, "InitializeFromMemory returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "InitializeFromMemory returned with %#lx, expected %#lx\n", hr, S_OK);
 
     hr = IWICStream_InitializeFromMemory(pStream, Memory, sizeof(Memory));   /* stream already initialized */
-    ok(hr == WINCODEC_ERR_WRONGSTATE, "InitializeFromMemory returned with %#x, expected %#x\n", hr, WINCODEC_ERR_WRONGSTATE);
+    ok(hr == WINCODEC_ERR_WRONGSTATE, "InitializeFromMemory returned with %#lx, expected %#lx\n", hr, WINCODEC_ERR_WRONGSTATE);
 
     /* recreate stream */
     IWICStream_Release(pStream);
     hr = IWICImagingFactory_CreateStream(pFactory, &pStream);
-    ok(hr == S_OK, "CreateStream failed with %#x\n", hr);
+    ok(hr == S_OK, "CreateStream failed with %#lx\n", hr);
 
     hr = IWICStream_InitializeFromMemory(pStream, Memory, sizeof(Memory));
-    ok(hr == S_OK, "InitializeFromMemory returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "InitializeFromMemory returned with %#lx, expected %#lx\n", hr, S_OK);
 
     /* IWICStream does not maintain an independent copy of the backing memory buffer. */
     memcpy(Memory, ZeroMem, sizeof(ZeroMem));
     hr = IWICStream_Read(pStream, MemBuf, sizeof(ZeroMem), &uBytesRead);
-    ok(hr == S_OK, "Read returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "Read returned with %#lx, expected %#lx\n", hr, S_OK);
     if(SUCCEEDED(hr)) {
-        ok(uBytesRead == sizeof(ZeroMem), "Read %u bytes\n", uBytesRead);
+        ok(uBytesRead == sizeof(ZeroMem), "Read %lu bytes\n", uBytesRead);
         ok(memcmp(MemBuf, ZeroMem, sizeof(ZeroMem)) == 0, "Read returned invalid data!\n");
     }
 
     IWICStream_Seek(pStream, LargeNull, STREAM_SEEK_SET, NULL);
 
     hr = IWICStream_Write(pStream, CmpMem, sizeof(CmpMem), &uBytesWritten);
-    ok(hr == S_OK, "Read returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "Read returned with %#lx, expected %#lx\n", hr, S_OK);
 
     /* Seek */
     hr = IWICStream_Seek(pStream, LargeNull, STREAM_SEEK_SET, &uNewPos);
-    ok(hr == S_OK, "Seek returned with %#x, expected %#x\n", hr, S_OK);
-    ok(uNewPos.u.HighPart == 0 && uNewPos.u.LowPart == 0, "Seek cursor moved to position (%u;%u), expected (%u;%u)\n", uNewPos.u.HighPart, uNewPos.u.LowPart, 0, 0);
+    ok(hr == S_OK, "Seek returned with %#lx, expected %#lx\n", hr, S_OK);
+    ok(uNewPos.u.HighPart == 0 && uNewPos.u.LowPart == 0, "Seek cursor moved to position (%lu;%lu), expected (%u;%u)\n", uNewPos.u.HighPart, uNewPos.u.LowPart, 0, 0);
 
     hr = IWICStream_Seek(pStream, LargeNull, STREAM_SEEK_SET, NULL);
-    ok(hr == S_OK, "Seek returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "Seek returned with %#lx, expected %#lx\n", hr, S_OK);
 
     LargeInt.u.HighPart = 1;
     LargeInt.u.LowPart = 0;
     uNewPos.u.HighPart = 0xdeadbeef;
     uNewPos.u.LowPart = 0xdeadbeef;
     hr = IWICStream_Seek(pStream, LargeInt, STREAM_SEEK_SET, &uNewPos);
-    ok(hr == HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW), "Seek returned with %#x, expected %#x\n", hr, HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW));
-    ok(uNewPos.u.HighPart == 0xdeadbeef && uNewPos.u.LowPart == 0xdeadbeef, "Seek cursor initialized to position (%u;%u), expected (%u;%u)\n", uNewPos.u.HighPart, uNewPos.u.LowPart, 0xdeadbeef, 0xdeadbeef);
+    ok(hr == HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW), "Seek returned with %#lx, expected %#lx\n", hr, HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW));
+    ok(uNewPos.u.HighPart == 0xdeadbeef && uNewPos.u.LowPart == 0xdeadbeef, "Seek cursor initialized to position (%lu;%lu), expected (%u;%u)\n", uNewPos.u.HighPart, uNewPos.u.LowPart, 0xdeadbeef, 0xdeadbeef);
     CHECK_CUR_POS(pStream, 0);
 
     LargeInt.QuadPart = sizeof(Memory) + 10;
     uNewPos.u.HighPart = 0xdeadbeef;
     uNewPos.u.LowPart = 0xdeadbeef;
     hr = IWICStream_Seek(pStream, LargeInt, STREAM_SEEK_SET, &uNewPos);
-    ok(hr == E_INVALIDARG, "Seek returned with %#x, expected %#x\n", hr, E_INVALIDARG);
-    ok(uNewPos.u.HighPart == 0xdeadbeef && uNewPos.u.LowPart == 0xdeadbeef, "Seek cursor initialized to position (%u;%u), expected (%u;%u)\n", uNewPos.u.HighPart, uNewPos.u.LowPart, 0xdeadbeef, 0xdeadbeef);
+    ok(hr == E_INVALIDARG, "Seek returned with %#lx, expected %#lx\n", hr, E_INVALIDARG);
+    ok(uNewPos.u.HighPart == 0xdeadbeef && uNewPos.u.LowPart == 0xdeadbeef, "Seek cursor initialized to position (%lu;%lu), expected (%u;%u)\n", uNewPos.u.HighPart, uNewPos.u.LowPart, 0xdeadbeef, 0xdeadbeef);
     CHECK_CUR_POS(pStream, 0);
 
     LargeInt.QuadPart = 1;
     uNewPos.u.HighPart = 0xdeadbeef;
     uNewPos.u.LowPart = 0xdeadbeef;
     hr = IWICStream_Seek(pStream, LargeInt, STREAM_SEEK_END, &uNewPos);
-    ok(hr == E_INVALIDARG, "Seek returned with %#x, expected %#x\n", hr, E_INVALIDARG);
-    ok(uNewPos.u.HighPart == 0xdeadbeef && uNewPos.u.LowPart == 0xdeadbeef, "Seek cursor initialized to position (%u;%u), expected (%u;%u)\n", uNewPos.u.HighPart, uNewPos.u.LowPart, 0xdeadbeef, 0xdeadbeef);
+    ok(hr == E_INVALIDARG, "Seek returned with %#lx, expected %#lx\n", hr, E_INVALIDARG);
+    ok(uNewPos.u.HighPart == 0xdeadbeef && uNewPos.u.LowPart == 0xdeadbeef, "Seek cursor initialized to position (%lu;%lu), expected (%u;%u)\n", uNewPos.u.HighPart, uNewPos.u.LowPart, 0xdeadbeef, 0xdeadbeef);
     CHECK_CUR_POS(pStream, 0);
 
     LargeInt.QuadPart = -1;
     hr = IWICStream_Seek(pStream, LargeInt, STREAM_SEEK_END, &uNewPos);
-    ok(hr == S_OK, "Seek returned with %#x, expected %#x\n", hr, S_OK);
-    ok(uNewPos.u.HighPart == 0 && uNewPos.u.LowPart == sizeof(Memory) - 1, "bSeek cursor moved to position (%u;%u)\n", uNewPos.u.HighPart, uNewPos.u.LowPart);
+    ok(hr == S_OK, "Seek returned with %#lx, expected %#lx\n", hr, S_OK);
+    ok(uNewPos.u.HighPart == 0 && uNewPos.u.LowPart == sizeof(Memory) - 1, "bSeek cursor moved to position (%lu;%lu)\n", uNewPos.u.HighPart, uNewPos.u.LowPart);
 
     IWICStream_Seek(pStream, LargeNull, STREAM_SEEK_SET, &uNewPos); /* reset seek pointer */
     LargeInt.QuadPart = -(LONGLONG)sizeof(Memory) - 5;
@@ -156,16 +156,16 @@ static void test_StreamOnMemory(void)
     uNewPos.u.LowPart = 0xdeadbeef;
     hr = IWICStream_Seek(pStream, LargeInt, STREAM_SEEK_END, &uNewPos);
     ok(hr == HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW),
-       "Seek returned with %#x, expected %#x\n", hr, HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW));
-    ok(uNewPos.u.HighPart == 0xdeadbeef && uNewPos.u.LowPart == 0xdeadbeef, "Seek cursor initialized to position (%u;%u), expected (%u;%u)\n", uNewPos.u.HighPart, uNewPos.u.LowPart, 0xdeadbeef, 0xdeadbeef);
+       "Seek returned with %#lx, expected %#lx\n", hr, HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW));
+    ok(uNewPos.u.HighPart == 0xdeadbeef && uNewPos.u.LowPart == 0xdeadbeef, "Seek cursor initialized to position (%lu;%lu), expected (%u;%u)\n", uNewPos.u.HighPart, uNewPos.u.LowPart, 0xdeadbeef, 0xdeadbeef);
     CHECK_CUR_POS(pStream, 0);
     IWICStream_Seek(pStream, LargeNull, STREAM_SEEK_SET, NULL);
 
     /* Read */
     hr = IWICStream_Read(pStream, MemBuf, 12, &uBytesRead);
-    ok(hr == S_OK, "Read returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "Read returned with %#lx, expected %#lx\n", hr, S_OK);
     if(SUCCEEDED(hr)) {
-        ok(uBytesRead == 12, "Read %u bytes, expected %u\n", uBytesRead, 12);
+        ok(uBytesRead == 12, "Read %lu bytes, expected %u\n", uBytesRead, 12);
         ok(memcmp(MemBuf, CmpMem, 12) == 0, "Read returned invalid data!\n");
 
         /* check whether the seek pointer has moved correctly */
@@ -175,18 +175,18 @@ static void test_StreamOnMemory(void)
     IWICStream_Seek(pStream, LargeNull, STREAM_SEEK_SET, NULL);
 
     hr = IWICStream_Read(pStream, Memory, 10, &uBytesRead);   /* source = dest */
-    ok(hr == S_OK, "Read returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "Read returned with %#lx, expected %#lx\n", hr, S_OK);
     if(SUCCEEDED(hr)) {
-        ok(uBytesRead == 10, "Read %u bytes, expected %u\n", uBytesRead, 10);
+        ok(uBytesRead == 10, "Read %lu bytes, expected %u\n", uBytesRead, 10);
         ok(memcmp(Memory, CmpMem, uBytesRead) == 0, "Read returned invalid data!\n");
     }
 
     IWICStream_Seek(pStream, SeekPos, STREAM_SEEK_SET, NULL);
 
     hr = IWICStream_Read(pStream, Memory, 10, &uBytesRead);   /* source and dest overlap */
-    ok(hr == S_OK, "Read returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "Read returned with %#lx, expected %#lx\n", hr, S_OK);
     if(SUCCEEDED(hr)) {
-        ok(uBytesRead == 10, "Read %u bytes, expected %u\n", uBytesRead, 10);
+        ok(uBytesRead == 10, "Read %lu bytes, expected %u\n", uBytesRead, 10);
         ok(memcmp(Memory, CmpMemOverlap, uBytesRead) == 0, "Read returned invalid data!\n");
     }
 
@@ -195,33 +195,33 @@ static void test_StreamOnMemory(void)
     IWICStream_Seek(pStream, LargeNull, STREAM_SEEK_SET, NULL);
 
     hr = IWICStream_Read(pStream, Memory, sizeof(Memory) + 10, &uBytesRead);   /* request too many bytes */
-    ok(hr == S_OK, "Read returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "Read returned with %#lx, expected %#lx\n", hr, S_OK);
     if(SUCCEEDED(hr)) {
-        ok(uBytesRead == sizeof(Memory), "Read %u bytes\n", uBytesRead);
+        ok(uBytesRead == sizeof(Memory), "Read %lu bytes\n", uBytesRead);
         ok(memcmp(Memory, CmpMem, uBytesRead) == 0, "Read returned invalid data!\n");
     }
 
     hr = IWICStream_Read(pStream, NULL, 1, &uBytesRead);    /* destination buffer = NULL */
-    ok(hr == E_INVALIDARG, "Read returned with %#x, expected %#x\n", hr, E_INVALIDARG);
+    ok(hr == E_INVALIDARG, "Read returned with %#lx, expected %#lx\n", hr, E_INVALIDARG);
 
     hr = IWICStream_Read(pStream, MemBuf, 0, &uBytesRead);    /* read 0 bytes */
-    ok(hr == S_OK, "Read returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "Read returned with %#lx, expected %#lx\n", hr, S_OK);
 
     hr = IWICStream_Read(pStream, NULL, 0, &uBytesRead);
-    ok(hr == E_INVALIDARG, "Read returned with %#x, expected %#x\n", hr, E_INVALIDARG);
+    ok(hr == E_INVALIDARG, "Read returned with %#lx, expected %#lx\n", hr, E_INVALIDARG);
 
     hr = IWICStream_Read(pStream, NULL, 0, NULL);
-    ok(hr == E_INVALIDARG, "Read returned with %#x, expected %#x\n", hr, E_INVALIDARG);
+    ok(hr == E_INVALIDARG, "Read returned with %#lx, expected %#lx\n", hr, E_INVALIDARG);
 
     hr = IWICStream_Read(pStream, MemBuf, 1, NULL);
-    ok(hr == S_OK, "Read returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "Read returned with %#lx, expected %#lx\n", hr, S_OK);
 
     IWICStream_Seek(pStream, LargeNull, STREAM_SEEK_SET, NULL);
     ZeroMemory(MemBuf, sizeof(MemBuf));
     hr = IWICStream_Read(pStream, MemBuf, sizeof(Memory) + 10, &uBytesRead);
-    ok(hr == S_OK, "Read returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "Read returned with %#lx, expected %#lx\n", hr, S_OK);
     if(SUCCEEDED(hr)) {
-        ok(uBytesRead == sizeof(Memory), "Read %u bytes\n", uBytesRead);
+        ok(uBytesRead == sizeof(Memory), "Read %lu bytes\n", uBytesRead);
         ok(memcmp(Memory, CmpMem, 64) == 0, "Read returned invalid data!\n");
     }
     IWICStream_Seek(pStream, LargeNull, STREAM_SEEK_SET, NULL);
@@ -232,9 +232,9 @@ static void test_StreamOnMemory(void)
     MemBuf[1] = CmpMem[1] + 1;
     MemBuf[2] = CmpMem[2] + 1;
     hr = IWICStream_Write(pStream, MemBuf, 3, &uBytesWritten);
-    ok(hr == S_OK, "Write returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "Write returned with %#lx, expected %#lx\n", hr, S_OK);
     if(SUCCEEDED(hr)) {
-        ok(uBytesWritten == 3, "Wrote %u bytes, expected %u\n", uBytesWritten, 3);
+        ok(uBytesWritten == 3, "Wrote %lu bytes, expected %u\n", uBytesWritten, 3);
         ok(memcmp(MemBuf, Memory, 3) == 0, "Wrote returned invalid data!\n"); /* make sure we're writing directly */
 
         /* check whether the seek pointer has moved correctly */
@@ -243,19 +243,19 @@ static void test_StreamOnMemory(void)
     IWICStream_Seek(pStream, LargeNull, STREAM_SEEK_SET, NULL);
 
     hr = IWICStream_Write(pStream, MemBuf, 0, &uBytesWritten);
-    ok(hr == S_OK, "Read returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "Read returned with %#lx, expected %#lx\n", hr, S_OK);
 
     /* Restore the original contents of the memory stream. */
     hr = IWICStream_Write(pStream, CmpMem, sizeof(CmpMem), &uBytesWritten);
-    ok(hr == S_OK, "Read returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "Read returned with %#lx, expected %#lx\n", hr, S_OK);
 
     IWICStream_Seek(pStream, LargeNull, STREAM_SEEK_SET, NULL);
 
     /* Source and destination overlap. */
     hr = IWICStream_Write(pStream, Memory + 5, 10, &uBytesWritten);
-    ok(hr == S_OK, "Write returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "Write returned with %#lx, expected %#lx\n", hr, S_OK);
     if(SUCCEEDED(hr)) {
-        ok(uBytesWritten == 10, "Wrote %u bytes, expected %u\n", uBytesWritten, 10);
+        ok(uBytesWritten == 10, "Wrote %lu bytes, expected %u\n", uBytesWritten, 10);
         ok(memcmp(CmpMemOverlap, Memory, sizeof(CmpMemOverlap)) == 0, "Wrote returned invalid data!\n");
     }
 
@@ -263,20 +263,20 @@ static void test_StreamOnMemory(void)
 
     uBytesWritten = 0xdeadbeef;
     hr = IWICStream_Write(pStream, NULL, 3, &uBytesWritten);
-    ok(hr == E_INVALIDARG, "Write returned with %#x, expected %#x\n", hr, E_INVALIDARG);
-    ok(uBytesWritten == 0xdeadbeef, "Expected uBytesWritten to be unchanged, got %u\n", uBytesWritten);
+    ok(hr == E_INVALIDARG, "Write returned with %#lx, expected %#lx\n", hr, E_INVALIDARG);
+    ok(uBytesWritten == 0xdeadbeef, "Expected uBytesWritten to be unchanged, got %lu\n", uBytesWritten);
     CHECK_CUR_POS(pStream, 0);
 
     uBytesWritten = 0xdeadbeef;
     hr = IWICStream_Write(pStream, NULL, 0, &uBytesWritten);
-    ok(hr == E_INVALIDARG, "Write returned with %#x, expected %#x\n", hr, E_INVALIDARG);
-    ok(uBytesWritten == 0xdeadbeef, "Expected uBytesWritten to be unchanged, got %u\n", uBytesWritten);
+    ok(hr == E_INVALIDARG, "Write returned with %#lx, expected %#lx\n", hr, E_INVALIDARG);
+    ok(uBytesWritten == 0xdeadbeef, "Expected uBytesWritten to be unchanged, got %lu\n", uBytesWritten);
     CHECK_CUR_POS(pStream, 0);
 
     uBytesWritten = 0xdeadbeef;
     hr = IWICStream_Write(pStream, CmpMem, sizeof(Memory) + 10, &uBytesWritten);
-    ok(hr == STG_E_MEDIUMFULL, "Write returned with %#x, expected %#x\n", hr, STG_E_MEDIUMFULL);
-    ok(uBytesWritten == 0xdeadbeef, "Expected uBytesWritten to be unchanged, got %u\n", uBytesWritten);
+    ok(hr == STG_E_MEDIUMFULL, "Write returned with %#lx, expected %#lx\n", hr, STG_E_MEDIUMFULL);
+    ok(uBytesWritten == 0xdeadbeef, "Expected uBytesWritten to be unchanged, got %lu\n", uBytesWritten);
     CHECK_CUR_POS(pStream, 0);
     IWICStream_Seek(pStream, LargeNull, STREAM_SEEK_SET, NULL);
 
@@ -285,97 +285,97 @@ static void test_StreamOnMemory(void)
     uNewPos.u.HighPart = 0;
     uNewPos.u.LowPart = sizeof(Memory) + 10;
     hr = IWICStream_SetSize(pStream, uNewPos);
-    ok(hr == E_NOTIMPL, "SetSize returned %#x, expected %#x\n", hr, E_NOTIMPL);
+    ok(hr == E_NOTIMPL, "SetSize returned %#lx, expected %#lx\n", hr, E_NOTIMPL);
 
     uNewPos.u.HighPart = 0;
     uNewPos.u.LowPart = sizeof(Memory);
     hr = IWICStream_SetSize(pStream, uNewPos);
-    ok(hr == E_NOTIMPL, "SetSize returned %#x, expected %#x\n", hr, E_NOTIMPL);
+    ok(hr == E_NOTIMPL, "SetSize returned %#lx, expected %#lx\n", hr, E_NOTIMPL);
 
     uNewPos.u.HighPart = 0;
     uNewPos.u.LowPart = sizeof(Memory) - 10;
     hr = IWICStream_SetSize(pStream, uNewPos);
-    ok(hr == E_NOTIMPL, "SetSize returned %#x, expected %#x\n", hr, E_NOTIMPL);
+    ok(hr == E_NOTIMPL, "SetSize returned %#lx, expected %#lx\n", hr, E_NOTIMPL);
 
     uNewPos.u.HighPart = 0;
     uNewPos.u.LowPart = 0;
     hr = IWICStream_SetSize(pStream, uNewPos);
-    ok(hr == E_NOTIMPL, "SetSize returned %#x, expected %#x\n", hr, E_NOTIMPL);
+    ok(hr == E_NOTIMPL, "SetSize returned %#lx, expected %#lx\n", hr, E_NOTIMPL);
 
     uNewPos.QuadPart = -10;
     hr = IWICStream_SetSize(pStream, uNewPos);
-    ok(hr == E_NOTIMPL, "SetSize returned %#x, expected %#x\n", hr, E_NOTIMPL);
+    ok(hr == E_NOTIMPL, "SetSize returned %#lx, expected %#lx\n", hr, E_NOTIMPL);
 
 
     /* CopyTo */
     uNewPos.u.HighPart = 0;
     uNewPos.u.LowPart = 5;
     hr = IWICStream_CopyTo(pStream, NULL, uNewPos, NULL, NULL);
-    ok(hr == E_NOTIMPL, "CopyTo returned %#x, expected %#x\n", hr, E_NOTIMPL);
+    ok(hr == E_NOTIMPL, "CopyTo returned %#lx, expected %#lx\n", hr, E_NOTIMPL);
 
     hr = IWICImagingFactory_CreateStream(pFactory, &pBufStream);
-    ok(hr == S_OK, "CreateStream failed with %#x\n", hr);
+    ok(hr == S_OK, "CreateStream failed with %#lx\n", hr);
 
     hr = IWICStream_InitializeFromMemory(pBufStream, Memory, sizeof(Memory));
-    ok(hr == S_OK, "InitializeFromMemory returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "InitializeFromMemory returned with %#lx, expected %#lx\n", hr, S_OK);
 
     hr = IWICStream_CopyTo(pStream, (IStream*)pBufStream, uNewPos, NULL, NULL);
-    ok(hr == E_NOTIMPL, "CopyTo returned %#x, expected %#x\n", hr, E_NOTIMPL);
+    ok(hr == E_NOTIMPL, "CopyTo returned %#lx, expected %#lx\n", hr, E_NOTIMPL);
     IWICStream_Release(pBufStream);
 
 
     /* Commit */
     hr = IWICStream_Commit(pStream, STGC_DEFAULT);
-    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
+    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#lx\n", hr);
 
     hr = IWICStream_Commit(pStream, STGC_OVERWRITE);
-    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
+    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#lx\n", hr);
 
     hr = IWICStream_Commit(pStream, STGC_ONLYIFCURRENT);
-    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
+    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#lx\n", hr);
 
     hr = IWICStream_Commit(pStream, STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE);
-    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
+    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#lx\n", hr);
 
     hr = IWICStream_Commit(pStream, STGC_CONSOLIDATE);
-    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
+    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#lx\n", hr);
 
 
     /* Revert */
     IWICStream_Write(pStream, &MemBuf[5], 6, NULL);
     hr = IWICStream_Revert(pStream);
-    ok(hr == E_NOTIMPL, "Revert returned %#x, expected %#x\n", hr, E_NOTIMPL);
+    ok(hr == E_NOTIMPL, "Revert returned %#lx, expected %#lx\n", hr, E_NOTIMPL);
     memcpy(Memory, CmpMem, sizeof(Memory));
 
 
     /* LockRegion/UnlockRegion */
     hr = IWICStream_LockRegion(pStream, uLargeNull, uLargeNull, 0);
-    ok(hr == E_NOTIMPL, "LockRegion returned %#x, expected %#x\n", hr, E_NOTIMPL);
+    ok(hr == E_NOTIMPL, "LockRegion returned %#lx, expected %#lx\n", hr, E_NOTIMPL);
 
     hr = IWICStream_UnlockRegion(pStream, uLargeNull, uLargeNull, 0);
-    ok(hr == E_NOTIMPL, "UnlockRegion returned %#x, expected %#x\n", hr, E_NOTIMPL);
+    ok(hr == E_NOTIMPL, "UnlockRegion returned %#lx, expected %#lx\n", hr, E_NOTIMPL);
 
 
     /* Stat */
     hr = IWICStream_Stat(pStream, NULL, 0);
-    ok(hr == E_INVALIDARG, "Stat returned %#x, expected %#x\n", hr, E_INVALIDARG);
+    ok(hr == E_INVALIDARG, "Stat returned %#lx, expected %#lx\n", hr, E_INVALIDARG);
 
     hr = IWICStream_Stat(pStream, &Stats, 0);
-    ok(hr == S_OK, "Stat returned %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "Stat returned %#lx, expected %#lx\n", hr, S_OK);
     ok(Stats.pwcsName == NULL, "Stat returned name %p, expected %p\n", Stats.pwcsName, NULL);
-    ok(Stats.type == STGTY_STREAM, "Stat returned type %d, expected %d\n", Stats.type, STGTY_STREAM);
-    ok(Stats.cbSize.u.HighPart == 0 && Stats.cbSize.u.LowPart == sizeof(Memory), "Stat returned size (%u;%u)\n", Stats.cbSize.u.HighPart, Stats.cbSize.u.LowPart);
-    ok(Stats.mtime.dwHighDateTime == 0 && Stats.mtime.dwLowDateTime == 0, "Stat returned mtime (%u;%u), expected (%u;%u)\n", Stats.mtime.dwHighDateTime, Stats.mtime.dwLowDateTime, 0, 0);
-    ok(Stats.ctime.dwHighDateTime == 0 && Stats.ctime.dwLowDateTime == 0, "Stat returned ctime (%u;%u), expected (%u;%u)\n", Stats.ctime.dwHighDateTime, Stats.ctime.dwLowDateTime, 0, 0);
-    ok(Stats.atime.dwHighDateTime == 0 && Stats.atime.dwLowDateTime == 0, "Stat returned atime (%u;%u), expected (%u;%u)\n", Stats.atime.dwHighDateTime, Stats.atime.dwLowDateTime, 0, 0);
-    ok(Stats.grfMode == 0, "Stat returned access mode %d, expected %d\n", Stats.grfMode, 0);
-    ok(Stats.grfLocksSupported == 0, "Stat returned supported locks %#x, expected %#x\n", Stats.grfLocksSupported, 0);
-    ok(Stats.grfStateBits == 0, "Stat returned state bits %#x, expected %#x\n", Stats.grfStateBits, 0);
+    ok(Stats.type == STGTY_STREAM, "Stat returned type %ld, expected %d\n", Stats.type, STGTY_STREAM);
+    ok(Stats.cbSize.u.HighPart == 0 && Stats.cbSize.u.LowPart == sizeof(Memory), "Stat returned size (%lu;%lu)\n", Stats.cbSize.u.HighPart, Stats.cbSize.u.LowPart);
+    ok(Stats.mtime.dwHighDateTime == 0 && Stats.mtime.dwLowDateTime == 0, "Stat returned mtime (%lu;%lu), expected (%u;%u)\n", Stats.mtime.dwHighDateTime, Stats.mtime.dwLowDateTime, 0, 0);
+    ok(Stats.ctime.dwHighDateTime == 0 && Stats.ctime.dwLowDateTime == 0, "Stat returned ctime (%lu;%lu), expected (%u;%u)\n", Stats.ctime.dwHighDateTime, Stats.ctime.dwLowDateTime, 0, 0);
+    ok(Stats.atime.dwHighDateTime == 0 && Stats.atime.dwLowDateTime == 0, "Stat returned atime (%lu;%lu), expected (%u;%u)\n", Stats.atime.dwHighDateTime, Stats.atime.dwLowDateTime, 0, 0);
+    ok(Stats.grfMode == 0, "Stat returned access mode %ld, expected %d\n", Stats.grfMode, 0);
+    ok(Stats.grfLocksSupported == 0, "Stat returned supported locks %#lx, expected %#x\n", Stats.grfLocksSupported, 0);
+    ok(Stats.grfStateBits == 0, "Stat returned state bits %#lx, expected %#x\n", Stats.grfStateBits, 0);
 
 
     /* Clone */
     hr = IWICStream_Clone(pStream, (IStream**)&pBufStream);
-    ok(hr == E_NOTIMPL, "UnlockRegion returned %#x, expected %#x\n", hr, E_NOTIMPL);
+    ok(hr == E_NOTIMPL, "UnlockRegion returned %#lx, expected %#lx\n", hr, E_NOTIMPL);
 
 
     IWICStream_Release(pStream);
@@ -409,27 +409,27 @@ static void test_StreamOnStreamRange(void)
 
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, &IID_IWICImagingFactory, (void**)&pFactory);
     if(FAILED(hr)) {
-        skip("CoCreateInstance returned with %#x, expected %#x\n", hr, S_OK);
+        skip("CoCreateInstance returned with %#lx, expected %#lx\n", hr, S_OK);
         return;
     }
 
     hr = IWICImagingFactory_CreateStream(pFactory, &pStream);
-    ok(hr == S_OK, "CreateStream returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "CreateStream returned with %#lx, expected %#lx\n", hr, S_OK);
     if(FAILED(hr)) {
         skip("Failed to create stream\n");
         return;
     }
 
     hr = IWICStream_InitializeFromMemory(pStream, Memory, sizeof(Memory));
-    ok(hr == S_OK, "InitializeFromMemory returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "InitializeFromMemory returned with %#lx, expected %#lx\n", hr, S_OK);
 
     hr = IWICImagingFactory_CreateStream(pFactory, &pSubStream);
-    ok(hr == S_OK, "CreateStream returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "CreateStream returned with %#lx, expected %#lx\n", hr, S_OK);
 
     uNewPos.QuadPart = 20;
     uSize.QuadPart = 20;
     hr = IWICStream_InitializeFromIStreamRegion(pSubStream, (IStream*)pStream, uNewPos, uSize);
-    ok(hr == S_OK, "InitializeFromIStreamRegion returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "InitializeFromIStreamRegion returned with %#lx, expected %#lx\n", hr, S_OK);
     if(FAILED(hr)) {
         skip("InitializeFromIStreamRegion unimplemented\n");
         IWICStream_Release(pSubStream);
@@ -442,47 +442,47 @@ static void test_StreamOnStreamRange(void)
     /* Seek */
     CHECK_CUR_POS(pStream, 0);
     hr = IWICStream_Seek(pSubStream, LargeNull, STREAM_SEEK_END, &uNewPos);
-    ok(uNewPos.u.HighPart == 0 && uNewPos.u.LowPart == 20, "Seek cursor moved to position (%u;%u), expected (%u;%u)\n", uNewPos.u.HighPart, uNewPos.u.LowPart, 0, 20);
-    ok(hr == S_OK, "Seek returned with %#x, expected %#x\n", hr, S_OK);
+    ok(uNewPos.u.HighPart == 0 && uNewPos.u.LowPart == 20, "Seek cursor moved to position (%lu;%lu), expected (%u;%u)\n", uNewPos.u.HighPart, uNewPos.u.LowPart, 0, 20);
+    ok(hr == S_OK, "Seek returned with %#lx, expected %#lx\n", hr, S_OK);
     CHECK_CUR_POS(pStream, 0);
 
     hr = IWICStream_Seek(pSubStream, LargeNull, STREAM_SEEK_SET, &uNewPos);
-    ok(hr == S_OK, "Seek returned with %#x, expected %#x\n", hr, S_OK);
-    ok(uNewPos.u.HighPart == 0 && uNewPos.u.LowPart == 0, "Seek cursor moved to position (%u;%u), expected (%u;%u)\n", uNewPos.u.HighPart, uNewPos.u.LowPart, 0, 0);
+    ok(hr == S_OK, "Seek returned with %#lx, expected %#lx\n", hr, S_OK);
+    ok(uNewPos.u.HighPart == 0 && uNewPos.u.LowPart == 0, "Seek cursor moved to position (%lu;%lu), expected (%u;%u)\n", uNewPos.u.HighPart, uNewPos.u.LowPart, 0, 0);
     CHECK_CUR_POS(pStream, 0);
 
     hr = IWICStream_Seek(pSubStream, LargeNull, STREAM_SEEK_SET, NULL);
-    ok(hr == S_OK, "Seek returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "Seek returned with %#lx, expected %#lx\n", hr, S_OK);
 
     LargeInt.u.HighPart = 1;
     LargeInt.u.LowPart = 0;
     uNewPos.u.HighPart = 0xdeadbeef;
     uNewPos.u.LowPart = 0xdeadbeef;
     hr = IWICStream_Seek(pSubStream, LargeInt, STREAM_SEEK_SET, &uNewPos);
-    ok(hr == WINCODEC_ERR_VALUEOUTOFRANGE, "Seek returned with %#x, expected %#x\n", hr, WINCODEC_ERR_VALUEOUTOFRANGE);
-    ok(uNewPos.u.HighPart == 0xdeadbeef && uNewPos.u.LowPart == 0xdeadbeef, "Seek cursor initialized to position (%u;%u), expected (%u;%u)\n", uNewPos.u.HighPart, uNewPos.u.LowPart, 0xdeadbeef, 0xdeadbeef);
+    ok(hr == WINCODEC_ERR_VALUEOUTOFRANGE, "Seek returned with %#lx, expected %#lx\n", hr, WINCODEC_ERR_VALUEOUTOFRANGE);
+    ok(uNewPos.u.HighPart == 0xdeadbeef && uNewPos.u.LowPart == 0xdeadbeef, "Seek cursor initialized to position (%lu;%lu), expected (%u;%u)\n", uNewPos.u.HighPart, uNewPos.u.LowPart, 0xdeadbeef, 0xdeadbeef);
     CHECK_CUR_POS(pStream, 0);
 
     LargeInt.QuadPart = 30;
     uNewPos.u.HighPart = 0xdeadbeef;
     uNewPos.u.LowPart = 0xdeadbeef;
     hr = IWICStream_Seek(pSubStream, LargeInt, STREAM_SEEK_SET, &uNewPos);
-    ok(hr == WINCODEC_ERR_VALUEOUTOFRANGE, "Seek returned with %#x, expected %#x\n", hr, WINCODEC_ERR_VALUEOUTOFRANGE);
-    ok(uNewPos.u.HighPart == 0xdeadbeef && uNewPos.u.LowPart == 0xdeadbeef, "Seek cursor initialized to position (%u;%u), expected (%u;%u)\n", uNewPos.u.HighPart, uNewPos.u.LowPart, 0xdeadbeef, 0xdeadbeef);
+    ok(hr == WINCODEC_ERR_VALUEOUTOFRANGE, "Seek returned with %#lx, expected %#lx\n", hr, WINCODEC_ERR_VALUEOUTOFRANGE);
+    ok(uNewPos.u.HighPart == 0xdeadbeef && uNewPos.u.LowPart == 0xdeadbeef, "Seek cursor initialized to position (%lu;%lu), expected (%u;%u)\n", uNewPos.u.HighPart, uNewPos.u.LowPart, 0xdeadbeef, 0xdeadbeef);
     CHECK_CUR_POS(pStream, 0);
 
     LargeInt.QuadPart = 1;
     uNewPos.u.HighPart = 0xdeadbeef;
     uNewPos.u.LowPart = 0xdeadbeef;
     hr = IWICStream_Seek(pSubStream, LargeInt, STREAM_SEEK_END, &uNewPos);
-    ok(hr == WINCODEC_ERR_VALUEOUTOFRANGE, "Seek returned with %#x, expected %#x\n", hr, WINCODEC_ERR_VALUEOUTOFRANGE);
-    ok(uNewPos.u.HighPart == 0xdeadbeef && uNewPos.u.LowPart == 0xdeadbeef, "Seek cursor initialized to position (%u;%u), expected (%u;%u)\n", uNewPos.u.HighPart, uNewPos.u.LowPart, 0xdeadbeef, 0xdeadbeef);
+    ok(hr == WINCODEC_ERR_VALUEOUTOFRANGE, "Seek returned with %#lx, expected %#lx\n", hr, WINCODEC_ERR_VALUEOUTOFRANGE);
+    ok(uNewPos.u.HighPart == 0xdeadbeef && uNewPos.u.LowPart == 0xdeadbeef, "Seek cursor initialized to position (%lu;%lu), expected (%u;%u)\n", uNewPos.u.HighPart, uNewPos.u.LowPart, 0xdeadbeef, 0xdeadbeef);
     CHECK_CUR_POS(pStream, 0);
 
     LargeInt.QuadPart = -1;
     hr = IWICStream_Seek(pSubStream, LargeInt, STREAM_SEEK_END, &uNewPos);
-    ok(hr == S_OK, "Seek returned with %#x, expected %#x\n", hr, S_OK);
-    ok(uNewPos.u.HighPart == 0 && uNewPos.u.LowPart == 19, "bSeek cursor moved to position (%u;%u)\n", uNewPos.u.HighPart, uNewPos.u.LowPart);
+    ok(hr == S_OK, "Seek returned with %#lx, expected %#lx\n", hr, S_OK);
+    ok(uNewPos.u.HighPart == 0 && uNewPos.u.LowPart == 19, "bSeek cursor moved to position (%lu;%lu)\n", uNewPos.u.HighPart, uNewPos.u.LowPart);
     CHECK_CUR_POS(pStream, 0);
 
     IWICStream_Seek(pSubStream, LargeNull, STREAM_SEEK_SET, &uNewPos); /* reset seek pointer */
@@ -491,17 +491,17 @@ static void test_StreamOnStreamRange(void)
     uNewPos.u.LowPart = 0xdeadbeef;
     hr = IWICStream_Seek(pSubStream, LargeInt, STREAM_SEEK_END, &uNewPos);
     ok(hr == WINCODEC_ERR_VALUEOUTOFRANGE,
-       "Seek returned with %#x, expected %#x\n", hr, HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW));
-    ok(uNewPos.u.HighPart == 0xdeadbeef && uNewPos.u.LowPart == 0xdeadbeef, "Seek cursor initialized to position (%u;%u), expected (%u;%u)\n", uNewPos.u.HighPart, uNewPos.u.LowPart, 0xdeadbeef, 0xdeadbeef);
+       "Seek returned with %#lx, expected %#lx\n", hr, HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW));
+    ok(uNewPos.u.HighPart == 0xdeadbeef && uNewPos.u.LowPart == 0xdeadbeef, "Seek cursor initialized to position (%lu;%lu), expected (%u;%u)\n", uNewPos.u.HighPart, uNewPos.u.LowPart, 0xdeadbeef, 0xdeadbeef);
     CHECK_CUR_POS(pStream, 0);
     IWICStream_Seek(pSubStream, LargeNull, STREAM_SEEK_SET, NULL);
 
 
     /* Read */
     hr = IWICStream_Read(pSubStream, MemBuf, 12, &uBytesRead);
-    ok(hr == S_OK, "Read returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "Read returned with %#lx, expected %#lx\n", hr, S_OK);
     if(SUCCEEDED(hr)) {
-        ok(uBytesRead == 12, "Read %u bytes, expected %u\n", uBytesRead, 12);
+        ok(uBytesRead == 12, "Read %lu bytes, expected %u\n", uBytesRead, 12);
         ok(memcmp(MemBuf, CmpMem+20, 12) == 0, "Read returned invalid data!\n");
 
         /* check whether the seek pointer has moved correctly */
@@ -512,9 +512,9 @@ static void test_StreamOnStreamRange(void)
     IWICStream_Seek(pSubStream, LargeNull, STREAM_SEEK_SET, NULL);
 
     hr = IWICStream_Read(pSubStream, Memory, 10, &uBytesRead);   /* source = dest */
-    ok(hr == S_OK, "Read returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "Read returned with %#lx, expected %#lx\n", hr, S_OK);
     if(SUCCEEDED(hr)) {
-        ok(uBytesRead == 10, "Read %u bytes, expected %u\n", uBytesRead, 10);
+        ok(uBytesRead == 10, "Read %lu bytes, expected %u\n", uBytesRead, 10);
         ok(memcmp(Memory, CmpMem+20, uBytesRead) == 0, "Read returned invalid data!\n");
     }
     CHECK_CUR_POS(pStream, 0);
@@ -522,9 +522,9 @@ static void test_StreamOnStreamRange(void)
     IWICStream_Seek(pSubStream, LargeNull, STREAM_SEEK_SET, NULL);
 
     hr = IWICStream_Read(pSubStream, Memory, 30, &uBytesRead);   /* request too many bytes */
-    ok(hr == S_OK, "Read returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "Read returned with %#lx, expected %#lx\n", hr, S_OK);
     if(SUCCEEDED(hr)) {
-        ok(uBytesRead == 20, "Read %u bytes\n", uBytesRead);
+        ok(uBytesRead == 20, "Read %lu bytes\n", uBytesRead);
         ok(memcmp(Memory, CmpMem+20, uBytesRead) == 0, "Read returned invalid data!\n");
     }
     CHECK_CUR_POS(pStream, 0);
@@ -532,29 +532,29 @@ static void test_StreamOnStreamRange(void)
     IWICStream_Seek(pSubStream, LargeNull, STREAM_SEEK_SET, NULL);
     uBytesRead = 0xdeadbeef;
     hr = IWICStream_Read(pSubStream, NULL, 1, &uBytesRead);    /* destination buffer = NULL */
-    ok(hr == E_INVALIDARG, "Read returned with %#x, expected %#x\n", hr, E_INVALIDARG);
-    ok(uBytesRead == 0xdeadbeef, "Expected uBytesRead to be unchanged, got %u\n", uBytesRead);
+    ok(hr == E_INVALIDARG, "Read returned with %#lx, expected %#lx\n", hr, E_INVALIDARG);
+    ok(uBytesRead == 0xdeadbeef, "Expected uBytesRead to be unchanged, got %lu\n", uBytesRead);
 
     hr = IWICStream_Read(pSubStream, MemBuf, 0, &uBytesRead);    /* read 0 bytes */
-    ok(hr == S_OK, "Read returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "Read returned with %#lx, expected %#lx\n", hr, S_OK);
 
     uBytesRead = 0xdeadbeef;
     hr = IWICStream_Read(pSubStream, NULL, 0, &uBytesRead);
-    ok(hr == E_INVALIDARG, "Read returned with %#x, expected %#x\n", hr, E_INVALIDARG);
-    ok(uBytesRead == 0xdeadbeef, "Expected uBytesRead to be unchanged, got %u\n", uBytesRead);
+    ok(hr == E_INVALIDARG, "Read returned with %#lx, expected %#lx\n", hr, E_INVALIDARG);
+    ok(uBytesRead == 0xdeadbeef, "Expected uBytesRead to be unchanged, got %lu\n", uBytesRead);
 
     hr = IWICStream_Read(pSubStream, NULL, 0, NULL);
-    ok(hr == E_INVALIDARG, "Read returned with %#x, expected %#x\n", hr, E_INVALIDARG);
+    ok(hr == E_INVALIDARG, "Read returned with %#lx, expected %#lx\n", hr, E_INVALIDARG);
 
     hr = IWICStream_Read(pSubStream, MemBuf, 1, NULL);
-    ok(hr == S_OK, "Read returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "Read returned with %#lx, expected %#lx\n", hr, S_OK);
 
     IWICStream_Seek(pSubStream, LargeNull, STREAM_SEEK_SET, NULL);
     ZeroMemory(MemBuf, sizeof(MemBuf));
     hr = IWICStream_Read(pSubStream, MemBuf, 30, &uBytesRead);
-    ok(hr == S_OK, "Read returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "Read returned with %#lx, expected %#lx\n", hr, S_OK);
     if(SUCCEEDED(hr)) {
-        ok(uBytesRead == 20, "Read %u bytes\n", uBytesRead);
+        ok(uBytesRead == 20, "Read %lu bytes\n", uBytesRead);
         ok(memcmp(Memory, CmpMem+20, 20) == 0, "Read returned invalid data!\n");
     }
     IWICStream_Seek(pSubStream, LargeNull, STREAM_SEEK_SET, NULL);
@@ -565,9 +565,9 @@ static void test_StreamOnStreamRange(void)
     MemBuf[1] = CmpMem[1] + 1;
     MemBuf[2] = CmpMem[2] + 1;
     hr = IWICStream_Write(pSubStream, MemBuf, 3, &uBytesWritten);
-    ok(hr == S_OK, "Write returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "Write returned with %#lx, expected %#lx\n", hr, S_OK);
     if(SUCCEEDED(hr)) {
-        ok(uBytesWritten == 3, "Wrote %u bytes, expected %u\n", uBytesWritten, 3);
+        ok(uBytesWritten == 3, "Wrote %lu bytes, expected %u\n", uBytesWritten, 3);
         ok(memcmp(MemBuf, Memory+20, 3) == 0, "Wrote returned invalid data!\n"); /* make sure we're writing directly */
 
         /* check whether the seek pointer has moved correctly */
@@ -577,25 +577,25 @@ static void test_StreamOnStreamRange(void)
     IWICStream_Seek(pSubStream, LargeNull, STREAM_SEEK_SET, NULL);
 
     hr = IWICStream_Write(pSubStream, MemBuf, 0, &uBytesWritten);
-    ok(hr == S_OK, "Read returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "Read returned with %#lx, expected %#lx\n", hr, S_OK);
 
     uBytesWritten = 0xdeadbeef;
     hr = IWICStream_Write(pSubStream, NULL, 3, &uBytesWritten);
-    ok(hr == E_INVALIDARG, "Write returned with %#x, expected %#x\n", hr, E_INVALIDARG);
-    ok(uBytesWritten == 0xdeadbeef, "Expected uBytesWritten to be unchanged, got %u\n", uBytesWritten);
+    ok(hr == E_INVALIDARG, "Write returned with %#lx, expected %#lx\n", hr, E_INVALIDARG);
+    ok(uBytesWritten == 0xdeadbeef, "Expected uBytesWritten to be unchanged, got %lu\n", uBytesWritten);
     CHECK_CUR_POS(pSubStream, 0);
     CHECK_CUR_POS(pStream, 0);
 
     uBytesWritten = 0xdeadbeef;
     hr = IWICStream_Write(pSubStream, NULL, 0, &uBytesWritten);
-    ok(hr == E_INVALIDARG, "Write returned with %#x, expected %#x\n", hr, E_INVALIDARG);
-    ok(uBytesWritten == 0xdeadbeef, "Expected uBytesWritten to be unchanged, got %u\n", uBytesWritten);
+    ok(hr == E_INVALIDARG, "Write returned with %#lx, expected %#lx\n", hr, E_INVALIDARG);
+    ok(uBytesWritten == 0xdeadbeef, "Expected uBytesWritten to be unchanged, got %lu\n", uBytesWritten);
     CHECK_CUR_POS(pSubStream, 0);
     CHECK_CUR_POS(pStream, 0);
 
     hr = IWICStream_Write(pSubStream, CmpMem, 30, &uBytesWritten);
-    ok(hr == S_OK, "Write returned with %#x, expected %#x\n", hr, STG_E_MEDIUMFULL);
-    ok(uBytesWritten == 20, "Wrote %u bytes, expected %u\n", uBytesWritten, 0);
+    ok(hr == S_OK, "Write returned with %#lx, expected %#lx\n", hr, STG_E_MEDIUMFULL);
+    ok(uBytesWritten == 20, "Wrote %lu bytes, expected %u\n", uBytesWritten, 0);
     CHECK_CUR_POS(pSubStream, uBytesWritten);
     CHECK_CUR_POS(pStream, 0);
     IWICStream_Seek(pSubStream, LargeNull, STREAM_SEEK_SET, NULL);
@@ -605,94 +605,94 @@ static void test_StreamOnStreamRange(void)
     uNewPos.u.HighPart = 0;
     uNewPos.u.LowPart = sizeof(Memory) + 10;
     hr = IWICStream_SetSize(pSubStream, uNewPos);
-    ok(hr == E_NOTIMPL, "SetSize returned %#x, expected %#x\n", hr, E_NOTIMPL);
+    ok(hr == E_NOTIMPL, "SetSize returned %#lx, expected %#lx\n", hr, E_NOTIMPL);
 
     uNewPos.u.HighPart = 0;
     uNewPos.u.LowPart = sizeof(Memory);
     hr = IWICStream_SetSize(pSubStream, uNewPos);
-    ok(hr == E_NOTIMPL, "SetSize returned %#x, expected %#x\n", hr, E_NOTIMPL);
+    ok(hr == E_NOTIMPL, "SetSize returned %#lx, expected %#lx\n", hr, E_NOTIMPL);
 
     uNewPos.u.HighPart = 0;
     uNewPos.u.LowPart = sizeof(Memory) - 10;
     hr = IWICStream_SetSize(pSubStream, uNewPos);
-    ok(hr == E_NOTIMPL, "SetSize returned %#x, expected %#x\n", hr, E_NOTIMPL);
+    ok(hr == E_NOTIMPL, "SetSize returned %#lx, expected %#lx\n", hr, E_NOTIMPL);
 
     uNewPos.u.HighPart = 0;
     uNewPos.u.LowPart = 0;
     hr = IWICStream_SetSize(pSubStream, uNewPos);
-    ok(hr == E_NOTIMPL, "SetSize returned %#x, expected %#x\n", hr, E_NOTIMPL);
+    ok(hr == E_NOTIMPL, "SetSize returned %#lx, expected %#lx\n", hr, E_NOTIMPL);
 
     uNewPos.QuadPart = -10;
     hr = IWICStream_SetSize(pSubStream, uNewPos);
-    ok(hr == E_NOTIMPL, "SetSize returned %#x, expected %#x\n", hr, E_NOTIMPL);
+    ok(hr == E_NOTIMPL, "SetSize returned %#lx, expected %#lx\n", hr, E_NOTIMPL);
 
 
     /* CopyTo */
     uNewPos.u.HighPart = 0;
     uNewPos.u.LowPart = 30;
     hr = IWICStream_CopyTo(pSubStream, NULL, uNewPos, NULL, NULL);
-    ok(hr == E_NOTIMPL, "CopyTo returned %#x, expected %#x\n", hr, E_NOTIMPL);
+    ok(hr == E_NOTIMPL, "CopyTo returned %#lx, expected %#lx\n", hr, E_NOTIMPL);
 
     hr = CreateStreamOnHGlobal(NULL, TRUE, &CopyStream);
-    ok(hr == S_OK, "CreateStream failed with %#x\n", hr);
+    ok(hr == S_OK, "CreateStream failed with %#lx\n", hr);
 
     hr = IWICStream_CopyTo(pSubStream, CopyStream, uNewPos, NULL, NULL);
-    ok(hr == E_NOTIMPL, "CopyTo returned %#x, expected %#x\n", hr, E_NOTIMPL);
+    ok(hr == E_NOTIMPL, "CopyTo returned %#lx, expected %#lx\n", hr, E_NOTIMPL);
     IStream_Release(CopyStream);
 
 
     /* Commit */
     hr = IWICStream_Commit(pSubStream, STGC_DEFAULT);
-    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
+    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#lx\n", hr);
 
     hr = IWICStream_Commit(pSubStream, STGC_OVERWRITE);
-    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
+    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#lx\n", hr);
 
     hr = IWICStream_Commit(pSubStream, STGC_ONLYIFCURRENT);
-    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
+    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#lx\n", hr);
 
     hr = IWICStream_Commit(pSubStream, STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE);
-    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
+    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#lx\n", hr);
 
     hr = IWICStream_Commit(pSubStream, STGC_CONSOLIDATE);
-    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
+    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#lx\n", hr);
 
 
     /* Revert */
     IWICStream_Write(pSubStream, &MemBuf[5], 6, NULL);
     hr = IWICStream_Revert(pSubStream);
-    ok(hr == E_NOTIMPL, "Revert returned %#x, expected %#x\n", hr, E_NOTIMPL);
+    ok(hr == E_NOTIMPL, "Revert returned %#lx, expected %#lx\n", hr, E_NOTIMPL);
     memcpy(Memory, CmpMem, sizeof(Memory));
 
 
     /* LockRegion/UnlockRegion */
     hr = IWICStream_LockRegion(pSubStream, uLargeNull, uLargeNull, 0);
-    ok(hr == E_NOTIMPL, "LockRegion returned %#x, expected %#x\n", hr, E_NOTIMPL);
+    ok(hr == E_NOTIMPL, "LockRegion returned %#lx, expected %#lx\n", hr, E_NOTIMPL);
 
     hr = IWICStream_UnlockRegion(pSubStream, uLargeNull, uLargeNull, 0);
-    ok(hr == E_NOTIMPL, "UnlockRegion returned %#x, expected %#x\n", hr, E_NOTIMPL);
+    ok(hr == E_NOTIMPL, "UnlockRegion returned %#lx, expected %#lx\n", hr, E_NOTIMPL);
 
 
     /* Stat */
     hr = IWICStream_Stat(pSubStream, NULL, 0);
-    ok(hr == E_INVALIDARG, "Stat returned %#x, expected %#x\n", hr, E_INVALIDARG);
+    ok(hr == E_INVALIDARG, "Stat returned %#lx, expected %#lx\n", hr, E_INVALIDARG);
 
     hr = IWICStream_Stat(pSubStream, &Stats, 0);
-    ok(hr == S_OK, "Stat returned %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "Stat returned %#lx, expected %#lx\n", hr, S_OK);
     ok(Stats.pwcsName == NULL, "Stat returned name %p, expected %p\n", Stats.pwcsName, NULL);
-    ok(Stats.type == STGTY_STREAM, "Stat returned type %d, expected %d\n", Stats.type, STGTY_STREAM);
-    ok(Stats.cbSize.u.HighPart == 0 && Stats.cbSize.u.LowPart == 20, "Stat returned size (%u;%u)\n", Stats.cbSize.u.HighPart, Stats.cbSize.u.LowPart);
-    ok(Stats.mtime.dwHighDateTime == 0 && Stats.mtime.dwLowDateTime == 0, "Stat returned mtime (%u;%u), expected (%u;%u)\n", Stats.mtime.dwHighDateTime, Stats.mtime.dwLowDateTime, 0, 0);
-    ok(Stats.ctime.dwHighDateTime == 0 && Stats.ctime.dwLowDateTime == 0, "Stat returned ctime (%u;%u), expected (%u;%u)\n", Stats.ctime.dwHighDateTime, Stats.ctime.dwLowDateTime, 0, 0);
-    ok(Stats.atime.dwHighDateTime == 0 && Stats.atime.dwLowDateTime == 0, "Stat returned atime (%u;%u), expected (%u;%u)\n", Stats.atime.dwHighDateTime, Stats.atime.dwLowDateTime, 0, 0);
-    ok(Stats.grfMode == 0, "Stat returned access mode %d, expected %d\n", Stats.grfMode, 0);
-    ok(Stats.grfLocksSupported == 0, "Stat returned supported locks %#x, expected %#x\n", Stats.grfLocksSupported, 0);
-    ok(Stats.grfStateBits == 0, "Stat returned state bits %#x, expected %#x\n", Stats.grfStateBits, 0);
+    ok(Stats.type == STGTY_STREAM, "Stat returned type %ld, expected %d\n", Stats.type, STGTY_STREAM);
+    ok(Stats.cbSize.u.HighPart == 0 && Stats.cbSize.u.LowPart == 20, "Stat returned size (%lu;%lu)\n", Stats.cbSize.u.HighPart, Stats.cbSize.u.LowPart);
+    ok(Stats.mtime.dwHighDateTime == 0 && Stats.mtime.dwLowDateTime == 0, "Stat returned mtime (%lu;%lu), expected (%u;%u)\n", Stats.mtime.dwHighDateTime, Stats.mtime.dwLowDateTime, 0, 0);
+    ok(Stats.ctime.dwHighDateTime == 0 && Stats.ctime.dwLowDateTime == 0, "Stat returned ctime (%lu;%lu), expected (%u;%u)\n", Stats.ctime.dwHighDateTime, Stats.ctime.dwLowDateTime, 0, 0);
+    ok(Stats.atime.dwHighDateTime == 0 && Stats.atime.dwLowDateTime == 0, "Stat returned atime (%lu;%lu), expected (%u;%u)\n", Stats.atime.dwHighDateTime, Stats.atime.dwLowDateTime, 0, 0);
+    ok(Stats.grfMode == 0, "Stat returned access mode %ld, expected %d\n", Stats.grfMode, 0);
+    ok(Stats.grfLocksSupported == 0, "Stat returned supported locks %#lx, expected %#x\n", Stats.grfLocksSupported, 0);
+    ok(Stats.grfStateBits == 0, "Stat returned state bits %#lx, expected %#x\n", Stats.grfStateBits, 0);
 
 
     /* Clone */
     hr = IWICStream_Clone(pSubStream, &CopyStream);
-    ok(hr == E_NOTIMPL, "Clone returned %#x, expected %#x\n", hr, E_NOTIMPL);
+    ok(hr == E_NOTIMPL, "Clone returned %#lx, expected %#lx\n", hr, E_NOTIMPL);
 
 
     IWICStream_Release(pSubStream);
@@ -700,30 +700,30 @@ static void test_StreamOnStreamRange(void)
 
     /* Recreate, this time larger than the original. */
     hr = IWICImagingFactory_CreateStream(pFactory, &pSubStream);
-    ok(hr == S_OK, "CreateStream returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "CreateStream returned with %#lx, expected %#lx\n", hr, S_OK);
 
     uNewPos.QuadPart = 48;
     uSize.QuadPart = 32;
     hr = IWICStream_InitializeFromIStreamRegion(pSubStream, (IStream*)pStream, uNewPos, uSize);
-    ok(hr == S_OK, "InitializeFromMemory returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "InitializeFromMemory returned with %#lx, expected %#lx\n", hr, S_OK);
 
     hr = IWICStream_Seek(pSubStream, LargeNull, STREAM_SEEK_END, &uNewPos);
-    ok(hr == S_OK, "Seek returned with %#x, expected %#x\n", hr, S_OK);
-    ok(uNewPos.u.HighPart == 0 && uNewPos.u.LowPart == 16, "Seek cursor moved to position (%u;%u), expected (%u;%u)\n", uNewPos.u.HighPart, uNewPos.u.LowPart, 0, 16);
+    ok(hr == S_OK, "Seek returned with %#lx, expected %#lx\n", hr, S_OK);
+    ok(uNewPos.u.HighPart == 0 && uNewPos.u.LowPart == 16, "Seek cursor moved to position (%lu;%lu), expected (%u;%u)\n", uNewPos.u.HighPart, uNewPos.u.LowPart, 0, 16);
 
     IWICStream_Seek(pSubStream, LargeNull, STREAM_SEEK_SET, NULL);
     hr = IWICStream_Read(pSubStream, Memory, 48, &uBytesRead);
-    ok(hr == S_OK, "Read returned with %#x, expected %#x\n", hr, S_OK);
+    ok(hr == S_OK, "Read returned with %#lx, expected %#lx\n", hr, S_OK);
     if(SUCCEEDED(hr)) {
-        ok(uBytesRead == 16, "Read %u bytes\n", uBytesRead);
+        ok(uBytesRead == 16, "Read %lu bytes\n", uBytesRead);
         ok(memcmp(Memory, CmpMem+48, uBytesRead) == 0, "Read returned invalid data!\n");
     }
 
     IWICStream_Seek(pSubStream, LargeNull, STREAM_SEEK_SET, NULL);
     uBytesWritten = 0xdeadbeef;
     hr = IWICStream_Write(pSubStream, CmpMem, 32, &uBytesWritten);
-    ok(hr == STG_E_MEDIUMFULL, "Write returned with %#x, expected %#x\n", hr, STG_E_MEDIUMFULL);
-    ok(uBytesWritten == 0xdeadbeef, "Expected uBytesWritten to be unchanged, got %u\n", uBytesWritten);
+    ok(hr == STG_E_MEDIUMFULL, "Write returned with %#lx, expected %#lx\n", hr, STG_E_MEDIUMFULL);
+    ok(uBytesWritten == 0xdeadbeef, "Expected uBytesWritten to be unchanged, got %lu\n", uBytesWritten);
     CHECK_CUR_POS(pSubStream, 0);
     CHECK_CUR_POS(pStream, 0);
 
@@ -759,49 +759,49 @@ static void test_StreamOnIStream(void)
 
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
         &IID_IWICImagingFactory, (void **)&factory);
-    ok(hr == S_OK, "Failed to create a factory, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to create a factory, hr %#lx.\n", hr);
 
     hr = IWICImagingFactory_CreateStream(factory, &stream);
-    ok(hr == S_OK, "Failed to create a stream, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to create a stream, hr %#lx.\n", hr);
 
     hr = IWICStream_InitializeFromMemory(stream, memory, sizeof(memory));
-    ok(hr == S_OK, "Failed to initialize stream, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to initialize stream, hr %#lx.\n", hr);
 
     hr = IWICImagingFactory_CreateStream(factory, &substream);
-    ok(hr == S_OK, "Failed to create a stream, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to create a stream, hr %#lx.\n", hr);
 
     pos.QuadPart = 1;
     hr = IWICStream_Seek(stream, pos, STREAM_SEEK_SET, &newpos);
-    ok(hr == S_OK, "Failed to set position, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to set position, hr %#lx.\n", hr);
     CHECK_CUR_POS(stream, 1);
 
     hr = IWICStream_InitializeFromIStream(substream, (IStream *)stream);
-    ok(hr == S_OK, "Failed to initialize stream, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to initialize stream, hr %#lx.\n", hr);
     CHECK_CUR_POS(substream, 1);
 
     /* Seek */
     CHECK_CUR_POS(stream, 1);
     hr = IWICStream_Seek(substream, zero_pos, STREAM_SEEK_END, &newpos);
-    ok(hr == S_OK, "Failed to seek a stream, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to seek a stream, hr %#lx.\n", hr);
     ok(newpos.QuadPart == sizeof(memory), "Unexpected position %s.\n", wine_dbgstr_longlong(newpos.QuadPart));
     CHECK_CUR_POS(substream, sizeof(memory));
     CHECK_CUR_POS(stream, sizeof(memory));
 
     hr = IWICStream_Seek(substream, zero_pos, STREAM_SEEK_SET, &newpos);
-    ok(hr == S_OK, "Failed to seek a stream, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to seek a stream, hr %#lx.\n", hr);
     ok(newpos.QuadPart == 0, "Unexpected position %s.\n", wine_dbgstr_longlong(newpos.QuadPart));
     CHECK_CUR_POS(stream, 0);
     CHECK_CUR_POS(substream, 0);
 
     hr = IWICStream_Seek(substream, zero_pos, STREAM_SEEK_SET, NULL);
-    ok(hr == S_OK, "Failed to seek a stream, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to seek a stream, hr %#lx.\n", hr);
 
     pos.u.HighPart = 1;
     pos.u.LowPart = 0;
     newpos.u.HighPart = 0xdeadbeef;
     newpos.u.LowPart = 0xdeadbeef;
     hr = IWICStream_Seek(substream, pos, STREAM_SEEK_SET, &newpos);
-    ok(hr == HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW), "Unexpected hr %#x.\n", hr);
+    ok(hr == HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW), "Unexpected hr %#lx.\n", hr);
     ok(newpos.u.HighPart == 0xdeadbeef && newpos.u.LowPart == 0xdeadbeef, "Unexpected position %s.\n",
         wine_dbgstr_longlong(newpos.QuadPart));
     CHECK_CUR_POS(stream, 0);
@@ -811,7 +811,7 @@ static void test_StreamOnIStream(void)
     newpos.u.HighPart = 0xdeadbeef;
     newpos.u.LowPart = 0xdeadbeef;
     hr = IWICStream_Seek(substream, pos, STREAM_SEEK_SET, &newpos);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
     ok(newpos.u.HighPart == 0xdeadbeef && newpos.u.LowPart == 0xdeadbeef, "Unexpected position %s.\n",
         wine_dbgstr_longlong(newpos.QuadPart));
     CHECK_CUR_POS(stream, 0);
@@ -821,7 +821,7 @@ static void test_StreamOnIStream(void)
     newpos.u.HighPart = 0xdeadbeef;
     newpos.u.LowPart = 0xdeadbeef;
     hr = IWICStream_Seek(substream, pos, STREAM_SEEK_END, &newpos);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
     ok(newpos.u.HighPart == 0xdeadbeef && newpos.u.LowPart == 0xdeadbeef, "Unexpected position %s.\n",
         wine_dbgstr_longlong(newpos.QuadPart));
     CHECK_CUR_POS(stream, 0);
@@ -829,7 +829,7 @@ static void test_StreamOnIStream(void)
 
     pos.QuadPart = -1;
     hr = IWICStream_Seek(substream, pos, STREAM_SEEK_END, &newpos);
-    ok(hr == S_OK, "Failed to seek a stream, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to seek a stream, hr %#lx.\n", hr);
     ok(newpos.QuadPart == sizeof(memory) - 1, "Unexpected position %s.\n", wine_dbgstr_longlong(newpos.QuadPart));
     CHECK_CUR_POS(stream, sizeof(memory) - 1);
     CHECK_CUR_POS(substream, sizeof(memory) - 1);
@@ -838,8 +838,8 @@ static void test_StreamOnIStream(void)
 
     /* Read */
     hr = IWICStream_Read(substream, buff, 12, &read_len);
-    ok(hr == S_OK, "Failed to read from stream, hr %#x.\n", hr);
-    ok(read_len == 12, "Unexpected read length %u.\n", read_len);
+    ok(hr == S_OK, "Failed to read from stream, hr %#lx.\n", hr);
+    ok(read_len == 12, "Unexpected read length %lu.\n", read_len);
     ok(!memcmp(buff, data, 12), "Unexpected data.\n");
     CHECK_CUR_POS(substream, read_len);
     CHECK_CUR_POS(stream, read_len);
@@ -848,39 +848,39 @@ static void test_StreamOnIStream(void)
     CHECK_CUR_POS(stream, 0);
 
     hr = IWICStream_Read(substream, memory, 10, &read_len);   /* source = dest */
-    ok(hr == S_OK, "Failed to read from stream, hr %#x.\n", hr);
-    ok(read_len == 10, "Unexpected read length %u.\n", read_len);
+    ok(hr == S_OK, "Failed to read from stream, hr %#lx.\n", hr);
+    ok(read_len == 10, "Unexpected read length %lu.\n", read_len);
     ok(!memcmp(memory, data, read_len), "Unexpected data.\n");
     CHECK_CUR_POS(stream, 10);
 
     IWICStream_Seek(substream, zero_pos, STREAM_SEEK_SET, NULL);
     hr = IWICStream_Read(substream, memory, 2 * sizeof(data), &read_len);   /* request too many bytes */
-    ok(hr == S_OK, "Failed to read from stream, hr %#x.\n", hr);
-    ok(read_len == 64, "Unexpected read length %u.\n", read_len);
+    ok(hr == S_OK, "Failed to read from stream, hr %#lx.\n", hr);
+    ok(read_len == 64, "Unexpected read length %lu.\n", read_len);
     ok(!memcmp(memory, data, read_len), "Unexpected data.\n");
     CHECK_CUR_POS(stream, sizeof(data));
 
     IWICStream_Seek(substream, zero_pos, STREAM_SEEK_SET, NULL);
     read_len = 0xdeadbeef;
     hr = IWICStream_Read(substream, NULL, 1, &read_len);    /* destination buffer = NULL */
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
-    ok(read_len == 0xdeadbeef, "Unexpected read length %u.\n", read_len);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
+    ok(read_len == 0xdeadbeef, "Unexpected read length %lu.\n", read_len);
 
     read_len = 1;
     hr = IWICStream_Read(substream, buff, 0, &read_len);    /* read 0 bytes */
-    ok(hr == S_OK, "Failed to read from stream, hr %#x.\n", hr);
-    ok(read_len == 0, "Unexpected read length %u.\n", read_len);
+    ok(hr == S_OK, "Failed to read from stream, hr %#lx.\n", hr);
+    ok(read_len == 0, "Unexpected read length %lu.\n", read_len);
 
     read_len = 0xdeadbeef;
     hr = IWICStream_Read(substream, NULL, 0, &read_len);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
-    ok(read_len == 0xdeadbeef, "Unexpected read length %u.\n", read_len);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
+    ok(read_len == 0xdeadbeef, "Unexpected read length %lu.\n", read_len);
 
     hr = IWICStream_Read(substream, NULL, 0, NULL);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
 
     hr = IWICStream_Read(substream, buff, 1, NULL);
-    ok(hr == S_OK, "Failed to read from stream, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to read from stream, hr %#lx.\n", hr);
     CHECK_CUR_POS(substream, 1);
     CHECK_CUR_POS(stream, 1);
     IWICStream_Seek(substream, zero_pos, STREAM_SEEK_SET, NULL);
@@ -890,27 +890,27 @@ static void test_StreamOnIStream(void)
         buff[i] = data[i] + 1;
 
     hr = IWICStream_Write(substream, buff, 3, &written);
-    ok(hr == S_OK, "Failed to write to stream, hr %#x.\n", hr);
-    ok(written == 3, "Unexpected written length %u.\n", written);
+    ok(hr == S_OK, "Failed to write to stream, hr %#lx.\n", hr);
+    ok(written == 3, "Unexpected written length %lu.\n", written);
     ok(!memcmp(buff, memory, 3), "Unexpected stream data.\n");
     CHECK_CUR_POS(substream, written);
     CHECK_CUR_POS(stream, written);
     IWICStream_Seek(substream, zero_pos, STREAM_SEEK_SET, NULL);
 
     hr = IWICStream_Write(substream, buff, 0, &written);
-    ok(hr == S_OK, "Failed to write to stream, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to write to stream, hr %#lx.\n", hr);
 
     written = 0xdeadbeef;
     hr = IWICStream_Write(substream, NULL, 3, &written);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
-    ok(written == 0xdeadbeef, "Unexpected written length %u.\n", written);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
+    ok(written == 0xdeadbeef, "Unexpected written length %lu.\n", written);
     CHECK_CUR_POS(substream, 0);
     CHECK_CUR_POS(stream, 0);
 
     written = 0xdeadbeef;
     hr = IWICStream_Write(substream, NULL, 0, &written);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
-    ok(written == 0xdeadbeef, "Unexpected written length %u.\n", written);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
+    ok(written == 0xdeadbeef, "Unexpected written length %lu.\n", written);
     CHECK_CUR_POS(substream, 0);
     CHECK_CUR_POS(stream, 0);
 
@@ -918,90 +918,90 @@ static void test_StreamOnIStream(void)
     newpos.u.HighPart = 0;
     newpos.u.LowPart = sizeof(memory) + 10;
     hr = IWICStream_SetSize(substream, newpos);
-    ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
 
     newpos.u.HighPart = 0;
     newpos.u.LowPart = sizeof(memory);
     hr = IWICStream_SetSize(substream, newpos);
-    ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
 
     newpos.u.HighPart = 0;
     newpos.u.LowPart = sizeof(memory) - 10;
     hr = IWICStream_SetSize(substream, newpos);
-    ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
 
     newpos.QuadPart = 0;
     hr = IWICStream_SetSize(substream, newpos);
-    ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
 
     newpos.QuadPart = -10;
     hr = IWICStream_SetSize(substream, newpos);
-    ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
 
     /* CopyTo */
     newpos.u.HighPart = 0;
     newpos.u.LowPart = 30;
     hr = IWICStream_CopyTo(substream, NULL, newpos, NULL, NULL);
-    ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
 
     hr = CreateStreamOnHGlobal(NULL, TRUE, &copy_stream);
-    ok(hr == S_OK, "Failed to create a stream, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to create a stream, hr %#lx.\n", hr);
 
     hr = IWICStream_CopyTo(substream, copy_stream, newpos, NULL, NULL);
-    ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
     IStream_Release(copy_stream);
 
     /* Commit */
     hr = IWICStream_Commit(substream, STGC_DEFAULT);
-    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
+    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#lx\n", hr);
 
     hr = IWICStream_Commit(substream, STGC_OVERWRITE);
-    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
+    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#lx\n", hr);
 
     hr = IWICStream_Commit(substream, STGC_ONLYIFCURRENT);
-    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
+    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#lx\n", hr);
 
     hr = IWICStream_Commit(substream, STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE);
-    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
+    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#lx\n", hr);
 
     hr = IWICStream_Commit(substream, STGC_CONSOLIDATE);
-    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#x\n", hr);
+    ok(broken(hr == E_NOTIMPL) || hr == S_OK, "Commit returned %#lx\n", hr);
 
     /* Revert */
     IWICStream_Write(substream, buff + 5, 6, NULL);
     hr = IWICStream_Revert(substream);
-    ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
     memcpy(memory, data, sizeof(memory));
 
     /* LockRegion/UnlockRegion */
     hr = IWICStream_LockRegion(substream, uzero, uzero, 0);
-    ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
 
     hr = IWICStream_UnlockRegion(substream, uzero, uzero, 0);
-    ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
 
     /* Stat */
     hr = IWICStream_Stat(substream, NULL, 0);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
 
     hr = IWICStream_Stat(substream, &stats, 0);
-    ok(hr == S_OK, "Failed to get stream stats, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to get stream stats, hr %#lx.\n", hr);
     ok(stats.pwcsName == NULL, "Unexpected name %p.\n", stats.pwcsName);
-    ok(stats.type == STGTY_STREAM, "Unexpected type %d.\n", stats.type);
+    ok(stats.type == STGTY_STREAM, "Unexpected type %ld.\n", stats.type);
     ok(stats.cbSize.QuadPart == sizeof(data), "Unexpected size %s.\n", wine_dbgstr_longlong(stats.cbSize.QuadPart));
-    ok(stats.mtime.dwHighDateTime == 0 && stats.mtime.dwLowDateTime == 0, "Unexpected mtime (%u;%u).\n",
+    ok(stats.mtime.dwHighDateTime == 0 && stats.mtime.dwLowDateTime == 0, "Unexpected mtime (%lu;%lu).\n",
         stats.mtime.dwHighDateTime, stats.mtime.dwLowDateTime);
-    ok(stats.ctime.dwHighDateTime == 0 && stats.ctime.dwLowDateTime == 0, "Unexpected ctime (%u;%u).\n",
+    ok(stats.ctime.dwHighDateTime == 0 && stats.ctime.dwLowDateTime == 0, "Unexpected ctime (%lu;%lu).\n",
         stats.ctime.dwHighDateTime, stats.ctime.dwLowDateTime);
-    ok(stats.atime.dwHighDateTime == 0 && stats.atime.dwLowDateTime == 0, "Unexpected atime (%u;%u).\n",
+    ok(stats.atime.dwHighDateTime == 0 && stats.atime.dwLowDateTime == 0, "Unexpected atime (%lu;%lu).\n",
         stats.atime.dwHighDateTime, stats.atime.dwLowDateTime);
-    ok(stats.grfMode == 0, "Unexpected mode %d.\n", stats.grfMode);
-    ok(stats.grfLocksSupported == 0, "Unexpected locks support %#x.\n", stats.grfLocksSupported);
-    ok(stats.grfStateBits == 0, "Unexpected state bits %#x.\n", stats.grfStateBits);
+    ok(stats.grfMode == 0, "Unexpected mode %ld.\n", stats.grfMode);
+    ok(stats.grfLocksSupported == 0, "Unexpected locks support %#lx.\n", stats.grfLocksSupported);
+    ok(stats.grfStateBits == 0, "Unexpected state bits %#lx.\n", stats.grfStateBits);
 
     /* Clone */
     hr = IWICStream_Clone(substream, &copy_stream);
-    ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
 
     IWICStream_Release(substream);
     IWICStream_Release(stream);
diff --git a/dlls/windowscodecs/tests/tiffformat.c b/dlls/windowscodecs/tests/tiffformat.c
index 4c3dea2288f..86365fb7b92 100644
--- a/dlls/windowscodecs/tests/tiffformat.c
+++ b/dlls/windowscodecs/tests/tiffformat.c
@@ -32,7 +32,7 @@ static void _expect_ref(IUnknown* obj, ULONG ref, int line)
     ULONG rc;
     IUnknown_AddRef(obj);
     rc = IUnknown_Release(obj);
-    ok_(__FILE__,line)(rc == ref, "expected refcount %d, got %d\n", ref, rc);
+    ok_(__FILE__,line)(rc == ref, "expected refcount %ld, got %ld\n", ref, rc);
 }
 
 #define IFD_BYTE 1
@@ -363,7 +363,7 @@ static IStream *create_stream(const void *data, int data_size)
     GlobalUnlock(hdata);
 
     hr = CreateStreamOnHGlobal(hdata, TRUE, &stream);
-    ok(hr == S_OK, "CreateStreamOnHGlobal failed, hr=%x\n", hr);
+    ok(hr == S_OK, "CreateStreamOnHGlobal failed, hr=%lx\n", hr);
 
     return stream;
 }
@@ -385,13 +385,13 @@ static HRESULT create_decoder(const void *image_data, UINT image_size, IWICBitma
     GlobalUnlock(hmem);
 
     hr = CreateStreamOnHGlobal(hmem, TRUE, &stream);
-    ok(hr == S_OK, "CreateStreamOnHGlobal error %#x\n", hr);
+    ok(hr == S_OK, "CreateStreamOnHGlobal error %#lx\n", hr);
 
     hr = IWICImagingFactory_CreateDecoderFromStream(factory, stream, NULL, 0, decoder);
     if (hr == S_OK)
     {
         hr = IWICBitmapDecoder_GetContainerFormat(*decoder, &format);
-        ok(hr == S_OK, "GetContainerFormat error %#x\n", hr);
+        ok(hr == S_OK, "GetContainerFormat error %#lx\n", hr);
         ok(IsEqualGUID(&format, &GUID_ContainerFormatTiff),
            "wrong container format %s\n", wine_dbgstr_guid(&format));
 
@@ -409,23 +409,23 @@ static HRESULT get_pixelformat_info(const GUID *format, UINT *bpp, UINT *channel
     IWICPixelFormatInfo2 *formatinfo;
 
     hr = IWICImagingFactory_CreateComponentInfo(factory, format, &info);
-    ok(hr == S_OK, "CreateComponentInfo(%s) error %#x\n", wine_dbgstr_guid(format), hr);
+    ok(hr == S_OK, "CreateComponentInfo(%s) error %#lx\n", wine_dbgstr_guid(format), hr);
     if (hr == S_OK)
     {
         hr = IWICComponentInfo_QueryInterface(info, &IID_IWICPixelFormatInfo2, (void **)&formatinfo);
         if (hr == S_OK)
         {
             hr = IWICPixelFormatInfo2_SupportsTransparency(formatinfo, transparency);
-            ok(hr == S_OK, "SupportsTransparency error %#x\n", hr);
+            ok(hr == S_OK, "SupportsTransparency error %#lx\n", hr);
             IWICPixelFormatInfo2_Release(formatinfo);
         }
         hr = IWICComponentInfo_QueryInterface(info, &IID_IWICPixelFormatInfo, (void **)&formatinfo);
         if (hr == S_OK)
         {
             hr = IWICPixelFormatInfo2_GetBitsPerPixel(formatinfo, bpp);
-            ok(hr == S_OK, "GetBitsPerPixel error %#x\n", hr);
+            ok(hr == S_OK, "GetBitsPerPixel error %#lx\n", hr);
             hr = IWICPixelFormatInfo2_GetChannelCount(formatinfo, channels);
-            ok(hr == S_OK, "GetChannelCount error %#x\n", hr);
+            ok(hr == S_OK, "GetChannelCount error %#lx\n", hr);
             IWICPixelFormatInfo2_Release(formatinfo);
         }
         IWICComponentInfo_Release(info);
@@ -445,7 +445,7 @@ static void dump_tiff(void *buf)
 
     for (i = 0; i < count; i++)
     {
-        printf("tag %u: id %04x, type %04x, count %u, value %d",
+        printf("tag %u: id %04x, type %04x, count %lu, value %ld",
                 i, tag[i].id, tag[i].type, tag[i].count, tag[i].value);
         if (tag[i].id == 0x102 && tag[i].count > 2)
         {
@@ -466,22 +466,22 @@ static void test_tiff_1bpp_palette(void)
     GUID format;
 
     hr = create_decoder(&tiff_1bpp_data, sizeof(tiff_1bpp_data), &decoder);
-    ok(hr == S_OK, "Failed to load TIFF image data %#x\n", hr);
+    ok(hr == S_OK, "Failed to load TIFF image data %#lx\n", hr);
     if (hr != S_OK) return;
 
     hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
-    ok(hr == S_OK, "GetFrame error %#x\n", hr);
+    ok(hr == S_OK, "GetFrame error %#lx\n", hr);
 
     hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format);
-    ok(hr == S_OK, "GetPixelFormat error %#x\n", hr);
+    ok(hr == S_OK, "GetPixelFormat error %#lx\n", hr);
     ok(IsEqualGUID(&format, &GUID_WICPixelFormatBlackWhite),
        "got wrong format %s\n", wine_dbgstr_guid(&format));
 
     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-    ok(hr == S_OK, "CreatePalette error %#x\n", hr);
+    ok(hr == S_OK, "CreatePalette error %#lx\n", hr);
     hr = IWICBitmapFrameDecode_CopyPalette(frame, palette);
     ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE,
-       "expected WINCODEC_ERR_PALETTEUNAVAILABLE, got %#x\n", hr);
+       "expected WINCODEC_ERR_PALETTEUNAVAILABLE, got %#lx\n", hr);
 
     IWICPalette_Release(palette);
     IWICBitmapFrameDecode_Release(frame);
@@ -507,77 +507,77 @@ static void test_QueryCapability(void)
     if (!stream) return;
 
     hr = IWICImagingFactory_CreateDecoder(factory, &GUID_ContainerFormatTiff, NULL, &decoder);
-    ok(hr == S_OK, "CreateDecoder error %#x\n", hr);
+    ok(hr == S_OK, "CreateDecoder error %#lx\n", hr);
     if (FAILED(hr)) return;
 
     frame_count = 0xdeadbeef;
     hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count);
-    ok(hr == S_OK || broken(hr == E_POINTER) /* XP */, "GetFrameCount error %#x\n", hr);
+    ok(hr == S_OK || broken(hr == E_POINTER) /* XP */, "GetFrameCount error %#lx\n", hr);
     ok(frame_count == 0, "expected 0, got %u\n", frame_count);
 
     hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
-    ok(hr == WINCODEC_ERR_FRAMEMISSING || broken(hr == E_POINTER) /* XP */, "expected WINCODEC_ERR_FRAMEMISSING, got %#x\n", hr);
+    ok(hr == WINCODEC_ERR_FRAMEMISSING || broken(hr == E_POINTER) /* XP */, "expected WINCODEC_ERR_FRAMEMISSING, got %#lx\n", hr);
 
     pos.QuadPart = 4;
     hr = IStream_Seek(stream, pos, SEEK_SET, NULL);
-    ok(hr == S_OK, "IStream_Seek error %#x\n", hr);
+    ok(hr == S_OK, "IStream_Seek error %#lx\n", hr);
 
     capability = 0xdeadbeef;
     hr = IWICBitmapDecoder_QueryCapability(decoder, stream, &capability);
-    ok(hr == S_OK, "QueryCapability error %#x\n", hr);
+    ok(hr == S_OK, "QueryCapability error %#lx\n", hr);
     ok(capability == exp_caps || capability == exp_caps_xp,
-       "expected %#x, got %#x\n", exp_caps, capability);
+       "expected %#lx, got %#lx\n", exp_caps, capability);
 
     frame_count = 0xdeadbeef;
     hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count);
-    ok(hr == S_OK, "GetFrameCount error %#x\n", hr);
+    ok(hr == S_OK, "GetFrameCount error %#lx\n", hr);
     ok(frame_count == 1, "expected 1, got %u\n", frame_count);
 
     hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
-    ok(hr == S_OK, "GetFrame error %#x\n", hr);
+    ok(hr == S_OK, "GetFrame error %#lx\n", hr);
     IWICBitmapFrameDecode_Release(frame);
 
     pos.QuadPart = 5;
     hr = IStream_Seek(stream, pos, SEEK_SET, NULL);
-    ok(hr == S_OK, "IStream_Seek error %#x\n", hr);
+    ok(hr == S_OK, "IStream_Seek error %#lx\n", hr);
 
     hr = IWICBitmapDecoder_QueryCapability(decoder, stream, &capability);
-    ok(hr == WINCODEC_ERR_WRONGSTATE, "expected WINCODEC_ERR_WRONGSTATE, got %#x\n", hr);
+    ok(hr == WINCODEC_ERR_WRONGSTATE, "expected WINCODEC_ERR_WRONGSTATE, got %#lx\n", hr);
 
     hr = IWICBitmapDecoder_Initialize(decoder, stream, WICDecodeMetadataCacheOnDemand);
-    ok(hr == WINCODEC_ERR_WRONGSTATE, "expected WINCODEC_ERR_WRONGSTATE, got %#x\n", hr);
+    ok(hr == WINCODEC_ERR_WRONGSTATE, "expected WINCODEC_ERR_WRONGSTATE, got %#lx\n", hr);
 
     IWICBitmapDecoder_Release(decoder);
 
     /* CreateDecoderFromStream fails if seeked past the start */
     hr = IWICImagingFactory_CreateDecoderFromStream(factory, stream, NULL, 0, &decoder);
     todo_wine
-    ok(hr == WINCODEC_ERR_COMPONENTNOTFOUND, "expected WINCODEC_ERR_COMPONENTNOTFOUND, got %#x\n", hr);
+    ok(hr == WINCODEC_ERR_COMPONENTNOTFOUND, "expected WINCODEC_ERR_COMPONENTNOTFOUND, got %#lx\n", hr);
 
     if (SUCCEEDED(hr))
         IWICBitmapDecoder_Release(decoder);
 
     pos.QuadPart = 0;
     hr = IStream_Seek(stream, pos, SEEK_SET, NULL);
-    ok(hr == S_OK, "IStream_Seek error %#x\n", hr);
+    ok(hr == S_OK, "IStream_Seek error %#lx\n", hr);
 
     hr = IWICImagingFactory_CreateDecoderFromStream(factory, stream, NULL, 0, &decoder);
-    ok(hr == S_OK, "CreateDecoderFromStream error %#x\n", hr);
+    ok(hr == S_OK, "CreateDecoderFromStream error %#lx\n", hr);
 
     frame_count = 0xdeadbeef;
     hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count);
-    ok(hr == S_OK, "GetFrameCount error %#x\n", hr);
+    ok(hr == S_OK, "GetFrameCount error %#lx\n", hr);
     ok(frame_count == 1, "expected 1, got %u\n", frame_count);
 
     hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
-    ok(hr == S_OK, "GetFrame error %#x\n", hr);
+    ok(hr == S_OK, "GetFrame error %#lx\n", hr);
     IWICBitmapFrameDecode_Release(frame);
 
     hr = IWICBitmapDecoder_Initialize(decoder, stream, WICDecodeMetadataCacheOnDemand);
-    ok(hr == WINCODEC_ERR_WRONGSTATE, "expected WINCODEC_ERR_WRONGSTATE, got %#x\n", hr);
+    ok(hr == WINCODEC_ERR_WRONGSTATE, "expected WINCODEC_ERR_WRONGSTATE, got %#lx\n", hr);
 
     hr = IWICBitmapDecoder_QueryCapability(decoder, stream, &capability);
-    ok(hr == WINCODEC_ERR_WRONGSTATE, "expected WINCODEC_ERR_WRONGSTATE, got %#x\n", hr);
+    ok(hr == WINCODEC_ERR_WRONGSTATE, "expected WINCODEC_ERR_WRONGSTATE, got %#lx\n", hr);
 
     IWICBitmapDecoder_Release(decoder);
     IStream_Release(stream);
@@ -598,39 +598,39 @@ static void test_tiff_8bpp_alpha(void)
                                             0x55,0x55,0x55,0x66,0x77,0x77,0x77,0x88 };
 
     hr = create_decoder(&tiff_8bpp_alpha, sizeof(tiff_8bpp_alpha), &decoder);
-    ok(hr == S_OK, "Failed to load TIFF image data %#x\n", hr);
+    ok(hr == S_OK, "Failed to load TIFF image data %#lx\n", hr);
     if (hr != S_OK) return;
 
     hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count);
-    ok(hr == S_OK, "GetFrameCount error %#x\n", hr);
+    ok(hr == S_OK, "GetFrameCount error %#lx\n", hr);
     ok(frame_count == 1, "expected 1, got %u\n", frame_count);
 
     EXPECT_REF(decoder, 1);
     hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
-    ok(hr == S_OK, "GetFrame error %#x\n", hr);
+    ok(hr == S_OK, "GetFrame error %#lx\n", hr);
     EXPECT_REF(decoder, 2);
     IWICBitmapDecoder_Release(decoder);
 
     hr = IWICBitmapFrameDecode_GetSize(frame, &width, &height);
-    ok(hr == S_OK, "GetSize error %#x\n", hr);
+    ok(hr == S_OK, "GetSize error %#lx\n", hr);
     ok(width == 2, "expected 2, got %u\n", width);
     ok(height == 2, "expected 2, got %u\n", height);
 
     hr = IWICBitmapFrameDecode_GetResolution(frame, &dpi_x, &dpi_y);
-    ok(hr == S_OK, "GetResolution error %#x\n", hr);
+    ok(hr == S_OK, "GetResolution error %#lx\n", hr);
     ok(dpi_x == 96.0, "expected 96.0, got %f\n", dpi_x);
     ok(dpi_y == 96.0, "expected 96.0, got %f\n", dpi_y);
 
     hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format);
-    ok(hr == S_OK, "GetPixelFormat error %#x\n", hr);
+    ok(hr == S_OK, "GetPixelFormat error %#lx\n", hr);
     ok(IsEqualGUID(&format, &GUID_WICPixelFormat32bppPBGRA),
        "got wrong format %s\n", wine_dbgstr_guid(&format));
 
     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-    ok(hr == S_OK, "CreatePalette error %#x\n", hr);
+    ok(hr == S_OK, "CreatePalette error %#lx\n", hr);
     hr = IWICBitmapFrameDecode_CopyPalette(frame, palette);
     ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE,
-       "expected WINCODEC_ERR_PALETTEUNAVAILABLE, got %#x\n", hr);
+       "expected WINCODEC_ERR_PALETTEUNAVAILABLE, got %#lx\n", hr);
     IWICPalette_Release(palette);
 
     rc.X = 0;
@@ -638,7 +638,7 @@ static void test_tiff_8bpp_alpha(void)
     rc.Width = 2;
     rc.Height = 2;
     hr = IWICBitmapFrameDecode_CopyPixels(frame, &rc, 8, sizeof(data), data);
-    ok(hr == S_OK, "CopyPixels error %#x\n", hr);
+    ok(hr == S_OK, "CopyPixels error %#lx\n", hr);
 
     for (i = 0; i < sizeof(data); i++)
         ok(data[i] == expected_data[i], "%u: expected %02x, got %02x\n", i, expected_data[i], data[i]);
@@ -691,28 +691,28 @@ static void test_tiff_8bpp_palette(void)
     generate_tiff_palette(buf + FIELD_OFFSET(struct tiff_8bpp_data, palette_data), 256);
 
     hr = create_decoder(buf, sizeof(buf), &decoder);
-    ok(hr == S_OK, "Failed to load TIFF image data %#x\n", hr);
+    ok(hr == S_OK, "Failed to load TIFF image data %#lx\n", hr);
     if (hr != S_OK) return;
 
     hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
-    ok(hr == S_OK, "GetFrame error %#x\n", hr);
+    ok(hr == S_OK, "GetFrame error %#lx\n", hr);
 
     hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format);
-    ok(hr == S_OK, "GetPixelFormat error %#x\n", hr);
+    ok(hr == S_OK, "GetPixelFormat error %#lx\n", hr);
     ok(IsEqualGUID(&format, &GUID_WICPixelFormat8bppIndexed),
        "expected GUID_WICPixelFormat8bppIndexed, got %s\n", wine_dbgstr_guid(&format));
 
     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-    ok(hr == S_OK, "CreatePalette error %#x\n", hr);
+    ok(hr == S_OK, "CreatePalette error %#lx\n", hr);
     hr = IWICBitmapFrameDecode_CopyPalette(frame, palette);
-    ok(hr == S_OK, "CopyPalette error %#x\n", hr);
+    ok(hr == S_OK, "CopyPalette error %#lx\n", hr);
 
     hr = IWICPalette_GetColorCount(palette, &count);
-    ok(hr == S_OK, "GetColorCount error %#x\n", hr);
+    ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
     ok(count == 256, "expected 256, got %u\n", count);
 
     hr = IWICPalette_GetColors(palette, 256, color, &ret);
-    ok(hr == S_OK, "GetColors error %#x\n", hr);
+    ok(hr == S_OK, "GetColors error %#lx\n", hr);
     ok(ret == count, "expected %u, got %u\n", count, ret);
     ok(color[0] == 0xff112233, "got %#x\n", color[0]);
     ok(color[1] == 0xff445566, "got %#x\n", color[1]);
@@ -740,14 +740,14 @@ static void test_tiff_resolution(void)
         tiff_resolution_image_data.entry[12].value = test_data->resolution_unit;
 
         hr = create_decoder(&tiff_resolution_image_data, sizeof(tiff_resolution_image_data), &decoder);
-        ok(hr == S_OK, "Failed to load TIFF image data %#x\n", hr);
+        ok(hr == S_OK, "Failed to load TIFF image data %#lx\n", hr);
         if (hr != S_OK) return;
 
         hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
-        ok(hr == S_OK, "%d: GetFrame error %#x\n", i, hr);
+        ok(hr == S_OK, "%d: GetFrame error %#lx\n", i, hr);
 
         hr = IWICBitmapFrameDecode_GetResolution(frame, &dpi_x, &dpi_y);
-        ok(hr == S_OK, "%d: GetResolution error %#x\n", i, hr);
+        ok(hr == S_OK, "%d: GetResolution error %#lx\n", i, hr);
 
         if (test_data->broken_dpi_x != 0)
         {
@@ -789,29 +789,29 @@ static void test_tiff_24bpp(void)
     static const BYTE expected_data[] = { 0x33,0x22,0x11 };
 
     hr = create_decoder(&tiff_24bpp_data, sizeof(tiff_24bpp_data), &decoder);
-    ok(hr == S_OK, "Failed to load TIFF image data %#x\n", hr);
+    ok(hr == S_OK, "Failed to load TIFF image data %#lx\n", hr);
     if (hr != S_OK) return;
     ok(decoder != NULL, "Failed to load TIFF image data\n");
 
     hr = IWICBitmapDecoder_GetFrameCount(decoder, &count);
-    ok(hr == S_OK, "GetFrameCount error %#x\n", hr);
+    ok(hr == S_OK, "GetFrameCount error %#lx\n", hr);
     ok(count == 1, "got %u\n", count);
 
     hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
-    ok(hr == S_OK, "GetFrame error %#x\n", hr);
+    ok(hr == S_OK, "GetFrame error %#lx\n", hr);
 
     hr = IWICBitmapFrameDecode_GetSize(frame, &width, &height);
-    ok(hr == S_OK, "GetSize error %#x\n", hr);
+    ok(hr == S_OK, "GetSize error %#lx\n", hr);
     ok(width == 1, "got %u\n", width);
     ok(height == 1, "got %u\n", height);
 
     hr = IWICBitmapFrameDecode_GetResolution(frame, &dpi_x, &dpi_y);
-    ok(hr == S_OK, "GetResolution error %#x\n", hr);
+    ok(hr == S_OK, "GetResolution error %#lx\n", hr);
     ok(dpi_x == 300.0, "got %f\n", dpi_x);
     ok(dpi_y == 300.0, "got %f\n", dpi_y);
 
     hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format);
-    ok(hr == S_OK, "GetPixelFormat error %#x\n", hr);
+    ok(hr == S_OK, "GetPixelFormat error %#lx\n", hr);
     ok(IsEqualGUID(&format, &GUID_WICPixelFormat24bppBGR),
        "got wrong format %s\n", wine_dbgstr_guid(&format));
 
@@ -824,10 +824,10 @@ static void test_tiff_24bpp(void)
         rc.Height = 1;
         hr = IWICBitmapFrameDecode_CopyPixels(frame, &rc, stride, sizeof(data), data);
         if (stride < 3)
-            ok(hr == E_INVALIDARG, "CopyPixels(%u) should fail: %#x\n", stride, hr);
+            ok(hr == E_INVALIDARG, "CopyPixels(%u) should fail: %#lx\n", stride, hr);
         else
         {
-            ok(hr == S_OK, "CopyPixels(%u) error %#x\n", stride, hr);
+            ok(hr == S_OK, "CopyPixels(%u) error %#lx\n", stride, hr);
 
             for (i = 0; i < sizeof(data); i++)
                 ok(data[i] == expected_data[i], "%u: expected %02x, got %02x\n", i, expected_data[i], data[i]);
@@ -1205,7 +1205,7 @@ static void test_color_formats(void)
         if (!td[i].data)
         {
             ok(hr == WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT || hr == WINCODEC_ERR_COMPONENTNOTFOUND /* win8+ */ || hr == WINCODEC_ERR_BADIMAGE /* XP */,
-               "%u: (%d,%d,%d,%d) wrong error %#x\n", i, td[i].photometric, td[i].samples, td[i].extra_samples, td[i].bps, hr);
+               "%u: (%d,%d,%d,%d) wrong error %#lx\n", i, td[i].photometric, td[i].samples, td[i].extra_samples, td[i].bps, hr);
             if (hr == S_OK)
             {
                 IWICBitmapDecoder_Release(decoder);
@@ -1215,15 +1215,15 @@ static void test_color_formats(void)
         }
         else
             ok(hr == S_OK || broken(hr == WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT || hr == WINCODEC_ERR_BADIMAGE) /* XP */,
-               "%u: failed to load TIFF image data (%d,%d,%d,%d) %#x\n",
+               "%u: failed to load TIFF image data (%d,%d,%d,%d) %#lx\n",
                i, td[i].photometric, td[i].samples, td[i].extra_samples, td[i].bps, hr);
         if (hr != S_OK) continue;
 
         hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
-        ok(hr == S_OK, "%u: GetFrame error %#x\n", i, hr);
+        ok(hr == S_OK, "%u: GetFrame error %#lx\n", i, hr);
 
         hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format);
-        ok(hr == S_OK, "%u: GetPixelFormat error %#x\n", i, hr);
+        ok(hr == S_OK, "%u: GetPixelFormat error %#lx\n", i, hr);
         if (IsEqualGUID(td[i].data->format, &GUID_WICPixelFormat96bppRGBFloat) && IsEqualGUID(&format, &GUID_WICPixelFormat128bppRGBFloat))
         {
             win_skip("Windows Server 2008 misinterprets 96bppRGBFloat as 128bppRGBFloat, skipping the tests\n");
@@ -1238,14 +1238,14 @@ static void test_color_formats(void)
 
         transparency = (td[i].photometric == 2 && td[i].samples == 4); /* for XP */
         hr = get_pixelformat_info(&format, &bpp, &channels, &transparency);
-        ok(hr == S_OK, "%u: get_pixelformat_bpp error %#x\n", i, hr);
+        ok(hr == S_OK, "%u: get_pixelformat_bpp error %#lx\n", i, hr);
         ok(bpp == td[i].data->bpp, "%u: expected %u, got %u\n", i, td[i].data->bpp, bpp);
         ok(channels == td[i].samples, "%u: expected %u, got %u\n", i, td[i].samples, channels);
         ok(transparency == (td[i].photometric == 2 && td[i].samples == 4), "%u: got %u\n", i, transparency);
 
         memset(pixels, 0, sizeof(pixels));
         hr = IWICBitmapFrameDecode_CopyPixels(frame, NULL, width_bytes(td[i].data->width, bpp), sizeof(pixels), pixels);
-        ok(hr == S_OK, "%u: CopyPixels error %#x\n", i, hr);
+        ok(hr == S_OK, "%u: CopyPixels error %#lx\n", i, hr);
         ret = memcmp(pixels, td[i].data->bits, width_bytes(td[i].data->width, bpp));
         if (ret && td[i].alt_data)
             ret = memcmp(pixels, td[i].alt_data->bits, width_bytes(td[i].data->width, bpp));
@@ -1277,36 +1277,36 @@ static void test_tiff_4bps_bgra(void)
                                             0,0xff,0,0, 0xff,0xff,0,0xff, 0xff,0xff,0xff,0 };
 
     hr = create_decoder(&tiff_4bps_bgra, sizeof(tiff_4bps_bgra), &decoder);
-    ok(hr == S_OK, "Failed to load TIFF image data %#x\n", hr);
+    ok(hr == S_OK, "Failed to load TIFF image data %#lx\n", hr);
     if (hr != S_OK) return;
 
     hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count);
-    ok(hr == S_OK, "GetFrameCount error %#x\n", hr);
+    ok(hr == S_OK, "GetFrameCount error %#lx\n", hr);
     ok(frame_count == 1, "expected 1, got %u\n", frame_count);
 
     hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
-    ok(hr == S_OK, "GetFrame error %#x\n", hr);
+    ok(hr == S_OK, "GetFrame error %#lx\n", hr);
 
     hr = IWICBitmapFrameDecode_GetSize(frame, &width, &height);
-    ok(hr == S_OK, "GetSize error %#x\n", hr);
+    ok(hr == S_OK, "GetSize error %#lx\n", hr);
     ok(width == 3, "got %u\n", width);
     ok(height == 2, "got %u\n", height);
 
     hr = IWICBitmapFrameDecode_GetResolution(frame, &dpi_x, &dpi_y);
-    ok(hr == S_OK, "GetResolution error %#x\n", hr);
+    ok(hr == S_OK, "GetResolution error %#lx\n", hr);
     ok(dpi_x == 96.0, "expected 96.0, got %f\n", dpi_x);
     ok(dpi_y == 96.0, "expected 96.0, got %f\n", dpi_y);
 
     hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format);
-    ok(hr == S_OK, "GetPixelFormat error %#x\n", hr);
+    ok(hr == S_OK, "GetPixelFormat error %#lx\n", hr);
     ok(IsEqualGUID(&format, &GUID_WICPixelFormat32bppBGRA),
        "got wrong format %s\n", wine_dbgstr_guid(&format));
 
     hr = IWICImagingFactory_CreatePalette(factory, &palette);
-    ok(hr == S_OK, "CreatePalette error %#x\n", hr);
+    ok(hr == S_OK, "CreatePalette error %#lx\n", hr);
     hr = IWICBitmapFrameDecode_CopyPalette(frame, palette);
     ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE,
-       "expected WINCODEC_ERR_PALETTEUNAVAILABLE, got %#x\n", hr);
+       "expected WINCODEC_ERR_PALETTEUNAVAILABLE, got %#lx\n", hr);
     IWICPalette_Release(palette);
 
     memset(data, 0xaa, sizeof(data));
@@ -1315,7 +1315,7 @@ static void test_tiff_4bps_bgra(void)
     rc.Width = 3;
     rc.Height = 2;
     hr = IWICBitmapFrameDecode_CopyPixels(frame, &rc, 12, sizeof(data), data);
-    ok(hr == S_OK, "CopyPixels error %#x\n", hr);
+    ok(hr == S_OK, "CopyPixels error %#lx\n", hr);
 
     for (i = 0; i < sizeof(data); i++)
         ok(data[i] == expected_data[i], "%u: expected %02x, got %02x\n", i, expected_data[i], data[i]);
@@ -1332,7 +1332,7 @@ START_TEST(tiffformat)
 
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
                           &IID_IWICImagingFactory, (void **)&factory);
-    ok(hr == S_OK, "CoCreateInstance error %#x\n", hr);
+    ok(hr == S_OK, "CoCreateInstance error %#lx\n", hr);
     if (FAILED(hr)) return;
 
     test_tiff_4bps_bgra();
diff --git a/dlls/windowscodecs/tests/wmpformat.c b/dlls/windowscodecs/tests/wmpformat.c
index c1a320b6ec0..365902b3172 100644
--- a/dlls/windowscodecs/tests/wmpformat.c
+++ b/dlls/windowscodecs/tests/wmpformat.c
@@ -95,7 +95,7 @@ static void test_decode(void)
 
     hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
                           &IID_IWICImagingFactory, (void **)&factory);
-    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
+    ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
 
     hwmpdata = GlobalAlloc(GMEM_MOVEABLE, sizeof(wmp_imagedata));
     ok(hwmpdata != 0, "GlobalAlloc failed\n");
@@ -105,38 +105,38 @@ static void test_decode(void)
     GlobalUnlock(hwmpdata);
 
     hr = CreateStreamOnHGlobal(hwmpdata, FALSE, &wmpstream);
-    ok(SUCCEEDED(hr), "CreateStreamOnHGlobal failed, hr=%x\n", hr);
+    ok(SUCCEEDED(hr), "CreateStreamOnHGlobal failed, hr=%lx\n", hr);
 
     hr = IWICBitmapDecoder_Initialize(decoder, wmpstream, WICDecodeMetadataCacheOnLoad);
-    ok(hr == S_OK, "Initialize failed, hr=%x\n", hr);
+    ok(hr == S_OK, "Initialize failed, hr=%lx\n", hr);
 
     hr = IWICBitmapDecoder_Initialize(decoder, wmpstream, WICDecodeMetadataCacheOnLoad);
-    ok(hr == WINCODEC_ERR_WRONGSTATE, "Initialize returned %x\n", hr);
+    ok(hr == WINCODEC_ERR_WRONGSTATE, "Initialize returned %lx\n", hr);
 
     hr = IWICBitmapDecoder_GetContainerFormat(decoder, &format);
-    ok(SUCCEEDED(hr), "GetContainerFormat failed, hr=%x\n", hr);
+    ok(SUCCEEDED(hr), "GetContainerFormat failed, hr=%lx\n", hr);
     ok(IsEqualGUID(&format, &GUID_ContainerFormatWmp),
        "unexpected container format\n");
 
     hr = IWICBitmapDecoder_GetFrameCount(decoder, &count);
-    ok(SUCCEEDED(hr), "GetFrameCount failed, hr=%x\n", hr);
+    ok(SUCCEEDED(hr), "GetFrameCount failed, hr=%lx\n", hr);
     ok(count == 1, "unexpected count %u\n", count);
 
     hr = IWICBitmapDecoder_GetFrame(decoder, 0, NULL);
-    ok(hr == E_INVALIDARG, "GetFrame(NULL) returned hr=%x\n", hr);
+    ok(hr == E_INVALIDARG, "GetFrame(NULL) returned hr=%lx\n", hr);
 
     for (j = 2; j > 0; --j)
     {
         hr = IWICBitmapDecoder_GetFrame(decoder, 0, &framedecode);
-        ok(SUCCEEDED(hr), "GetFrame failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "GetFrame failed, hr=%lx\n", hr);
 
         hr = IWICBitmapFrameDecode_GetSize(framedecode, &width, &height);
-        ok(SUCCEEDED(hr), "GetSize failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "GetSize failed, hr=%lx\n", hr);
         ok(width == 1, "expected width=1, got %u\n", width);
         ok(height == 5, "expected height=5, got %u\n", height);
 
         hr = IWICBitmapFrameDecode_GetPixelFormat(framedecode, &format);
-        ok(SUCCEEDED(hr), "GetPixelFormat failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "GetPixelFormat failed, hr=%lx\n", hr);
         ok(IsEqualGUID(&format, &GUID_WICPixelFormat32bppBGRA),
            "unexpected pixel format: %s\n", wine_dbgstr_guid(&format));
 
@@ -145,20 +145,20 @@ static void test_decode(void)
             memset(imagedata, 0, sizeof(imagedata));
             hr = IWICBitmapFrameDecode_CopyPixels(
                 framedecode, NULL, 4, sizeof(imagedata), imagedata);
-            ok(SUCCEEDED(hr), "CopyPixels failed, hr=%x\n", hr);
+            ok(SUCCEEDED(hr), "CopyPixels failed, hr=%lx\n", hr);
             ok(!memcmp(imagedata, expected_imagedata, sizeof(imagedata)) ||
                broken(!memcmp(imagedata, broken_imagedata, sizeof(imagedata)) /* w2008s64 */),
                "unexpected image data\n");
         }
 
         hr = IWICImagingFactory_CreatePalette(factory, &palette);
-        ok(SUCCEEDED(hr), "CreatePalette failed, hr=%x\n", hr);
+        ok(SUCCEEDED(hr), "CreatePalette failed, hr=%lx\n", hr);
 
         hr = IWICBitmapDecoder_CopyPalette(decoder, palette);
-        ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "Unexpected hr %#x.\n", hr);
+        ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "Unexpected hr %#lx.\n", hr);
 
         hr = IWICBitmapFrameDecode_CopyPalette(framedecode, palette);
-        ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "Unexpected hr %#x.\n", hr);
+        ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "Unexpected hr %#lx.\n", hr);
 
         IWICPalette_Release(palette);
 




More information about the wine-devel mailing list