[PATCH] dlls/user32/tests: enable compilation with long types (menu.c)

Eric Pouech eric.pouech at gmail.com
Sat Mar 12 02:37:14 CST 2022


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

---
 dlls/user32/tests/menu.c |  333 +++++++++++++++++++++++-----------------------
 1 file changed, 167 insertions(+), 166 deletions(-)

diff --git a/dlls/user32/tests/menu.c b/dlls/user32/tests/menu.c
index cc0a9e6d9fa..42db6d7c0d8 100644
--- a/dlls/user32/tests/menu.c
+++ b/dlls/user32/tests/menu.c
@@ -18,6 +18,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 <stdarg.h>
 #include <stdio.h>
@@ -120,9 +121,9 @@ static LRESULT WINAPI menu_ownerdraw_wnd_proc(HWND hwnd, UINT msg,
             {
                 MEASUREITEMSTRUCT* pmis = (MEASUREITEMSTRUCT*)lparam;
                 if (winetest_debug > 1)
-                    trace("WM_MEASUREITEM received data %lx size %dx%d\n",
+                    trace("WM_MEASUREITEM received data %Ix size %dx%d\n",
                             pmis->itemData, pmis->itemWidth, pmis->itemHeight);
-                ok( !wparam, "wrong wparam %lx\n", wparam );
+                ok( !wparam, "wrong wparam %Ix\n", wparam );
                 ok( pmis->CtlType == ODT_MENU, "wrong type %x\n", pmis->CtlType );
                 MOD_odheight = pmis->itemHeight;
                 pmis->itemWidth = MODsizes[pmis->itemData].cx;
@@ -141,7 +142,7 @@ static LRESULT WINAPI menu_ownerdraw_wnd_proc(HWND hwnd, UINT msg,
                 if (winetest_debug > 1) {
                     RECT rc;
                     GetMenuItemRect( hwnd, (HMENU)pdis->hwndItem, pdis->itemData ,&rc);
-                    trace("WM_DRAWITEM received hwnd %p hmenu %p itemdata %ld item %d rc %s itemrc:  %s\n",
+                    trace("WM_DRAWITEM received hwnd %p hmenu %p itemdata %Id item %d rc %s itemrc:  %s\n",
                             hwnd, pdis->hwndItem, pdis->itemData, pdis->itemID,
                             wine_dbgstr_rect(&pdis->rcItem), wine_dbgstr_rect(&rc));
                     oldpen=SelectObject( pdis->hDC, GetStockObject(
@@ -150,7 +151,7 @@ static LRESULT WINAPI menu_ownerdraw_wnd_proc(HWND hwnd, UINT msg,
                             pdis->rcItem.right,pdis->rcItem.bottom );
                     SelectObject( pdis->hDC, oldpen);
                 }
-                ok( !wparam, "wrong wparam %lx\n", wparam );
+                ok( !wparam, "wrong wparam %Ix\n", wparam );
                 ok( pdis->CtlType == ODT_MENU, "wrong type %x\n", pdis->CtlType );
                 /* calculate widths of some menu texts */
                 if( ! MOD_txtsizes[0].size.cx)
@@ -236,7 +237,7 @@ static void test_getmenubarinfo(void)
     hwnd = CreateWindowExA(0, (LPCSTR)MAKEINTATOM(atomMenuCheckClass), NULL,
             WS_SYSMENU | WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 100, 100,
             NULL, NULL, NULL, NULL);
-    ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError());
+    ok(hwnd != NULL, "CreateWindowEx failed with error %ld\n", GetLastError());
 
     /* no menu: getmenubarinfo should fail */
     SetLastError(0xdeadbeef);
@@ -247,10 +248,10 @@ static void test_getmenubarinfo(void)
 
     /* create menubar, no items yet */
     hmenu = CreateMenu();
-    ok(hmenu != NULL, "CreateMenu failed with error %d\n", GetLastError());
+    ok(hmenu != NULL, "CreateMenu failed with error %ld\n", GetLastError());
 
     ret = SetMenu(hwnd, hmenu);
-    ok(ret, "SetMenu failed with error %d\n", GetLastError());
+    ok(ret, "SetMenu failed with error %ld\n", GetLastError());
 
     SetLastError(0xdeadbeef);
     ret = GetMenuBarInfo(NULL, OBJID_CLIENT, 0, &mbi);
@@ -285,7 +286,7 @@ static void test_getmenubarinfo(void)
     ok(err == 0xdeadbeef, "err = %d\n", err);
 
     ret = GetMenuBarInfo(hwnd, OBJID_MENU, 0, &mbi);
-    ok(ret, "GetMenuBarInfo failed with error %d\n", GetLastError());
+    ok(ret, "GetMenuBarInfo failed with error %ld\n", GetLastError());
 
     ok(mbi.rcBar.left == 0 && mbi.rcBar.top == 0 && mbi.rcBar.bottom == 0 && mbi.rcBar.right == 0,
             "rcBar: Expected (0,0)-(0,0), got: %s\n", wine_dbgstr_rect(&mbi.rcBar));
@@ -300,7 +301,7 @@ static void test_getmenubarinfo(void)
     ret = AppendMenuA(hmenu, MF_STRING , 101, "item 2");
     ok(ret, "AppendMenu failed.\n");
     ret = SetMenu(hwnd, hmenu);
-    ok(ret, "SetMenu failed with error %d\n", GetLastError());
+    ok(ret, "SetMenu failed with error %ld\n", GetLastError());
 
     SetLastError(0xdeadbeef);
     ret = GetMenuBarInfo(hwnd, OBJID_MENU, 200, &mbi);
@@ -310,7 +311,7 @@ static void test_getmenubarinfo(void)
 
     /* get info for the whole menu */
     ret = GetMenuBarInfo(hwnd, OBJID_MENU, 0, &mbi);
-    ok(ret, "GetMenuBarInfo failed with error %d\n", GetLastError());
+    ok(ret, "GetMenuBarInfo failed with error %ld\n", GetLastError());
 
     /* calculate menu rectangle, from window rectangle and the position of the first item  */
     ret = GetWindowRect(hwnd, &rcw);
@@ -319,7 +320,7 @@ static void test_getmenubarinfo(void)
     ok(ret, "GetMenuItemRect failed.\n");
     todo_wine ok(mbi.rcBar.left == rci.left && mbi.rcBar.top == rci.top &&
             mbi.rcBar.bottom == rci.bottom && mbi.rcBar.right == rcw.right - rci.left + rcw.left,
-            "rcBar: Got %s instead of (%d,%d)-(%d,%d)\n", wine_dbgstr_rect(&mbi.rcBar),
+            "rcBar: Got %s instead of (%ld,%ld)-(%ld,%ld)\n", wine_dbgstr_rect(&mbi.rcBar),
             rci.left, rci.top, rcw.right - rci.left + rcw.left, rci.bottom);
     ok(mbi.hMenu == hmenu, "hMenu: Got %p instead of %p\n", mbi.hMenu, hmenu);
     ok(mbi.fBarFocused == 0, "fBarFocused: got %d instead of 0\n", mbi.fBarFocused);
@@ -327,7 +328,7 @@ static void test_getmenubarinfo(void)
 
     /* get info for item nr.2 */
     ret = GetMenuBarInfo(hwnd, OBJID_MENU, 2, &mbi);
-    ok(ret, "GetMenuBarInfo failed with error %d\n", GetLastError());
+    ok(ret, "GetMenuBarInfo failed with error %ld\n", GetLastError());
     ret = GetMenuItemRect(hwnd, hmenu, 1, &rci);
     ok(ret, "GetMenuItemRect failed.\n");
     ok(EqualRect(&mbi.rcBar, &rci), "rcBar: Got %s instead of %s\n", wine_dbgstr_rect(&mbi.rcBar),
@@ -352,21 +353,21 @@ static void test_GetMenuItemRect(void)
 
     hwnd = CreateWindowW((LPCWSTR)MAKEINTATOM(atomMenuCheckClass), NULL, WS_OVERLAPPEDWINDOW, 0, 0, 100, 100, NULL,
                          NULL, NULL, NULL);
-    ok(hwnd != NULL, "CreateWindow failed with error %d\n", GetLastError());
+    ok(hwnd != NULL, "CreateWindow failed with error %ld\n", GetLastError());
     hmenu = CreateMenu();
-    ok(hmenu != NULL, "CreateMenu failed with error %d\n", GetLastError());
+    ok(hmenu != NULL, "CreateMenu failed with error %ld\n", GetLastError());
     popup_hmenu = CreatePopupMenu();
-    ok(popup_hmenu != NULL, "CreatePopupMenu failed with error %d\n", GetLastError());
+    ok(popup_hmenu != NULL, "CreatePopupMenu failed with error %ld\n", GetLastError());
     ret = AppendMenuA(popup_hmenu, MF_STRING, 0, "Popup");
-    ok(ret, "AppendMenu failed with error %d\n", GetLastError());
+    ok(ret, "AppendMenu failed with error %ld\n", GetLastError());
     ret = AppendMenuA(hmenu, MF_STRING | MF_POPUP, (UINT_PTR)popup_hmenu, "Menu");
-    ok(ret, "AppendMenu failed with error %d\n", GetLastError());
+    ok(ret, "AppendMenu failed with error %ld\n", GetLastError());
     ret = SetMenu(hwnd, hmenu);
-    ok(ret, "SetMenu failed with error %d\n", GetLastError());
+    ok(ret, "SetMenu failed with error %ld\n", GetLastError());
 
     /* Get the menu item rectangle of the displayed sysmenu item */
     ret = GetMenuItemRect(hwnd, hmenu, 0, &item_rect);
-    ok(ret, "GetMenuItemRect failed with error %d\n", GetLastError());
+    ok(ret, "GetMenuItemRect failed with error %ld\n", GetLastError());
     GetWindowRect(hwnd, &window_rect);
     /* Get the screen coordinate of the left top corner of the client rectangle */
     client_top_left.x = 0;
@@ -374,22 +375,22 @@ static void test_GetMenuItemRect(void)
     MapWindowPoints(hwnd, 0, &client_top_left, 1);
     caption_height = GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CYCAPTION);
 
-    ok(item_rect.left == client_top_left.x, "Expect item_rect.left %d == %d\n", item_rect.left, client_top_left.x);
-    ok(item_rect.right <= window_rect.right, "Expect item_rect.right %d <= %d\n", item_rect.right, window_rect.right);
+    ok(item_rect.left == client_top_left.x, "Expect item_rect.left %ld == %ld\n", item_rect.left, client_top_left.x);
+    ok(item_rect.right <= window_rect.right, "Expect item_rect.right %ld <= %ld\n", item_rect.right, window_rect.right);
     /* A gap of 1 pixel is added deliberately in commit 75f9e64, so using equal operator would fail on Wine.
      * Check that top and bottom are correct with 1 pixel margin tolerance */
-    ok(item_rect.top - (window_rect.top + caption_height) <= 1, "Expect item_rect.top %d - %d <= 1\n", item_rect.top,
+    ok(item_rect.top - (window_rect.top + caption_height) <= 1, "Expect item_rect.top %ld - %ld <= 1\n", item_rect.top,
        window_rect.top + caption_height);
-    ok(item_rect.bottom - (client_top_left.y - 1) <= 1, "Expect item_rect.bottom %d - %d <= 1\n", item_rect.bottom,
+    ok(item_rect.bottom - (client_top_left.y - 1) <= 1, "Expect item_rect.bottom %ld - %ld <= 1\n", item_rect.bottom,
        client_top_left.y - 1);
 
     /* Get the item rectangle of the not yet displayed popup menu item. */
     ret = GetMenuItemRect(hwnd, popup_hmenu, 0, &item_rect);
-    ok(ret, "GetMenuItemRect failed with error %d\n", GetLastError());
-    ok(item_rect.left == client_top_left.x, "Expect item_rect.left %d == %d\n", item_rect.left, client_top_left.x);
-    ok(item_rect.right == client_top_left.x, "Expect item_rect.right %d == %d\n", item_rect.right, client_top_left.x);
-    ok(item_rect.top == client_top_left.y, "Expect item_rect.top %d == %d\n", item_rect.top, client_top_left.y);
-    ok(item_rect.bottom == client_top_left.y, "Expect item_rect.bottom %d == %d\n", item_rect.bottom,
+    ok(ret, "GetMenuItemRect failed with error %ld\n", GetLastError());
+    ok(item_rect.left == client_top_left.x, "Expect item_rect.left %ld == %ld\n", item_rect.left, client_top_left.x);
+    ok(item_rect.right == client_top_left.x, "Expect item_rect.right %ld == %ld\n", item_rect.right, client_top_left.x);
+    ok(item_rect.top == client_top_left.y, "Expect item_rect.top %ld == %ld\n", item_rect.top, client_top_left.y);
+    ok(item_rect.bottom == client_top_left.y, "Expect item_rect.bottom %ld == %ld\n", item_rect.bottom,
        client_top_left.y);
 
     DestroyWindow(hwnd);
@@ -410,7 +411,7 @@ static void test_system_menu(void)
     hwnd = CreateWindowExA(0, (LPCSTR)MAKEINTATOM(atomMenuCheckClass), NULL,
                            WS_SYSMENU | WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 100, 100,
                            NULL, NULL, NULL, NULL);
-    ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError());
+    ok(hwnd != NULL, "CreateWindowEx failed with error %ld\n", GetLastError());
     menu = GetSystemMenu( hwnd, FALSE );
     ok( menu != NULL, "no system menu\n" );
 
@@ -533,7 +534,7 @@ static void test_system_menu(void)
     /* now a normal (non-system) menu */
 
     menu = CreateMenu();
-    ok( menu != NULL, "CreateMenu failed with error %d\n", GetLastError() );
+    ok( menu != NULL, "CreateMenu failed with error %ld\n", GetLastError() );
 
     res = CheckMenuItem( menu, SC_TASKLIST, 0 );
     ok( res == -1, "CheckMenuItem succeeded\n" );
@@ -544,9 +545,9 @@ static void test_system_menu(void)
     ret = RemoveMenu( menu, SC_TASKLIST, 0 );
     ok( !ret, "RemoveMenu succeeded\n" );
     ret = ModifyMenuA( menu, SC_TASKLIST, 0, SC_TASKLIST, "test" );
-    ok( ret, "ModifyMenuA failed err %d\n", GetLastError() );
+    ok( ret, "ModifyMenuA failed err %ld\n", GetLastError() );
     ret = ModifyMenuW( menu, SC_TASKLIST, 0, SC_TASKLIST, testW );
-    ok( ret, "ModifyMenuW failed err %d\n", GetLastError() );
+    ok( ret, "ModifyMenuW failed err %ld\n", GetLastError() );
     ret = ModifyMenuA( menu, SC_TASKLIST-1, 0, SC_TASKLIST, "test" );
     ok( !ret, "ModifyMenu succeeded on SC_TASKLIST-1\n" );
     strcpy( buffer, "test" );
@@ -589,18 +590,18 @@ static void test_menu_locked_by_window(void)
     HWND hwnd = CreateWindowExA(0, (LPCSTR)MAKEINTATOM(atomMenuCheckClass), NULL,
                                WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 200, 200,
                                NULL, NULL, NULL, NULL);
-    ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError());
+    ok(hwnd != NULL, "CreateWindowEx failed with error %ld\n", GetLastError());
     hmenu = CreateMenu();
-    ok(hmenu != NULL, "CreateMenu failed with error %d\n", GetLastError());
+    ok(hmenu != NULL, "CreateMenu failed with error %ld\n", GetLastError());
     ret = InsertMenuA(hmenu, 0, MF_STRING, 0, "&Test");
-    ok(ret, "InsertMenu failed with error %d\n", GetLastError());
+    ok(ret, "InsertMenu failed with error %ld\n", GetLastError());
     ret = SetMenu(hwnd, hmenu);
-    ok(ret, "SetMenu failed with error %d\n", GetLastError());
+    ok(ret, "SetMenu failed with error %ld\n", GetLastError());
     ret = DestroyMenu(hmenu);
-    ok(ret, "DestroyMenu failed with error %d\n", GetLastError());
+    ok(ret, "DestroyMenu failed with error %ld\n", GetLastError());
 
     ret = DrawMenuBar(hwnd);
-    ok(ret, "DrawMenuBar failed with error %d\n", GetLastError());
+    ok(ret, "DrawMenuBar failed with error %ld\n", GetLastError());
     ret = IsMenu(GetMenu(hwnd));
     ok(!ret || broken(ret) /* nt4 */, "Menu handle should have been destroyed\n");
 
@@ -645,38 +646,38 @@ static void test_subpopup_locked_by_menu(void)
     hwnd = CreateWindowExA(0, (LPCSTR)MAKEINTATOM(atomMenuCheckClass), NULL,
             WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 200, 200,
             NULL, NULL, NULL, NULL);
-    ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError());
+    ok(hwnd != NULL, "CreateWindowEx failed with error %ld\n", GetLastError());
     SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR) subpopuplocked_wnd_proc);
     hmenu = CreatePopupMenu();
-    ok(hmenu != NULL, "CreateMenu failed with error %d\n", GetLastError());
+    ok(hmenu != NULL, "CreateMenu failed with error %ld\n", GetLastError());
     hsubmenu = CreatePopupMenu();
-    ok(hsubmenu != NULL, "CreateMenu failed with error %d\n", GetLastError());
+    ok(hsubmenu != NULL, "CreateMenu failed with error %ld\n", GetLastError());
     ret = InsertMenuA(hmenu, 0, MF_BYPOSITION | MF_POPUP | MF_STRING, (UINT_PTR)hsubmenu,
             "PopUpLockTest");
-    ok(ret, "InsertMenu failed with error %d\n", GetLastError());
+    ok(ret, "InsertMenu failed with error %ld\n", GetLastError());
     ret = InsertMenuA(hsubmenu, 0, MF_BYPOSITION | MF_STRING, itemid, "PopUpMenu");
-    ok(ret, "InsertMenu failed with error %d\n", GetLastError());
+    ok(ret, "InsertMenu failed with error %ld\n", GetLastError());
     /* first some tests that all this functions properly */
     mii.fMask = MIIM_SUBMENU;
     ret = GetMenuItemInfoA( hmenu, 0, TRUE, &mii);
-    ok( ret, "GetMenuItemInfo failed error %d\n", GetLastError());
+    ok( ret, "GetMenuItemInfo failed error %ld\n", GetLastError());
     ok( mii.hSubMenu == hsubmenu, "submenu is %p\n", mii.hSubMenu);
     mi.fMask |= MIM_STYLE;
     ret = GetMenuInfo( hsubmenu, &mi);
-    ok( ret , "GetMenuInfo returned 0 with error %d\n", GetLastError());
+    ok( ret , "GetMenuInfo returned 0 with error %ld\n", GetLastError());
     ret = IsMenu( hsubmenu);
     ok( ret , "Menu handle is not valid\n");
 
     ret = TrackPopupMenu( hmenu, TPM_RETURNCMD, 100,100, 0, hwnd, NULL);
-    ok( ret == itemid , "TrackPopupMenu returned %d error is %d\n", ret, GetLastError());
+    ok( ret == itemid , "TrackPopupMenu returned %d error is %ld\n", ret, GetLastError());
 
     /* then destroy the sub-popup */
     ret = DestroyMenu( hsubmenu);
-    ok(ret, "DestroyMenu failed with error %d\n", GetLastError());
+    ok(ret, "DestroyMenu failed with error %ld\n", GetLastError());
     /* and repeat the tests */
     mii.fMask = MIIM_SUBMENU;
     ret = GetMenuItemInfoA( hmenu, 0, TRUE, &mii);
-    ok( ret, "GetMenuItemInfo failed error %d\n", GetLastError());
+    ok( ret, "GetMenuItemInfo failed error %ld\n", GetLastError());
     /* GetMenuInfo fails now */
     ok( mii.hSubMenu == hsubmenu, "submenu is %p\n", mii.hSubMenu);
     mi.fMask |= MIM_STYLE;
@@ -689,7 +690,7 @@ static void test_subpopup_locked_by_menu(void)
     /* but TrackPopupMenu still works! */
     ret = TrackPopupMenu( hmenu, TPM_RETURNCMD, 100,100, 0, hwnd, NULL);
     todo_wine {
-        ok( ret == itemid , "TrackPopupMenu returned %d error is %d\n", ret, GetLastError());
+        ok( ret == itemid , "TrackPopupMenu returned %d error is %ld\n", ret, GetLastError());
     }
 
     /* clean up */
@@ -707,11 +708,11 @@ static void test_menu_ownerdraw(void)
     HWND hwnd = CreateWindowExA(0, (LPCSTR)MAKEINTATOM(atomMenuCheckClass), NULL,
                                WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 200, 200,
                                NULL, NULL, NULL, NULL);
-    ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError());
+    ok(hwnd != NULL, "CreateWindowEx failed with error %ld\n", GetLastError());
     if( !hwnd) return;
     SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_ownerdraw_wnd_proc);
     hmenu = CreatePopupMenu();
-    ok(hmenu != NULL, "CreateMenu failed with error %d\n", GetLastError());
+    ok(hmenu != NULL, "CreateMenu failed with error %ld\n", GetLastError());
     if( !hmenu) { DestroyWindow(hwnd);return;}
     k=0;
     for( j=0;j<2;j++) /* create columns */
@@ -731,11 +732,11 @@ static void test_menu_ownerdraw(void)
             "item rectangles are not separated by 4 pixels space\n");
     /* height should be what the MEASUREITEM message has returned */
     ok( MOD_rc[0].bottom - MOD_rc[0].top == MOD_SIZE,
-            "menu item has wrong height: %d should be %d\n",
+            "menu item has wrong height: %ld should be %d\n",
             MOD_rc[0].bottom - MOD_rc[0].top, MOD_SIZE);
     /* no gaps between the rows */
     ok( MOD_rc[0].bottom - MOD_rc[1].top == 0,
-            "There should not be a space between the rows, gap is %d\n",
+            "There should not be a space between the rows, gap is %ld\n",
             MOD_rc[0].bottom - MOD_rc[1].top);
     /* test the correct value of the item height that was sent
      * by the WM_MEASUREITEM message */
@@ -751,15 +752,15 @@ static void test_menu_ownerdraw(void)
     TrackPopupMenu( hmenu, TPM_RETURNCMD, 100,100, 0, hwnd, NULL);
     /* left should be 4 pixels less now */
     ok( leftcol == MOD_rc[0].left + 4, 
-            "columns should be 4 pixels to the left (actual %d).\n",
+            "columns should be 4 pixels to the left (actual %ld).\n",
             leftcol - MOD_rc[0].left);
     /* test width */
     ok( MOD_rc[0].right - MOD_rc[0].left == 2 * MOD_avec + MOD_SIZE,
-            "width of owner drawn menu item is wrong. Got %d expected %d\n",
+            "width of owner drawn menu item is wrong. Got %ld expected %d\n",
             MOD_rc[0].right - MOD_rc[0].left , 2*MOD_avec + MOD_SIZE);
     /* and height */
     ok( MOD_rc[0].bottom - MOD_rc[0].top == MOD_SIZE,
-            "Height is incorrect. Got %d expected %d\n",
+            "Height is incorrect. Got %ld expected %d\n",
             MOD_rc[0].bottom - MOD_rc[0].top, MOD_SIZE);
 
     /* test owner-drawn callback bitmap */
@@ -776,9 +777,9 @@ static void test_menu_ownerdraw(void)
 
     /* test width/height of an ownerdraw menu bar as well */
     ret = DestroyMenu(hmenu);
-    ok(ret, "DestroyMenu failed with error %d\n", GetLastError());
+    ok(ret, "DestroyMenu failed with error %ld\n", GetLastError());
     hmenu = CreateMenu();
-    ok(hmenu != NULL, "CreateMenu failed with error %d\n", GetLastError());
+    ok(hmenu != NULL, "CreateMenu failed with error %ld\n", GetLastError());
     if( !hmenu) { DestroyWindow(hwnd);return;}
     MOD_maxid=1;
     for(i=0;i<2;i++) { 
@@ -787,19 +788,19 @@ static void test_menu_ownerdraw(void)
     }
     ret = SetMenu( hwnd, hmenu);
     UpdateWindow( hwnd); /* hack for wine to draw the window + menu */
-    ok(ret, "SetMenu failed with error %d\n", GetLastError());
+    ok(ret, "SetMenu failed with error %ld\n", GetLastError());
     /* test width */
     ok( MOD_rc[0].right - MOD_rc[0].left == 2 * MOD_avec + MOD_SIZE,
-            "width of owner drawn menu item is wrong. Got %d expected %d\n",
+            "width of owner drawn menu item is wrong. Got %ld expected %d\n",
             MOD_rc[0].right - MOD_rc[0].left , 2*MOD_avec + MOD_SIZE);
     /* test height */
     ok( MOD_rc[0].bottom - MOD_rc[0].top == GetSystemMetrics( SM_CYMENU) - 1,
-            "Height of owner drawn menu item is wrong. Got %d expected %d\n",
+            "Height of owner drawn menu item is wrong. Got %ld expected %d\n",
             MOD_rc[0].bottom - MOD_rc[0].top, GetSystemMetrics( SM_CYMENU) - 1);
 
     /* clean up */
     ret = DestroyMenu(hmenu);
-    ok(ret, "DestroyMenu failed with error %d\n", GetLastError());
+    ok(ret, "DestroyMenu failed with error %ld\n", GetLastError());
     DestroyWindow(hwnd);
 }
 
