[PATCH] dlls/ntdll/tests/virtual.c: enable compilation with long types

Eric Pouech eric.pouech at gmail.com
Thu Mar 24 02:35:32 CDT 2022


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

---
 dlls/ntdll/tests/virtual.c |  313 ++++++++++++++++++++++----------------------
 1 file changed, 157 insertions(+), 156 deletions(-)

diff --git a/dlls/ntdll/tests/virtual.c b/dlls/ntdll/tests/virtual.c
index adc9b1ae6dc..2125d2c8971 100644
--- a/dlls/ntdll/tests/virtual.c
+++ b/dlls/ntdll/tests/virtual.c
@@ -17,6 +17,7 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+#undef WINE_NO_LONG_TYPES /* temporary for migration */
 
 #include <stdio.h>
 
@@ -56,9 +57,9 @@ static HANDLE create_target_process(const char *arg)
     winetest_get_mainargs(&argv);
     sprintf(cmdline, "%s %s %s", argv[0], argv[1], arg);
     ret = CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
-    ok(ret, "error: %u\n", GetLastError());
+    ok(ret, "error: %lu\n", GetLastError());
     ret = CloseHandle(pi.hThread);
-    ok(ret, "error %u\n", GetLastError());
+    ok(ret, "error %lu\n", GetLastError());
     return pi.hProcess;
 }
 
@@ -100,21 +101,21 @@ static void test_NtAllocateVirtualMemory(void)
     addr1 = NULL;
     status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr1, 0, &size,
                                      MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE);
-    ok(status == STATUS_SUCCESS, "NtAllocateVirtualMemory returned %08x\n", status);
+    ok(status == STATUS_SUCCESS, "NtAllocateVirtualMemory returned %08lx\n", status);
 
     /* allocation conflicts because of 64k align */
     size = 0x1000;
     addr2 = (char *)addr1 + 0x1000;
     status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, 0, &size,
                                      MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE);
-    ok(status == STATUS_CONFLICTING_ADDRESSES, "NtAllocateVirtualMemory returned %08x\n", status);
+    ok(status == STATUS_CONFLICTING_ADDRESSES, "NtAllocateVirtualMemory returned %08lx\n", status);
 
     /* it should conflict, even when zero_bits is explicitly set */
     size = 0x1000;
     addr2 = (char *)addr1 + 0x1000;
     status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, 12, &size,
                                      MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE);
-    ok(status == STATUS_CONFLICTING_ADDRESSES, "NtAllocateVirtualMemory returned %08x\n", status);
+    ok(status == STATUS_CONFLICTING_ADDRESSES, "NtAllocateVirtualMemory returned %08lx\n", status);
 
     /* 1 zero bits should zero 63-31 upper bits */
     size = 0x1000;
@@ -125,7 +126,7 @@ static void test_NtAllocateVirtualMemory(void)
                                      PAGE_READWRITE);
     ok(status == STATUS_SUCCESS || status == STATUS_NO_MEMORY ||
        broken(status == STATUS_INVALID_PARAMETER_3) /* winxp */,
-       "NtAllocateVirtualMemory returned %08x\n", status);
+       "NtAllocateVirtualMemory returned %08lx\n", status);
     if (status == STATUS_SUCCESS)
     {
         ok(((UINT_PTR)addr2 >> (32 - zero_bits)) == 0,
@@ -133,7 +134,7 @@ static void test_NtAllocateVirtualMemory(void)
 
         size = 0;
         status = NtFreeVirtualMemory(NtCurrentProcess(), &addr2, &size, MEM_RELEASE);
-        ok(status == STATUS_SUCCESS, "NtFreeVirtualMemory return %08x, addr2: %p\n", status, addr2);
+        ok(status == STATUS_SUCCESS, "NtFreeVirtualMemory return %08lx, addr2: %p\n", status, addr2);
     }
 
     for (zero_bits = 2; zero_bits <= 20; zero_bits++)
@@ -145,7 +146,7 @@ static void test_NtAllocateVirtualMemory(void)
                                          PAGE_READWRITE);
         ok(status == STATUS_SUCCESS || status == STATUS_NO_MEMORY ||
            broken(zero_bits == 20 && status == STATUS_CONFLICTING_ADDRESSES) /* w1064v1809 */,
-           "NtAllocateVirtualMemory with %d zero_bits returned %08x\n", (int)zero_bits, status);
+           "NtAllocateVirtualMemory with %d zero_bits returned %08lx\n", (int)zero_bits, status);
         if (status == STATUS_SUCCESS)
         {
             ok(((UINT_PTR)addr2 >> (32 - zero_bits)) == 0,
@@ -153,7 +154,7 @@ static void test_NtAllocateVirtualMemory(void)
 
             size = 0;
             status = NtFreeVirtualMemory(NtCurrentProcess(), &addr2, &size, MEM_RELEASE);
-            ok(status == STATUS_SUCCESS, "NtFreeVirtualMemory return %08x, addr2: %p\n", status, addr2);
+            ok(status == STATUS_SUCCESS, "NtFreeVirtualMemory return %08lx, addr2: %p\n", status, addr2);
         }
     }
 
@@ -163,12 +164,12 @@ static void test_NtAllocateVirtualMemory(void)
     status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, 21, &size,
                                      MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE);
     ok(status == STATUS_NO_MEMORY || status == STATUS_INVALID_PARAMETER,
-       "NtAllocateVirtualMemory returned %08x\n", status);
+       "NtAllocateVirtualMemory returned %08lx\n", status);
     if (status == STATUS_SUCCESS)
     {
         size = 0;
         status = NtFreeVirtualMemory(NtCurrentProcess(), &addr2, &size, MEM_RELEASE);
-        ok(status == STATUS_SUCCESS, "NtFreeVirtualMemory return %08x, addr2: %p\n", status, addr2);
+        ok(status == STATUS_SUCCESS, "NtFreeVirtualMemory return %08lx, addr2: %p\n", status, addr2);
     }
 
     /* 22 zero bits is invalid */
@@ -177,7 +178,7 @@ static void test_NtAllocateVirtualMemory(void)
     status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, 22, &size,
                                      MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE);
     ok(status == STATUS_INVALID_PARAMETER_3 || status == STATUS_INVALID_PARAMETER,
-       "NtAllocateVirtualMemory returned %08x\n", status);
+       "NtAllocateVirtualMemory returned %08lx\n", status);
 
     /* zero bits > 31 should be considered as a leading zeroes bitmask on 64bit and WoW64 */
     size = 0x1000;
@@ -189,12 +190,12 @@ static void test_NtAllocateVirtualMemory(void)
 
     if (!is_win64 && !is_wow64)
     {
-        ok(status == STATUS_INVALID_PARAMETER_3, "NtAllocateVirtualMemory returned %08x\n", status);
+        ok(status == STATUS_INVALID_PARAMETER_3, "NtAllocateVirtualMemory returned %08lx\n", status);
     }
     else
     {
         ok(status == STATUS_SUCCESS || status == STATUS_NO_MEMORY,
-           "NtAllocateVirtualMemory returned %08x\n", status);
+           "NtAllocateVirtualMemory returned %08lx\n", status);
         if (status == STATUS_SUCCESS)
         {
             ok(((UINT_PTR)addr2 & ~get_zero_bits_mask(zero_bits)) == 0 &&
@@ -203,7 +204,7 @@ static void test_NtAllocateVirtualMemory(void)
 
             size = 0;
             status = NtFreeVirtualMemory(NtCurrentProcess(), &addr2, &size, MEM_RELEASE);
-            ok(status == STATUS_SUCCESS, "NtFreeVirtualMemory return %08x, addr2: %p\n", status, addr2);
+            ok(status == STATUS_SUCCESS, "NtFreeVirtualMemory return %08lx, addr2: %p\n", status, addr2);
         }
     }
 
@@ -213,7 +214,7 @@ static void test_NtAllocateVirtualMemory(void)
     status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, 0, &size,
                                      MEM_RESERVE | MEM_COMMIT | AT_ROUND_TO_PAGE, PAGE_EXECUTE_READWRITE);
     ok(status == STATUS_INVALID_PARAMETER_5 || status == STATUS_INVALID_PARAMETER,
-       "NtAllocateVirtualMemory returned %08x\n", status);
+       "NtAllocateVirtualMemory returned %08lx\n", status);
 
     size = 0;
     status = NtFreeVirtualMemory(NtCurrentProcess(), &addr1, &size, MEM_RELEASE);
@@ -225,41 +226,41 @@ static void test_NtAllocateVirtualMemory(void)
     addr1 = NULL;
     status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr1, 0, &size,
                                      MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE);
