[Bug 53014] HICON leak in CopyImage causes TheBat! to crash after a while
WineHQ Bugzilla
wine-bugs at winehq.org
Mon May 30 21:27:44 CDT 2022
https://bugs.winehq.org/show_bug.cgi?id=53014
--- Comment #10 from jswinebz at kanargh.org.uk ---
PS: what exactly was the link to the /tests/ (line 377) code supposed to
demonstrate?
358 memset( module, 0xcc, sizeof(module) );
359 module_str.Buffer = module;
360 module_str.Length = 0xdead;
361 module_str.MaximumLength = sizeof(module);
362 memset( res_buf, 0xcc, sizeof(res_buf) );
363 res_str.Buffer = res_buf;
364 res_str.Length = 0xdead;
365 res_str.MaximumLength = sizeof(res_buf);
366 ret = NtUserGetIconInfo( handle, &info, &module_str, &res_str, NULL, 0
);
367 ok( ret, "NtUserGetIconInfo failed: %lu\n", GetLastError() );
368 ok( info.fIcon == TRUE, "fIcon = %x\n", info.fIcon );
369 ok( module_str.Length, "module_str.Length = 0\n" );
370 ok( !res_str.Length, "res_str.Length = %u\n", res_str.Length );
371 ok( module_str.Buffer == module, "module_str.Buffer = %p\n",
module_str.Buffer );
372 ok( res_str.Buffer == (WCHAR *)IDI_HAND, "res_str.Buffer = %p\n",
res_str.Buffer );
373 DeleteObject( info.hbmColor );
374 DeleteObject( info.hbmMask );
375
376 module[module_str.Length] = 0;
377 ok( GetModuleHandleW(module) == GetModuleHandleW(L"user32.dll"),
378 "GetIconInfoEx wrong module %s\n", wine_dbgstr_w(module) );
It certainly doesn't appear to show that "UNICODE_STRING Length handling really
uses characters in this case, see related tests" because (well firstly it's not
actually true, and...) all we're really showing is that the returned module
name length is non-zero (not necessarily the *right* length in any situation),
and that an icon loaded from user32.dll is associated with the same DLL as
GetModuleHandle for user32.dll... which obviously ought to be true. And doesn't
really demonstrate the bug between system and application DLLs.
--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.
More information about the wine-bugs
mailing list