@@ -841,12 +842,12 @@ static void test_mbs_help( int ispop, int hassub, int mnuopt,
         mii.hbmpItem = hbmp;
     }
     submenu = CreateMenu();
-    ok( submenu != 0, "CreateMenu failed with error %d\n", GetLastError());
+    ok( submenu != 0, "CreateMenu failed with error %ld\n", GetLastError());
     if( ispop)
         hmenu = CreatePopupMenu();
     else
         hmenu = CreateMenu();
-    ok( hmenu != 0, "Create{Popup}Menu failed with error %d\n", GetLastError());
+    ok( hmenu != 0, "Create{Popup}Menu failed with error %ld\n", GetLastError());
     if( hassub) {
         mii.fMask |= MIIM_SUBMENU;
         mii.hSubMenu = submenu;
@@ -857,10 +858,10 @@ static void test_mbs_help( int ispop, int hassub, int mnuopt,
         GetMenuInfo( hmenu, &mi);
         if( mnuopt) mi.dwStyle |= mnuopt == 1 ? MNS_NOCHECK : MNS_CHECKORBMP;
         ret = SetMenuInfo( hmenu, &mi);
-        ok( ret, "SetMenuInfo failed with error %d\n", GetLastError());
+        ok( ret, "SetMenuInfo failed with error %ld\n", GetLastError());
     }
     ret = InsertMenuItemA( hmenu, 0, FALSE, &mii);
-    ok( ret, "InsertMenuItem failed with error %d\n", GetLastError());
+    ok( ret, "InsertMenuItem failed with error %ld\n", GetLastError());
     failed = !ret;
     if( winetest_debug) {
         HDC hdc=GetDC(hwnd);
@@ -876,11 +877,11 @@ static void test_mbs_help( int ispop, int hassub, int mnuopt,
         TrackPopupMenu( hmenu, TPM_RETURNCMD, 100,100, 0, hwnd, NULL);
     else {
         ret = SetMenu( hwnd, hmenu);
-        ok(ret, "SetMenu failed with error %d\n", GetLastError());
+        ok(ret, "SetMenu failed with error %ld\n", GetLastError());
         DrawMenuBar( hwnd);
     }
     ret = GetMenuItemRect( hwnd, hmenu, 0, &rc);
-    ok(ret, "GetMenuItemRect failed with error %d\n", GetLastError());
+    ok(ret, "GetMenuItemRect failed with error %ld\n", GetLastError());
 
     if (0)  /* comment out menu size checks, behavior is different in almost every Windows version */
             /* the tests should however succeed on win2000, XP and Wine (at least up to 1.1.15) */
@@ -902,7 +903,7 @@ static void test_mbs_help( int ispop, int hassub, int mnuopt,
                 ( hbmp ? (text ? 2:0) + bmpsize.cx  : 0 ) +
                 (text ? 2 * MOD_avec + (text[0] ? size.cx :0): 0) ;
         ok( rc.right - rc.left == expect,
-            "menu width wrong, got %d expected %d\n", rc.right - rc.left, expect);
+            "menu width wrong, got %ld expected %d\n", rc.right - rc.left, expect);
         failed = failed || !(rc.right - rc.left == expect);
         /* check menu height */
         if( ispop)
@@ -917,7 +918,7 @@ static void test_mbs_help( int ispop, int hassub, int mnuopt,
             expect = ( !(text || hbmp) ? GetSystemMetrics( SM_CYMENUSIZE)/2 :
                        max( GetSystemMetrics( SM_CYMENU) - 1, (hbmp ? bmpsize.cy : 0)));
         ok( rc.bottom - rc.top == expect,
-            "menu height wrong, got %d expected %d (%d)\n",
+            "menu height wrong, got %ld expected %d (%d)\n",
             rc.bottom - rc.top, expect, GetSystemMetrics( SM_CYMENU));
         failed = failed || !(rc.bottom - rc.top == expect);
         if( hbmp == HBMMENU_CALLBACK && MOD_GotDrawItemMsg) {
@@ -932,18 +933,18 @@ static void test_mbs_help( int ispop, int hassub, int mnuopt,
             else /* mnuopt == 2 */
                 expect = 2;
             ok( expect == MOD_rc[0].left,
-                "bitmap left is %d expected %d\n", MOD_rc[0].left, expect);
+                "bitmap left is %ld expected %d\n", MOD_rc[0].left, expect);
             failed = failed || !(expect == MOD_rc[0].left);
             /* vertical */
             expect = (rc.bottom - rc.top - MOD_rc[0].bottom + MOD_rc[0].top) / 2;
             ok( expect == MOD_rc[0].top,
-                "bitmap top is %d expected %d\n", MOD_rc[0].top, expect);
+                "bitmap top is %ld expected %d\n", MOD_rc[0].top, expect);
             failed = failed || !(expect == MOD_rc[0].top);
         }
     }
     /* if there was a failure, report details */
     if( failed) {
-        trace("*** count %d %s text \"%s\" bitmap %p bmsize %d,%d textsize %d+%d,%d mnuopt %d hastab %d\n",
+        trace("*** count %d %s text \"%s\" bitmap %p bmsize %ld,%ld textsize %ld+%ld,%ld mnuopt %d hastab %d\n",
                 count, (ispop? "POPUP": "MENUBAR"),text ? text: "(nil)", hbmp, bmpsize.cx, bmpsize.cy,
                 size.cx, size.cy, sc_size.cx, mnuopt, hastab);
         trace("    check %d,%d arrow %d avechar %d\n",
@@ -954,9 +955,9 @@ static void test_mbs_help( int ispop, int hassub, int mnuopt,
     }
     /* clean up */
     ret = DestroyMenu(submenu);
-    ok(ret, "DestroyMenu failed with error %d\n", GetLastError());
+    ok(ret, "DestroyMenu failed with error %ld\n", GetLastError());
     ret = DestroyMenu(hmenu);
-    ok(ret, "DestroyMenu failed with error %d\n", GetLastError());
+    ok(ret, "DestroyMenu failed with error %ld\n", GetLastError());
 }
 
 
@@ -980,21 +981,21 @@ static void test_menu_bmp_and_string(void)
     hbm_arrow = LoadBitmapA( 0, (LPCSTR)OBM_MNARROW);
     GetObjectA( hbm_arrow, sizeof(bm), &bm);
     arrowwidth = bm.bmWidth;
-    ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError());
+    ok(hwnd != NULL, "CreateWindowEx failed with error %ld\n", GetLastError());
     if( !hwnd) return;
     /* test system menu */
     hsysmenu = GetSystemMenu( hwnd, FALSE);
-    ok( hsysmenu != NULL, "GetSystemMenu failed with error %d\n", GetLastError());
+    ok( hsysmenu != NULL, "GetSystemMenu failed with error %ld\n", GetLastError());
     mi.fMask = MIM_STYLE;
     mi.dwStyle = 0;
     got = GetMenuInfo( hsysmenu, &mi);
-    ok( got, "GetMenuInfo failed gle=%d\n", GetLastError());
-    ok( MNS_CHECKORBMP == mi.dwStyle, "System Menu Style is %08x, without the bit %08x\n",
+    ok( got, "GetMenuInfo failed gle=%ld\n", GetLastError());
+    ok( MNS_CHECKORBMP == mi.dwStyle, "System Menu Style is %08lx, without the bit %08x\n",
         mi.dwStyle, MNS_CHECKORBMP);
     mii.fMask = MIIM_BITMAP;
     mii.hbmpItem = NULL;
     got = GetMenuItemInfoA( hsysmenu, SC_CLOSE, FALSE, &mii);
-    ok( got, "GetMenuItemInfoA failed gle=%d\n", GetLastError());
+    ok( got, "GetMenuItemInfoA failed gle=%ld\n", GetLastError());
     ok( HBMMENU_POPUP_CLOSE == mii.hbmpItem, "Item info did not get the right hbitmap: got %p  expected %p\n",
         mii.hbmpItem, HBMMENU_POPUP_CLOSE);
 
@@ -1010,7 +1011,7 @@ static void test_menu_bmp_and_string(void)
     ok(mii.fState == MF_ENABLED, "expected MF_ENABLED, got %#x\n", mii.fState);
     ok(mii.wID == SC_RESTORE, "expected SC_RESTORE, got %#x\n", mii.wID);
     ok(mii.hSubMenu == 0, "expected 0, got %p\n", mii.hSubMenu);
-    ok(mii.dwItemData == 0, "expected 0, got %#lx\n", mii.dwItemData);
+    ok(mii.dwItemData == 0, "expected 0, got %#Ix\n", mii.dwItemData);
     ok(mii.dwTypeData == (LPSTR)bmfill, "expected %p, got %p\n", bmfill, mii.dwTypeData);
     ok(mii.cch != 0, "cch should not be 0\n");
     ok(mii.hbmpItem == HBMMENU_POPUP_RESTORE, "expected HBMMENU_POPUP_RESTORE, got %p\n", mii.hbmpItem);
@@ -1024,7 +1025,7 @@ static void test_menu_bmp_and_string(void)
     ok(mii.fState == MF_ENABLED, "expected MF_ENABLED, got %#x\n", mii.fState);
     ok(mii.wID == SC_RESTORE, "expected SC_RESTORE, got %#x\n", mii.wID);
     ok(mii.hSubMenu == 0, "expected 0, got %p\n", mii.hSubMenu);
-    ok(mii.dwItemData == 0, "expected 0, got %#lx\n", mii.dwItemData);
+    ok(mii.dwItemData == 0, "expected 0, got %#Ix\n", mii.dwItemData);
     ok(mii.dwTypeData == (LPSTR)bmfill, "expected %p, got %p\n", bmfill, mii.dwTypeData);
     ok(mii.cch != 0, "cch should not be 0\n");
     ok(mii.hbmpItem == HBMMENU_POPUP_CLOSE, "expected HBMMENU_POPUP_CLOSE, got %p\n", mii.hbmpItem);
@@ -1043,7 +1044,7 @@ static void test_menu_bmp_and_string(void)
         for( szidx=0; szidx < ARRAY_SIZE(bmsizes); szidx++) {
             HBITMAP hbm = CreateBitmap( bmsizes[szidx].cx, bmsizes[szidx].cy,1,1,bmfill);
             HBITMAP bitmaps[] = { HBMMENU_CALLBACK, hbm, HBMMENU_POPUP_CLOSE, NULL  };
-            ok( hbm != 0, "CreateBitmap failed err %d\n", GetLastError());
+            ok( hbm != 0, "CreateBitmap failed err %ld\n", GetLastError());
             for( txtidx = 0; txtidx < ARRAY_SIZE(MOD_txtsizes); txtidx++) {
                 for( hassub = 0; hassub < 2 ; hassub++) { /* add submenu item */
                     for( mnuopt = 0; mnuopt < 3 ; mnuopt++){ /* test MNS_NOCHECK/MNS_CHECKORBMP */
@@ -1227,7 +1228,7 @@ static void insert_menu_item( int line, HMENU hmenu, BOOL ansi, UINT mask, UINT
     if (ansi) ret = InsertMenuItemA( hmenu, 0, TRUE, &info );
     else ret = InsertMenuItemW( hmenu, 0, TRUE, (MENUITEMINFOW*)&info );
     if (!expect) ok_(__FILE__, line)( !ret, "InsertMenuItem should have failed.\n" );
-    else ok_(__FILE__, line)( ret, "InsertMenuItem failed, err %u\n", GetLastError());
+    else ok_(__FILE__, line)( ret, "InsertMenuItem failed, err %lu\n", GetLastError());
 }
 
 static void check_menu_item_info( int line, HMENU hmenu, BOOL ansi, UINT mask, UINT type, UINT state,
@@ -1253,7 +1254,7 @@ static void check_menu_item_info( int line, HMENU hmenu, BOOL ansi, UINT mask, U
         ok_(__FILE__, line)( !ret, "GetMenuItemInfo should have failed.\n" );
         return;
     }
-    ok_(__FILE__, line)( ret, "GetMenuItemInfo failed, err %u\n", GetLastError());
+    ok_(__FILE__, line)( ret, "GetMenuItemInfo failed, err %lu\n", GetLastError());
     if (mask & MIIM_TYPE)
         ok_(__FILE__, line)( info.fType == type || info.fType == LOWORD(type),
                              "wrong type %x/%x\n", info.fType, type );
@@ -1275,7 +1276,7 @@ static void check_menu_item_info( int line, HMENU hmenu, BOOL ansi, UINT mask, U
     }
     if (mask & MIIM_DATA)
         ok_(__FILE__, line)( info.dwItemData == data || info.dwItemData == LOWORD(data),
-                             "wrong item data %lx/%lx\n", info.dwItemData, data );
+                             "wrong item data %Ix/%Ix\n", info.dwItemData, data );
     if (mask & MIIM_BITMAP)
         ok_(__FILE__, line)( info.hbmpItem == item || (ULONG_PTR)info.hbmpItem == LOWORD(item),
                              "wrong bmpitem %p/%p\n", info.hbmpItem, item );
@@ -1297,7 +1298,7 @@ static void check_menu_item_info( int line, HMENU hmenu, BOOL ansi, UINT mask, U
         ret = ansi ? GetMenuStringA( hmenu, 0, (char *)buffer, 80, MF_BYPOSITION ) :
             GetMenuStringW( hmenu, 0, buffer, 80, MF_BYPOSITION );
         if (expstring)
-            ok_(__FILE__, line)( ret, "GetMenuString failed, err %u\n", GetLastError());
+            ok_(__FILE__, line)( ret, "GetMenuString failed, err %lu\n", GetLastError());
         else
             ok_(__FILE__, line)( !ret, "GetMenuString should have failed\n" );
     }
@@ -1310,7 +1311,7 @@ static void modify_menu( int line, HMENU hmenu, BOOL ansi, UINT flags, UINT_PTR
     SetLastError( 0xdeadbeef );
     if (ansi) ret = ModifyMenuA( hmenu, 0, flags, id, data );
     else ret = ModifyMenuW( hmenu, 0, flags, id, data );
-    ok_(__FILE__,line)( ret, "ModifyMenuA failed, err %u\n", GetLastError());
+    ok_(__FILE__,line)( ret, "ModifyMenuA failed, err %lu\n", GetLastError());
 }
 
 static void set_menu_item_info( int line, HMENU hmenu, BOOL ansi, UINT mask, UINT type, UINT state,
@@ -1340,7 +1341,7 @@ static void set_menu_item_info( int line, HMENU hmenu, BOOL ansi, UINT mask, UIN
     SetLastError( 0xdeadbeef );
     if (ansi) ret = SetMenuItemInfoA( hmenu, 0, TRUE, &info );
     else ret = SetMenuItemInfoW( hmenu, 0, TRUE, (MENUITEMINFOW*)&info );
-    ok_(__FILE__, line)( ret, "SetMenuItemInfo failed, err %u\n", GetLastError());
+    ok_(__FILE__, line)( ret, "SetMenuItemInfo failed, err %lu\n", GetLastError());
 }
 
 #define TMII_INSMI( c1,d1,e1,f1,g1,h1,i1,j1,k1,l1,m1,eret1 )\
@@ -2551,14 +2552,14 @@ static void test_menu_hilitemenuitem( void )
     }
     ok(GetLastError() == 0xdeadbeef || /* 9x */
        GetLastError() == ERROR_INVALID_WINDOW_HANDLE /* NT */,
-      "HiliteMenuItem: expected error ERROR_INVALID_WINDOW_HANDLE, got: %d\n", GetLastError());
+      "HiliteMenuItem: expected error ERROR_INVALID_WINDOW_HANDLE, got: %ld\n", GetLastError());
 
     SetLastError(0xdeadbeef);
     ok(!HiliteMenuItem(hWnd, NULL, 1, MF_HILITE | MF_BYPOSITION),
       "HiliteMenuItem: call should have failed.\n");
     ok(GetLastError() == 0xdeadbeef || /* 9x */
        GetLastError() == ERROR_INVALID_MENU_HANDLE /* NT */,
-      "HiliteMenuItem: expected error ERROR_INVALID_MENU_HANDLE, got: %d\n", GetLastError());
+      "HiliteMenuItem: expected error ERROR_INVALID_MENU_HANDLE, got: %ld\n", GetLastError());
 
     ok(!(GetMenuState(hPopupMenu, 1, MF_BYPOSITION) & MF_HILITE),
       "HiliteMenuItem: Item 2 is hilited\n");
@@ -2569,7 +2570,7 @@ static void test_menu_hilitemenuitem( void )
     ok(HiliteMenuItem(hWnd, hPopupMenu, 1, MF_BYPOSITION),
       "HiliteMenuItem: call should have succeeded.\n");
     ok(GetLastError() == 0xdeadbeef,
-      "HiliteMenuItem: expected error 0xdeadbeef, got: %d\n", GetLastError());
+      "HiliteMenuItem: expected error 0xdeadbeef, got: %ld\n", GetLastError());
 
     ok(!(GetMenuState(hPopupMenu, 1, MF_BYPOSITION) & MF_HILITE),
       "HiliteMenuItem: Item 2 is hilited\n");
@@ -2581,7 +2582,7 @@ static void test_menu_hilitemenuitem( void )
       "HiliteMenuItem: call should have succeeded.\n");
     }
     ok(GetLastError() == 0xdeadbeef,
-      "HiliteMenuItem: expected error 0xdeadbeef, got: %d\n", GetLastError());
+      "HiliteMenuItem: expected error 0xdeadbeef, got: %ld\n", GetLastError());
 
     ok(!(GetMenuState(hPopupMenu, 1, MF_BYPOSITION) & MF_HILITE),
       "HiliteMenuItem: Item 2 is hilited\n");
@@ -2592,7 +2593,7 @@ static void test_menu_hilitemenuitem( void )
     ok(HiliteMenuItem(hWnd, hPopupMenu, 1, MF_HILITE | MF_BYPOSITION),
       "HiliteMenuItem: call should not have failed.\n");
     ok(GetLastError() == 0xdeadbeef,
-      "HiliteMenuItem: expected error 0xdeadbeef, got: %d\n", GetLastError());
+      "HiliteMenuItem: expected error 0xdeadbeef, got: %ld\n", GetLastError());
 
     todo_wine
     {
@@ -2606,7 +2607,7 @@ static void test_menu_hilitemenuitem( void )
     ok(HiliteMenuItem(hWnd, hPopupMenu, 1, MF_UNHILITE | MF_BYPOSITION),
       "HiliteMenuItem: call should not have failed.\n");
     ok(GetLastError() == 0xdeadbeef,
-      "HiliteMenuItem: expected error 0xdeadbeef, got: %d\n", GetLastError());
+      "HiliteMenuItem: expected error 0xdeadbeef, got: %ld\n", GetLastError());
 
     ok(!(GetMenuState(hPopupMenu, 1, MF_BYPOSITION) & MF_HILITE),
       "HiliteMenuItem: Item 2 is hilited\n");
@@ -2617,7 +2618,7 @@ static void test_menu_hilitemenuitem( void )
     ok(HiliteMenuItem(hWnd, hPopupMenu, 103, MF_HILITE | MF_BYCOMMAND),
       "HiliteMenuItem: call should not have failed.\n");
     ok(GetLastError() == 0xdeadbeef,
-      "HiliteMenuItem: expected error 0xdeadbeef, got: %d\n", GetLastError());
+      "HiliteMenuItem: expected error 0xdeadbeef, got: %ld\n", GetLastError());
 
     todo_wine
     {
@@ -2631,7 +2632,7 @@ static void test_menu_hilitemenuitem( void )
     ok(HiliteMenuItem(hWnd, hPopupMenu, 103, MF_UNHILITE | MF_BYCOMMAND),
       "HiliteMenuItem: call should not have failed.\n");
     ok(GetLastError() == 0xdeadbeef,
-      "HiliteMenuItem: expected error 0xdeadbeef, got: %d\n", GetLastError());
+      "HiliteMenuItem: expected error 0xdeadbeef, got: %ld\n", GetLastError());
 
     ok(!(GetMenuState(hPopupMenu, 2, MF_BYPOSITION) & MF_HILITE),
       "HiliteMenuItem: Item 3 is hilited\n");
@@ -2797,7 +2798,7 @@ static void test_menu_resource_layout(void)
     BOOL ret;
 
     hmenu = LoadMenuIndirectA(&menu_template);
-    ok(hmenu != 0, "LoadMenuIndirect error %u\n", GetLastError());
+    ok(hmenu != 0, "LoadMenuIndirect error %lu\n", GetLastError());
 
     ret = AppendMenuA(hmenu, MF_STRING, 6, NULL);
     ok(ret, "AppendMenu failed\n");
@@ -2860,7 +2861,7 @@ static HMENU create_menu_from_data(const struct menu_data *item, INT item_count)
     {
         SetLastError(0xdeadbeef);
         ret = AppendMenuA(hmenu, item[i].type, item[i].id, item[i].str);
-        ok(ret, "%d: AppendMenu(%04x, %04x, %p) error %u\n",
+        ok(ret, "%d: AppendMenu(%04x, %04x, %p) error %lu\n",
            i, item[i].type, item[i].id, item[i].str, GetLastError());
     }
     return hmenu;
@@ -2902,7 +2903,7 @@ static HMENU create_menuitem_from_data(const struct menu_data *item, INT item_co
         if(  item[i].type & MF_HELP) mii.fType |= MF_HELP;
         mii.wID = item[i].id;
         ret = InsertMenuItemA( hmenu, -1, TRUE, &mii);
-        ok(ret, "%d: InsertMenuItem(%04x, %04x, %p) error %u\n",
+        ok(ret, "%d: InsertMenuItem(%04x, %04x, %p) error %lu\n",
            i, item[i].type, item[i].id, item[i].str, GetLastError());
     }
     return hmenu;
@@ -3086,7 +3087,7 @@ static void test_menu_getmenuinfo(void)
     ok( !ret, "GetMenuInfo() should have failed\n");
     ok( gle == ERROR_INVALID_PARAMETER ||
         broken(gle == 0xdeadbeef), /* Win98, WinME */
-        "GetMenuInfo() error got %u expected %u\n", gle, ERROR_INVALID_PARAMETER);
+        "GetMenuInfo() error got %lu expected %u\n", gle, ERROR_INVALID_PARAMETER);
     SetLastError(0xdeadbeef);
     mi.cbSize = 0;
     ret = GetMenuInfo( hmenu, &mi);
@@ -3094,13 +3095,13 @@ static void test_menu_getmenuinfo(void)
     ok( !ret, "GetMenuInfo() should have failed\n");
     ok( gle == ERROR_INVALID_PARAMETER ||
         broken(gle == 0xdeadbeef), /* Win98, WinME */
-        "GetMenuInfo() error got %u expected %u\n", gle, ERROR_INVALID_PARAMETER);
+        "GetMenuInfo() error got %lu expected %u\n", gle, ERROR_INVALID_PARAMETER);
     SetLastError(0xdeadbeef);
     mi.cbSize = sizeof( MENUINFO);
     ret = GetMenuInfo( hmenu, &mi);
     gle= GetLastError();
     ok( ret, "GetMenuInfo() should have succeeded\n");
