user32: Don't call CreateDesktop() with an empty desktop name.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2020-06-24 11:37:21 +01:00 committed by Alexandre Julliard
parent 01ac2e48b1
commit 42e50e44f4
2 changed files with 5 additions and 4 deletions

View File

@ -196,7 +196,8 @@ static const WCHAR *get_default_desktop(void)
len = sizeof(buffer); len = sizeof(buffer);
if (!RegQueryValueExW( appkey, desktopW, 0, NULL, (LPBYTE)buffer, &len )) ret = buffer; if (!RegQueryValueExW( appkey, desktopW, 0, NULL, (LPBYTE)buffer, &len )) ret = buffer;
RegCloseKey( appkey ); RegCloseKey( appkey );
if (ret) return ret; if (ret && *ret) return ret;
ret = NULL;
} }
} }
@ -209,7 +210,7 @@ static const WCHAR *get_default_desktop(void)
len = sizeof(buffer); len = sizeof(buffer);
if (!RegQueryValueExW( appkey, desktopW, 0, NULL, (LPBYTE)buffer, &len )) ret = buffer; if (!RegQueryValueExW( appkey, desktopW, 0, NULL, (LPBYTE)buffer, &len )) ret = buffer;
RegCloseKey( appkey ); RegCloseKey( appkey );
if (ret) return ret; if (ret && *ret) return ret;
} }
return defaultW; return defaultW;
} }

View File

@ -732,7 +732,7 @@ static const WCHAR *get_default_desktop_name(void)
/* @@ Wine registry key: HKCU\Software\Wine\Explorer */ /* @@ Wine registry key: HKCU\Software\Wine\Explorer */
if (!RegOpenKeyW( HKEY_CURRENT_USER, explorer_keyW, &hkey )) if (!RegOpenKeyW( HKEY_CURRENT_USER, explorer_keyW, &hkey ))
{ {
if (!RegQueryValueExW( hkey, desktopW, 0, NULL, (LPBYTE)buffer, &size )) ret = buffer; if (!RegQueryValueExW( hkey, desktopW, 0, NULL, (LPBYTE)buffer, &size ) && *buffer) ret = buffer;
RegCloseKey( hkey ); RegCloseKey( hkey );
} }
return ret; return ret;
@ -974,7 +974,7 @@ void manage_desktop( WCHAR *arg )
/* parse the desktop option */ /* parse the desktop option */
/* the option is of the form /desktop=name[,widthxheight[,driver]] */ /* the option is of the form /desktop=name[,widthxheight[,driver]] */
if (*arg == '=' || *arg == ',') if ((arg[0] == '=' || arg[0] == ',') && arg[1] && arg[1] != ',')
{ {
arg++; arg++;
name = arg; name = arg;