-    ok(status == STATUS_SUCCESS, "NtAllocateVirtualMemory returned %08x\n", status);
+    ok(status == STATUS_SUCCESS, "NtAllocateVirtualMemory returned %08lx\n", status);
 
     size = 2;
     addr2 = (char *)addr1 + 0x1fff;
     status = NtFreeVirtualMemory(NtCurrentProcess(), &addr2, &size, MEM_DECOMMIT);
-    ok(status == STATUS_SUCCESS, "NtFreeVirtualMemory failed %x\n", status);
-    ok( size == 0x2000, "wrong size %lx\n", size );
+    ok(status == STATUS_SUCCESS, "NtFreeVirtualMemory failed %lx\n", status);
+    ok( size == 0x2000, "wrong size %Ix\n", size );
     ok( addr2 == (char *)addr1 + 0x1000, "wrong addr %p\n", addr2 );
 
     size = 0;
     addr2 = (char *)addr1 + 0x1001;
     status = NtFreeVirtualMemory(NtCurrentProcess(), &addr2, &size, MEM_DECOMMIT);
-    ok(status == STATUS_FREE_VM_NOT_AT_BASE, "NtFreeVirtualMemory failed %x\n", status);
-    ok( size == 0, "wrong size %lx\n", size );
+    ok(status == STATUS_FREE_VM_NOT_AT_BASE, "NtFreeVirtualMemory failed %lx\n", status);
+    ok( size == 0, "wrong size %Ix\n", size );
     ok( addr2 == (char *)addr1 + 0x1001, "wrong addr %p\n", addr2 );
 
     size = 0;
     addr2 = (char *)addr1 + 0xffe;
     status = NtFreeVirtualMemory(NtCurrentProcess(), &addr2, &size, MEM_DECOMMIT);
-    ok(status == STATUS_SUCCESS, "NtFreeVirtualMemory failed %x\n", status);
-    ok( size == 0 || broken(size == 0x10000) /* <= win10 1709 */, "wrong size %lx\n", size );
+    ok(status == STATUS_SUCCESS, "NtFreeVirtualMemory failed %lx\n", status);
+    ok( size == 0 || broken(size == 0x10000) /* <= win10 1709 */, "wrong size %Ix\n", size );
     ok( addr2 == addr1, "wrong addr %p\n", addr2 );
 
     size = 0;
     addr2 = (char *)addr1 + 0x1001;
     status = NtFreeVirtualMemory(NtCurrentProcess(), &addr2, &size, MEM_RELEASE);
-    ok(status == STATUS_FREE_VM_NOT_AT_BASE, "NtFreeVirtualMemory failed %x\n", status);
-    ok( size == 0, "wrong size %lx\n", size );
+    ok(status == STATUS_FREE_VM_NOT_AT_BASE, "NtFreeVirtualMemory failed %lx\n", status);
+    ok( size == 0, "wrong size %Ix\n", size );
     ok( addr2 == (char *)addr1 + 0x1001, "wrong addr %p\n", addr2 );
 
     size = 0;
     addr2 = (char *)addr1 + 0xfff;
     status = NtFreeVirtualMemory(NtCurrentProcess(), &addr2, &size, MEM_RELEASE);
-    ok(status == STATUS_SUCCESS, "NtFreeVirtualMemory failed %x\n", status);
-    ok( size == 0x10000, "wrong size %lx\n", size );
+    ok(status == STATUS_SUCCESS, "NtFreeVirtualMemory failed %lx\n", status);
+    ok( size == 0x10000, "wrong size %Ix\n", size );
     ok( addr2 == addr1, "wrong addr %p\n", addr2 );
 
     if (!pNtAllocateVirtualMemoryEx)
@@ -273,12 +274,12 @@ static void test_NtAllocateVirtualMemory(void)
     addr1 = NULL;
     status = pNtAllocateVirtualMemoryEx(NtCurrentProcess(), &addr1, &size, MEM_RESERVE | MEM_COMMIT,
                                         PAGE_EXECUTE_READWRITE, NULL, 0);
-    ok(status == STATUS_SUCCESS, "NtAllocateVirtualMemoryEx returned %08x\n", status);
+    ok(status == STATUS_SUCCESS, "NtAllocateVirtualMemoryEx returned %08lx\n", status);
 
     /* specifying a count of >0 with NULL parameters should fail */
     status = pNtAllocateVirtualMemoryEx(NtCurrentProcess(), &addr1, &size, MEM_RESERVE | MEM_COMMIT,
                                         PAGE_EXECUTE_READWRITE, NULL, 1);
-    ok(status == STATUS_INVALID_PARAMETER, "NtAllocateVirtualMemoryEx returned %08x\n", status);
+    ok(status == STATUS_INVALID_PARAMETER, "NtAllocateVirtualMemoryEx returned %08lx\n", status);
 }
 
 struct test_stack_size_thread_args
@@ -318,39 +319,39 @@ static DWORD WINAPI test_stack_size_thread(void *ptr)
 
     committed = (char *)NtCurrentTeb()->Tib.StackBase - (char *)NtCurrentTeb()->Tib.StackLimit;
     reserved = (char *)NtCurrentTeb()->Tib.StackBase - (char *)NtCurrentTeb()->DeallocationStack;
-    todo_wine ok( committed == args->expect_committed || broken(committed == 0x1000), "unexpected stack committed size %x, expected %x\n", committed, args->expect_committed );
-    ok( reserved == args->expect_reserved, "unexpected stack reserved size %x, expected %x\n", reserved, args->expect_reserved );
+    todo_wine ok( committed == args->expect_committed || broken(committed == 0x1000), "unexpected stack committed size %lx, expected %lx\n", committed, args->expect_committed );
+    ok( reserved == args->expect_reserved, "unexpected stack reserved size %lx, expected %lx\n", reserved, args->expect_reserved );
 
     addr = (char *)NtCurrentTeb()->DeallocationStack;
     status = NtQueryVirtualMemory( NtCurrentProcess(), addr, MemoryBasicInformation, &mbi, sizeof(mbi), &size );
-    ok( !status, "NtQueryVirtualMemory returned %08x\n", status );
+    ok( !status, "NtQueryVirtualMemory returned %08lx\n", status );
     ok( mbi.AllocationBase == NtCurrentTeb()->DeallocationStack, "unexpected AllocationBase %p, expected %p\n", mbi.AllocationBase, NtCurrentTeb()->DeallocationStack );
-    ok( mbi.AllocationProtect == PAGE_READWRITE, "unexpected AllocationProtect %#x, expected %#x\n", mbi.AllocationProtect, PAGE_READWRITE );
+    ok( mbi.AllocationProtect == PAGE_READWRITE, "unexpected AllocationProtect %#lx, expected %#x\n", mbi.AllocationProtect, PAGE_READWRITE );
     ok( mbi.BaseAddress == addr, "unexpected BaseAddress %p, expected %p\n", mbi.BaseAddress, addr );
-    todo_wine ok( mbi.State == MEM_RESERVE, "unexpected State %#x, expected %#x\n", mbi.State, MEM_RESERVE );
-    todo_wine ok( mbi.Protect == 0, "unexpected Protect %#x, expected %#x\n", mbi.Protect, 0 );
-    ok( mbi.Type == MEM_PRIVATE, "unexpected Type %#x, expected %#x\n", mbi.Type, MEM_PRIVATE );
+    todo_wine ok( mbi.State == MEM_RESERVE, "unexpected State %#lx, expected %#x\n", mbi.State, MEM_RESERVE );
+    todo_wine ok( mbi.Protect == 0, "unexpected Protect %#lx, expected %#x\n", mbi.Protect, 0 );
+    ok( mbi.Type == MEM_PRIVATE, "unexpected Type %#lx, expected %#x\n", mbi.Type, MEM_PRIVATE );
 
 
     force_stack_grow();
 
     committed = (char *)NtCurrentTeb()->Tib.StackBase - (char *)NtCurrentTeb()->Tib.StackLimit;
     reserved = (char *)NtCurrentTeb()->Tib.StackBase - (char *)NtCurrentTeb()->DeallocationStack;
-    todo_wine ok( committed == 0x9000, "unexpected stack committed size %x, expected 9000\n", committed );
-    ok( reserved == args->expect_reserved, "unexpected stack reserved size %x, expected %x\n", reserved, args->expect_reserved );
+    todo_wine ok( committed == 0x9000, "unexpected stack committed size %lx, expected 9000\n", committed );
+    ok( reserved == args->expect_reserved, "unexpected stack reserved size %lx, expected %lx\n", reserved, args->expect_reserved );
 
 
     /* reserved area shrinks whenever stack grows */
 
     addr = (char *)NtCurrentTeb()->DeallocationStack;
     status = NtQueryVirtualMemory( NtCurrentProcess(), addr, MemoryBasicInformation, &mbi, sizeof(mbi), &size );