-    ok( gle == 0xdeadbeef, "GetMenuInfo() error got %u\n", gle);
+    ok( gle == 0xdeadbeef, "GetMenuInfo() error got %lu\n", gle);
     SetLastError(0xdeadbeef);
     mi.cbSize = 0;
     ret = GetMenuInfo( NULL, &mi);
@@ -3108,7 +3109,7 @@ static void test_menu_getmenuinfo(void)
     ok( !ret, "GetMenuInfo() should have failed\n");
     ok( gle == ERROR_INVALID_PARAMETER ||
         broken(gle == 0xdeadbeef), /* Win98, WinME */
-        "GetMenuInfo() error got %u expected %u\n", gle, ERROR_INVALID_PARAMETER);
+        "GetMenuInfo() error got %lu expected %u\n", gle, ERROR_INVALID_PARAMETER);
     /* clean up */
     DestroyMenu( hmenu);
     return;
@@ -3130,7 +3131,7 @@ static void test_menu_setmenuinfo(void)
     mii.fMask = MIIM_SUBMENU;
     mii.hSubMenu = hsubmenu;
     ret = InsertMenuItemA( hmenu, 0, FALSE, &mii);
-    ok( ret, "InsertMenuItem failed with error %d\n", GetLastError());
+    ok( ret, "InsertMenuItem failed with error %ld\n", GetLastError());
     /* test some parameter errors */
     SetLastError(0xdeadbeef);
     ret = SetMenuInfo( hmenu, NULL);
