Commit 42e50e44 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

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

parent 01ac2e48
......@@ -196,7 +196,8 @@ static const WCHAR *get_default_desktop(void)
len = sizeof(buffer);
if (!RegQueryValueExW( appkey, desktopW, 0, NULL, (LPBYTE)buffer, &len )) ret = buffer;
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);
if (!RegQueryValueExW( appkey, desktopW, 0, NULL, (LPBYTE)buffer, &len )) ret = buffer;
RegCloseKey( appkey );
if (ret) return ret;
if (ret && *ret) return ret;
}
return defaultW;
}
......
......@@ -732,7 +732,7 @@ static const WCHAR *get_default_desktop_name(void)
/* @@ Wine registry key: HKCU\Software\Wine\Explorer */
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 );
}
return ret;
......@@ -974,7 +974,7 @@ void manage_desktop( WCHAR *arg )
/* parse the desktop option */
/* the option is of the form /desktop=name[,widthxheight[,driver]] */
if (*arg == '=' || *arg == ',')
if ((arg[0] == '=' || arg[0] == ',') && arg[1] && arg[1] != ',')
{
arg++;
name = arg;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment