winemac: Detect system cursors from cursor module name in copy_system_cursor_name.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
This commit is contained in:
Jacek Caban 2022-05-29 16:20:48 +02:00 committed by Alexandre Julliard
parent 5e18d7d823
commit a0a890b78c
2 changed files with 6 additions and 4 deletions

View file

@ -367,6 +367,7 @@ static inline UINT asciiz_to_unicode(WCHAR *dst, const char *src)
}
/* FIXME: remove once we use unixlib */
#define wcsicmp strcmpiW
#define wcsnicmp strncmpiW
#define wcsrchr strrchrW
#define wcstol strtolW

View file

@ -170,7 +170,7 @@ CFStringRef copy_system_cursor_name(ICONINFOEXW *info)
const struct system_cursors *cursors;
unsigned int i;
CFStringRef cursor_name = NULL;
HMODULE module;
const WCHAR *module;
HKEY key;
WCHAR *p, name[MAX_PATH * 2];
@ -223,10 +223,11 @@ CFStringRef copy_system_cursor_name(ICONINFOEXW *info)
}
if (info->szResName[0]) goto done; /* only integer resources are supported here */
if (!(module = GetModuleHandleW(info->szModName))) goto done;
for (i = 0; i < ARRAY_SIZE(module_cursors); i++)
if (GetModuleHandleW(module_cursors[i].name) == module) break;
if ((module = wcsrchr(info->szModName, '\\'))) module++;
else module = info->szModName;
for (i = 0; i < ARRAY_SIZE( module_cursors ); i++)
if (!wcsicmp(module, module_cursors[i].name)) break;
if (i == ARRAY_SIZE(module_cursors)) goto done;
cursors = module_cursors[i].cursors;