@@ -3138,7 +3139,7 @@ static void test_menu_setmenuinfo(void)
     ok( !ret, "SetMenuInfo() should have failed\n");
     ok( gle == ERROR_INVALID_PARAMETER ||
         broken(gle == 0xdeadbeef), /* Win98, WinME */
-        "SetMenuInfo() error got %u expected %u\n", gle, ERROR_INVALID_PARAMETER);
+        "SetMenuInfo() error got %lu expected %u\n", gle, ERROR_INVALID_PARAMETER);
     SetLastError(0xdeadbeef);
     mi.cbSize = 0;
     ret = SetMenuInfo( hmenu, &mi);
@@ -3146,13 +3147,13 @@ static void test_menu_setmenuinfo(void)
     ok( !ret, "SetMenuInfo() should have failed\n");
     ok( gle == ERROR_INVALID_PARAMETER ||
         broken(gle == 0xdeadbeef), /* Win98, WinME */
-        "SetMenuInfo() error got %u expected %u\n", gle, ERROR_INVALID_PARAMETER);
+        "SetMenuInfo() error got %lu expected %u\n", gle, ERROR_INVALID_PARAMETER);
     SetLastError(0xdeadbeef);
     mi.cbSize = sizeof( MENUINFO);
     ret = SetMenuInfo( hmenu, &mi);
     gle= GetLastError();
     ok( ret, "SetMenuInfo() should have succeeded\n");
-    ok( gle == 0xdeadbeef, "SetMenuInfo() error got %u\n", gle);
+    ok( gle == 0xdeadbeef, "SetMenuInfo() error got %lu\n", gle);
     SetLastError(0xdeadbeef);
     mi.cbSize = 0;
     ret = SetMenuInfo( NULL, &mi);
@@ -3160,7 +3161,7 @@ static void test_menu_setmenuinfo(void)
     ok( !ret, "SetMenuInfo() should have failed\n");
     ok( gle == ERROR_INVALID_PARAMETER ||
         broken(gle == 0xdeadbeef), /* Win98, WinME */
-        "SetMenuInfo() error got %u expected %u\n", gle, ERROR_INVALID_PARAMETER);
+        "SetMenuInfo() error got %lu expected %u\n", gle, ERROR_INVALID_PARAMETER);
     /* functional tests */
     /* menu and submenu should have the CHECKORBMP style bit cleared */
     SetLastError(0xdeadbeef);
@@ -3169,7 +3170,7 @@ static void test_menu_setmenuinfo(void)
     ret = GetMenuInfo( hmenu, &mi);
     gle= GetLastError();
     ok( ret, "GetMenuInfo() should have succeeded\n");
-    ok( gle == 0xdeadbeef, "GetMenuInfo() error got %u\n", gle);
+    ok( gle == 0xdeadbeef, "GetMenuInfo() error got %lu\n", gle);
     ok( !(mi.dwStyle & MNS_CHECKORBMP), "menustyle was not expected to have the MNS_CHECKORBMP flag\n");
     SetLastError(0xdeadbeef);
     mi.cbSize = sizeof( MENUINFO);
@@ -3177,7 +3178,7 @@ static void test_menu_setmenuinfo(void)
     ret = GetMenuInfo( hsubmenu, &mi);
     gle= GetLastError();
     ok( ret, "GetMenuInfo() should have succeeded\n");
-    ok( gle == 0xdeadbeef, "GetMenuInfo() error got %u\n", gle);
+    ok( gle == 0xdeadbeef, "GetMenuInfo() error got %lu\n", gle);
     ok( !(mi.dwStyle & MNS_CHECKORBMP), "menustyle was not expected to have the MNS_CHECKORBMP flag\n");
     /* SetMenuInfo() */
     SetLastError(0xdeadbeef);
@@ -3187,7 +3188,7 @@ static void test_menu_setmenuinfo(void)
     ret = SetMenuInfo( hmenu, &mi);
     gle= GetLastError();
     ok( ret, "SetMenuInfo() should have succeeded\n");
