winex11: Use wcsicmp for string comparison.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2022-05-01 23:55:41 +02:00 committed by Alexandre Julliard
parent 497f37cf99
commit 6dd08c34dc
6 changed files with 11 additions and 9 deletions

View File

@ -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 |

View File

@ -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",

View File

@ -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)

View File

@ -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 */

View File

@ -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;
}

View File

@ -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;
}