mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 21:11:54 +00:00
- Implement reading user shell folders from registry
See issue #4206 for more details. svn path=/trunk/; revision=44177
This commit is contained in:
parent
f0680faa1a
commit
94307ac7ec
1 changed files with 14 additions and 0 deletions
|
@ -1011,7 +1011,9 @@ static HRESULT _SHGetUserShellFolderPath(HKEY rootKey, LPCWSTR userPrefix,
|
|||
*/
|
||||
static HRESULT _SHGetDefaultValue(BYTE folder, LPWSTR pszPath)
|
||||
{
|
||||
DWORD dwSize;
|
||||
HRESULT hr;
|
||||
HKEY hKey;
|
||||
WCHAR resourcePath[MAX_PATH];
|
||||
LPCWSTR pDefaultPath = NULL;
|
||||
|
||||
|
@ -1022,6 +1024,18 @@ static HRESULT _SHGetDefaultValue(BYTE folder, LPWSTR pszPath)
|
|||
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))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue