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) ...@@ -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) ...@@ -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;
} }
......
...@@ -732,7 +732,7 @@ static const WCHAR *get_default_desktop_name(void) ...@@ -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 ) ...@@ -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;
......
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