Commit 83c422e1 authored by Paul Vriens's avatar Paul Vriens Committed by Alexandre Julliard

shell32/tests: Fix crash on ancient Win95.

parent 72393c55
......@@ -102,6 +102,30 @@ static BOOL use_common(void)
return TRUE;
}
static BOOL full_title(void)
{
CABINETSTATE cs;
memset(&cs, 0, sizeof(cs));
if (pReadCabinetState)
{
pReadCabinetState(&cs, sizeof(cs));
}
else
{
HKEY key;
DWORD size;
win_skip("ReadCabinetState is not available, reading registry directly\n");
RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CabinetState", &key);
size = sizeof(cs);
RegQueryValueExA(key, "Settings", NULL, NULL, (LPBYTE)&cs, &size);
RegCloseKey(key);
}
return (cs.fFullPathTitle == -1);
}
static char ProgramsDir[MAX_PATH];
static char Group1Title[MAX_PATH] = "Group1";
......@@ -115,8 +139,6 @@ static void init_strings(void)
char commonprograms[MAX_PATH];
char programs[MAX_PATH];
CABINETSTATE cs;
if (pSHGetSpecialFolderPathA)
{
pSHGetSpecialFolderPathA(NULL, programs, CSIDL_PROGRAMS, FALSE);
......@@ -153,9 +175,7 @@ static void init_strings(void)
else
lstrcpyA(ProgramsDir, programs);
memset(&cs, 0, sizeof(cs));
pReadCabinetState(&cs, sizeof(cs));
if (cs.fFullPathTitle == -1)
if (full_title())
{
lstrcpyA(Group1Title, ProgramsDir);
lstrcatA(Group1Title, "\\Group1");
......
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