Author: janderwald
Date: Sun Nov 15 20:08:27 2009
New Revision: 44177
URL:
http://svn.reactos.org/svn/reactos?rev=44177&view=rev
Log:
- Implement reading user shell folders from registry
See issue #4206 for more details.
Modified:
trunk/reactos/dll/win32/shell32/shellpath.c
Modified: trunk/reactos/dll/win32/shell32/shellpath.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shellpat…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shellpath.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shellpath.c [iso-8859-1] Sun Nov 15 20:08:27 2009
@@ -1011,7 +1011,9 @@
*/
static HRESULT _SHGetDefaultValue(BYTE folder, LPWSTR pszPath)
{
+ DWORD dwSize;
HRESULT hr;
+ HKEY hKey;
WCHAR resourcePath[MAX_PATH];
LPCWSTR pDefaultPath = NULL;
@@ -1021,6 +1023,18 @@
return E_INVALIDARG;
if (!pszPath)
return E_INVALIDARG;
+
+ if (RegOpenKeyExW(HKEY_CURRENT_USER,
L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", 0,
KEY_READ, &hKey) == ERROR_SUCCESS)
+ {
+ /* FIXME assume MAX_PATH size */
+ dwSize = MAX_PATH * sizeof(WCHAR);
+ if (RegQueryValueExW(hKey, CSIDL_Data[folder].szValueName, NULL, NULL,
(LPBYTE)pszPath, &dwSize) == ERROR_SUCCESS)
+ {
+ RegCloseKey(hKey);
+ return S_OK;
+ }
+ RegCloseKey(hKey);
+ }
if (CSIDL_Data[folder].szDefaultPath &&
IS_INTRESOURCE(CSIDL_Data[folder].szDefaultPath))