shell32: Check if known folder's relative path was passed to function.

All non-virtual known folders must have set relative path field.
This commit is contained in:
Mariusz Pluciński 2011-08-04 16:26:33 +02:00 committed by Alexandre Julliard
parent faa9d41e7f
commit f3bd5210b8
1 changed files with 10 additions and 1 deletions

View File

@ -3846,9 +3846,18 @@ static HRESULT WINAPI foldermanager_RegisterFolder(
}
if(SUCCEEDED(hr) && pKFD->category != KF_CATEGORY_VIRTUAL)
hr = HRESULT_FROM_WIN32(RegSetValueExW(hKey, szRelativePath, 0, REG_SZ, (LPBYTE)pKFD->pszRelativePath, (lstrlenW(pKFD->pszRelativePath)+1)*sizeof(WCHAR) ));
{
if(!pKFD->pszRelativePath)
hr = E_INVALIDARG;
if(SUCCEEDED(hr))
hr = HRESULT_FROM_WIN32(RegSetValueExW(hKey, szRelativePath, 0, REG_SZ, (LPBYTE)pKFD->pszRelativePath, (lstrlenW(pKFD->pszRelativePath)+1)*sizeof(WCHAR) ));
}
RegCloseKey(hKey);
if(FAILED(hr))
SHDeleteKeyW(HKEY_LOCAL_MACHINE, registryPath);
}
HeapFree(GetProcessHeap(), 0, registryPath);