-    ok( !status, "NtQueryVirtualMemory returned %08x\n", status );
+    ok( !status, "NtQueryVirtualMemory returned %08lx\n", status );
     ok( mbi.AllocationBase == NtCurrentTeb()->DeallocationStack, "unexpected AllocationBase %p, expected %p\n", mbi.AllocationBase, NtCurrentTeb()->DeallocationStack );
-    ok( mbi.AllocationProtect == PAGE_READWRITE, "unexpected AllocationProtect %#x, expected %#x\n", mbi.AllocationProtect, PAGE_READWRITE );
+    ok( mbi.AllocationProtect == PAGE_READWRITE, "unexpected AllocationProtect %#lx, expected %#x\n", mbi.AllocationProtect, PAGE_READWRITE );
     ok( mbi.BaseAddress == addr, "unexpected BaseAddress %p, expected %p\n", mbi.BaseAddress, addr );
-    todo_wine ok( mbi.State == MEM_RESERVE, "unexpected State %#x, expected %#x\n", mbi.State, MEM_RESERVE );
-    todo_wine ok( mbi.Protect == 0, "unexpected Protect %#x, expected %#x\n", mbi.Protect, 0 );
-    ok( mbi.Type == MEM_PRIVATE, "unexpected Type %#x, expected %#x\n", mbi.Type, MEM_PRIVATE );
+    todo_wine ok( mbi.State == MEM_RESERVE, "unexpected State %#lx, expected %#x\n", mbi.State, MEM_RESERVE );
+    todo_wine ok( mbi.Protect == 0, "unexpected Protect %#lx, expected %#x\n", mbi.Protect, 0 );
+    ok( mbi.Type == MEM_PRIVATE, "unexpected Type %#lx, expected %#x\n", mbi.Type, MEM_PRIVATE );
 
     guard_size = reserved - committed - mbi.RegionSize;
     ok( guard_size == 0x1000 || guard_size == 0x2000 || guard_size == 0x3000, "unexpected guard_size %I64x, expected 1000, 2000 or 3000\n", (UINT64)guard_size );
@@ -359,25 +360,25 @@ static DWORD WINAPI test_stack_size_thread(void *ptr)
 
     addr = (char *)NtCurrentTeb()->DeallocationStack + mbi.RegionSize;
     status = NtQueryVirtualMemory( NtCurrentProcess(), addr, MemoryBasicInformation, &mbi, sizeof(mbi), &size );
-    ok( !status, "NtQueryVirtualMemory returned %08x\n", status );
+    ok( !status, "NtQueryVirtualMemory returned %08lx\n", status );
     ok( mbi.AllocationBase == NtCurrentTeb()->DeallocationStack, "unexpected AllocationBase %p, expected %p\n", mbi.AllocationBase, NtCurrentTeb()->DeallocationStack );
-    ok( mbi.AllocationProtect == PAGE_READWRITE, "unexpected AllocationProtect %#x, expected %#x\n", mbi.AllocationProtect, PAGE_READWRITE );
+    ok( mbi.AllocationProtect == PAGE_READWRITE, "unexpected AllocationProtect %#lx, expected %#x\n", mbi.AllocationProtect, PAGE_READWRITE );
     ok( mbi.BaseAddress == addr, "unexpected BaseAddress %p, expected %p\n", mbi.BaseAddress, addr );
     ok( mbi.RegionSize == guard_size, "unexpected RegionSize %I64x, expected 3000\n", (UINT64)mbi.RegionSize );
-    ok( mbi.State == MEM_COMMIT, "unexpected State %#x, expected %#x\n", mbi.State, MEM_COMMIT );
-    ok( mbi.Protect == (PAGE_READWRITE|PAGE_GUARD), "unexpected Protect %#x, expected %#x\n", mbi.Protect, PAGE_READWRITE|PAGE_GUARD );
-    ok( mbi.Type == MEM_PRIVATE, "unexpected Type %#x, expected %#x\n", mbi.Type, MEM_PRIVATE );
+    ok( mbi.State == MEM_COMMIT, "unexpected State %#lx, expected %#x\n", mbi.State, MEM_COMMIT );
+    ok( mbi.Protect == (PAGE_READWRITE|PAGE_GUARD), "unexpected Protect %#lx, expected %#x\n", mbi.Protect, PAGE_READWRITE|PAGE_GUARD );
+    ok( mbi.Type == MEM_PRIVATE, "unexpected Type %#lx, expected %#x\n", mbi.Type, MEM_PRIVATE );
 
     addr = (char *)NtCurrentTeb()->Tib.StackLimit;
     status = NtQueryVirtualMemory( NtCurrentProcess(), addr, MemoryBasicInformation, &mbi, sizeof(mbi), &size );
-    ok( !status, "NtQueryVirtualMemory returned %08x\n", status );
+    ok( !status, "NtQueryVirtualMemory returned %08lx\n", status );
     ok( mbi.AllocationBase == NtCurrentTeb()->DeallocationStack, "unexpected AllocationBase %p, expected %p\n", mbi.AllocationBase, NtCurrentTeb()->DeallocationStack );
-    ok( mbi.AllocationProtect == PAGE_READWRITE, "unexpected AllocationProtect %#x, expected %#x\n", mbi.AllocationProtect, PAGE_READWRITE );
+    ok( mbi.AllocationProtect == PAGE_READWRITE, "unexpected AllocationProtect %#lx, expected %#x\n", mbi.AllocationProtect, PAGE_READWRITE );
     ok( mbi.BaseAddress == addr, "unexpected BaseAddress %p, expected %p\n", mbi.BaseAddress, addr );
     ok( mbi.RegionSize == committed, "unexpected RegionSize %I64x, expected %I64x\n", (UINT64)mbi.RegionSize, (UINT64)committed );
-    ok( mbi.State == MEM_COMMIT, "unexpected State %#x, expected %#x\n", mbi.State, MEM_COMMIT );
-    ok( mbi.Protect == PAGE_READWRITE, "unexpected Protect %#x, expected %#x\n", mbi.Protect, PAGE_READWRITE );
-    ok( mbi.Type == MEM_PRIVATE, "unexpected Type %#x, expected %#x\n", mbi.Type, MEM_PRIVATE );
+    ok( mbi.State == MEM_COMMIT, "unexpected State %#lx, expected %#x\n", mbi.State, MEM_COMMIT );
+    ok( mbi.Protect == PAGE_READWRITE, "unexpected Protect %#lx, expected %#x\n", mbi.Protect, PAGE_READWRITE );
+    ok( mbi.Type == MEM_PRIVATE, "unexpected Type %#lx, expected %#x\n", mbi.Type, MEM_PRIVATE );
 
 
 #ifdef _WIN64
@@ -386,29 +387,29 @@ static DWORD WINAPI test_stack_size_thread(void *ptr)
     addr = (char *)NtCurrentTeb()->Tib.StackLimit + 0x2000;
     size = 0x1000;
     status = NtAllocateVirtualMemory( NtCurrentProcess(), &addr, 0, &size, MEM_COMMIT, PAGE_READWRITE | PAGE_GUARD );
-    ok( !status, "NtAllocateVirtualMemory returned %08x\n", status );
+    ok( !status, "NtAllocateVirtualMemory returned %08lx\n", status );
 
     committed = (char *)NtCurrentTeb()->Tib.StackBase - (char *)NtCurrentTeb()->Tib.StackLimit;
-    todo_wine ok( committed == 0x6000, "unexpected stack committed size %x, expected 6000\n", committed );
+    todo_wine ok( committed == 0x6000, "unexpected stack committed size %lx, expected 6000\n", committed );
 
     status = NtQueryVirtualMemory( NtCurrentProcess(), (char *)addr - 0x2000, MemoryBasicInformation, &mbi, sizeof(mbi), &size );
-    ok( !status, "NtQueryVirtualMemory returned %08x\n", status );
+    ok( !status, "NtQueryVirtualMemory returned %08lx\n", status );
     ok( mbi.RegionSize == 0x2000, "unexpected RegionSize %I64x, expected 2000\n", (UINT64)mbi.RegionSize );
-    ok( mbi.State == MEM_COMMIT, "unexpected State %#x, expected %#x\n", mbi.State, MEM_COMMIT );
-    ok( mbi.Protect == PAGE_READWRITE, "unexpected Protect %#x, expected %#x\n", mbi.Protect, PAGE_READWRITE );
+    ok( mbi.State == MEM_COMMIT, "unexpected State %#lx, expected %#x\n", mbi.State, MEM_COMMIT );
+    ok( mbi.Protect == PAGE_READWRITE, "unexpected Protect %#lx, expected %#x\n", mbi.Protect, PAGE_READWRITE );
 
     status = NtQueryVirtualMemory( NtCurrentProcess(), addr, MemoryBasicInformation, &mbi, sizeof(mbi), &size );
-    ok( !status, "NtQueryVirtualMemory returned %08x\n", status );
+    ok( !status, "NtQueryVirtualMemory returned %08lx\n", status );
     ok( mbi.RegionSize == 0x1000, "unexpected RegionSize %I64x, expected 1000\n", (UINT64)mbi.RegionSize );
-    ok( mbi.State == MEM_COMMIT, "unexpected State %#x, expected %#x\n", mbi.State, MEM_COMMIT );
-    ok( mbi.Protect == (PAGE_READWRITE|PAGE_GUARD), "unexpected Protect %#x, expected %#x\n", mbi.Protect, (PAGE_READWRITE|PAGE_GUARD) );
+    ok( mbi.State == MEM_COMMIT, "unexpected State %#lx, expected %#x\n", mbi.State, MEM_COMMIT );
+    ok( mbi.Protect == (PAGE_READWRITE|PAGE_GUARD), "unexpected Protect %#lx, expected %#x\n", mbi.Protect, (PAGE_READWRITE|PAGE_GUARD) );
 
     addr = (char *)NtCurrentTeb()->Tib.StackLimit;
     status = NtQueryVirtualMemory( NtCurrentProcess(), addr, MemoryBasicInformation, &mbi, sizeof(mbi), &size );
-    ok( !status, "NtQueryVirtualMemory returned %08x\n", status );
+    ok( !status, "NtQueryVirtualMemory returned %08lx\n", status );
     todo_wine ok( mbi.RegionSize == 0x6000, "unexpected RegionSize %I64x, expected 6000\n", (UINT64)mbi.RegionSize );
-    ok( mbi.State == MEM_COMMIT, "unexpected State %#x, expected %#x\n", mbi.State, MEM_COMMIT );
-    ok( mbi.Protect == PAGE_READWRITE, "unexpected Protect %#x, expected %#x\n", mbi.Protect, PAGE_READWRITE );
+    ok( mbi.State == MEM_COMMIT, "unexpected State %#lx, expected %#x\n", mbi.State, MEM_COMMIT );
+    ok( mbi.Protect == PAGE_READWRITE, "unexpected Protect %#lx, expected %#x\n", mbi.Protect, PAGE_READWRITE );
 
 
     /* guard pages are restored as the stack grows back */
@@ -417,33 +418,33 @@ static DWORD WINAPI test_stack_size_thread(void *ptr)
     tmp = (char *)addr - guard_size - 0x1000;
     size = 0x1000;
     status = NtAllocateVirtualMemory( NtCurrentProcess(), &addr, 0, &size, MEM_COMMIT, PAGE_READWRITE | PAGE_GUARD );
-    ok( !status, "NtAllocateVirtualMemory returned %08x\n", status );
+    ok( !status, "NtAllocateVirtualMemory returned %08lx\n", status );
 
     committed = (char *)NtCurrentTeb()->Tib.StackBase - (char *)NtCurrentTeb()->Tib.StackLimit;
-    todo_wine ok( committed == 0x1000, "unexpected stack committed size %x, expected 1000\n", committed );
+    todo_wine ok( committed == 0x1000, "unexpected stack committed size %lx, expected 1000\n", committed );
 
     status = NtQueryVirtualMemory( NtCurrentProcess(), tmp, MemoryBasicInformation, &mbi, sizeof(mbi), &size );
-    ok( !status, "NtQueryVirtualMemory returned %08x\n", status );
+    ok( !status, "NtQueryVirtualMemory returned %08lx\n", status );
     todo_wine ok( mbi.RegionSize == guard_size + 0x1000, "unexpected RegionSize %I64x, expected %I64x\n", (UINT64)mbi.RegionSize, (UINT64)(guard_size + 0x1000) );
-    ok( mbi.State == MEM_COMMIT, "unexpected State %#x, expected %#x\n", mbi.State, MEM_COMMIT );
-    todo_wine ok( mbi.Protect == PAGE_READWRITE, "unexpected Protect %#x, expected %#x\n", mbi.Protect, PAGE_READWRITE );
+    ok( mbi.State == MEM_COMMIT, "unexpected State %#lx, expected %#x\n", mbi.State, MEM_COMMIT );
+    todo_wine ok( mbi.Protect == PAGE_READWRITE, "unexpected Protect %#lx, expected %#x\n", mbi.Protect, PAGE_READWRITE );
 
     force_stack_grow_small();
 
     committed = (char *)NtCurrentTeb()->Tib.StackBase - (char *)NtCurrentTeb()->Tib.StackLimit;
-    todo_wine ok( committed == 0x2000, "unexpected stack committed size %x, expected 2000\n", committed );
+    todo_wine ok( committed == 0x2000, "unexpected stack committed size %lx, expected 2000\n", committed );
 
     status = NtQueryVirtualMemory( NtCurrentProcess(), tmp, MemoryBasicInformation, &mbi, sizeof(mbi), &size );
-    ok( !status, "NtQueryVirtualMemory returned %08x\n", status );
+    ok( !status, "NtQueryVirtualMemory returned %08lx\n", status );
     ok( mbi.RegionSize == 0x1000, "unexpected RegionSize %I64x, expected 1000\n", (UINT64)mbi.RegionSize );
-    ok( mbi.State == MEM_COMMIT, "unexpected State %#x, expected %#x\n", mbi.State, MEM_COMMIT );
-    todo_wine ok( mbi.Protect == PAGE_READWRITE, "unexpected Protect %#x, expected %#x\n", mbi.Protect, PAGE_READWRITE );
+    ok( mbi.State == MEM_COMMIT, "unexpected State %#lx, expected %#x\n", mbi.State, MEM_COMMIT );
+    todo_wine ok( mbi.Protect == PAGE_READWRITE, "unexpected Protect %#lx, expected %#x\n", mbi.Protect, PAGE_READWRITE );
 
     status = NtQueryVirtualMemory( NtCurrentProcess(), (char *)tmp + 0x1000, MemoryBasicInformation, &mbi, sizeof(mbi), &size );
-    ok( !status, "NtQueryVirtualMemory returned %08x\n", status );
+    ok( !status, "NtQueryVirtualMemory returned %08lx\n", status );
     ok( mbi.RegionSize == guard_size, "unexpected RegionSize %I64x, expected %I64x\n", (UINT64)mbi.RegionSize, (UINT64)guard_size );
-    ok( mbi.State == MEM_COMMIT, "unexpected State %#x, expected %#x\n", mbi.State, MEM_COMMIT );
-    todo_wine ok( mbi.Protect == (PAGE_READWRITE|PAGE_GUARD), "unexpected Protect %#x, expected %#x\n", mbi.Protect, (PAGE_READWRITE|PAGE_GUARD) );
+    ok( mbi.State == MEM_COMMIT, "unexpected State %#lx, expected %#x\n", mbi.State, MEM_COMMIT );
+    todo_wine ok( mbi.Protect == (PAGE_READWRITE|PAGE_GUARD), "unexpected Protect %#lx, expected %#x\n", mbi.Protect, (PAGE_READWRITE|PAGE_GUARD) );
 
 
     /* forcing stack limit over guard pages still shrinks the stack on page fault */
@@ -451,20 +452,20 @@ static DWORD WINAPI test_stack_size_thread(void *ptr)
     addr = (char *)tmp + guard_size + 0x1000;
     size = 0x1000;
     status = NtAllocateVirtualMemory( NtCurrentProcess(), &addr, 0, &size, MEM_COMMIT, PAGE_READWRITE | PAGE_GUARD );
-    ok( !status, "NtAllocateVirtualMemory returned %08x\n", status );
+    ok( !status, "NtAllocateVirtualMemory returned %08lx\n", status );
 
     NtCurrentTeb()->Tib.StackLimit = (char *)tmp;
 
     status = NtQueryVirtualMemory( NtCurrentProcess(), (char *)tmp + 0x1000, MemoryBasicInformation, &mbi, sizeof(mbi), &size );
