win32u: Fix name comparison in find_class.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52654
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2022-03-15 14:26:39 +01:00 committed by Alexandre Julliard
parent 0b350ab967
commit d402df3196
2 changed files with 7 additions and 1 deletions

View file

@ -1049,6 +1049,11 @@ if (0) { /* crashes under XP */
ok(ret, "GetClassInfoExA() error %ld\n", GetLastError());
ok(wcx.cbSize == sizeof(wcx) + 1, "expected sizeof(wcx)+1, got %u\n", wcx.cbSize);
ok(wcx.lpfnWndProc != NULL, "got null proc\n");
wcx.cbSize = sizeof(wcx);
ret = GetClassInfoExA(0, "stati", &wcx);
ok(!ret && GetLastError() == ERROR_CLASS_DOES_NOT_EXIST,
"GetClassInfoExA() returned %x %ld\n", ret, GetLastError());
}
static void test_icons(void)

View file

@ -259,7 +259,8 @@ static CLASS *find_class( HINSTANCE module, UNICODE_STRING *name )
}
else
{
if (wcsnicmp( class->name, name->Buffer, name->Length / sizeof(WCHAR) )) continue;
if (wcsnicmp( class->name, name->Buffer, name->Length / sizeof(WCHAR) ) ||
class->name[name->Length / sizeof(WCHAR)]) continue;
}
if (!class->local || !module || (class->instance & ~0xffff) == instance)
{