-    ok( gle == 0xdeadbeef, "SetMenuInfo() error got %u\n", gle);
+    ok( gle == 0xdeadbeef, "SetMenuInfo() error got %lu\n", gle);
     /* Now both menus should have the MNS_CHECKORBMP style bit set */
     SetLastError(0xdeadbeef);
     mi.cbSize = sizeof( MENUINFO);
@@ -3195,7 +3196,7 @@ static void test_menu_setmenuinfo(void)
     ret = GetMenuInfo( hmenu, &mi);
     gle= GetLastError();
     ok( ret, "GetMenuInfo() should have succeeded\n");
-    ok( gle == 0xdeadbeef, "GetMenuInfo() error got %u\n", gle);
+    ok( gle == 0xdeadbeef, "GetMenuInfo() error got %lu\n", gle);
     ok( mi.dwStyle & MNS_CHECKORBMP, "menustyle was expected to have the MNS_CHECKORBMP flag\n");
     SetLastError(0xdeadbeef);
     mi.cbSize = sizeof( MENUINFO);
@@ -3203,7 +3204,7 @@ static void test_menu_setmenuinfo(void)
     ret = GetMenuInfo( hsubmenu, &mi);
     gle= GetLastError();
     ok( ret, "GetMenuInfo() should have succeeded\n");
-    ok( gle == 0xdeadbeef, "GetMenuInfo() error got %u\n", gle);
+    ok( gle == 0xdeadbeef, "GetMenuInfo() error got %lu\n", gle);
     ok( mi.dwStyle & MNS_CHECKORBMP, "menustyle was expected to have the MNS_CHECKORBMP flag\n");
     /* now repeat that without the APPLYTOSUBMENUS flag and another style bit */
     SetLastError(0xdeadbeef);
@@ -3213,7 +3214,7 @@ static void test_menu_setmenuinfo(void)
     ret = SetMenuInfo( hmenu, &mi);
     gle= GetLastError();
     ok( ret, "SetMenuInfo() should have succeeded\n");
-    ok( gle == 0xdeadbeef, "SetMenuInfo() error got %u\n", gle);
+    ok( gle == 0xdeadbeef, "SetMenuInfo() error got %lu\n", gle);
     /* Now only the top menu should have the MNS_NOCHECK style bit set */
     SetLastError(0xdeadbeef);
     mi.cbSize = sizeof( MENUINFO);
@@ -3221,7 +3222,7 @@ static void test_menu_setmenuinfo(void)
     ret = GetMenuInfo( hmenu, &mi);
     gle= GetLastError();
     ok( ret, "GetMenuInfo() should have succeeded\n");
-    ok( gle == 0xdeadbeef, "GetMenuInfo() error got %u\n", gle);
+    ok( gle == 0xdeadbeef, "GetMenuInfo() error got %lu\n", gle);
     ok( mi.dwStyle & MNS_NOCHECK, "menustyle was expected to have the MNS_NOCHECK flag\n");
     SetLastError(0xdeadbeef);
     mi.cbSize = sizeof( MENUINFO);
@@ -3229,7 +3230,7 @@ static void test_menu_setmenuinfo(void)
     ret = GetMenuInfo( hsubmenu, &mi);
     gle= GetLastError();
     ok( ret, "GetMenuInfo() should have succeeded\n");
-    ok( gle == 0xdeadbeef, "GetMenuInfo() error got %u\n", gle);
+    ok( gle == 0xdeadbeef, "GetMenuInfo() error got %lu\n", gle);
     ok( !(mi.dwStyle & MNS_NOCHECK), "menustyle was not expected to have the MNS_NOCHECK flag\n");
 
     /* test background brush */
@@ -3284,13 +3285,13 @@ static void test_menu_trackpopupmenu(void)
     HWND hwnd = CreateWindowExA(0, (LPCSTR)MAKEINTATOM(atomMenuCheckClass), NULL,
             WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 200, 200,
             NULL, NULL, NULL, NULL);
-    ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError());
+    ok(hwnd != NULL, "CreateWindowEx failed with error %ld\n", GetLastError());
     if (!hwnd) return;
     SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_ownerdraw_wnd_proc);
     for( Ex = 0; Ex < 2; Ex++)
     {
         hmenu = CreatePopupMenu();
-        ok(hmenu != NULL, "CreateMenu failed with error %d\n", GetLastError());
+        ok(hmenu != NULL, "CreateMenu failed with error %ld\n", GetLastError());
         if (!hmenu)
         {
             DestroyWindow(hwnd);
@@ -3307,7 +3308,7 @@ static void test_menu_trackpopupmenu(void)
         ok( gle == ERROR_INVALID_MENU_HANDLE
             || broken (gle == 0xdeadbeef) /* win95 */
             || broken (gle == NO_ERROR) /* win98/ME */
-            ,"TrackPopupMenu%s error got %u expected %u\n",
+            ,"TrackPopupMenu%s error got %lu expected %u\n",
             Ex ? "Ex" : "", gle, ERROR_INVALID_MENU_HANDLE);
         ok( !(gflag_initmenupopup || gflag_entermenuloop || gflag_initmenu),
                 "got unexpected message(s)%s%s%s\n",
@@ -3323,7 +3324,7 @@ static void test_menu_trackpopupmenu(void)
         ok( gle == ERROR_INVALID_MENU_HANDLE
             || broken (gle == 0xdeadbeef) /* win95 */
             || broken (gle == NO_ERROR) /* win98/ME */
-            ,"TrackPopupMenu%s error got %u expected %u\n",
+            ,"TrackPopupMenu%s error got %lu expected %u\n",
             Ex ? "Ex" : "", gle, ERROR_INVALID_MENU_HANDLE);
         ok( !(gflag_initmenupopup || gflag_entermenuloop || gflag_initmenu),
                 "got unexpected message(s)%s%s%s\n",
@@ -3337,7 +3338,7 @@ static void test_menu_trackpopupmenu(void)
         ret = MyTrackPopupMenu( Ex, hmenu, TPM_RETURNCMD, 100,100, 0, NULL);
         gle = GetLastError();
         ok( !ret, "TrackPopupMenu%s should have failed\n", Ex ? "Ex" : "");
-        ok( gle == ERROR_INVALID_WINDOW_HANDLE, "TrackPopupMenu%s error got %u\n", Ex ? "Ex" : "", gle );
+        ok( gle == ERROR_INVALID_WINDOW_HANDLE, "TrackPopupMenu%s error got %lu\n", Ex ? "Ex" : "", gle );
         ok( !(gflag_initmenupopup || gflag_entermenuloop || gflag_initmenu),
                 "got unexpected message(s)%s%s%s\n",
                 gflag_initmenupopup ? " WM_INITMENUPOPUP ": " ",
@@ -3353,7 +3354,7 @@ static void test_menu_trackpopupmenu(void)
         ok( gle == NO_ERROR
             || gle == ERROR_INVALID_MENU_HANDLE /* NT4, win2k */
             || broken (gle == 0xdeadbeef) /* win95 */
-            ,"TrackPopupMenu%s error got %u expected %u or %u\n",
+            ,"TrackPopupMenu%s error got %lu expected %u or %u\n",
             Ex ? "Ex" : "", gle, NO_ERROR, ERROR_INVALID_MENU_HANDLE);
         ok( gflag_initmenupopup && gflag_entermenuloop && gflag_initmenu,
                 "missed expected message(s)%s%s%s\n",
@@ -3371,7 +3372,7 @@ static void test_menu_trackpopupmenu(void)
         ok( gle == NO_ERROR
             || gle == ERROR_INVALID_MENU_HANDLE /* NT4, win2k and Vista in the TrackPopupMenuEx case */
             || broken (gle == 0xdeadbeef) /* win95 */
-            ,"TrackPopupMenu%s error got %u expected %u or %u\n",
+            ,"TrackPopupMenu%s error got %lu expected %u or %u\n",
             Ex ? "Ex" : "", gle, NO_ERROR, ERROR_INVALID_MENU_HANDLE);
         ok( gflag_initmenupopup && gflag_entermenuloop && gflag_initmenu,
                 "missed expected message(s)%s%s%s\n",
@@ -3399,7 +3400,7 @@ static LRESULT WINAPI menu_track_again_wnd_proc(HWND hwnd, UINT msg, WPARAM wpar
         ret = TrackPopupMenu(g_hmenu, 0, 100, 100, 0, hwnd, NULL);
         ok(ret == FALSE, "got %d\n", ret);
         ok(GetLastError() == ERROR_POPUP_ALREADY_ACTIVE ||
-           broken(GetLastError() == 0xdeadbeef) /* W9x */, "got %d\n", GetLastError());
+           broken(GetLastError() == 0xdeadbeef) /* W9x */, "got %ld\n", GetLastError());
 
         /* exit menu modal loop
          * ( A SendMessage does not work on NT3.51 here ) */
@@ -3417,12 +3418,12 @@ static void test_menu_trackagain(void)
     hwnd = CreateWindowExA(0, (LPCSTR)MAKEINTATOM(atomMenuCheckClass), NULL,
             WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 200, 200,
             NULL, NULL, NULL, NULL);
-    ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError());
+    ok(hwnd != NULL, "CreateWindowEx failed with error %ld\n", GetLastError());
     if (!hwnd) return;
     SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_track_again_wnd_proc);
 
     g_hmenu = CreatePopupMenu();
-    ok(g_hmenu != NULL, "CreateMenu failed with error %d\n", GetLastError());
+    ok(g_hmenu != NULL, "CreateMenu failed with error %ld\n", GetLastError());
 
     ret = AppendMenuA(g_hmenu, MF_STRING , 100, "item 1");
     ok(ret, "AppendMenu failed.\n");
@@ -3475,14 +3476,14 @@ static void test_menu_cancelmode(void)
             WS_VISIBLE | WS_CHILD, 10, 10, 20, 20,
             hwnd, NULL, NULL, NULL);
     ok( hwnd != NULL && hwndchild != NULL,
-            "CreateWindowEx failed with error %d\n", GetLastError());
+            "CreateWindowEx failed with error %ld\n", GetLastError());
     g_hwndtosend = hwnd;
     SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_cancelmode_wnd_proc);
     SetWindowLongPtrA( hwndchild, GWLP_WNDPROC, (LONG_PTR)menu_cancelmode_wnd_proc);
     menu = CreatePopupMenu();
-    ok( menu != NULL, "CreatePopupMenu failed with error %d\n", GetLastError());
+    ok( menu != NULL, "CreatePopupMenu failed with error %ld\n", GetLastError());
     ret = AppendMenuA( menu, MF_STRING, 1, "winetest");
-    ok( ret, "Functie failed lasterror is %u\n", GetLastError());
+    ok( ret, "Functie failed lasterror is %lu\n", GetLastError());
     /* seems to be needed only on wine :( */
     while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE))
         DispatchMessageA(&msg);