-    ok( !status, "NtQueryVirtualMemory returned %08x\n", status );
+    ok( !status, "NtQueryVirtualMemory returned %08lx\n", status );
     todo_wine ok( mbi.RegionSize == guard_size + 0x1000, "unexpected RegionSize %I64x, expected %I64x\n", (UINT64)mbi.RegionSize, (UINT64)(guard_size + 0x1000) );
-    ok( mbi.State == MEM_COMMIT, "unexpected State %#x, expected %#x\n", mbi.State, MEM_COMMIT );
-    todo_wine ok( mbi.Protect == (PAGE_READWRITE|PAGE_GUARD), "unexpected Protect %#x, expected %#x\n", mbi.Protect, (PAGE_READWRITE|PAGE_GUARD) );
+    ok( mbi.State == MEM_COMMIT, "unexpected State %#lx, expected %#x\n", mbi.State, MEM_COMMIT );
+    todo_wine ok( mbi.Protect == (PAGE_READWRITE|PAGE_GUARD), "unexpected Protect %#lx, expected %#x\n", mbi.Protect, (PAGE_READWRITE|PAGE_GUARD) );
 
     force_stack_grow_small();
 
     committed = (char *)NtCurrentTeb()->Tib.StackBase - (char *)NtCurrentTeb()->Tib.StackLimit;
-    todo_wine ok( committed == 0x2000, "unexpected stack committed size %x, expected 2000\n", committed );
+    todo_wine ok( committed == 0x2000, "unexpected stack committed size %lx, expected 2000\n", committed );
 
 
     /* it works with NtProtectVirtualMemory as well */
@@ -474,30 +475,30 @@ static DWORD WINAPI test_stack_size_thread(void *ptr)
     addr = (char *)NtCurrentTeb()->Tib.StackLimit + 0x2000;
     size = 0x1000;
     status = NtProtectVirtualMemory( NtCurrentProcess(), &addr, &size, PAGE_READWRITE | PAGE_GUARD, &prot );
-    ok( !status, "NtProtectVirtualMemory returned %08x\n", status );
-    todo_wine ok( prot == PAGE_READWRITE, "unexpected prot %#x, expected %#x\n", prot, PAGE_READWRITE );
+    ok( !status, "NtProtectVirtualMemory returned %08lx\n", status );
+    todo_wine ok( prot == PAGE_READWRITE, "unexpected prot %#lx, expected %#x\n", prot, PAGE_READWRITE );
 
     committed = (char *)NtCurrentTeb()->Tib.StackBase - (char *)NtCurrentTeb()->Tib.StackLimit;
-    todo_wine ok( committed == 0x6000, "unexpected stack committed size %x, expected 6000\n", committed );
+    todo_wine ok( committed == 0x6000, "unexpected stack committed size %lx, expected 6000\n", committed );
 
     status = NtQueryVirtualMemory( NtCurrentProcess(), (char *)addr - 0x2000, MemoryBasicInformation, &mbi, sizeof(mbi), &size );
-    ok( !status, "NtQueryVirtualMemory returned %08x\n", status );
+    ok( !status, "NtQueryVirtualMemory returned %08lx\n", status );
     todo_wine ok( mbi.RegionSize == 0x2000, "unexpected RegionSize %I64x, expected 2000\n", (UINT64)mbi.RegionSize );
-    ok( mbi.State == MEM_COMMIT, "unexpected State %#x, expected %#x\n", mbi.State, MEM_COMMIT );
-    todo_wine ok( mbi.Protect == PAGE_READWRITE, "unexpected Protect %#x, expected %#x\n", mbi.Protect, PAGE_READWRITE );
+    ok( mbi.State == MEM_COMMIT, "unexpected State %#lx, expected %#x\n", mbi.State, MEM_COMMIT );
+    todo_wine ok( mbi.Protect == PAGE_READWRITE, "unexpected Protect %#lx, expected %#x\n", mbi.Protect, PAGE_READWRITE );
 
     status = NtQueryVirtualMemory( NtCurrentProcess(), addr, MemoryBasicInformation, &mbi, sizeof(mbi), &size );
-    ok( !status, "NtQueryVirtualMemory returned %08x\n", status );
+    ok( !status, "NtQueryVirtualMemory returned %08lx\n", status );
     ok( mbi.RegionSize == 0x1000, "unexpected RegionSize %I64x, expected 1000\n", (UINT64)mbi.RegionSize );
-    ok( mbi.State == MEM_COMMIT, "unexpected State %#x, expected %#x\n", mbi.State, MEM_COMMIT );
-    ok( mbi.Protect == (PAGE_READWRITE|PAGE_GUARD), "unexpected Protect %#x, expected %#x\n", mbi.Protect, (PAGE_READWRITE|PAGE_GUARD) );
+    ok( mbi.State == MEM_COMMIT, "unexpected State %#lx, expected %#x\n", mbi.State, MEM_COMMIT );
+    ok( mbi.Protect == (PAGE_READWRITE|PAGE_GUARD), "unexpected Protect %#lx, expected %#x\n", mbi.Protect, (PAGE_READWRITE|PAGE_GUARD) );
 
     addr = (char *)NtCurrentTeb()->Tib.StackLimit;
     status = NtQueryVirtualMemory( NtCurrentProcess(), addr, MemoryBasicInformation, &mbi, sizeof(mbi), &size );
-    ok( !status, "NtQueryVirtualMemory returned %08x\n", status );
+    ok( !status, "NtQueryVirtualMemory returned %08lx\n", status );
     todo_wine ok( mbi.RegionSize == 0x6000, "unexpected RegionSize %I64x, expected 6000\n", (UINT64)mbi.RegionSize );
-    ok( mbi.State == MEM_COMMIT, "unexpected State %#x, expected %#x\n", mbi.State, MEM_COMMIT );
-    todo_wine ok( mbi.Protect == PAGE_READWRITE, "unexpected Protect %#x, expected %#x\n", mbi.Protect, PAGE_READWRITE );
+    ok( mbi.State == MEM_COMMIT, "unexpected State %#lx, expected %#x\n", mbi.State, MEM_COMMIT );
+    todo_wine ok( mbi.Protect == PAGE_READWRITE, "unexpected Protect %#lx, expected %#x\n", mbi.Protect, PAGE_READWRITE );
 
 
     /* clearing the guard pages doesn't change StackLimit back */
@@ -507,25 +508,25 @@ static DWORD WINAPI test_stack_size_thread(void *ptr)
     addr = (char *)NtCurrentTeb()->Tib.StackLimit + 0x2000;
     size = 0x1000;
     status = NtProtectVirtualMemory( NtCurrentProcess(), &addr, &size, PAGE_READWRITE | PAGE_GUARD, &prot );
-    ok( !status, "NtProtectVirtualMemory returned %08x\n", status );
-    todo_wine ok( prot == PAGE_READWRITE, "unexpected prot %#x, expected %#x\n", prot, PAGE_READWRITE );
+    ok( !status, "NtProtectVirtualMemory returned %08lx\n", status );
+    todo_wine ok( prot == PAGE_READWRITE, "unexpected prot %#lx, expected %#x\n", prot, PAGE_READWRITE );
 
     committed = (char *)NtCurrentTeb()->Tib.StackBase - (char *)NtCurrentTeb()->Tib.StackLimit;
-    todo_wine ok( committed == 0x6000, "unexpected stack committed size %x, expected 6000\n", committed );
+    todo_wine ok( committed == 0x6000, "unexpected stack committed size %lx, expected 6000\n", committed );
 
     status = NtProtectVirtualMemory( NtCurrentProcess(), &addr, &size, PAGE_READWRITE, &prot );
-    ok( !status, "NtProtectVirtualMemory returned %08x\n", status );
-    ok( prot == (PAGE_READWRITE | PAGE_GUARD), "unexpected prot %#x, expected %#x\n", prot, (PAGE_READWRITE | PAGE_GUARD) );
+    ok( !status, "NtProtectVirtualMemory returned %08lx\n", status );
+    ok( prot == (PAGE_READWRITE | PAGE_GUARD), "unexpected prot %#lx, expected %#x\n", prot, (PAGE_READWRITE | PAGE_GUARD) );
 
     committed = (char *)NtCurrentTeb()->Tib.StackBase - (char *)NtCurrentTeb()->Tib.StackLimit;
-    todo_wine ok( committed == 0x6000, "unexpected stack committed size %x, expected 6000\n", committed );
+    todo_wine ok( committed == 0x6000, "unexpected stack committed size %lx, expected 6000\n", committed );
 
     /* and as we messed with it and it now doesn't fault, it doesn't grow back either */
 
     force_stack_grow();
 
     committed = (char *)NtCurrentTeb()->Tib.StackBase - (char *)NtCurrentTeb()->Tib.StackLimit;
