From: Jacek Caban jacek@codeweavers.com
Signed-off-by: Jacek Caban jacek@codeweavers.com --- dlls/winemac.drv/Makefile.in | 2 +- dlls/winemac.drv/macdrv.h | 1 + dlls/winemac.drv/macdrv_main.c | 2 +- dlls/winemac.drv/mouse.c | 16 ++++++++-------- 4 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/dlls/winemac.drv/Makefile.in b/dlls/winemac.drv/Makefile.in index da2e5eaf4c4..e345249aac7 100644 --- a/dlls/winemac.drv/Makefile.in +++ b/dlls/winemac.drv/Makefile.in @@ -1,6 +1,6 @@ EXTRADEFS = -DWINE_NO_LONG_TYPES MODULE = winemac.drv -IMPORTS = uuid rpcrt4 user32 gdi32 advapi32 win32u +IMPORTS = uuid rpcrt4 user32 gdi32 win32u DELAYIMPORTS = ole32 shell32 imm32 EXTRALIBS = -framework AppKit -framework Carbon -framework Security -framework OpenGL -framework IOKit -framework CoreVideo -framework QuartzCore $(METAL_LIBS)
diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h index 922a2df75cb..0a0c42aefd0 100644 --- a/dlls/winemac.drv/macdrv.h +++ b/dlls/winemac.drv/macdrv.h @@ -295,6 +295,7 @@ extern BOOL query_ime_char_rect(macdrv_query* query) DECLSPEC_HIDDEN;
/* registry helpers */
+extern HKEY open_hkcu_key( const char *name ) DECLSPEC_HIDDEN; extern ULONG query_reg_value(HKEY hkey, const WCHAR *name, KEY_VALUE_PARTIAL_INFORMATION *info, ULONG size) DECLSPEC_HIDDEN; extern HKEY reg_create_ascii_key(HKEY root, const char *name, DWORD options, diff --git a/dlls/winemac.drv/macdrv_main.c b/dlls/winemac.drv/macdrv_main.c index b168e12439c..5f61c9491b7 100644 --- a/dlls/winemac.drv/macdrv_main.c +++ b/dlls/winemac.drv/macdrv_main.c @@ -122,7 +122,7 @@ HKEY reg_open_key(HKEY root, const WCHAR *name, ULONG name_len) }
-static HKEY open_hkcu_key(const char *name) +HKEY open_hkcu_key(const char *name) { WCHAR bufferW[256]; static HKEY hkcu; diff --git a/dlls/winemac.drv/mouse.c b/dlls/winemac.drv/mouse.c index 34d6febdefa..55bed52ae8e 100644 --- a/dlls/winemac.drv/mouse.c +++ b/dlls/winemac.drv/mouse.c @@ -195,17 +195,17 @@ CFStringRef copy_system_cursor_name(ICONINFOEXW *info) else sprintfW(p, idW, info->wResID);
/* @@ Wine registry key: HKCU\Software\Wine\Mac Driver\Cursors */ - if (!RegOpenKeyA(HKEY_CURRENT_USER, "Software\Wine\Mac Driver\Cursors", &key)) + if (!(key = open_hkcu_key("Software\Wine\Mac Driver\Cursors"))) { - WCHAR value[64]; - DWORD size, ret; + char buffer[2048]; + KEY_VALUE_PARTIAL_INFORMATION *info = (void *)buffer; + DWORD ret;
- value[0] = 0; - size = sizeof(value); - ret = RegQueryValueExW(key, name, NULL, NULL, (BYTE *)value, &size); - RegCloseKey(key); - if (!ret) + ret = query_reg_value(key, name, info, sizeof(buffer)); + NtClose(key); + if (ret) { + const WCHAR *value = (const WCHAR *)info->Data; if (!value[0]) { TRACE("registry forces standard cursor for %s\n", debugstr_w(name));