The first patch is a bit of a shortcut. I have a better solution in works, but it's not yet ready. It shouldn't matter until we use 32on64 for NtUserCreateWindowEx anyway.
From: Jacek Caban jacek@codeweavers.com
Signed-off-by: Jacek Caban jacek@codeweavers.com --- dlls/win32u/window.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 9231f98539e..7bfdb449090 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -4845,9 +4845,10 @@ HWND WINAPI NtUserCreateWindowEx( DWORD ex_style, UNICODE_STRING *class_name, HWND parent, HMENU menu, HINSTANCE instance, void *params, DWORD flags, CBT_CREATEWNDW *cbtc, DWORD unk, BOOL ansi ) { - CREATESTRUCTW cs, *client_cs = cbtc->lpcs; + CREATESTRUCTW cs, *client_cs, cs_buf; UINT win_dpi, thread_dpi = get_thread_dpi(); DPI_AWARENESS_CONTEXT context; + CBT_CREATEWNDW cbtc_buf; HWND hwnd, owner = 0; INT sw = SW_SHOW; RECT rect; @@ -4855,8 +4856,24 @@ HWND WINAPI NtUserCreateWindowEx( DWORD ex_style, UNICODE_STRING *class_name,
static const WCHAR messageW[] = {'M','e','s','s','a','g','e'};
+ /* FIXME: We should pass a packed struct to client instead od using client_cs */ + if (cbtc) + { + client_cs = cbtc->lpcs; + cs.lpszName = client_cs->lpszName; + cs.lpszClass = client_cs->lpszClass; + cs.hInstance = client_cs->hInstance; /* may be different than instance for win16 */ + } + else + { + cbtc = &cbtc_buf; + client_cs = cbtc->lpcs = &cs_buf; + cs.lpszName = window_name ? window_name->Buffer : NULL; + cs.lpszClass = class_name->Buffer; + cs.hInstance = instance; + } + cs.lpCreateParams = params; - cs.hInstance = client_cs->hInstance; /* may be different than instance for win16 */ cs.hMenu = menu; cs.hwndParent = parent; cs.style = style; @@ -4865,10 +4882,6 @@ HWND WINAPI NtUserCreateWindowEx( DWORD ex_style, UNICODE_STRING *class_name, cs.y = y; cs.cx = cx; cs.cy = cy; - /* We use client_cs to pass original class and name pointers, - * that's probably not how native handles it. */ - cs.lpszName = client_cs->lpszName; - cs.lpszClass = client_cs->lpszClass;
/* Find the parent window */ if (parent == HWND_MESSAGE)
From: Jacek Caban jacek@codeweavers.com
Signed-off-by: Jacek Caban jacek@codeweavers.com --- dlls/winex11.drv/mouse.c | 7 +++++-- dlls/winex11.drv/window.c | 19 ++++++++++++------- 2 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 02c5bf88f0e..d080ed5458e 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -373,6 +373,7 @@ static BOOL grab_clipping_window( const RECT *clip ) #if HAVE_X11_EXTENSIONS_XINPUT2_H static const WCHAR messageW[] = {'M','e','s','s','a','g','e',0}; struct x11drv_thread_data *data = x11drv_thread_data(); + UNICODE_STRING class_name; Window clip_window; HWND msg_hwnd = 0; POINT pos; @@ -383,8 +384,10 @@ static BOOL grab_clipping_window( const RECT *clip ) if (!data) return FALSE; if (!(clip_window = init_clip_window())) return TRUE;
- if (!(msg_hwnd = CreateWindowW( messageW, NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, 0, - GetModuleHandleW(0), NULL ))) + RtlInitUnicodeString( &class_name, messageW ); + if (!(msg_hwnd = NtUserCreateWindowEx( 0, &class_name, &class_name, NULL, 0, 0, 0, 0, 0, + HWND_MESSAGE, 0, NtCurrentTeb()->Peb->ImageBaseAddress, + NULL, 0, NULL, 0, FALSE ))) return TRUE;
if (keyboard_grabbed) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index cfb61c3217a..161f749a81d 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2004,10 +2004,11 @@ HWND create_foreign_window( Display *display, Window xwin ) unsigned int nchildren; XWindowAttributes attr; DWORD style = WS_CLIPCHILDREN; + UNICODE_STRING class_name;
if (!class_registered) { - UNICODE_STRING class_name, version = { 0 }; + UNICODE_STRING version = { 0 }; WNDCLASSEXW class;
memset( &class, 0, sizeof(class) ); @@ -2050,8 +2051,10 @@ HWND create_foreign_window( Display *display, Window xwin ) pos.y = attr.y; }
- hwnd = CreateWindowW( classW, NULL, style, pos.x, pos.y, attr.width, attr.height, - parent, 0, 0, NULL ); + RtlInitUnicodeString( &class_name, classW ); + hwnd = NtUserCreateWindowEx( 0, &class_name, &class_name, NULL, style, pos.x, pos.y, + attr.width, attr.height, parent, 0, NULL, NULL, 0, NULL, + 0, FALSE );
if (!(data = alloc_win_data( display, hwnd ))) { @@ -2167,6 +2170,7 @@ NTSTATUS x11drv_systray_dock( void *arg ) XSetWindowAttributes attr; XVisualInfo visual; struct x11drv_win_data *data; + UNICODE_STRING class_name; BOOL layered; HWND hwnd;
@@ -2189,10 +2193,11 @@ NTSTATUS x11drv_systray_dock( void *arg )
*params->layered = layered = (visual.depth == 32);
- hwnd = CreateWindowExW( layered ? WS_EX_LAYERED : 0, - icon_classname, NULL, WS_CLIPSIBLINGS | WS_POPUP, - CW_USEDEFAULT, CW_USEDEFAULT, params->cx, params->cy, - NULL, NULL, NULL, params->icon ); + RtlInitUnicodeString( &class_name, icon_classname ); + hwnd = NtUserCreateWindowEx( layered ? WS_EX_LAYERED : 0, &class_name, &class_name, NULL, + WS_CLIPSIBLINGS | WS_POPUP, CW_USEDEFAULT, CW_USEDEFAULT, + params->cx, params->cy, NULL, 0, NULL, params->icon, 0, + NULL, 0, FALSE );
if (!(data = get_win_data( hwnd ))) return STATUS_UNSUCCESSFUL; if (layered) set_window_visual( data, &visual, TRUE );
From: Jacek Caban jacek@codeweavers.com
Signed-off-by: Jacek Caban jacek@codeweavers.com --- dlls/winex11.drv/dllmain.c | 26 ++++++++++++++++++++++++++ dlls/winex11.drv/mouse.c | 25 +++++++++---------------- dlls/winex11.drv/unixlib.h | 10 ++++++++++ 3 files changed, 45 insertions(+), 16 deletions(-)
diff --git a/dlls/winex11.drv/dllmain.c b/dlls/winex11.drv/dllmain.c index 7ea07647dc9..705503dc37c 100644 --- a/dlls/winex11.drv/dllmain.c +++ b/dlls/winex11.drv/dllmain.c @@ -127,6 +127,30 @@ static NTSTATUS x11drv_clipboard_init( UINT arg ) }
+static NTSTATUS WINAPI x11drv_is_system_module( void *arg, ULONG size ) +{ + HMODULE module; + unsigned int i; + + static const WCHAR cursor_modules[][16] = + { + { 'u','s','e','r','3','2','.','d','l','l',0 }, + { 'c','o','m','c','t','l','3','2','.','d','l','l',0 }, + { 'o','l','e','3','2','.','d','l','l',0 }, + { 'r','i','c','h','e','d','2','0','.','d','l','l',0 } + }; + + if (!(module = GetModuleHandleW( arg ))) return system_module_none; + + for (i = 0; i < ARRAYSIZE(cursor_modules); i++) + { + if (GetModuleHandleW( cursor_modules[i] ) == module) return i; + } + + return system_module_none; +} + + typedef NTSTATUS (*callback_func)( UINT arg ); static const callback_func callback_funcs[] = { @@ -157,11 +181,13 @@ static const kernel_callback kernel_callbacks[] = x11drv_dnd_post_drop, x11drv_ime_set_composition_string, x11drv_ime_set_result, + x11drv_is_system_module, x11drv_systray_change_owner, };
C_ASSERT( NtUserDriverCallbackFirst + ARRAYSIZE(kernel_callbacks) == client_func_last );
+ BOOL WINAPI DllMain( HINSTANCE instance, DWORD reason, void *reserved ) { void **callback_table; diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index d080ed5458e..adf23d04450 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -930,16 +930,12 @@ static const struct system_cursors riched20_cursors[] = { 0 } };
-static const struct +static const struct system_cursors *module_cursors[] = { - const struct system_cursors *cursors; - WCHAR name[16]; -} module_cursors[] = -{ - { user32_cursors, {'u','s','e','r','3','2','.','d','l','l',0} }, - { comctl32_cursors, {'c','o','m','c','t','l','3','2','.','d','l','l',0} }, - { ole32_cursors, {'o','l','e','3','2','.','d','l','l',0} }, - { riched20_cursors, {'r','i','c','h','e','d','2','0','.','d','l','l',0} } + user32_cursors, + comctl32_cursors, + ole32_cursors, + riched20_cursors, };
struct cursor_font_fallback @@ -1059,7 +1055,6 @@ static Cursor create_xcursor_system_cursor( const ICONINFOEXW *info ) const struct system_cursors *cursors; unsigned int i; Cursor cursor = 0; - HMODULE module; HKEY key; const char * const *names = NULL; WCHAR *p, name[MAX_PATH * 2]; @@ -1098,13 +1093,11 @@ static Cursor create_xcursor_system_cursor( const 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 (i == ARRAY_SIZE( module_cursors )) goto done; + i = x11drv_client_func( client_func_is_system_module, info->szModName, + (lstrlenW( info->szModName ) + 1) * sizeof(WCHAR) ); + if (i == system_module_none) goto done;
- cursors = module_cursors[i].cursors; + cursors = module_cursors[i]; for (i = 0; cursors[i].id; i++) if (cursors[i].id == info->wResID) { diff --git a/dlls/winex11.drv/unixlib.h b/dlls/winex11.drv/unixlib.h index dc3c74979ca..233a2578b41 100644 --- a/dlls/winex11.drv/unixlib.h +++ b/dlls/winex11.drv/unixlib.h @@ -66,6 +66,15 @@ struct systray_dock_params BOOL *layered; };
+enum system_modules +{ + system_module_user32, + system_module_comctl32, + system_module_ole32, + system_module_riched20, + system_module_none = 0xffff, +}; + /* x11drv_tablet_info params */ struct tablet_info_params { @@ -90,6 +99,7 @@ enum x11drv_client_funcs client_func_dnd_post_drop, client_func_ime_set_composition_string, client_func_ime_set_result, + client_func_is_system_module, client_func_systray_change_owner, client_func_last };
From: Jacek Caban jacek@codeweavers.com
Signed-off-by: Jacek Caban jacek@codeweavers.com --- dlls/winex11.drv/dllmain.c | 7 +++++++ dlls/winex11.drv/unixlib.h | 1 + dlls/winex11.drv/window.c | 5 ++++- 3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/dlls/winex11.drv/dllmain.c b/dlls/winex11.drv/dllmain.c index 705503dc37c..2a361c477f4 100644 --- a/dlls/winex11.drv/dllmain.c +++ b/dlls/winex11.drv/dllmain.c @@ -151,6 +151,12 @@ static NTSTATUS WINAPI x11drv_is_system_module( void *arg, ULONG size ) }
+static NTSTATUS x11drv_load_icon( UINT id ) +{ + return HandleToUlong( LoadIconW( NULL, UlongToPtr( id ))); +} + + typedef NTSTATUS (*callback_func)( UINT arg ); static const callback_func callback_funcs[] = { @@ -162,6 +168,7 @@ static const callback_func callback_funcs[] = x11drv_ime_set_cursor_pos, x11drv_ime_set_open_status, x11drv_ime_update_association, + x11drv_load_icon, };
C_ASSERT( ARRAYSIZE(callback_funcs) == client_funcs_count ); diff --git a/dlls/winex11.drv/unixlib.h b/dlls/winex11.drv/unixlib.h index 233a2578b41..f3f6b9b8f06 100644 --- a/dlls/winex11.drv/unixlib.h +++ b/dlls/winex11.drv/unixlib.h @@ -117,6 +117,7 @@ enum client_callback client_ime_set_cursor_pos, client_ime_set_open_status, client_ime_update_association, + client_load_icon, client_funcs_count };
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 161f749a81d..a62a3e84e81 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -627,7 +627,10 @@ static void fetch_icon_data( HWND hwnd, HICON icon_big, HICON icon_small ) if (!icon_big) icon_big = get_icon_info( (HICON)NtUserGetClassLongPtrW( hwnd, GCLP_HICON ), &ii ); if (!icon_big) - icon_big = get_icon_info( LoadIconW( 0, (LPWSTR)IDI_WINLOGO ), &ii); + { + UINT winlogo = x11drv_client_call( client_load_icon, IDI_WINLOGO ); + icon_big = get_icon_info( UlongToHandle( winlogo ), &ii ); + } } if (!icon_small) {
From: Jacek Caban jacek@codeweavers.com
Allows win32u.so to expose such functions using unixlib interface.
Signed-off-by: Jacek Caban jacek@codeweavers.com --- include/dde.h | 2 +- include/ddeml.h | 2 +- include/wingdi.h | 2 +- include/winuser.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/dde.h b/include/dde.h index 35623615398..4e0d1176727 100644 --- a/include/dde.h +++ b/include/dde.h @@ -28,7 +28,7 @@ extern "C" { #endif
-#ifdef _USER32_ +#if defined(_USER32_) || defined(WINE_UNIX_LIB) #define WINUSERAPI #else #define WINUSERAPI DECLSPEC_HIDDEN diff --git a/include/ddeml.h b/include/ddeml.h index b8d7f00631a..dcac04bfb19 100644 --- a/include/ddeml.h +++ b/include/ddeml.h @@ -26,7 +26,7 @@ extern "C" { #endif /* defined(__cplusplus) */
-#ifdef _USER32_ +#if defined(_USER32_) || defined(WINE_UNIX_LIB) #define WINUSERAPI #else #define WINUSERAPI DECLSPEC_HIDDEN diff --git a/include/wingdi.h b/include/wingdi.h index 7220aff089b..6778c60db79 100644 --- a/include/wingdi.h +++ b/include/wingdi.h @@ -24,7 +24,7 @@ extern "C" { #endif
-#ifdef _GDI32_ +#if defined(_GDI32_) || defined(WINE_UNIX_LIB) #define WINGDIAPI #else #define WINGDIAPI DECLSPEC_HIDDEN diff --git a/include/winuser.h b/include/winuser.h index 01660e8a8f7..a227b912e0e 100644 --- a/include/winuser.h +++ b/include/winuser.h @@ -19,7 +19,7 @@ #ifndef _WINUSER_ #define _WINUSER_
-#if !defined(_USER32_) +#if !defined(_USER32_) && !defined(WINE_UNIX_LIB) #define WINUSERAPI DECLSPEC_HIDDEN #else #define WINUSERAPI
From: Jacek Caban jacek@codeweavers.com
Signed-off-by: Jacek Caban jacek@codeweavers.com --- dlls/winex11.drv/desktop.c | 4 ++-- dlls/winex11.drv/keyboard.c | 2 +- dlls/winex11.drv/settings.c | 8 ++++---- dlls/winex11.drv/x11drv.h | 2 ++ dlls/winex11.drv/xrandr.c | 2 +- dlls/winex11.drv/xvidmode.c | 2 +- 6 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c index c335bc5ba2b..20f4063c343 100644 --- a/dlls/winex11.drv/desktop.c +++ b/dlls/winex11.drv/desktop.c @@ -90,7 +90,7 @@ static BOOL X11DRV_desktop_get_id( const WCHAR *device_name, ULONG_PTR *id ) { WCHAR primary_adapter[CCHDEVICENAME];
- if (!get_primary_adapter( primary_adapter ) || lstrcmpiW( primary_adapter, device_name )) + if (!get_primary_adapter( primary_adapter ) || wcsicmp( primary_adapter, device_name )) return FALSE;
*id = 0; @@ -342,7 +342,7 @@ NTSTATUS x11drv_create_desktop( void *arg ) TRACE( "%s %ux%u\n", debugstr_w(name), params->width, params->height );
/* magic: desktop "root" means use the root window */ - if (!lstrcmpiW( name, rootW )) return FALSE; + if (!wcsicmp( name, rootW )) return FALSE;
/* Create window */ win_attr.event_mask = ExposureMask | KeyPressMask | KeyReleaseMask | EnterWindowMask | diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c index 6b876c3bee9..ff43939a858 100644 --- a/dlls/winex11.drv/keyboard.c +++ b/dlls/winex11.drv/keyboard.c @@ -2203,7 +2203,7 @@ INT X11DRV_GetKeyNameText( LONG lParam, LPWSTR lpBuffer, INT nSize ) if (name && (vkey == VK_SHIFT || vkey == VK_CONTROL || vkey == VK_MENU)) { char* idx = strrchr(name, '_'); - if (idx && (_strnicmp(idx, "_r", -1) == 0 || _strnicmp(idx, "_l", -1) == 0)) + if (idx && (idx[1] == 'r' || idx[1] == 'R' || idx[1] == 'l' || idx[1] == 'L') && !idx[2]) { pthread_mutex_unlock( &kbd_mutex ); TRACE("found scan=%04x keyc=%u keysym=%lx modified_string=%s\n", diff --git a/dlls/winex11.drv/settings.c b/dlls/winex11.drv/settings.c index 1e8868acc6c..3e83e467c63 100644 --- a/dlls/winex11.drv/settings.c +++ b/dlls/winex11.drv/settings.c @@ -91,7 +91,7 @@ static BOOL nores_get_id(const WCHAR *device_name, ULONG_PTR *id) if (!get_primary_adapter( primary_adapter )) return FALSE;
- *id = !lstrcmpiW( device_name, primary_adapter ) ? 1 : 0; + *id = !wcsicmp( device_name, primary_adapter ) ? 1 : 0; return TRUE; }
@@ -500,7 +500,7 @@ BOOL X11DRV_EnumDisplaySettingsEx( LPCWSTR name, DWORD n, LPDEVMODEW devmode, DW }
pthread_mutex_lock( &settings_mutex ); - if (n == 0 || lstrcmpiW(cached_device_name, name) || cached_flags != flags) + if (n == 0 || wcsicmp(cached_device_name, name) || cached_flags != flags) { if (!handler.get_id(name, &id) || !handler.get_modes(id, flags, &modes, &mode_count)) { @@ -654,7 +654,7 @@ static LONG get_display_settings(struct x11drv_display_setting **new_displays,
displays[display_idx].desired_mode = registry_mode; } - else if (!lstrcmpiW(dev_name, display_device.DeviceName)) + else if (!wcsicmp(dev_name, display_device.DeviceName)) { displays[display_idx].desired_mode = *dev_mode; if (!(dev_mode->dmFields & DM_POSITION)) @@ -950,7 +950,7 @@ LONG X11DRV_ChangeDisplaySettingsEx( LPCWSTR devname, LPDEVMODEW devmode, { for (display_idx = 0; display_idx < display_count; ++display_idx) { - if (!lstrcmpiW(displays[display_idx].desired_mode.dmDeviceName, devname)) + if (!wcsicmp(displays[display_idx].desired_mode.dmDeviceName, devname)) { full_mode = get_full_mode(displays[display_idx].id, &displays[display_idx].desired_mode); if (!full_mode) diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 42d9e39b082..5540a6ebbb5 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -949,4 +949,6 @@ static inline int ntdll_wcstoumbs( const WCHAR *src, DWORD srclen, char *dst, DW return WideCharToMultiByte( CP_UNIXCP, 0, src, srclen, dst, dstlen, NULL, NULL ); }
+#define wcsicmp lstrcmpiW + #endif /* __WINE_X11DRV_H */ diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c index 6ede776d76b..eec7a81a4cb 100644 --- a/dlls/winex11.drv/xrandr.c +++ b/dlls/winex11.drv/xrandr.c @@ -151,7 +151,7 @@ static BOOL xrandr10_get_id( const WCHAR *device_name, ULONG_PTR *id ) /* RandR 1.0 only supports changing the primary adapter settings. * For non-primary adapters, an id is still provided but getting * and changing non-primary adapters' settings will be ignored. */ - *id = !lstrcmpiW( device_name, primary_adapter ) ? 1 : 0; + *id = !wcsicmp( device_name, primary_adapter ) ? 1 : 0; return TRUE; }
diff --git a/dlls/winex11.drv/xvidmode.c b/dlls/winex11.drv/xvidmode.c index 126e2bf2a69..a51ded9fe4a 100644 --- a/dlls/winex11.drv/xvidmode.c +++ b/dlls/winex11.drv/xvidmode.c @@ -91,7 +91,7 @@ static BOOL xf86vm_get_id(const WCHAR *device_name, ULONG_PTR *id) /* XVidMode only supports changing the primary adapter settings. * For non-primary adapters, an id is still provided but getting * and changing non-primary adapters' settings will be ignored. */ - *id = !lstrcmpiW( device_name, primary_adapter ) ? 1 : 0; + *id = !wcsicmp( device_name, primary_adapter ) ? 1 : 0; return TRUE; }
From: Jacek Caban jacek@codeweavers.com
Signed-off-by: Jacek Caban jacek@codeweavers.com --- dlls/winex11.drv/Makefile.in | 3 +- dlls/winex11.drv/bitblt.c | 4 +++ dlls/winex11.drv/brush.c | 4 +++ dlls/winex11.drv/clipboard.c | 4 +++ dlls/winex11.drv/desktop.c | 4 +++ dlls/winex11.drv/display.c | 4 +++ dlls/winex11.drv/dllmain.c | 16 ++++++++- dlls/winex11.drv/event.c | 12 ++++--- dlls/winex11.drv/graphics.c | 4 +++ dlls/winex11.drv/init.c | 4 +++ dlls/winex11.drv/keyboard.c | 4 +++ dlls/winex11.drv/mouse.c | 4 +++ dlls/winex11.drv/opengl.c | 4 +++ dlls/winex11.drv/palette.c | 4 +++ dlls/winex11.drv/pen.c | 4 +++ dlls/winex11.drv/settings.c | 4 +++ dlls/winex11.drv/systray.c | 2 ++ dlls/winex11.drv/unixlib.h | 11 +++++- dlls/winex11.drv/vulkan.c | 4 +++ dlls/winex11.drv/window.c | 6 +++- dlls/winex11.drv/wintab.c | 4 +++ dlls/winex11.drv/x11drv.h | 64 +++++++++++++++++++++++++++------- dlls/winex11.drv/x11drv_main.c | 29 ++++++++++++--- dlls/winex11.drv/xim.c | 4 +++ dlls/winex11.drv/xinerama.c | 4 +++ dlls/winex11.drv/xrandr.c | 4 +++ dlls/winex11.drv/xrender.c | 4 +++ dlls/winex11.drv/xvidmode.c | 4 +++ tools/winewrapper | 4 +-- 29 files changed, 201 insertions(+), 26 deletions(-)
diff --git a/dlls/winex11.drv/Makefile.in b/dlls/winex11.drv/Makefile.in index 2a0e3467905..9de440c35ff 100644 --- a/dlls/winex11.drv/Makefile.in +++ b/dlls/winex11.drv/Makefile.in @@ -1,9 +1,10 @@ EXTRADEFS = -DWINE_NO_LONG_TYPES MODULE = winex11.drv +UNIXLIB = winex11.so IMPORTS = uuid user32 gdi32 win32u DELAYIMPORTS = comctl32 ole32 shell32 imm32 EXTRAINCL = $(X_CFLAGS) -EXTRALIBS = $(X_LIBS) $(X_EXTRA_LIBS) $(PTHREAD_LIBS) +EXTRALIBS = -lwin32u $(X_LIBS) $(X_EXTRA_LIBS) $(PTHREAD_LIBS) -lm
EXTRADLLFLAGS = -mcygwin
diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index e21f975ef4a..d1e6407d87c 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -19,6 +19,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep unix +#endif + #include "config.h"
#include <assert.h> diff --git a/dlls/winex11.drv/brush.c b/dlls/winex11.drv/brush.c index 1ade09bd4be..2a2e8ef4e98 100644 --- a/dlls/winex11.drv/brush.c +++ b/dlls/winex11.drv/brush.c @@ -18,6 +18,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep unix +#endif + #include "config.h"
#include <stdlib.h> diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c index 276eee9b4dd..feb9eb487e5 100644 --- a/dlls/winex11.drv/clipboard.c +++ b/dlls/winex11.drv/clipboard.c @@ -63,6 +63,10 @@ * FIXME: global format list needs a critical section */
+#if 0 +#pragma makedep unix +#endif + #include "config.h"
#include <string.h> diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c index 20f4063c343..bc2ba60397b 100644 --- a/dlls/winex11.drv/desktop.c +++ b/dlls/winex11.drv/desktop.c @@ -19,6 +19,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep unix +#endif + #include "config.h" #include <X11/cursorfont.h> #include <X11/Xlib.h> diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c index aef4ed0b5b0..510cb9dcee6 100644 --- a/dlls/winex11.drv/display.c +++ b/dlls/winex11.drv/display.c @@ -18,6 +18,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep unix +#endif + #include "config.h" #include "x11drv.h" #include "wine/debug.h" diff --git a/dlls/winex11.drv/dllmain.c b/dlls/winex11.drv/dllmain.c index 2a361c477f4..1f1d98903bc 100644 --- a/dlls/winex11.drv/dllmain.c +++ b/dlls/winex11.drv/dllmain.c @@ -26,6 +26,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(x11drv);
HMODULE x11drv_module = 0; +static unixlib_handle_t x11drv_handle; +NTSTATUS (CDECL *x11drv_unix_call)( enum x11drv_funcs code, void *params );
/************************************************************************** * wait_clipboard_mutex @@ -198,15 +200,27 @@ C_ASSERT( NtUserDriverCallbackFirst + ARRAYSIZE(kernel_callbacks) == client_func BOOL WINAPI DllMain( HINSTANCE instance, DWORD reason, void *reserved ) { void **callback_table; + struct init_params params = + { + NtWaitForMultipleObjects, + foreign_window_proc, + };
if (reason != DLL_PROCESS_ATTACH) return TRUE;
DisableThreadLibraryCalls( instance ); x11drv_module = instance; - if (X11DRV_CALL( init, NULL )) return FALSE; + if (NtQueryVirtualMemory( GetCurrentProcess(), instance, MemoryWineUnixFuncs, + &x11drv_handle, sizeof(x11drv_handle), NULL )) + return FALSE; + + if (__wine_unix_call( x11drv_handle, unix_init, ¶ms )) return FALSE;
callback_table = NtCurrentTeb()->Peb->KernelCallbackTable; memcpy( callback_table + NtUserDriverCallbackFirst, kernel_callbacks, sizeof(kernel_callbacks) ); + + show_systray = params.show_systray; + x11drv_unix_call = params.unix_call; return TRUE; }
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index d5e7127ceed..cbab1dcfe13 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -19,6 +19,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep unix +#endif + #include "config.h"
#include <poll.h> @@ -485,8 +489,8 @@ NTSTATUS X11DRV_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, if (!data) { if (!count && timeout && !timeout->QuadPart) return WAIT_TIMEOUT; - return NtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL), - !!(flags & MWMO_ALERTABLE), timeout ); + return pNtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL), + !!(flags & MWMO_ALERTABLE), timeout ); }
if (data->current_event) mask = 0; /* don't process nested events */ @@ -494,8 +498,8 @@ NTSTATUS X11DRV_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, if (process_events( data->display, filter_event, mask )) ret = count - 1; else if (count || !timeout || timeout->QuadPart) { - ret = NtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL), - !!(flags & MWMO_ALERTABLE), timeout ); + ret = pNtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL), + !!(flags & MWMO_ALERTABLE), timeout ); if (ret == count - 1) process_events( data->display, filter_event, mask ); } else ret = WAIT_TIMEOUT; diff --git a/dlls/winex11.drv/graphics.c b/dlls/winex11.drv/graphics.c index 7ab358c43c1..18d7c6e9adc 100644 --- a/dlls/winex11.drv/graphics.c +++ b/dlls/winex11.drv/graphics.c @@ -24,6 +24,10 @@ * graphics mode */
+#if 0 +#pragma makedep unix +#endif + #include "config.h"
#include <stdarg.h> diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index 27e070ef9b4..a1dbfa1ed50 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -18,6 +18,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep unix +#endif + #include "config.h"
#include <stdarg.h> diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c index ff43939a858..efd8f03eae1 100644 --- a/dlls/winex11.drv/keyboard.c +++ b/dlls/winex11.drv/keyboard.c @@ -23,6 +23,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep unix +#endif + #include "config.h"
#include <X11/Xatom.h> diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index adf23d04450..458bd469caa 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -19,6 +19,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep unix +#endif + #include "config.h"
#include <math.h> diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 92555841f71..91aef7f67be 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -23,6 +23,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep unix +#endif + #include "config.h"
#include <assert.h> diff --git a/dlls/winex11.drv/palette.c b/dlls/winex11.drv/palette.c index 475466999b1..7845985dbb0 100644 --- a/dlls/winex11.drv/palette.c +++ b/dlls/winex11.drv/palette.c @@ -18,6 +18,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep unix +#endif + #include "config.h"
#include <stdarg.h> diff --git a/dlls/winex11.drv/pen.c b/dlls/winex11.drv/pen.c index ffa628ce6f7..a32bf4752e1 100644 --- a/dlls/winex11.drv/pen.c +++ b/dlls/winex11.drv/pen.c @@ -18,6 +18,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep unix +#endif + #include "config.h"
#include "x11drv.h" diff --git a/dlls/winex11.drv/settings.c b/dlls/winex11.drv/settings.c index 3e83e467c63..9fffc9c0b0a 100644 --- a/dlls/winex11.drv/settings.c +++ b/dlls/winex11.drv/settings.c @@ -19,6 +19,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep unix +#endif + #include "config.h" #include <stdlib.h>
diff --git a/dlls/winex11.drv/systray.c b/dlls/winex11.drv/systray.c index 1c6616e0d9c..961ec05a7dc 100644 --- a/dlls/winex11.drv/systray.c +++ b/dlls/winex11.drv/systray.c @@ -44,6 +44,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(systray);
+BOOL show_systray = TRUE; + /* an individual systray icon */ struct tray_icon { diff --git a/dlls/winex11.drv/unixlib.h b/dlls/winex11.drv/unixlib.h index f3f6b9b8f06..9be7c18cd12 100644 --- a/dlls/winex11.drv/unixlib.h +++ b/dlls/winex11.drv/unixlib.h @@ -38,7 +38,7 @@ enum x11drv_funcs };
/* FIXME: Use __wine_unix_call when the rest of the stack is ready */ -extern NTSTATUS x11drv_unix_call( enum x11drv_funcs code, void *params ) DECLSPEC_HIDDEN; +extern NTSTATUS (CDECL *x11drv_unix_call)( enum x11drv_funcs code, void *params ) DECLSPEC_HIDDEN; #define X11DRV_CALL(func, params) x11drv_unix_call( unix_ ## func, params )
/* x11drv_clipboard_message params */ @@ -57,6 +57,15 @@ struct create_desktop_params UINT height; };
+/* x11drv_init params */ +struct init_params +{ + NTSTATUS (WINAPI *pNtWaitForMultipleObjects)(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*); + WNDPROC foreign_window_proc; + BOOL show_systray; + NTSTATUS (CDECL *unix_call)( enum x11drv_funcs code, void *params ); +}; + struct systray_dock_params { UINT64 event_handle; diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index 0f96b6860fd..101504a7887 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -20,6 +20,10 @@ /* NOTE: If making changes here, consider whether they should be reflected in * the other drivers. */
+#if 0 +#pragma makedep unix +#endif + #include "config.h"
#include <stdarg.h> diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index a62a3e84e81..4506ba9c036 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -20,6 +20,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep unix +#endif + #include "config.h"
#include <stdarg.h> @@ -2016,7 +2020,7 @@ HWND create_foreign_window( Display *display, Window xwin )
memset( &class, 0, sizeof(class) ); class.cbSize = sizeof(class); - class.lpfnWndProc = foreign_window_proc; + class.lpfnWndProc = client_foreign_window_proc; class.lpszClassName = classW; RtlInitUnicodeString( &class_name, classW ); if (!NtUserRegisterClassExWOW( &class, &class_name, &version, NULL, 0, 0, NULL ) && diff --git a/dlls/winex11.drv/wintab.c b/dlls/winex11.drv/wintab.c index a6b80daedbe..ceb5e7276d6 100644 --- a/dlls/winex11.drv/wintab.c +++ b/dlls/winex11.drv/wintab.c @@ -18,6 +18,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep unix +#endif + #include "config.h"
#include <stdlib.h> diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 5540a6ebbb5..56c141a018d 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -62,8 +62,8 @@ typedef int Status; #include "ntgdi.h" #include "wine/gdi_driver.h" #include "unixlib.h" -#include "winnls.h" #include "wine/list.h" +#include "wine/unicode.h"
#define MAX_DASHLEN 16
@@ -438,6 +438,10 @@ extern int xrender_error_base DECLSPEC_HIDDEN; extern HMODULE x11drv_module DECLSPEC_HIDDEN; extern char *process_name DECLSPEC_HIDDEN; extern Display *clipboard_display DECLSPEC_HIDDEN; +extern WNDPROC client_foreign_window_proc; + +extern NTSTATUS (WINAPI *pNtWaitForMultipleObjects)(ULONG,const HANDLE*,BOOLEAN, + BOOLEAN,const LARGE_INTEGER*) DECLSPEC_HIDDEN;
/* atoms */
@@ -937,18 +941,54 @@ static inline UINT asciiz_to_unicode( WCHAR *dst, const char *src ) return (p - dst) * sizeof(WCHAR); }
-/* FIXME: remove once we may use ntdll.so version */ - -static inline DWORD ntdll_umbstowcs( const char *src, DWORD srclen, WCHAR *dst, DWORD dstlen ) -{ - return MultiByteToWideChar( CP_UNIXCP, 0, src, srclen, dst, dstlen ); -} - -static inline int ntdll_wcstoumbs( const WCHAR *src, DWORD srclen, char *dst, DWORD dstlen, BOOL strict ) -{ - return WideCharToMultiByte( CP_UNIXCP, 0, src, srclen, dst, dstlen, NULL, NULL ); +static inline LONG x11drv_wcstol( LPCWSTR s, LPWSTR *end, INT base ) +{ + BOOL negative = FALSE, empty = TRUE; + LONG ret = 0; + + if (base < 0 || base == 1 || base > 36) return 0; + if (end) *end = (WCHAR *)s; + while (*s == ' ' || *s == '\t') s++; + + if (*s == '-') + { + negative = TRUE; + s++; + } + else if (*s == '+') s++; + + if ((base == 0 || base == 16) && s[0] == '0' && (s[1] == 'x' || s[1] == 'X')) + { + base = 16; + s += 2; + } + if (base == 0) base = s[0] != '0' ? 10 : 8; + + while (*s) + { + int v; + + if ('0' <= *s && *s <= '9') v = *s - '0'; + else if ('A' <= *s && *s <= 'Z') v = *s - 'A' + 10; + else if ('a' <= *s && *s <= 'z') v = *s - 'a' + 10; + else break; + if (v >= base) break; + if (negative) v = -v; + s++; + empty = FALSE; + + if (!negative && (ret > MAXLONG / base || ret * base > MAXLONG - v)) + ret = MAXLONG; + else if (negative && (ret < (LONG)MINLONG / base || ret * base < (LONG)(MINLONG - v))) + ret = MINLONG; + else + ret = ret * base + v; + } + + if (end && !empty) *end = (WCHAR *)s; + return ret; }
-#define wcsicmp lstrcmpiW +#define strtolW x11drv_wcstol
#endif /* __WINE_X11DRV_H */ diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index cbcfc659a67..e358e92e5fe 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -19,6 +19,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep unix +#endif + #include "config.h"
#include <fcntl.h> @@ -84,6 +88,7 @@ int copy_default_colors = 128; int alloc_system_colors = 256; int xrender_error_base = 0; char *process_name = NULL; +WNDPROC client_foreign_window_proc = NULL;
static x11drv_error_callback err_callback; /* current callback for error */ static Display *err_callback_display; /* display callback is set for */ @@ -204,6 +209,16 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] = "text/uri-list" };
+/* We use use pointer to call NtWaitForMultipleObjects to make it go through + * syscall dispatcher. We need that because win32u bypasses syscall thunks and + * if we called NtWaitForMultipleObjects directly, it wouldn't be able to handle + * user APCs. This will be removed as soon as we may use syscall interface + * for NtUserMsgWaitForMultipleObjectsEx. */ +NTSTATUS (WINAPI *pNtWaitForMultipleObjects)( ULONG, const HANDLE *, BOOLEAN, + BOOLEAN, const LARGE_INTEGER* ); + +static NTSTATUS CDECL unix_call( enum x11drv_funcs code, void *params ); + /*********************************************************************** * ignore_error * @@ -636,6 +651,7 @@ static void init_visuals( Display *display, int screen ) */ static NTSTATUS x11drv_init( void *arg ) { + struct init_params *params = arg; Display *display; void *libx11 = dlopen( SONAME_LIBX11, RTLD_NOW|RTLD_GLOBAL );
@@ -657,6 +673,9 @@ static NTSTATUS x11drv_init( void *arg ) if (!XInitThreads()) ERR( "XInitThreads failed, trouble ahead\n" ); if (!(display = XOpenDisplay( NULL ))) return STATUS_UNSUCCESSFUL;
+ pNtWaitForMultipleObjects = params->pNtWaitForMultipleObjects; + client_foreign_window_proc = params->foreign_window_proc; + fcntl( ConnectionNumber(display), F_SETFD, 1 ); /* set close on exec flag */ root_window = DefaultRootWindow( display ); gdi_display = display; @@ -693,6 +712,8 @@ static NTSTATUS x11drv_init( void *arg )
init_user_driver(); X11DRV_DisplayDevices_Init(FALSE); + params->show_systray = show_systray; + params->unix_call = unix_call; return STATUS_SUCCESS; }
@@ -960,9 +981,9 @@ NTSTATUS CDECL X11DRV_D3DKMTCheckVidPnExclusiveOwnership( const D3DKMT_CHECKVIDP
NTSTATUS x11drv_client_func( enum x11drv_client_funcs id, const void *params, ULONG size ) { - /* FIXME: use KeUserModeCallback instead */ - NTSTATUS (WINAPI *func)( const void *, ULONG ) = ((void **)NtCurrentTeb()->Peb->KernelCallbackTable)[id]; - return func( params, size ); + void *ret_ptr; + ULONG ret_len; + return KeUserModeCallback( id, params, size, &ret_ptr, &ret_len ); }
@@ -995,7 +1016,7 @@ C_ASSERT( ARRAYSIZE(__wine_unix_call_funcs) == unix_funcs_count );
/* FIXME: Use __wine_unix_call instead */ -NTSTATUS x11drv_unix_call( enum x11drv_funcs code, void *params ) +static NTSTATUS CDECL unix_call( enum x11drv_funcs code, void *params ) { return __wine_unix_call_funcs[code]( params ); } diff --git a/dlls/winex11.drv/xim.c b/dlls/winex11.drv/xim.c index 595fb31fe0b..d2166697386 100644 --- a/dlls/winex11.drv/xim.c +++ b/dlls/winex11.drv/xim.c @@ -18,6 +18,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep unix +#endif + #include "config.h" #include <stdio.h> #include <stdlib.h> diff --git a/dlls/winex11.drv/xinerama.c b/dlls/winex11.drv/xinerama.c index a97590e705f..847b8fb6efb 100644 --- a/dlls/winex11.drv/xinerama.c +++ b/dlls/winex11.drv/xinerama.c @@ -18,6 +18,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep unix +#endif + #include "config.h"
#include <stdarg.h> diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c index eec7a81a4cb..152a9f35734 100644 --- a/dlls/winex11.drv/xrandr.c +++ b/dlls/winex11.drv/xrandr.c @@ -20,6 +20,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep unix +#endif + #include "config.h"
#define NONAMELESSSTRUCT diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c index 33725338f60..407e58d6eda 100644 --- a/dlls/winex11.drv/xrender.c +++ b/dlls/winex11.drv/xrender.c @@ -23,6 +23,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep unix +#endif + #include "config.h"
#include <assert.h> diff --git a/dlls/winex11.drv/xvidmode.c b/dlls/winex11.drv/xvidmode.c index a51ded9fe4a..4ca7bc1ac59 100644 --- a/dlls/winex11.drv/xvidmode.c +++ b/dlls/winex11.drv/xvidmode.c @@ -19,6 +19,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep unix +#endif + #include "config.h"
#include <assert.h> diff --git a/tools/winewrapper b/tools/winewrapper index 93d44bcd06c..031a0c05f69 100755 --- a/tools/winewrapper +++ b/tools/winewrapper @@ -69,9 +69,9 @@ if [ "`uname -s`" = "Darwin" ] then if [ -n "$DYLD_LIBRARY_PATH" ] then - DYLD_LIBRARY_PATH="$topdir/libs/wine:$topdir/dlls/ntdll:$DYLD_LIBRARY_PATH" + DYLD_LIBRARY_PATH="$topdir/libs/wine:$topdir/dlls/ntdll:$topdir/dlls/win32u:$DYLD_LIBRARY_PATH" else - DYLD_LIBRARY_PATH="$topdir/libs/wine:$topdir/dlls/ntdll" + DYLD_LIBRARY_PATH="$topdir/libs/wine:$topdir/dlls/ntdll:$topdir/dlls/win32u" fi export DYLD_LIBRARY_PATH else
From: Jacek Caban jacek@codeweavers.com
Signed-off-by: Jacek Caban jacek@codeweavers.com --- dlls/winex11.drv/Makefile.in | 2 -- dlls/winex11.drv/dllmain.c | 3 +-- dlls/winex11.drv/ime.c | 11 +------- dlls/winex11.drv/systray.c | 16 +---------- dlls/winex11.drv/x11drv.h | 19 ------------- dlls/winex11.drv/x11drv_dll.h | 51 +++++++++++++++++++++++++++++++++++ dlls/winex11.drv/xdnd.c | 20 +++----------- 7 files changed, 57 insertions(+), 65 deletions(-) create mode 100644 dlls/winex11.drv/x11drv_dll.h
diff --git a/dlls/winex11.drv/Makefile.in b/dlls/winex11.drv/Makefile.in index 9de440c35ff..3c653902ef2 100644 --- a/dlls/winex11.drv/Makefile.in +++ b/dlls/winex11.drv/Makefile.in @@ -6,8 +6,6 @@ DELAYIMPORTS = comctl32 ole32 shell32 imm32 EXTRAINCL = $(X_CFLAGS) EXTRALIBS = -lwin32u $(X_LIBS) $(X_EXTRA_LIBS) $(PTHREAD_LIBS) -lm
-EXTRADLLFLAGS = -mcygwin - C_SRCS = \ bitblt.c \ brush.c \ diff --git a/dlls/winex11.drv/dllmain.c b/dlls/winex11.drv/dllmain.c index 1f1d98903bc..b9bf5efd1e3 100644 --- a/dlls/winex11.drv/dllmain.c +++ b/dlls/winex11.drv/dllmain.c @@ -18,8 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include "config.h" -#include "x11drv.h" +#include "x11drv_dll.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(x11drv); diff --git a/dlls/winex11.drv/ime.c b/dlls/winex11.drv/ime.c index b2b61a17604..5f8bdd8c68b 100644 --- a/dlls/winex11.drv/ime.c +++ b/dlls/winex11.drv/ime.c @@ -40,19 +40,10 @@ * generate the messages that we want the IMM layer to send to the application. */
-#include "config.h" - -#include <stdarg.h> -#include "windef.h" -#include "winbase.h" -#include "wingdi.h" -#include "winuser.h" -#include "winerror.h" +#include "x11drv_dll.h" #include "wine/debug.h" #include "imm.h" #include "ddk/imm.h" -#include "winnls.h" -#include "x11drv.h"
WINE_DEFAULT_DEBUG_CHANNEL(imm);
diff --git a/dlls/winex11.drv/systray.c b/dlls/winex11.drv/systray.c index 961ec05a7dc..599240e3672 100644 --- a/dlls/winex11.drv/systray.c +++ b/dlls/winex11.drv/systray.c @@ -20,25 +20,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include "config.h" - -#include <assert.h> -#include <stdarg.h> -#include <stdlib.h> -#include <stdio.h> -#include <unistd.h> - -#include <X11/Xlib.h> - #define NONAMELESSUNION -#include "windef.h" -#include "winbase.h" -#include "wingdi.h" -#include "winuser.h" +#include "x11drv_dll.h" #include "commctrl.h" #include "shellapi.h"
-#include "x11drv.h" #include "wine/list.h" #include "wine/debug.h"
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 56c141a018d..257146fadcf 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -435,7 +435,6 @@ extern int primary_monitor DECLSPEC_HIDDEN; extern int copy_default_colors DECLSPEC_HIDDEN; extern int alloc_system_colors DECLSPEC_HIDDEN; extern int xrender_error_base DECLSPEC_HIDDEN; -extern HMODULE x11drv_module DECLSPEC_HIDDEN; extern char *process_name DECLSPEC_HIDDEN; extern Display *clipboard_display DECLSPEC_HIDDEN; extern WNDPROC client_foreign_window_proc; @@ -841,24 +840,6 @@ extern NTSTATUS x11drv_tablet_info( void *arg ) DECLSPEC_HIDDEN; extern NTSTATUS x11drv_xim_preedit_state( void *arg ) DECLSPEC_HIDDEN; extern NTSTATUS x11drv_xim_reset( void *arg ) DECLSPEC_HIDDEN;
-extern NTSTATUS WINAPI x11drv_dnd_enter_event( void *params, ULONG size ) DECLSPEC_HIDDEN; -extern NTSTATUS WINAPI x11drv_dnd_position_event( void *params, ULONG size ) DECLSPEC_HIDDEN; -extern NTSTATUS WINAPI x11drv_dnd_post_drop( void *data, ULONG size ) DECLSPEC_HIDDEN; -extern NTSTATUS WINAPI x11drv_ime_set_composition_string( void *params, ULONG size ) DECLSPEC_HIDDEN; -extern NTSTATUS WINAPI x11drv_ime_set_result( void *params, ULONG size ) DECLSPEC_HIDDEN; -extern NTSTATUS WINAPI x11drv_systray_change_owner( void *params, ULONG size ) DECLSPEC_HIDDEN; - -extern NTSTATUS x11drv_dnd_drop_event( UINT arg ) DECLSPEC_HIDDEN; -extern NTSTATUS x11drv_dnd_leave_event( UINT arg ) DECLSPEC_HIDDEN; -extern NTSTATUS x11drv_ime_get_cursor_pos( UINT arg ) DECLSPEC_HIDDEN; -extern NTSTATUS x11drv_ime_set_composition_status( UINT arg ) DECLSPEC_HIDDEN; -extern NTSTATUS x11drv_ime_set_cursor_pos( UINT pos ) DECLSPEC_HIDDEN; -extern NTSTATUS x11drv_ime_set_open_status( UINT open ) DECLSPEC_HIDDEN; -extern NTSTATUS x11drv_ime_update_association( UINT arg ) DECLSPEC_HIDDEN; - -extern LRESULT WINAPI foreign_window_proc( HWND hwnd, UINT msg, WPARAM wparam, - LPARAM lparam ) DECLSPEC_HIDDEN; - extern NTSTATUS x11drv_client_func( enum x11drv_client_funcs func, const void *params, ULONG size ) DECLSPEC_HIDDEN; extern NTSTATUS x11drv_client_call( enum client_callback func, UINT arg ) DECLSPEC_HIDDEN; diff --git a/dlls/winex11.drv/x11drv_dll.h b/dlls/winex11.drv/x11drv_dll.h new file mode 100644 index 00000000000..047bb430d39 --- /dev/null +++ b/dlls/winex11.drv/x11drv_dll.h @@ -0,0 +1,51 @@ +/* + * X11 driver definitions + * + * Copyright 2022 Jacek Caban for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINE_X11DRV_DLL_H +#define __WINE_X11DRV_DLL_H + +#include <stdarg.h> +#include "windef.h" +#include "winbase.h" +#include "ntgdi.h" +#include "unixlib.h" + +extern NTSTATUS WINAPI x11drv_dnd_enter_event( void *params, ULONG size ) DECLSPEC_HIDDEN; +extern NTSTATUS WINAPI x11drv_dnd_position_event( void *params, ULONG size ) DECLSPEC_HIDDEN; +extern NTSTATUS WINAPI x11drv_dnd_post_drop( void *data, ULONG size ) DECLSPEC_HIDDEN; +extern NTSTATUS WINAPI x11drv_ime_set_composition_string( void *params, ULONG size ) DECLSPEC_HIDDEN; +extern NTSTATUS WINAPI x11drv_ime_set_result( void *params, ULONG size ) DECLSPEC_HIDDEN; +extern NTSTATUS WINAPI x11drv_systray_change_owner( void *params, ULONG size ) DECLSPEC_HIDDEN; + +extern NTSTATUS x11drv_dnd_drop_event( UINT arg ) DECLSPEC_HIDDEN; +extern NTSTATUS x11drv_dnd_leave_event( UINT arg ) DECLSPEC_HIDDEN; +extern NTSTATUS x11drv_ime_get_cursor_pos( UINT arg ) DECLSPEC_HIDDEN; +extern NTSTATUS x11drv_ime_set_composition_status( UINT arg ) DECLSPEC_HIDDEN; +extern NTSTATUS x11drv_ime_set_cursor_pos( UINT pos ) DECLSPEC_HIDDEN; +extern NTSTATUS x11drv_ime_set_open_status( UINT open ) DECLSPEC_HIDDEN; +extern NTSTATUS x11drv_ime_update_association( UINT arg ) DECLSPEC_HIDDEN; + +extern LRESULT WINAPI foreign_window_proc( HWND hwnd, UINT msg, WPARAM wparam, + LPARAM lparam ) DECLSPEC_HIDDEN; + +extern BOOL show_systray DECLSPEC_HIDDEN; +extern HMODULE x11drv_module DECLSPEC_HIDDEN; + +#endif /* __WINE_X11DRV_DLL_H */ diff --git a/dlls/winex11.drv/xdnd.c b/dlls/winex11.drv/xdnd.c index 975fe7a114b..9137f46b5dc 100644 --- a/dlls/winex11.drv/xdnd.c +++ b/dlls/winex11.drv/xdnd.c @@ -19,26 +19,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include "config.h" - -#include <string.h> -#include <unistd.h> -#include <stdarg.h> -#include <stdio.h> - +#define COBJMACROS #define NONAMELESSUNION
-#include "windef.h" -#include "winbase.h" -#include "wingdi.h" -#include "winuser.h" - -#define COBJMACROS -#include "x11drv.h" +#include "x11drv_dll.h" #include "shellapi.h" -#include "shlobj.h" /* DROPFILES */ -#include "oleidl.h" -#include "objidl.h" +#include "shlobj.h"
#include "wine/debug.h" #include "wine/list.h"
From: Jacek Caban jacek@codeweavers.com
Signed-off-by: Jacek Caban jacek@codeweavers.com --- dlls/winex11.drv/clipboard.c | 3 +-- dlls/winex11.drv/graphics.c | 5 ++--- dlls/winex11.drv/keyboard.c | 5 ++--- dlls/winex11.drv/mouse.c | 9 ++++----- dlls/winex11.drv/settings.c | 5 ++--- dlls/winex11.drv/window.c | 1 - dlls/winex11.drv/wintab.c | 23 +++++++++++------------ dlls/winex11.drv/x11drv.h | 3 +-- dlls/winex11.drv/x11drv_main.c | 13 ++++++------- dlls/winex11.drv/xim.c | 7 +++---- dlls/winex11.drv/xrandr.c | 3 +-- dlls/winex11.drv/xrender.c | 7 +++---- 12 files changed, 36 insertions(+), 48 deletions(-)
diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c index feb9eb487e5..80c3e8520d3 100644 --- a/dlls/winex11.drv/clipboard.c +++ b/dlls/winex11.drv/clipboard.c @@ -93,7 +93,6 @@ #include "shlwapi.h" #include "wine/list.h" #include "wine/debug.h" -#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(clipboard);
@@ -1135,7 +1134,7 @@ void *uri_list_to_drop_files( const void *data, size_t size, size_t *ret_size )
if (path) { - int pathSize = strlenW(path) + 1; + int pathSize = wcslen( path ) + 1; if (pathSize > capacity - total) { WCHAR *new_out; diff --git a/dlls/winex11.drv/graphics.c b/dlls/winex11.drv/graphics.c index 18d7c6e9adc..b833fe0c629 100644 --- a/dlls/winex11.drv/graphics.c +++ b/dlls/winex11.drv/graphics.c @@ -48,7 +48,6 @@
#include "x11drv.h" #include "wine/debug.h" -#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(graphics);
@@ -1733,7 +1732,7 @@ BOOL CDECL X11DRV_GetICMProfile( PHYSDEV dev, BOOL allow_default, LPDWORD size, else lstrcpyW( p, srgb );
NtClose( hkey ); - required = strlenW( fullname ) + 1 - 4 /* skip NT prefix */; + required = wcslen( fullname ) + 1 - 4 /* skip NT prefix */; if (*size < required) { *size = required; @@ -1743,7 +1742,7 @@ BOOL CDECL X11DRV_GetICMProfile( PHYSDEV dev, BOOL allow_default, LPDWORD size, if (filename) { FILE_BASIC_INFORMATION info; - strcpyW( filename, fullname + 4 ); + wcscpy( filename, fullname + 4 ); RtlInitUnicodeString( &name, fullname ); InitializeObjectAttributes( &attr, &name, OBJ_CASE_INSENSITIVE, NULL, NULL ); if (NtQueryAttributesFile( &attr, &info )) diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c index efd8f03eae1..6157548474b 100644 --- a/dlls/winex11.drv/keyboard.c +++ b/dlls/winex11.drv/keyboard.c @@ -53,7 +53,6 @@ #include "ime.h" #include "x11drv.h" #include "wine/server.h" -#include "wine/unicode.h" #include "wine/debug.h"
/* log format (add 0-padding as appropriate): @@ -2104,7 +2103,7 @@ UINT X11DRV_MapVirtualKeyEx( UINT wCode, UINT wMapType, HKL hkl ) if (len) { WCHAR wch; - if (ntdll_umbstowcs( s, len, &wch, 1 )) ret = toupperW(wch); + if (ntdll_umbstowcs( s, len, &wch, 1 )) ret = RtlUpcaseUnicodeChar( wch ); } break; } @@ -2171,7 +2170,7 @@ INT X11DRV_GetKeyNameText( LONG lParam, LPWSTR lpBuffer, INT nSize ) { if (nSize >= 2) { - *lpBuffer = toupperW((WCHAR)ansi); + *lpBuffer = RtlUpcaseUnicodeChar( ansi ); *(lpBuffer+1) = 0; return 1; } diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 458bd469caa..d0cdd3d4984 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -56,7 +56,6 @@ MAKE_FUNCPTR(XcursorLibraryLoadCursor);
#include "x11drv.h" #include "wine/server.h" -#include "wine/unicode.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(cursor); @@ -1066,11 +1065,11 @@ static Cursor create_xcursor_system_cursor( const ICONINFOEXW *info )
if (!info->szModName[0]) return 0;
- p = strrchrW( info->szModName, '\' ); - strcpyW( name, p ? p + 1 : info->szModName ); - p = name + strlenW( name ); + p = wcsrchr( info->szModName, '\' ); + wcscpy( name, p ? p + 1 : info->szModName ); + p = name + lstrlenW( name ); *p++ = ','; - if (info->szResName[0]) strcpyW( p, info->szResName ); + if (info->szResName[0]) wcscpy( p, info->szResName ); else { char buf[16]; diff --git a/dlls/winex11.drv/settings.c b/dlls/winex11.drv/settings.c index 9fffc9c0b0a..e7e353b33ad 100644 --- a/dlls/winex11.drv/settings.c +++ b/dlls/winex11.drv/settings.c @@ -35,7 +35,6 @@ #include "winreg.h" #include "wingdi.h" #include "wine/debug.h" -#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(x11settings);
@@ -241,11 +240,11 @@ static HKEY get_display_device_reg_key( const WCHAR *device_name ) HKEY hkey;
/* Device name has to be \.\DISPLAY%d */ - if (strncmpiW(device_name, display, ARRAY_SIZE(display))) + if (wcsnicmp( device_name, display, ARRAY_SIZE(display) )) return FALSE;
/* Parse \.\DISPLAY* */ - adapter_index = strtolW(device_name + ARRAY_SIZE(display), &end_ptr, 10) - 1; + adapter_index = wcstol( device_name + ARRAY_SIZE(display), &end_ptr, 10 ) - 1; if (*end_ptr) return FALSE;
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 4506ba9c036..50a848cae86 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -49,7 +49,6 @@ #include "winbase.h" #include "wingdi.h" #include "winuser.h" -#include "wine/unicode.h"
#include "x11drv.h" #include "wine/debug.h" diff --git a/dlls/winex11.drv/wintab.c b/dlls/winex11.drv/wintab.c index ceb5e7276d6..b906a589e08 100644 --- a/dlls/winex11.drv/wintab.c +++ b/dlls/winex11.drv/wintab.c @@ -32,7 +32,6 @@ #include "windef.h" #include "winbase.h" #include "x11drv.h" -#include "wine/unicode.h" #include "wine/debug.h" #include "wintab.h"
@@ -516,8 +515,8 @@ NTSTATUS x11drv_tablet_load_info( void *hwnd ) hwndTabletDefault = hwnd;
/* Do base initialization */ - strcpyW(gSysContext.lcName, SZ_CONTEXT_NAME); - strcpyW(gSysDevice.NAME, SZ_DEVICE_NAME); + wcscpy(gSysContext.lcName, SZ_CONTEXT_NAME); + wcscpy(gSysDevice.NAME, SZ_DEVICE_NAME);
gSysContext.lcOptions = CXO_SYSTEM; gSysContext.lcLocks = CXL_INSIZE | CXL_INASPECT | CXL_MARGIN | @@ -553,7 +552,7 @@ NTSTATUS x11drv_tablet_load_info( void *hwnd ) gSysDevice.PKTDATA = PK_CONTEXT | PK_STATUS | PK_SERIAL_NUMBER| PK_TIME | PK_CURSOR | PK_BUTTONS | PK_X | PK_Y | PK_NORMAL_PRESSURE | PK_ORIENTATION; - strcpyW(gSysDevice.PNPID, SZ_NON_PLUG_N_PLAY); + wcscpy(gSysDevice.PNPID, SZ_NON_PLUG_N_PLAY);
devices = pXListInputDevices(data->display, &num_devices); if (!devices) @@ -744,14 +743,14 @@ NTSTATUS x11drv_tablet_load_info( void *hwnd ) for (i = 0; i < cursor.BUTTONS; i++) { /* FIXME - these names are probably incorrect */ - int cch = strlenW(cursor.NAME) + 1; + int cch = wcslen(cursor.NAME) + 1; while (cch > cchBuf - cchPos - 1) /* we want one extra byte for the last NUL */ { cchBuf *= 2; cursor.BTNNAMES = realloc( cursor.BTNNAMES, sizeof(WCHAR) * cchBuf ); }
- strcpyW(cursor.BTNNAMES + cchPos, cursor.NAME); + wcscpy(cursor.BTNNAMES + cchPos, cursor.NAME); cchPos += cch; } cursor.BTNNAMES[cchPos++] = 0; @@ -1034,7 +1033,7 @@ NTSTATUS x11drv_tablet_attach_queue( void *owner ) if (!gSysCursor[cur_loop].ACTIVE) continue;
/* the cursor name fits in the buffer because too long names are skipped */ - ntdll_wcstoumbs(gSysCursor[cur_loop].NAME, lstrlenW(gSysCursor[cur_loop].NAME) + 1, + ntdll_wcstoumbs(gSysCursor[cur_loop].NAME, wcslen(gSysCursor[cur_loop].NAME) + 1, cursorNameA, WT_MAX_NAME_LEN, FALSE); for (loop=0; loop < num_devices; loop ++) if (strcmp(devices[loop].name, cursorNameA) == 0) @@ -1160,7 +1159,7 @@ NTSTATUS x11drv_tablet_info( void *arg ) case IFC_WINTABID: { static const WCHAR driver[] = {'W','i','n','e',' ','W','i','n','t','a','b',' ','1','.','1',0}; - rc = CopyTabletData(lpOutput, driver, (strlenW(driver) + 1) * sizeof(WCHAR)); + rc = CopyTabletData(lpOutput, driver, (wcslen(driver) + 1) * sizeof(WCHAR)); break; } case IFC_SPECVERSION: @@ -1199,7 +1198,7 @@ NTSTATUS x11drv_tablet_info( void *arg ) break; case CTX_NAME: rc = CopyTabletData(lpOutput, gSysContext.lcName, - (strlenW(gSysContext.lcName)+1) * sizeof(WCHAR)); + (wcslen(gSysContext.lcName)+1) * sizeof(WCHAR)); break; case CTX_OPTIONS: rc = CopyTabletData(lpOutput, &gSysContext.lcOptions, @@ -1363,7 +1362,7 @@ NTSTATUS x11drv_tablet_info( void *arg ) { case CSR_NAME: rc = CopyTabletData(lpOutput, tgtcursor->NAME, - (strlenW(tgtcursor->NAME)+1) * sizeof(WCHAR)); + (wcslen(tgtcursor->NAME)+1) * sizeof(WCHAR)); break; case CSR_ACTIVE: rc = CopyTabletData(lpOutput,&tgtcursor->ACTIVE, @@ -1455,7 +1454,7 @@ NTSTATUS x11drv_tablet_info( void *arg ) { case DVC_NAME: rc = CopyTabletData(lpOutput,gSysDevice.NAME, - (strlenW(gSysDevice.NAME)+1) * sizeof(WCHAR)); + (wcslen(gSysDevice.NAME)+1) * sizeof(WCHAR)); break; case DVC_HARDWARE: rc = CopyTabletData(lpOutput,&gSysDevice.HARDWARE, @@ -1539,7 +1538,7 @@ NTSTATUS x11drv_tablet_info( void *arg ) break; case DVC_PNPID: rc = CopyTabletData(lpOutput,gSysDevice.PNPID, - (strlenW(gSysDevice.PNPID)+1)*sizeof(WCHAR)); + (wcslen(gSysDevice.PNPID)+1)*sizeof(WCHAR)); break; default: FIXME("WTI_DEVICES unhandled index %i\n",nIndex); diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 257146fadcf..fd102ea951a 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -63,7 +63,6 @@ typedef int Status; #include "wine/gdi_driver.h" #include "unixlib.h" #include "wine/list.h" -#include "wine/unicode.h"
#define MAX_DASHLEN 16
@@ -970,6 +969,6 @@ static inline LONG x11drv_wcstol( LPCWSTR s, LPWSTR *end, INT base ) return ret; }
-#define strtolW x11drv_wcstol +#define wcstol x11drv_wcstol
#endif /* __WINE_X11DRV_H */ diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index e358e92e5fe..2742bdbdeb1 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -52,7 +52,6 @@ #include "x11drv.h" #include "xcomposite.h" #include "wine/server.h" -#include "wine/unicode.h" #include "wine/debug.h" #include "wine/list.h"
@@ -449,8 +448,8 @@ static void setup_options(void) /* open the app-specific key */
appname = NtCurrentTeb()->Peb->ProcessParameters->ImagePathName.Buffer; - if ((p = strrchrW( appname, '/' ))) appname = p + 1; - if ((p = strrchrW( appname, '\' ))) appname = p + 1; + if ((p = wcsrchr( appname, '/' ))) appname = p + 1; + if ((p = wcsrchr( appname, '\' ))) appname = p + 1; len = lstrlenW( appname );
if (len && len < MAX_PATH) @@ -502,7 +501,7 @@ static void setup_options(void) grab_fullscreen = IS_OPTION_TRUE( buffer[0] );
if (!get_config_key( hkey, appkey, "ScreenDepth", buffer, sizeof(buffer) )) - default_visual.depth = strtolW( buffer, NULL, 0 ); + default_visual.depth = wcstol( buffer, NULL, 0 );
if (!get_config_key( hkey, appkey, "ClientSideGraphics", buffer, sizeof(buffer) )) client_side_graphics = IS_OPTION_TRUE( buffer[0] ); @@ -520,13 +519,13 @@ static void setup_options(void) private_color_map = IS_OPTION_TRUE( buffer[0] );
if (!get_config_key( hkey, appkey, "PrimaryMonitor", buffer, sizeof(buffer) )) - primary_monitor = strtolW( buffer, NULL, 0 ); + primary_monitor = wcstol( buffer, NULL, 0 );
if (!get_config_key( hkey, appkey, "CopyDefaultColors", buffer, sizeof(buffer) )) - copy_default_colors = strtolW( buffer, NULL, 0 ); + copy_default_colors = wcstol( buffer, NULL, 0 );
if (!get_config_key( hkey, appkey, "AllocSystemColors", buffer, sizeof(buffer) )) - alloc_system_colors = strtolW( buffer, NULL, 0 ); + alloc_system_colors = wcstol( buffer, NULL, 0 );
get_config_key( hkey, appkey, "InputStyle", input_style, sizeof(input_style) );
diff --git a/dlls/winex11.drv/xim.c b/dlls/winex11.drv/xim.c index d2166697386..00c15bb3bcf 100644 --- a/dlls/winex11.drv/xim.c +++ b/dlls/winex11.drv/xim.c @@ -34,7 +34,6 @@ #include "x11drv.h" #include "imm.h" #include "wine/debug.h" -#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(xim);
@@ -286,11 +285,11 @@ BOOL X11DRV_InitXIM( const WCHAR *input_style ) static const WCHAR overthespotW[] = {'o','v','e','r','t','h','e','s','p','o','t',0}; static const WCHAR rootW[] = {'r','o','o','t',0};
- if (!strcmpiW(input_style, offthespotW)) + if (!wcsicmp( input_style, offthespotW )) ximStyleRequest = STYLE_OFFTHESPOT; - else if (!strcmpiW(input_style, overthespotW)) + else if (!wcsicmp( input_style, overthespotW )) ximStyleRequest = STYLE_OVERTHESPOT; - else if (!strcmpiW(input_style, rootW)) + else if (!wcsicmp( input_style, rootW )) ximStyleRequest = STYLE_ROOT;
if (!XSupportsLocale()) diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c index 152a9f35734..3fa6bad56c1 100644 --- a/dlls/winex11.drv/xrandr.c +++ b/dlls/winex11.drv/xrandr.c @@ -47,7 +47,6 @@ WINE_DECLARE_DEBUG_CHANNEL(winediag); #define VK_NO_PROTOTYPES #define WINE_VK_HOST
-#include "wine/unicode.h" #include "wine/vulkan.h" #include "wine/vulkan_driver.h"
@@ -1223,7 +1222,7 @@ static BOOL xrandr14_get_id( const WCHAR *device_name, ULONG_PTR *id ) WCHAR *end;
/* Parse \.\DISPLAY%d */ - display_idx = strtolW( device_name + 11, &end, 10 ) - 1; + display_idx = wcstol( device_name + 11, &end, 10 ) - 1; if (*end) return FALSE;
diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c index 407e58d6eda..db9e454c317 100644 --- a/dlls/winex11.drv/xrender.c +++ b/dlls/winex11.drv/xrender.c @@ -39,7 +39,6 @@ #include "winbase.h" #include "x11drv.h" #include "winternl.h" -#include "wine/unicode.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(xrender); @@ -587,7 +586,7 @@ static BOOL fontcmp(LFANDSIZE *p1, LFANDSIZE *p2) if(memcmp(&p1->devsize, &p2->devsize, sizeof(p1->devsize))) return TRUE; if(memcmp(&p1->xform, &p2->xform, sizeof(p1->xform))) return TRUE; if(memcmp(&p1->lf, &p2->lf, offsetof(LOGFONTW, lfFaceName))) return TRUE; - return strcmpiW(p1->lf.lfFaceName, p2->lf.lfFaceName); + return wcsicmp( p1->lf.lfFaceName, p2->lf.lfFaceName ); }
static int LookupEntry(LFANDSIZE *plfsz) @@ -744,9 +743,9 @@ static void lfsz_calc_hash(LFANDSIZE *plfsz) two_chars = *ptr; pwc = (WCHAR *)&two_chars; if(!*pwc) break; - *pwc = toupperW(*pwc); + *pwc = RtlUpcaseUnicodeChar( *pwc ); pwc++; - *pwc = toupperW(*pwc); + *pwc = RtlUpcaseUnicodeChar( *pwc ); hash ^= two_chars; if(!*pwc) break; }