-    todo_wine ok( committed == 0x6000, "unexpected stack committed size %x, expected 6000\n", committed );
+    todo_wine ok( committed == 0x6000, "unexpected stack committed size %lx, expected 6000\n", committed );
 #endif
 
     ExitThread(0);
@@ -583,23 +584,23 @@ static void test_RtlCreateUserStack(void)
         memset(&stack, 0xcc, sizeof(stack));
         ret = pRtlCreateUserStack(tests[i].commit, tests[i].reserve, 0,
                 tests[i].commit_align, tests[i].reserve_align, &stack);
-        ok(!ret, "%u: got status %#x\n", i, ret);
+        ok(!ret, "%u: got status %#lx\n", i, ret);
         ok(!stack.OldStackBase, "%u: got OldStackBase %p\n", i, stack.OldStackBase);
         ok(!stack.OldStackLimit, "%u: got OldStackLimit %p\n", i, stack.OldStackLimit);
         ok(!((ULONG_PTR)stack.DeallocationStack & (page_size - 1)),
                 "%u: got unaligned memory %p\n", i, stack.DeallocationStack);
         ok((ULONG_PTR)stack.StackBase - (ULONG_PTR)stack.DeallocationStack == tests[i].expect_reserve,
-                "%u: got reserve %#lx\n", i, (ULONG_PTR)stack.StackBase - (ULONG_PTR)stack.DeallocationStack);
+                "%u: got reserve %#Ix\n", i, (ULONG_PTR)stack.StackBase - (ULONG_PTR)stack.DeallocationStack);
         todo_wine ok((ULONG_PTR)stack.StackBase - (ULONG_PTR)stack.StackLimit == tests[i].expect_commit,
-                "%u: got commit %#lx\n", i, (ULONG_PTR)stack.StackBase - (ULONG_PTR)stack.StackLimit);
+                "%u: got commit %#Ix\n", i, (ULONG_PTR)stack.StackBase - (ULONG_PTR)stack.StackLimit);
         pRtlFreeUserStack(stack.DeallocationStack);
     }
 
     ret = pRtlCreateUserStack(0x11000, 0x110000, 0, 1, 0, &stack);
-    ok(ret == STATUS_INVALID_PARAMETER, "got %#x\n", ret);
+    ok(ret == STATUS_INVALID_PARAMETER, "got %#lx\n", ret);
 
     ret = pRtlCreateUserStack(0x11000, 0x110000, 0, 0, 1, &stack);
-    ok(ret == STATUS_INVALID_PARAMETER, "got %#x\n", ret);
+    ok(ret == STATUS_INVALID_PARAMETER, "got %#lx\n", ret);
 
     args.expect_committed = 0x4000;
     args.expect_reserved = default_reserve;
@@ -634,7 +635,7 @@ static void test_RtlCreateUserStack(void)
         ok( ret == expect_ret || ret == STATUS_NO_MEMORY ||
             (ret == STATUS_INVALID_PARAMETER_3 && expect_ret == STATUS_INVALID_PARAMETER) ||
             broken( i == 1 && ret == STATUS_INVALID_PARAMETER_3 ), /* win7 */
-            "%u: got %x / %x\n", i, ret, expect_ret );
+            "%u: got %lx / %lx\n", i, ret, expect_ret );
         if (!ret) pRtlFreeUserStack( stack.DeallocationStack );
         ret = pRtlCreateUserThread( GetCurrentProcess(), NULL, FALSE, i,
                                     args.expect_reserved, args.expect_committed,
@@ -642,7 +643,7 @@ static void test_RtlCreateUserStack(void)
         ok( ret == expect_ret || ret == STATUS_NO_MEMORY ||
             (ret == STATUS_INVALID_PARAMETER_3 && expect_ret == STATUS_INVALID_PARAMETER) ||
             broken( i == 1 && ret == STATUS_INVALID_PARAMETER_3 ), /* win7 */
-            "%u: got %x / %x\n", i, ret, expect_ret );
+            "%u: got %lx / %lx\n", i, ret, expect_ret );
         if (!ret)
         {
             WaitForSingleObject( thread, INFINITE );
@@ -654,14 +655,14 @@ static void test_RtlCreateUserStack(void)
         ret = pRtlCreateUserStack( args.expect_committed, args.expect_reserved, mask, 0x1000, 0x1000, &stack );
         ok( ret == expect_ret || ret == STATUS_NO_MEMORY ||
             (ret == STATUS_INVALID_PARAMETER_3 && expect_ret == STATUS_INVALID_PARAMETER),
-            "%08x: got %x / %x\n", mask, ret, expect_ret );
+            "%08lx: got %lx / %lx\n", mask, ret, expect_ret );
         if (!ret) pRtlFreeUserStack( stack.DeallocationStack );
         ret = pRtlCreateUserThread( GetCurrentProcess(), NULL, FALSE, mask,
                                     args.expect_reserved, args.expect_committed,
                                     (void *)test_stack_size_thread, &args, &thread, &id );
         ok( ret == expect_ret || ret == STATUS_NO_MEMORY ||
             (ret == STATUS_INVALID_PARAMETER_3 && expect_ret == STATUS_INVALID_PARAMETER),
-            "%08x: got %x / %x\n", mask, ret, expect_ret );
+            "%08lx: got %lx / %lx\n", mask, ret, expect_ret );
         if (!ret)
         {
             WaitForSingleObject( thread, INFINITE );
@@ -703,12 +704,12 @@ static void test_NtMapViewOfSection(void)
     size = 0;
     offset.QuadPart = 0;
     status = NtMapViewOfSection(mapping, process, &ptr, 0, 0, &offset, &size, 1, 0, PAGE_READWRITE);
-    ok(status == STATUS_SUCCESS, "NtMapViewOfSection returned %08x\n", status);
+    ok(status == STATUS_SUCCESS, "NtMapViewOfSection returned %08lx\n", status);
     ok(!((ULONG_PTR)ptr & 0xffff), "returned memory %p is not aligned to 64k\n", ptr);
 
     ret = ReadProcessMemory(process, ptr, buffer, sizeof(buffer), &result);
     ok(ret, "ReadProcessMemory failed\n");
-    ok(result == sizeof(buffer), "ReadProcessMemory didn't read all data (%lx)\n", result);
+    ok(result == sizeof(buffer), "ReadProcessMemory didn't read all data (%Ix)\n", result);
     ok(!memcmp(buffer, data, sizeof(buffer)), "Wrong data read\n");
 
     /* 1 zero bits should zero 63-31 upper bits */
@@ -718,14 +719,14 @@ static void test_NtMapViewOfSection(void)
     offset.QuadPart = 0;
     status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, MEM_TOP_DOWN, PAGE_READWRITE);
     ok(status == STATUS_SUCCESS || status == STATUS_NO_MEMORY,
-       "NtMapViewOfSection returned %08x\n", status);
+       "NtMapViewOfSection returned %08lx\n", status);
     if (status == STATUS_SUCCESS)
     {
         ok(((UINT_PTR)ptr2 >> (32 - zero_bits)) == 0,
            "NtMapViewOfSection returned address: %p\n", ptr2);
 
         status = NtUnmapViewOfSection(process, ptr2);
-        ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08x\n", status);
+        ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08lx\n", status);
     }
 
     for (zero_bits = 2; zero_bits <= 20; zero_bits++)
@@ -735,14 +736,14 @@ static void test_NtMapViewOfSection(void)
         offset.QuadPart = 0;
         status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, MEM_TOP_DOWN, PAGE_READWRITE);
         ok(status == STATUS_SUCCESS || status == STATUS_NO_MEMORY,
-           "NtMapViewOfSection with %d zero_bits returned %08x\n", (int)zero_bits, status);
+           "NtMapViewOfSection with %d zero_bits returned %08lx\n", (int)zero_bits, status);
         if (status == STATUS_SUCCESS)
         {
             ok(((UINT_PTR)ptr2 >> (32 - zero_bits)) == 0,
                "NtMapViewOfSection with %d zero_bits returned address %p\n", (int)zero_bits, ptr2);
 
             status = NtUnmapViewOfSection(process, ptr2);
-            ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08x\n", status);
+            ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08lx\n", status);
         }
     }
 
