Commit f3bd5210 authored by Mariusz Pluciński's avatar Mariusz Pluciński Committed by Alexandre Julliard

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

All non-virtual known folders must have set relative path field.
parent faa9d41e
......@@ -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);
......
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