I got a private utility without source, that silently fails in current wine. After a succeeding call to RegisterClassExW it checks instead of the return value the value of GetLastError. I assume is a bug in the utility itself.
But it works in Windows and I could track it down to a call to LoadIconW, that clears the last error value, and therefore makes the utility work.
Windows XP does not clear last error, but the utility is just targeting version Vista or later.
Uncertainties: - Should both patches go into a single one? - Is there a better place for the test? - The file windowsm.ico is copied from programs/taskmgr, is this ok? --- dlls/user32/tests/resource.c | 21 +++++++++++++++++++++ dlls/user32/tests/resource.rc | 3 +++ dlls/user32/tests/windowsm.ico | Bin 0 -> 318 bytes 3 files changed, 24 insertions(+) create mode 100644 dlls/user32/tests/windowsm.ico
diff --git a/dlls/user32/tests/resource.c b/dlls/user32/tests/resource.c index 5d4c4e2f96..959b6c0a46 100644 --- a/dlls/user32/tests/resource.c +++ b/dlls/user32/tests/resource.c @@ -394,17 +394,38 @@ static void test_LoadImage(void) { HBITMAP bmp; HRSRC hres; + HICON ico; + int error;
+ SetLastError(0xdeadbeef); bmp = LoadBitmapA(GetModuleHandleA(NULL), MAKEINTRESOURCEA(100)); + error = GetLastError(); ok(bmp != NULL, "Could not load a bitmap resource\n"); + ok(error == 0xdeadbeef, "Last error: %u\n", error); if (bmp) DeleteObject(bmp);
+ SetLastError(0xdeadbeef); hres = FindResourceA(GetModuleHandleA(NULL), "#100", (LPCSTR)RT_BITMAP); + error = GetLastError(); ok(hres != NULL, "Could not find a bitmap resource with a numeric string\n"); + ok(error == 0xdeadbeef, "Last error: %u\n", error);
+ SetLastError(0xdeadbeef); bmp = LoadBitmapA(GetModuleHandleA(NULL), "#100"); + error = GetLastError(); ok(bmp != NULL, "Could not load a bitmap resource with a numeric string\n"); + ok(error == 0xdeadbeef, "Last error: %u\n", error); if (bmp) DeleteObject(bmp); + + SetLastError(0xdeadbeef); + ico = LoadIconA(GetModuleHandleA(NULL), MAKEINTRESOURCEA(102)); + error = GetLastError(); + ok(ico != NULL, "Could not load an icon resource\n"); + todo_wine + ok(error == ERROR_SUCCESS || + broken(error == ERROR_INVALID_HANDLE), /* WinXP */ + "Last error: %u\n", error); + if (ico) DeleteObject(ico); }
START_TEST(resource) diff --git a/dlls/user32/tests/resource.rc b/dlls/user32/tests/resource.rc index 89aaf5a61c..0afc25188e 100644 --- a/dlls/user32/tests/resource.rc +++ b/dlls/user32/tests/resource.rc @@ -252,6 +252,9 @@ FONT 8, "MS Shell Dlg" /* @makedep: bmp1x1_32bpp.bmp */ 101 BITMAP bmp1x1_32bpp.bmp
+/* @makedep: windowsm.ico */ +102 ICON windowsm.ico + 1 MENU { POPUP "&File" diff --git a/dlls/user32/tests/windowsm.ico b/dlls/user32/tests/windowsm.ico new file mode 100644 index 0000000000000000000000000000000000000000..9d4b2cff3bd2a9347e7775c6dc258ed8e186794d GIT binary patch literal 318 zcmb78u?@f=3^P&>VCvklhwxL^Y;aai;sa_!St_KePHabs5&!}t#t7jIz%D1%Imm#G z3V7F*7{G+tFe*#9J6(g;6RoKt8EQ#hC<B%`B>wx{Pbt+}Ez=3hSBE|K%Y1h6g*p0k F?cOT^Vu%0$
literal 0 HcmV?d00001
--- dlls/user32/cursoricon.c | 6 +++++- dlls/user32/tests/resource.c | 1 - 2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c index 6413d22d03..78cb3dfe1a 100644 --- a/dlls/user32/cursoricon.c +++ b/dlls/user32/cursoricon.c @@ -3042,6 +3042,7 @@ HANDLE WINAPI LoadImageA( HINSTANCE hinst, LPCSTR name, UINT type, HANDLE WINAPI LoadImageW( HINSTANCE hinst, LPCWSTR name, UINT type, INT desiredx, INT desiredy, UINT loadflags ) { + HANDLE ret; int depth; WCHAR path[MAX_PATH];
@@ -3062,7 +3063,10 @@ HANDLE WINAPI LoadImageW( HINSTANCE hinst, LPCWSTR name, UINT type, case IMAGE_CURSOR: depth = 1; if (!(loadflags & LR_MONOCHROME)) depth = get_display_bpp(); - return CURSORICON_Load(hinst, name, desiredx, desiredy, depth, (type == IMAGE_CURSOR), loadflags); + ret = CURSORICON_Load(hinst, name, desiredx, desiredy, depth, (type == IMAGE_CURSOR), loadflags); + if (hinst && ret) + SetLastError(ERROR_SUCCESS); + return ret; } return 0; } diff --git a/dlls/user32/tests/resource.c b/dlls/user32/tests/resource.c index 959b6c0a46..e33fc0d8ec 100644 --- a/dlls/user32/tests/resource.c +++ b/dlls/user32/tests/resource.c @@ -421,7 +421,6 @@ static void test_LoadImage(void) ico = LoadIconA(GetModuleHandleA(NULL), MAKEINTRESOURCEA(102)); error = GetLastError(); ok(ico != NULL, "Could not load an icon resource\n"); - todo_wine ok(error == ERROR_SUCCESS || broken(error == ERROR_INVALID_HANDLE), /* WinXP */ "Last error: %u\n", error);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=66541
Your paranoid android.
=== debiant (32 bit Chinese:China report) ===
user32: clipboard.c:833: Test failed: 0: gle 5 clipboard.c:838: Test failed: 0.0: got 0000 instead of 0001 clipboard.c:868: Test failed: 0: gle 1418 clipboard.c:717: Test failed: 1: gle 5 clipboard.c:719: Test failed: 1: gle 1418 clipboard.c:746: Test failed: 1: count 4 clipboard.c:749: Test failed: 1: gle 1418 clipboard.c:760: Test failed: 1: gle 5 clipboard.c:765: Test failed: 1.0: got 0000 instead of 0007 clipboard.c:805: Test failed: 1: gle 1418 clipboard.c:815: Test failed: 1: count 4 clipboard.c:818: Test failed: 1: gle 1418 clipboard.c:833: Test failed: 1: gle 5 clipboard.c:838: Test failed: 1.0: got 0000 instead of 0007 clipboard.c:868: Test failed: 1: gle 1418 clipboard.c:717: Test failed: 2: gle 5 clipboard.c:719: Test failed: 2: gle 1418 clipboard.c:746: Test failed: 2: count 4 clipboard.c:749: Test failed: 2: gle 1418 clipboard.c:760: Test failed: 2: gle 5 clipboard.c:765: Test failed: 2.0: got 0000 instead of 000d clipboard.c:805: Test failed: 2: gle 1418 clipboard.c:815: Test failed: 2: count 4 clipboard.c:818: Test failed: 2: gle 1418 clipboard.c:833: Test failed: 2: gle 5 clipboard.c:838: Test failed: 2.0: got 0000 instead of 000d clipboard.c:868: Test failed: 2: gle 1418 clipboard.c:717: Test failed: 3: gle 5 clipboard.c:719: Test failed: 3: gle 1418 clipboard.c:746: Test failed: 3: count 5 clipboard.c:749: Test failed: 3: gle 1418 clipboard.c:755: Test failed: 3: 0003 not available clipboard.c:757: Test failed: 3: count 5 instead of 2 clipboard.c:760: Test failed: 3: gle 5 clipboard.c:765: Test failed: 3.0: got 0000 instead of 000e clipboard.c:805: Test failed: 3: gle 1418 clipboard.c:815: Test failed: 3: count 5 clipboard.c:818: Test failed: 3: gle 1418 clipboard.c:826: Test failed: 3: 0003 not available clipboard.c:828: Test failed: 3: count 5 instead of 2 clipboard.c:833: Test failed: 3: gle 5 clipboard.c:838: Test failed: 3.0: got 0000 instead of 000e clipboard.c:868: Test failed: 3: gle 1418 clipboard.c:717: Test failed: 4: gle 5 clipboard.c:719: Test failed: 4: gle 1418 clipboard.c:746: Test failed: 4: count 6 clipboard.c:749: Test failed: 4: gle 1418 clipboard.c:757: Test failed: 4: count 6 instead of 2 clipboard.c:760: Test failed: 4: gle 5 clipboard.c:765: Test failed: 4.0: got 0000 instead of 0003 clipboard.c:805: Test failed: 4: gle 1418 clipboard.c:815: Test failed: 4: count 6 clipboard.c:818: Test failed: 4: gle 1418 clipboard.c:828: Test failed: 4: count 6 instead of 2 clipboard.c:833: Test failed: 4: gle 5 clipboard.c:838: Test failed: 4.0: got 0000 instead of 0003 clipboard.c:868: Test failed: 4: gle 1418 clipboard.c:717: Test failed: 5: gle 5 clipboard.c:719: Test failed: 5: gle 1418 clipboard.c:746: Test failed: 5: count 7 clipboard.c:749: Test failed: 5: gle 1418 clipboard.c:755: Test failed: 5: 0008 not available clipboard.c:755: Test failed: 5: 0011 not available clipboard.c:757: Test failed: 5: count 7 instead of 3 clipboard.c:760: Test failed: 5: gle 5 clipboard.c:765: Test failed: 5.0: got 0000 instead of 0002 clipboard.c:805: Test failed: 5: gle 1418 clipboard.c:815: Test failed: 5: count 7 clipboard.c:818: Test failed: 5: gle 1418 clipboard.c:826: Test failed: 5: 0008 not available clipboard.c:826: Test failed: 5: 0011 not available clipboard.c:828: Test failed: 5: count 7 instead of 3 clipboard.c:833: Test failed: 5: gle 5 clipboard.c:838: Test failed: 5.0: got 0000 instead of 0002 clipboard.c:868: Test failed: 5: gle 1418 clipboard.c:717: Test failed: 6: gle 5 clipboard.c:719: Test failed: 6: gle 1418 clipboard.c:746: Test failed: 6: count 8 clipboard.c:749: Test failed: 6: gle 1418 clipboard.c:755: Test failed: 6: 0011 not available clipboard.c:757: Test failed: 6: count 8 instead of 3 clipboard.c:760: Test failed: 6: gle 5 clipboard.c:765: Test failed: 6.0: got 0000 instead of 0008 clipboard.c:805: Test failed: 6: gle 1418 clipboard.c:815: Test failed: 6: count 8 clipboard.c:818: Test failed: 6: gle 1418 clipboard.c:826: Test failed: 6: 0011 not available clipboard.c:828: Test failed: 6: count 8 instead of 3 clipboard.c:833: Test failed: 6: gle 5 clipboard.c:838: Test failed: 6.0: got 0000 instead of 0008 clipboard.c:868: Test failed: 6: gle 1418 clipboard.c:717: Test failed: 7: gle 5 clipboard.c:719: Test failed: 7: gle 1418 clipboard.c:746: Test failed: 7: count 9 clipboard.c:749: Test failed: 7: gle 1418 clipboard.c:757: Test failed: 7: count 9 instead of 3 clipboard.c:760: Test failed: 7: gle 5 clipboard.c:765: Test failed: 7.0: got 0000 instead of 0011 clipboard.c:805: Test failed: 7: gle 1418 clipboard.c:815: Test failed: 7: count 9 clipboard.c:818: Test failed: 7: gle 1418 clipboard.c:828: Test failed: 7: count 9 instead of 3 clipboard.c:833: Test failed: 7: gle 5 clipboard.c:838: Test failed: 7.0: got 0000 instead of 0011 clipboard.c:868: Test failed: 7: gle 1418 clipboard.c:874: Test failed: gle 5 clipboard.c:876: Test failed: gle 1418 clipboard.c:878: Test failed: gle 1418
=== debiant (64 bit WoW report) ===
user32: clipboard.c:760: Test failed: 3: gle 5 clipboard.c:765: Test failed: 3.0: got 0000 instead of 000e clipboard.c:805: Test failed: 3: gle 1418 clipboard.c:815: Test failed: 3: count 2 clipboard.c:818: Test failed: 3: gle 1418 clipboard.c:852: Test failed: 3: format 000e got data 0005003F clipboard.c:853: Test failed: 3.0: formats 00000000 have been rendered clipboard.c:858: Test failed: 3.0: formats 00000000 have been rendered clipboard.c:852: Test failed: 3: format 0003 got data 0021FF98 clipboard.c:853: Test failed: 3.1: formats 00000000 have been rendered clipboard.c:858: Test failed: 3.1: formats 00000000 have been rendered clipboard.c:760: Test failed: 7: gle 5 clipboard.c:765: Test failed: 7.0: got 0000 instead of 0011 clipboard.c:805: Test failed: 7: gle 1418 clipboard.c:815: Test failed: 7: count 3 clipboard.c:818: Test failed: 7: gle 1418 clipboard.c:852: Test failed: 7: format 0011 got data 008AE4B0 clipboard.c:853: Test failed: 7.0: formats 00000000 have been rendered clipboard.c:858: Test failed: 7.0: formats 00000000 have been rendered clipboard.c:852: Test failed: 7: format 0002 got data 0009003F clipboard.c:853: Test failed: 7.1: formats 00000000 have been rendered clipboard.c:858: Test failed: 7.1: formats 00000000 have been rendered clipboard.c:852: Test failed: 7: format 0008 got data 008AF140 clipboard.c:853: Test failed: 7.2: formats 00000000 have been rendered clipboard.c:858: Test failed: 7.2: formats 00000000 have been rendered
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=66540
Your paranoid android.
=== w8adm (32 bit report) ===
user32: clipboard.c:402: Test failed: GlobalGetAtomNameA should fail clipboard.c:403: Test failed: err -559038737
=== w864 (32 bit report) ===
user32: clipboard.c:1660: clipboard.c:158: Test failed: 1831: expected WAIT_OBJECT_0, got 258
=== w1064v1507 (32 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064v1809 (32 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064v1809_2scr (32 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064v1809_ar (32 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064v1809_he (32 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064v1809_zh_CN (32 bit report) ===
user32: cursoricon.c:2366: Test failed: wrong info cursor 000203D5/00010003 cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064v1507 (64 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064v1809_ar (32 bit report) ===
user32: menu.c:2339: Test failed: test 6 menu.c:2339: Test failed: test 8 menu.c:2339: Test failed: test 10 menu.c:2339: Test failed: test 12 menu.c:2339: Test failed: test 14 menu.c:2339: Test failed: test 16
=== w1064v1809_he (32 bit report) ===
user32: menu.c:2339: Test failed: test 1
=== w1064v1809_he (testbot log) ===
The task timed out
=== w1064v1809_ja (32 bit report) ===
user32: menu: Timeout
=== w1064v1809_ja (testbot log) ===
The task timed out
=== w8 (32 bit report) ===
user32: sysparams.c:2512: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2523: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w8adm (32 bit report) ===
user32: sysparams.c:2512: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2523: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w864 (32 bit report) ===
user32: sysparams.c:2512: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2523: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w1064v1809 (32 bit report) ===
user32: sysparams.c:2512: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2523: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w1064v1809_2scr (32 bit report) ===
user32: sysparams.c:2512: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2523: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w1064v1809_ar (32 bit report) ===
user32: sysparams.c:228: Test failed: Unexpected WM_DISPLAYCHANGE message sysparams.c:2512: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2523: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w1064v1809_he (32 bit report) ===
user32: sysparams.c:2512: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2523: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w1064v1809_ja (32 bit report) ===
user32: sysparams.c:2512: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2523: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w1064v1809_zh_CN (32 bit report) ===
user32: sysparams.c:2512: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2523: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w1064v1809 (32 bit report) ===
user32: win.c:3167: Test failed: GetActiveWindow() = 0004004C win.c:3170: Test failed: GetFocus() = 00000000 win.c:3182: Test failed: GetFocus() = 00000000 win.c:3185: Test failed: GetFocus() = 00000000 win.c:3188: Test failed: GetFocus() = 00000000 win.c:3191: Test failed: GetActiveWindow() = 0004004C win.c:3195: Test failed: GetFocus() = 00000000 win.c:3198: Test failed: GetFocus() = 00000000 win.c:3892: Test failed: hwnd 000200E0/001602E4 message 0737 win.c:3897: Test failed: hwnd 001602E4/001602E4 message 0202 win.c:3902: Test failed: hwnd 001602E4/001602E4 message 0203 win.c:3906: Test failed: message 0202 available
=== w1064v1809_2scr (32 bit report) ===
user32: win.c:3852: Test failed: hwnd 0004029A message 0738
=== w1064v1809_ja (32 bit report) ===
user32: win.c:3449: Test failed: GetActiveWindow() = 00000000 win.c:3471: Test failed: GetActiveWindow() = 00000000 win.c:3727: Test failed: message 0738 available win.c:3852: Test failed: hwnd 001502E2 message 7fff win.c:3931: Test failed: hwnd 001502E2/000F0350 message 7fff win.c:3934: Test failed: hwnd 001502E2/000F0350 message 7fff
=== w1064v1809_zh_CN (32 bit report) ===
user32: win.c:3852: Test failed: hwnd 00010390 message 0282 win.c:3931: Test failed: hwnd 00010390/000C03DC message 0282 win.c:3934: Test failed: hwnd 00010390/000C03DC message 0282
=== w1064v1809 (64 bit report) ===
user32: win.c:3167: Test failed: GetActiveWindow() = 000000000004004A win.c:3170: Test failed: GetFocus() = 0000000000000000 win.c:3182: Test failed: GetFocus() = 0000000000000000 win.c:3185: Test failed: GetFocus() = 0000000000000000 win.c:3188: Test failed: GetFocus() = 0000000000000000 win.c:3191: Test failed: GetActiveWindow() = 000000000004004A win.c:3195: Test failed: GetFocus() = 0000000000000000 win.c:3198: Test failed: GetFocus() = 0000000000000000 win.c:3892: Test failed: hwnd 0000000000030048/00000000001302E0 message 0737 win.c:3897: Test failed: hwnd 00000000001302E0/00000000001302E0 message 0202 win.c:3902: Test failed: hwnd 00000000001302E0/00000000001302E0 message 0203 win.c:3906: Test failed: message 0202 available
=== debiant (64 bit WoW report) ===
user32: win.c:10125: Test failed: Expected foreground window 000D0120, got 00000000