@@ -752,7 +753,7 @@ static void test_NtMapViewOfSection(void)
     offset.QuadPart = 0;
     status = NtMapViewOfSection(mapping, process, &ptr2, 21, 0, &offset, &size, 1, 0, PAGE_READWRITE);
     ok(status == STATUS_NO_MEMORY || status == STATUS_INVALID_PARAMETER,
-       "NtMapViewOfSection returned %08x\n", status);
+       "NtMapViewOfSection returned %08lx\n", status);
 
     /* 22 zero bits is invalid */
     ptr2 = NULL;
@@ -760,7 +761,7 @@ static void test_NtMapViewOfSection(void)
     offset.QuadPart = 0;
     status = NtMapViewOfSection(mapping, process, &ptr2, 22, 0, &offset, &size, 1, 0, PAGE_READWRITE);
     ok(status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER,
-       "NtMapViewOfSection returned %08x\n", status);
+       "NtMapViewOfSection returned %08lx\n", status);
 
     /* zero bits > 31 should be considered as a leading zeroes bitmask on 64bit and WoW64 */
     ptr2 = NULL;
@@ -771,12 +772,12 @@ static void test_NtMapViewOfSection(void)
 
     if (!is_win64 && !is_wow64)
     {
-        ok(status == STATUS_INVALID_PARAMETER_4, "NtMapViewOfSection returned %08x\n", status);
+        ok(status == STATUS_INVALID_PARAMETER_4, "NtMapViewOfSection returned %08lx\n", status);
     }
     else
     {
         ok(status == STATUS_SUCCESS || status == STATUS_NO_MEMORY,
-           "NtMapViewOfSection returned %08x\n", status);
+           "NtMapViewOfSection returned %08lx\n", status);
         if (status == STATUS_SUCCESS)
         {
             ok(((UINT_PTR)ptr2 & ~get_zero_bits_mask(zero_bits)) == 0 &&
@@ -784,7 +785,7 @@ static void test_NtMapViewOfSection(void)
                "NtMapViewOfSection returned address %p\n", ptr2);
 
             status = NtUnmapViewOfSection(process, ptr2);
-            ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08x\n", status);
+            ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08lx\n", status);
         }
     }
 
@@ -793,28 +794,28 @@ static void test_NtMapViewOfSection(void)
     size = 0;
     offset.QuadPart = 0;
     status = NtMapViewOfSection(mapping, process, &ptr2, 0, 0, &offset, &size, 1, 0, PAGE_READWRITE);
-    ok(status == STATUS_CONFLICTING_ADDRESSES, "NtMapViewOfSection returned %08x\n", status);
+    ok(status == STATUS_CONFLICTING_ADDRESSES, "NtMapViewOfSection returned %08lx\n", status);
 
     /* offset has to be aligned */
     ptr2 = ptr;
     size = 0;
     offset.QuadPart = 1;
     status = NtMapViewOfSection(mapping, process, &ptr2, 0, 0, &offset, &size, 1, 0, PAGE_READWRITE);
-    ok(status == STATUS_MAPPED_ALIGNMENT, "NtMapViewOfSection returned %08x\n", status);
+    ok(status == STATUS_MAPPED_ALIGNMENT, "NtMapViewOfSection returned %08lx\n", status);
 
     /* ptr has to be aligned */
     ptr2 = (char *)ptr + 42;
     size = 0;
     offset.QuadPart = 0;
     status = NtMapViewOfSection(mapping, process, &ptr2, 0, 0, &offset, &size, 1, 0, PAGE_READWRITE);
-    ok(status == STATUS_MAPPED_ALIGNMENT, "NtMapViewOfSection returned %08x\n", status);
+    ok(status == STATUS_MAPPED_ALIGNMENT, "NtMapViewOfSection returned %08lx\n", status);
 
     /* still not 64k aligned */
     ptr2 = (char *)ptr + 0x1000;
     size = 0;
     offset.QuadPart = 0;
     status = NtMapViewOfSection(mapping, process, &ptr2, 0, 0, &offset, &size, 1, 0, PAGE_READWRITE);
-    ok(status == STATUS_MAPPED_ALIGNMENT, "NtMapViewOfSection returned %08x\n", status);
+    ok(status == STATUS_MAPPED_ALIGNMENT, "NtMapViewOfSection returned %08lx\n", status);
 
     /* when an address is passed, it has to satisfy the provided number of zero bits */
     ptr2 = (char *)ptr + 0x1000;
@@ -823,14 +824,14 @@ static void test_NtMapViewOfSection(void)
     zero_bits = get_zero_bits(((UINT_PTR)ptr2) >> 1);
     status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, 0, PAGE_READWRITE);
     ok(status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER,
-       "NtMapViewOfSection returned %08x\n", status);
+       "NtMapViewOfSection returned %08lx\n", status);
 
     ptr2 = (char *)ptr + 0x1000;
     size = 0;
     offset.QuadPart = 0;
     zero_bits = get_zero_bits((UINT_PTR)ptr2);
     status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, 0, PAGE_READWRITE);
-    ok(status == STATUS_MAPPED_ALIGNMENT, "NtMapViewOfSection returned %08x\n", status);
+    ok(status == STATUS_MAPPED_ALIGNMENT, "NtMapViewOfSection returned %08lx\n", status);
 
     if (!is_win64 && !is_wow64)
     {
@@ -840,14 +841,14 @@ static void test_NtMapViewOfSection(void)
         offset.QuadPart = 0;
         status = NtMapViewOfSection(mapping, process, &ptr2, 0, 0, &offset,
                                     &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE);
-        ok(status == STATUS_CONFLICTING_ADDRESSES, "NtMapViewOfSection returned %08x\n", status);
+        ok(status == STATUS_CONFLICTING_ADDRESSES, "NtMapViewOfSection returned %08lx\n", status);
 
         ptr2 = (char *)ptr + 42;
         size = 0;
         offset.QuadPart = 0;
         status = NtMapViewOfSection(mapping, process, &ptr2, 0, 0, &offset,
                                     &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE);
-        ok(status == STATUS_CONFLICTING_ADDRESSES, "NtMapViewOfSection returned %08x\n", status);
+        ok(status == STATUS_CONFLICTING_ADDRESSES, "NtMapViewOfSection returned %08lx\n", status);
 
         /* in contrary to regular NtMapViewOfSection, only 4kb align is enforced */
         ptr2 = (char *)ptr + 0x1000;
@@ -855,11 +856,11 @@ static void test_NtMapViewOfSection(void)
         offset.QuadPart = 0;
         status = NtMapViewOfSection(mapping, process, &ptr2, 0, 0, &offset,
                                     &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE);
-        ok(status == STATUS_SUCCESS, "NtMapViewOfSection returned %08x\n", status);
+        ok(status == STATUS_SUCCESS, "NtMapViewOfSection returned %08lx\n", status);
         ok((char *)ptr2 == (char *)ptr + 0x1000,
            "expected address %p, got %p\n", (char *)ptr + 0x1000, ptr2);
         status = NtUnmapViewOfSection(process, ptr2);
-        ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08x\n", status);
+        ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08lx\n", status);
 
         /* the address is rounded down if not on a page boundary */
         ptr2 = (char *)ptr + 0x1001;
@@ -867,22 +868,22 @@ static void test_NtMapViewOfSection(void)
         offset.QuadPart = 0;
         status = NtMapViewOfSection(mapping, process, &ptr2, 0, 0, &offset,
                                     &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE);
-        ok(status == STATUS_SUCCESS, "NtMapViewOfSection returned %08x\n", status);
+        ok(status == STATUS_SUCCESS, "NtMapViewOfSection returned %08lx\n", status);
         ok((char *)ptr2 == (char *)ptr + 0x1000,
            "expected address %p, got %p\n", (char *)ptr + 0x1000, ptr2);
         status = NtUnmapViewOfSection(process, ptr2);
-        ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08x\n", status);
+        ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08lx\n", status);
 
         ptr2 = (char *)ptr + 0x2000;
         size = 0;
         offset.QuadPart = 0;
         status = NtMapViewOfSection(mapping, process, &ptr2, 0, 0, &offset,
                                     &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE);
-        ok(status == STATUS_SUCCESS, "NtMapViewOfSection returned %08x\n", status);
+        ok(status == STATUS_SUCCESS, "NtMapViewOfSection returned %08lx\n", status);
         ok((char *)ptr2 == (char *)ptr + 0x2000,
            "expected address %p, got %p\n", (char *)ptr + 0x2000, ptr2);
         status = NtUnmapViewOfSection(process, ptr2);
-        ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08x\n", status);
+        ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08lx\n", status);
     }
     else
     {
@@ -893,11 +894,11 @@ static void test_NtMapViewOfSection(void)
                                     &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE);
         todo_wine
         ok(status == STATUS_INVALID_PARAMETER_9 || status == STATUS_INVALID_PARAMETER,
-           "NtMapViewOfSection returned %08x\n", status);
+           "NtMapViewOfSection returned %08lx\n", status);
     }
 
     status = NtUnmapViewOfSection(process, ptr);
-    ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08x\n", status);
+    ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08lx\n", status);
 
     NtClose(mapping);
 
@@ -939,7 +940,7 @@ static void test_user_shared_data(void)
     unsigned int i;
 
     ok(user_shared_data->NumberOfPhysicalPages == sbi.MmNumberOfPhysicalPages,
-            "Got number of physical pages %#x, expected %#x.\n",
+            "Got number of physical pages %#lx, expected %#lx.\n",
             user_shared_data->NumberOfPhysicalPages, sbi.MmNumberOfPhysicalPages);
 
 #if defined(__i386__) || defined(__x86_64__)
@@ -948,7 +949,7 @@ static void test_user_shared_data(void)
 #endif
     ok(user_shared_data->ActiveProcessorCount == NtCurrentTeb()->Peb->NumberOfProcessors
             || broken(!user_shared_data->ActiveProcessorCount) /* before Win7 */,
-            "Got unexpected ActiveProcessorCount %u.\n", user_shared_data->ActiveProcessorCount);
+            "Got unexpected ActiveProcessorCount %lu.\n", user_shared_data->ActiveProcessorCount);
     ok(user_shared_data->ActiveGroupCount == 1
             || broken(!user_shared_data->ActiveGroupCount) /* before Win7 */,
             "Got unexpected ActiveGroupCount %u.\n", user_shared_data->ActiveGroupCount);
@@ -990,24 +991,24 @@ static void test_user_shared_data(void)
             "Got unexpected EnabledFeatures %s.\n", wine_dbgstr_longlong(xstate.EnabledFeatures));
     ok((xstate.EnabledVolatileFeatures & SUPPORTED_XSTATE_FEATURES) == xstate.EnabledFeatures,
             "Got unexpected EnabledVolatileFeatures %s.\n", wine_dbgstr_longlong(xstate.EnabledVolatileFeatures));
-    ok(xstate.Size >= 512 + sizeof(XSTATE), "Got unexpected Size %u.\n", xstate.Size);
+    ok(xstate.Size >= 512 + sizeof(XSTATE), "Got unexpected Size %lu.\n", xstate.Size);
     if (xstate.CompactionEnabled)
         ok(xstate.OptimizedSave, "Got zero OptimizedSave with compaction enabled.\n");
     ok(!xstate.AlignedFeatures, "Got unexpected AlignedFeatures %s.\n",
             wine_dbgstr_longlong(xstate.AlignedFeatures));
     ok(xstate.AllFeatureSize >= 512 + sizeof(XSTATE)
             || !xstate.AllFeatureSize /* win8 on CPUs without XSAVEC */,
-            "Got unexpected AllFeatureSize %u.\n", xstate.AllFeatureSize);
+            "Got unexpected AllFeatureSize %lu.\n", xstate.AllFeatureSize);
 
     for (i = 0; i < ARRAY_SIZE(feature_sizes); ++i)
     {
         ok(xstate.AllFeatures[i] == feature_sizes[i]
                 || !xstate.AllFeatures[i] /* win8+ on CPUs without XSAVEC */,
-                "Got unexpected AllFeatures[%u] %u, expected %u.\n", i,
+                "Got unexpected AllFeatures[%u] %lu, expected %lu.\n", i,
                 xstate.AllFeatures[i], feature_sizes[i]);
-        ok(xstate.Features[i].Size == feature_sizes[i], "Got unexpected Features[%u].Size %u, expected %u.\n", i,
+        ok(xstate.Features[i].Size == feature_sizes[i], "Got unexpected Features[%u].Size %lu, expected %lu.\n", i,
                 xstate.Features[i].Size, feature_sizes[i]);
-        ok(xstate.Features[i].Offset == feature_offsets[i], "Got unexpected Features[%u].Offset %u, expected %u.\n",
+        ok(xstate.Features[i].Offset == feature_offsets[i], "Got unexpected Features[%u].Offset %lu, expected %lu.\n",
                 i, xstate.Features[i].Offset, feature_offsets[i]);
     }
 }
@@ -1062,11 +1063,11 @@ static void test_syscalls(void)
     /* initial image */
     pNtClose = (void *)GetProcAddress( module, "NtClose" );
     handle = CreateEventW( NULL, FALSE, FALSE, NULL );
-    ok( handle != 0, "CreateEventWfailed %u\n", GetLastError() );
+    ok( handle != 0, "CreateEventWfailed %lu\n", GetLastError() );
     status = pNtClose( handle );
-    ok( !status, "NtClose failed %x\n", status );
+    ok( !status, "NtClose failed %lx\n", status );
     status = pNtClose( handle );
-    ok( status == STATUS_INVALID_HANDLE, "NtClose failed %x\n", status );
+    ok( status == STATUS_INVALID_HANDLE, "NtClose failed %lx\n", status );
 
     /* syscall thunk copy */
     ptr = VirtualAlloc( NULL, 0x1000, MEM_COMMIT, PAGE_EXECUTE_READWRITE );
@@ -1074,21 +1075,21 @@ static void test_syscalls(void)
     memcpy( ptr, pNtClose, 32 );
     pNtClose = ptr;
     handle = CreateEventW( NULL, FALSE, FALSE, NULL );
-    ok( handle != 0, "CreateEventWfailed %u\n", GetLastError() );
+    ok( handle != 0, "CreateEventWfailed %lu\n", GetLastError() );
     status = pNtClose( handle );
-    ok( !status, "NtClose failed %x\n", status );
+    ok( !status, "NtClose failed %lx\n", status );
     status = pNtClose( handle );
-    ok( status == STATUS_INVALID_HANDLE, "NtClose failed %x\n", status );
+    ok( status == STATUS_INVALID_HANDLE, "NtClose failed %lx\n", status );
     VirtualFree( ptr, 0, MEM_FREE );
 
     /* new mapping */
     GetModuleFileNameW( module, path, MAX_PATH );
     file = CreateFileW( path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 );
-    ok( file != INVALID_HANDLE_VALUE, "can't open %s: %u\n", wine_dbgstr_w(path), GetLastError() );
+    ok( file != INVALID_HANDLE_VALUE, "can't open %s: %lu\n", wine_dbgstr_w(path), GetLastError() );
     mapping = CreateFileMappingW( file, NULL, SEC_IMAGE | PAGE_READONLY, 0, 0, NULL );
-    ok( mapping != NULL, "CreateFileMappingW failed err %u\n", GetLastError() );
+    ok( mapping != NULL, "CreateFileMappingW failed err %lu\n", GetLastError() );
     ptr = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, 0 );
-    ok( ptr != NULL, "MapViewOfFile failed err %u\n", GetLastError() );
+    ok( ptr != NULL, "MapViewOfFile failed err %lu\n", GetLastError() );
     CloseHandle( mapping );
     CloseHandle( file );
     delta = (char *)ptr - (char *)module;
@@ -1115,11 +1116,11 @@ static void test_syscalls(void)
     {
         pNtClose = (void *)((char *)pNtClose + delta);
         handle = CreateEventW( NULL, FALSE, FALSE, NULL );
-        ok( handle != 0, "CreateEventWfailed %u\n", GetLastError() );
+        ok( handle != 0, "CreateEventWfailed %lu\n", GetLastError() );
         status = pNtClose( handle );
-        ok( !status, "NtClose failed %x\n", status );
+        ok( !status, "NtClose failed %lx\n", status );
         status = pNtClose( handle );
-        ok( status == STATUS_INVALID_HANDLE, "NtClose failed %x\n", status );
+        ok( status == STATUS_INVALID_HANDLE, "NtClose failed %lx\n", status );
     }
     else
     {
@@ -1162,7 +1163,7 @@ START_TEST(virtual)
     pNtAllocateVirtualMemoryEx = (void *)GetProcAddress(mod, "NtAllocateVirtualMemoryEx");
 
     NtQuerySystemInformation(SystemBasicInformation, &sbi, sizeof(sbi), NULL);
-    trace("system page size %#x\n", sbi.PageSize);
+    trace("system page size %#lx\n", sbi.PageSize);
     page_size = sbi.PageSize;
     if (!pIsWow64Process || !pIsWow64Process(NtCurrentProcess(), &is_wow64)) is_wow64 = FALSE;
 




More information about the wine-devel mailing list