Author: rharabien Date: Mon Nov 28 10:01:24 2011 New Revision: 54523
URL: http://svn.reactos.org/svn/reactos?rev=54523&view=rev Log: [SHELL32] - Don't fail if Shell folder cannot be created. This way shell registers more folders on LiveCD.
Modified: trunk/reactos/dll/win32/shell32/shellpath.cpp
Modified: trunk/reactos/dll/win32/shell32/shellpath.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shellpath... ============================================================================== --- trunk/reactos/dll/win32/shell32/shellpath.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shellpath.cpp [iso-8859-1] Mon Nov 28 10:01:24 2011 @@ -1563,13 +1563,15 @@ hr = HRESULT_FROM_WIN32(ret); else { - hr = SHGetFolderPathW(NULL, folders[i] | CSIDL_FLAG_CREATE, - hToken, SHGFP_TYPE_DEFAULT, path); - ret = RegSetValueExW(hKey, - CSIDL_Data[folders[i]].szValueName, 0, REG_SZ, - (LPBYTE)path, (wcslen(path) + 1) * sizeof(WCHAR)); - if (ret) - hr = HRESULT_FROM_WIN32(ret); + // Don't fail if folder can't be created + if (SUCCEEDED(SHGetFolderPathW(NULL, folders[i] | CSIDL_FLAG_CREATE, + hToken, SHGFP_TYPE_DEFAULT, path))) + { + ret = RegSetValueExW(hKey, CSIDL_Data[folders[i]].szValueName, 0, REG_SZ, + (LPBYTE)path, (wcslen(path) + 1) * sizeof(WCHAR)); + if (ret) + hr = HRESULT_FROM_WIN32(ret); + } } } }