user32: Allow the app specific desktop to be "Default".

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:20 +01:00 committed by Alexandre Julliard
parent afe3e698c5
commit 01ac2e48b1
1 changed files with 5 additions and 5 deletions

View File

@ -175,12 +175,12 @@ static const WCHAR *get_default_desktop(void)
'A','p','p','D','e','f','a','u','l','t','s',0};
static WCHAR buffer[MAX_PATH + ARRAY_SIZE(explorerW)];
WCHAR *p, *appname = buffer;
const WCHAR *ret = defaultW;
const WCHAR *ret = NULL;
DWORD len;
HKEY tmpkey, appkey;
len = (GetModuleFileNameW( 0, buffer, MAX_PATH ));
if (!len || len >= MAX_PATH) return ret;
if (!len || len >= MAX_PATH) return defaultW;
if ((p = strrchrW( appname, '/' ))) appname = p + 1;
if ((p = strrchrW( appname, '\\' ))) appname = p + 1;
p = appname + strlenW(appname);
@ -196,8 +196,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 && strcmpiW( ret, defaultW )) return ret;
ret = defaultW;
if (ret) return ret;
}
}
@ -210,8 +209,9 @@ 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;
}
return ret;
return defaultW;
}