@@ -3509,15 +3510,15 @@ static void test_menu_cancelmode(void)
 
     /* test canceling tracking in a window's menu bar */
     menubar = CreateMenu();
-    ok( menubar != NULL, "CreateMenu failed with error %d\n", GetLastError());
+    ok( menubar != NULL, "CreateMenu failed with error %ld\n", GetLastError());
     ret = AppendMenuA( menubar, MF_POPUP|MF_STRING, (UINT_PTR)menu, "winetest");
-    ok( ret, "AppendMenuA failed lasterror is %u\n", GetLastError());
+    ok( ret, "AppendMenuA failed lasterror is %lu\n", GetLastError());
     ret = SetMenu( hwnd, menubar );
-    ok( ret, "SetMenu failed lasterror is %u\n", GetLastError());
+    ok( ret, "SetMenu failed lasterror is %lu\n", GetLastError());
     /* initiate tracking */
     g_hwndtosend = hwnd;
     ret = SendMessageA( hwnd, WM_SYSCOMMAND, SC_KEYMENU, 0 );
-    ok( ret == 0, "Sending WM_SYSCOMMAND/SC_KEYMENU failed lasterror is %u\n", GetLastError());
+    ok( ret == 0, "Sending WM_SYSCOMMAND/SC_KEYMENU failed lasterror is %lu\n", GetLastError());
     while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE))
         DispatchMessageA(&msg);
     ok(g_got_enteridle == 0, "received %d WM_ENTERIDLE messages, none expected\n", g_got_enteridle);
@@ -3548,7 +3549,7 @@ static void test_menu_maxdepth(void)
         if( !ret) break;
     }
     trace("Maximum depth is %d\n", i);
-    ok( GetLastError() == 12345678, "unexpected error %d\n",  GetLastError());
+    ok( GetLastError() == 12345678, "unexpected error %ld\n",  GetLastError());
     ok( i < NR_MENUS ||
            broken( i == NR_MENUS), /* win98, NT */
            "no ( or very large) limit on menu depth!\n");
@@ -3567,12 +3568,12 @@ static void test_menu_circref(void)
     menu2 = CreatePopupMenu();
     ok( menu1 && menu2, "error creating menus.\n");
     ret = AppendMenuA( menu1, MF_POPUP, (UINT_PTR)menu2, "winetest");
-    ok( ret, "AppendMenu failed, error is %d\n", GetLastError());
+    ok( ret, "AppendMenu failed, error is %ld\n", GetLastError());
     ret = AppendMenuA( menu1, MF_STRING | MF_HILITE, 123, "winetest");
-    ok( ret, "AppendMenu failed, error is %d\n", GetLastError());
+    ok( ret, "AppendMenu failed, error is %ld\n", GetLastError());
     /* app chooses an id that happens to clash with its own hmenu */
     ret = AppendMenuA( menu2, MF_STRING, (UINT_PTR)menu2, "winetest");
-    ok( ret, "AppendMenu failed, error is %d\n", GetLastError());
+    ok( ret, "AppendMenu failed, error is %ld\n", GetLastError());
     /* now attempt to change the string of the first item of menu1 */
     ret = ModifyMenuA( menu1, (UINT_PTR)menu2, MF_POPUP, (UINT_PTR)menu2, "menu 2");
     ok( !ret ||
@@ -3580,7 +3581,7 @@ static void test_menu_circref(void)
             "ModifyMenu should have failed.\n");
     if( !ret) { /* will probably stack fault if the ModifyMenu succeeded */
         ret = GetMenuState( menu1, 123, 0);
-        ok( ret == MF_HILITE, "GetMenuState returned %x\n",ret);
+        ok( ret == MF_HILITE, "GetMenuState returned %lx\n",ret);
     }
     DestroyMenu( menu2);
     DestroyMenu( menu1);
@@ -3621,9 +3622,9 @@ static void test_menualign(void)
 
     mi.fMask = MIM_STYLE;
     ret = GetMenuInfo( menu, &mi);
-    ok( ret, "GetMenuInfo failed: %d\n", GetLastError());
+    ok( ret, "GetMenuInfo failed: %ld\n", GetLastError());
     ok( menu != NULL, "GetMenuInfo() failed\n");
-    ok( 0 == mi.dwStyle, "menuinfo style is %x\n", mi.dwStyle);
+    ok( 0 == mi.dwStyle, "menuinfo style is %lx\n", mi.dwStyle);
 
     /* test 1 */
     mii.fMask = MIIM_BITMAP | MIIM_STRING | MIIM_ID;
@@ -3639,7 +3640,7 @@ static void test_menualign(void)
     ret = InsertMenuItemA( menu, -1, TRUE, &mii);
     ok( ret, "InsertMenuItem() failed\n");
     ret = TrackPopupMenu( menu, TPM_RETURNCMD, 110, 200, 0, hwnd, NULL);
-    ok( ret != 2, "User indicated that menu text alignment test 1 failed %d\n", ret);
+    ok( ret != 2, "User indicated that menu text alignment test 1 failed %ld\n", ret);
     /* test 2*/
     mii.fMask = MIIM_BITMAP | MIIM_STRING | MIIM_ID;
     mii.wID = 3;
@@ -3661,7 +3662,7 @@ static void test_menualign(void)
     ret = SetMenuItemInfoA( menu, 2, TRUE, &mii);
     ok( ret, "SetMenuItemInfo() failed\n");
     ret = TrackPopupMenu( menu, TPM_RETURNCMD, 110, 200, 0, hwnd, NULL);
-    ok( ret != 2, "User indicated that menu text alignment test 2 failed %d\n", ret);
+    ok( ret != 2, "User indicated that menu text alignment test 2 failed %ld\n", ret);
     /* test 3 */
     mii.fMask = MIIM_TYPE | MIIM_ID;
     mii.wID = 3;
@@ -3681,7 +3682,7 @@ static void test_menualign(void)
     ret = SetMenuItemInfoA( menu, 2, TRUE, &mii);
     ok( ret, "SetMenuItemInfo() failed\n");
     ret = TrackPopupMenu( menu, TPM_RETURNCMD, 110, 200, 0, hwnd, NULL);
-    ok( ret != 2, "User indicated that menu text alignment test 3 failed %d\n", ret);
+    ok( ret != 2, "User indicated that menu text alignment test 3 failed %ld\n", ret);
     /* cleanup */
     DeleteObject( hbm1);
     DeleteObject( hbm2);
@@ -3731,11 +3732,11 @@ static void test_emptypopup(void)
     HWND hwnd = CreateWindowExA(0, (LPCSTR)MAKEINTATOM(atomMenuCheckClass), NULL,
                                WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 200, 200,
                                NULL, NULL, NULL, NULL);
-    ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError());
+    ok(hwnd != NULL, "CreateWindowEx failed with error %ld\n", GetLastError());
     SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_ownerdraw_wnd_proc);
 
     hmenu = CreatePopupMenu();
-    ok(hmenu != NULL, "CreateMenu failed with error %d\n", GetLastError());
+    ok(hmenu != NULL, "CreateMenu failed with error %ld\n", GetLastError());
 
     gflag_initmenupopup = gflag_entermenuloop = gflag_initmenu = gflag_enteridle = 0;
     selectitem_wp = 0xdeadbeef;
@@ -3749,8 +3750,8 @@ static void test_emptypopup(void)
     ok(gflag_initmenu == 1, "got %i\n", gflag_initmenu);
     ok(gflag_enteridle == 0, "got %i\n", gflag_initmenu);
 
-    ok(selectitem_wp == 0xdeadbeef, "got %lx\n", selectitem_wp);
-    ok(selectitem_lp == 0xdeadbeef, "got %lx\n", selectitem_lp);
+    ok(selectitem_wp == 0xdeadbeef, "got %Ix\n", selectitem_wp);
+    ok(selectitem_lp == 0xdeadbeef, "got %Ix\n", selectitem_lp);
 
     gflag_initmenupopup = gflag_entermenuloop = gflag_initmenu = gflag_enteridle = 0;
     selectitem_wp = 0xdeadbeef;
@@ -3764,8 +3765,8 @@ static void test_emptypopup(void)
     ok(gflag_initmenu == 1, "got %i\n", gflag_initmenu);
     ok(gflag_enteridle == 0, "got %i\n", gflag_initmenu);
 
-    ok(selectitem_wp == 0xdeadbeef, "got %lx\n", selectitem_wp);
-    ok(selectitem_lp == 0xdeadbeef, "got %lx\n", selectitem_lp);
+    ok(selectitem_wp == 0xdeadbeef, "got %Ix\n", selectitem_wp);
+    ok(selectitem_lp == 0xdeadbeef, "got %Ix\n", selectitem_lp);
 
     SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_fill_in_init);
 
@@ -3781,13 +3782,13 @@ static void test_emptypopup(void)
     ok(gflag_initmenu == 1, "got %i\n", gflag_initmenu);
     ok(gflag_enteridle == 1, "got %i\n", gflag_initmenu);
 
-    ok(selectitem_wp == 0xffff0000, "got %lx\n", selectitem_wp);
-    ok(selectitem_lp == 0, "got %lx\n", selectitem_lp);
+    ok(selectitem_wp == 0xffff0000, "got %Ix\n", selectitem_wp);
+    ok(selectitem_lp == 0, "got %Ix\n", selectitem_lp);
 
     DestroyWindow(hwnd);
 
     ret = DestroyMenu(hmenu);
-    ok(ret, "DestroyMenu failed with error %d\n", GetLastError());
+    ok(ret, "DestroyMenu failed with error %ld\n", GetLastError());
 }
 
 static HMENU get_bad_hmenu( UINT_PTR id )
@@ -3946,7 +3947,7 @@ if (0) /* FIXME: uncomment once Wine is fixed */ {
     ok(mii.fState == MF_ENABLED, "expected MF_ENABLED, got %#x\n", mii.fState);
     ok(mii.wID == 0, "expected 0, got %#x\n", mii.wID);
     ok(mii.hSubMenu == 0, "expected 0, got %p\n", mii.hSubMenu);
-    ok(mii.dwItemData == 0x81818181, "expected 0x81818181, got %#lx\n", mii.dwItemData);
+    ok(mii.dwItemData == 0x81818181, "expected 0x81818181, got %#Ix\n", mii.dwItemData);
     ok(mii.dwTypeData == buf, "expected %p, got %p\n", buf, mii.dwTypeData);
     ok(mii.cch == 6, "expected 6, got %u\n", mii.cch);
     ok(!strcmp(buf, string), "expected %s, got %s\n", string, buf);
@@ -3962,7 +3963,7 @@ if (0) /* FIXME: uncomment once Wine is fixed */ {
     ok(mii.fState == 0x81818181, "expected 0x81818181, got %#x\n", mii.fState);
     ok(mii.wID == 0x81818181, "expected 0x81818181, got %#x\n", mii.wID);
     ok(mii.hSubMenu == 0, "expected 0, got %p\n", mii.hSubMenu);
-    ok(mii.dwItemData == 0x81818181, "expected 0x81818181, got %#lx\n", mii.dwItemData);
+    ok(mii.dwItemData == 0x81818181, "expected 0x81818181, got %#Ix\n", mii.dwItemData);
     ok(mii.dwTypeData == (LPSTR)hbmp, "expected %p, got %p\n", hbmp, mii.dwTypeData);
     ok(mii.cch == 6, "expected 6, got %u\n", mii.cch);
     ok(mii.hbmpItem == hbmp, "expected %p, got %p\n", hbmp, mii.hbmpItem);
@@ -3980,7 +3981,7 @@ if (0) /* FIXME: uncomment once Wine is fixed */ {
     ok(mii.fState == MF_ENABLED, "expected MF_ENABLED, got %#x\n", mii.fState);
     ok(mii.wID == 0, "expected 0, got %#x\n", mii.wID);
     ok(mii.hSubMenu == 0, "expected 0, got %p\n", mii.hSubMenu);
-    ok(mii.dwItemData == 0, "expected 0, got %#lx\n", mii.dwItemData);
+    ok(mii.dwItemData == 0, "expected 0, got %#Ix\n", mii.dwItemData);
     ok(mii.dwTypeData == (LPSTR)hbmp, "expected %p, got %p\n", hbmp, mii.dwTypeData);
     ok(mii.cch == 6, "expected 6, got %u\n", mii.cch);
     ok(mii.hbmpItem == hbmp, "expected %p, got %p\n", hbmp, mii.hbmpItem);
@@ -4013,7 +4014,7 @@ if (0) /* FIXME: uncomment once Wine is fixed */ {
     ok(mii.fState == MF_ENABLED, "expected MF_ENABLED, got %#x\n", mii.fState);
     ok(mii.wID == 0, "expected 0, got %#x\n", mii.wID);
     ok(mii.hSubMenu == 0, "expected 0, got %p\n", mii.hSubMenu);
-    ok(mii.dwItemData == 0x81818181, "expected 0x81818181, got %#lx\n", mii.dwItemData);
+    ok(mii.dwItemData == 0x81818181, "expected 0x81818181, got %#Ix\n", mii.dwItemData);
     ok(mii.dwTypeData == buf, "expected %p, got %p\n", buf, mii.dwTypeData);
     ok(mii.cch == 6, "expected 6, got %u\n", mii.cch);
     ok(!strcmp(buf, string), "expected %s, got %s\n", string, buf);
@@ -4031,7 +4032,7 @@ if (0) /* FIXME: uncomment once Wine is fixed */ {
     ok(mii.fState == 0x81818181, "expected 0x81818181, got %#x\n", mii.fState);
     ok(mii.wID == 0x81818181, "expected 0x81818181, got %#x\n", mii.wID);
     ok(mii.hSubMenu == 0, "expected 0, got %p\n", mii.hSubMenu);
-    ok(mii.dwItemData == 0x81818181, "expected 0x81818181, got %#lx\n", mii.dwItemData);
+    ok(mii.dwItemData == 0x81818181, "expected 0x81818181, got %#Ix\n", mii.dwItemData);
     ok(mii.dwTypeData == buf, "expected %p, got %p\n", buf, mii.dwTypeData);
     ok(mii.cch == 6, "expected 6, got %u\n", mii.cch);
     ok(!strcmp(buf, string), "expected %s, got %s\n", string, buf);
@@ -4050,7 +4051,7 @@ if (0) /* FIXME: uncomment once Wine is fixed */ {
     ok(mii.fState == MF_ENABLED, "expected MF_ENABLED, got %#x\n", mii.fState);
     ok(mii.wID == 0, "expected 0, got %#x\n", mii.wID);
     ok(mii.hSubMenu == 0, "expected 0, got %p\n", mii.hSubMenu);
-    ok(mii.dwItemData == 0, "expected 0, got %#lx\n", mii.dwItemData);
+    ok(mii.dwItemData == 0, "expected 0, got %#Ix\n", mii.dwItemData);
     ok(mii.dwTypeData == buf, "expected %p, got %p\n", buf, mii.dwTypeData);
     ok(mii.cch == 6, "expected 6, got %u\n", mii.cch);
     ok(!strcmp(buf, string), "expected %s, got %s\n", string, buf);
@@ -4085,7 +4086,7 @@ if (0) /* FIXME: uncomment once Wine is fixed */ {
     ok(mii.fState == MF_ENABLED, "expected MF_ENABLED, got %#x\n", mii.fState);
     ok(mii.wID == 0, "expected 0, got %#x\n", mii.wID);
     ok(mii.hSubMenu == 0, "expected 0, got %p\n", mii.hSubMenu);
-    ok(mii.dwItemData == (ULONG_PTR)hbmp, "expected %p, got %#lx\n", hbmp, mii.dwItemData);
+    ok(mii.dwItemData == (ULONG_PTR)hbmp, "expected %p, got %#Ix\n", hbmp, mii.dwItemData);
     ok(mii.dwTypeData == buf, "expected %p, got %p\n", buf, mii.dwTypeData);
     ok(mii.cch == 6, "expected 6, got %u\n", mii.cch);
     ok(!strcmp(buf, string), "expected %s, got %s\n", string, buf);
@@ -4104,7 +4105,7 @@ if (0) /* FIXME: uncomment once Wine is fixed */ {
     ok(mii.fState == 0x81818181, "expected 0x81818181, got %#x\n", mii.fState);
     ok(mii.wID == 0x81818181, "expected 0x81818181, got %#x\n", mii.wID);
     ok(mii.hSubMenu == 0, "expected 0, got %p\n", mii.hSubMenu);
-    ok(mii.dwItemData == 0x81818181, "expected 0x81818181, got %#lx\n", mii.dwItemData);
+    ok(mii.dwItemData == 0x81818181, "expected 0x81818181, got %#Ix\n", mii.dwItemData);
     ok(mii.dwTypeData == buf, "expected %p, got %p\n", buf, mii.dwTypeData);
     ok(mii.cch == 6, "expected 6, got %u\n", mii.cch);
     ok(!strcmp(buf, string), "expected %s, got %s\n", string, buf);
@@ -4137,7 +4138,7 @@ if (0) /* FIXME: uncomment once Wine is fixed */ {
     ok(mii.fState == MF_ENABLED, "expected MF_ENABLED, got %#x\n", mii.fState);
     ok(mii.wID == 0, "expected 0, got %#x\n", mii.wID);
     ok(mii.hSubMenu == 0, "expected 0, got %p\n", mii.hSubMenu);
-    ok(mii.dwItemData == 0x81818181, "expected 0x81818181, got %#lx\n", mii.dwItemData);
+    ok(mii.dwItemData == 0x81818181, "expected 0x81818181, got %#Ix\n", mii.dwItemData);
     ok(mii.dwTypeData == buf, "expected %p, got %p\n", buf, mii.dwTypeData);
     ok(mii.cch == 6, "expected 6, got %u\n", mii.cch);
     ok(!strcmp(buf, string), "expected %s, got %s\n", string, buf);
@@ -4161,7 +4162,7 @@ if (0) /* FIXME: uncomment once Wine is fixed */ {
     ok(mii.fState == MF_ENABLED, "expected MF_ENABLED, got %#x\n", mii.fState);
     ok(mii.wID == 0, "expected 0, got %#x\n", mii.wID);
     ok(mii.hSubMenu == 0, "expected 0, got %p\n", mii.hSubMenu);
-    ok(mii.dwItemData == 0x81818181, "expected 0x81818181, got %#lx\n", mii.dwItemData);
+    ok(mii.dwItemData == 0x81818181, "expected 0x81818181, got %#Ix\n", mii.dwItemData);
     ok(mii.dwTypeData == buf, "expected %p, got %p\n", buf, mii.dwTypeData);
     ok(mii.cch == 6, "expected 6, got %u\n", mii.cch);
     ok(!strcmp(buf, string), "expected %s, got %s\n", string, buf);
@@ -4180,7 +4181,7 @@ if (0) /* FIXME: uncomment once Wine is fixed */ {
     ok(mii.fState == 0x81818181, "expected 0x81818181, got %#x\n", mii.fState);
     ok(mii.wID == 0x81818181, "expected 0x81818181, got %#x\n", mii.wID);
     ok(mii.hSubMenu == 0, "expected 0, got %p\n", mii.hSubMenu);
-    ok(mii.dwItemData == 0x81818181, "expected 0x81818181, got %#lx\n", mii.dwItemData);
+    ok(mii.dwItemData == 0x81818181, "expected 0x81818181, got %#Ix\n", mii.dwItemData);
     ok(mii.dwTypeData == buf, "expected %p, got %p\n", buf, mii.dwTypeData);
     ok(mii.cch == 6, "expected 6, got %u\n", mii.cch);
     ok(!strcmp(buf, string), "expected %s, got %s\n", string, buf);
@@ -4204,7 +4205,7 @@ if (0) /* FIXME: uncomment once Wine is fixed */ {
     ok(mii.fState == MF_ENABLED, "expected MF_ENABLED, got %#x\n", mii.fState);
     ok(mii.wID == 0, "expected 0, got %#x\n", mii.wID);
     ok(mii.hSubMenu == 0, "expected 0, got %p\n", mii.hSubMenu);
-    ok(mii.dwItemData == 0x81818181, "expected 0x81818181, got %#lx\n", mii.dwItemData);
+    ok(mii.dwItemData == 0x81818181, "expected 0x81818181, got %#Ix\n", mii.dwItemData);
     ok(mii.dwTypeData == buf, "expected %p, got %p\n", buf, mii.dwTypeData);
     ok(mii.cch == 6, "expected 6, got %u\n", mii.cch);
     ok(!strcmp(buf, string), "expected %s, got %s\n", string, buf);
@@ -4223,7 +4224,7 @@ if (0) /* FIXME: uncomment once Wine is fixed */ {
     ok(mii.fState == 0x81818181, "expected 0x81818181, got %#x\n", mii.fState);
     ok(mii.wID == 0x81818181, "expected 0x81818181, got %#x\n", mii.wID);
     ok(mii.hSubMenu == 0, "expected 0, got %p\n", mii.hSubMenu);
-    ok(mii.dwItemData == 0x81818181, "expected 0x81818181, got %#lx\n", mii.dwItemData);
+    ok(mii.dwItemData == 0x81818181, "expected 0x81818181, got %#Ix\n", mii.dwItemData);
     ok(mii.dwTypeData == (LPSTR)hbmp, "expected %p, got %p\n", hbmp, mii.dwTypeData);
     ok(mii.cch == 6, "expected 6, got %u\n", mii.cch);
     ok(mii.hbmpItem == hbmp, "expected %p, got %p\n", hbmp, mii.hbmpItem);




More information about the wine-devel mailing list