mirror of
https://github.com/reactos/reactos.git
synced 2025-06-09 11:20:39 +00:00
[BROWSEUI] Fix CSHEnumClassesOfCategories::Initialize() parameters validation. (#1559)
CORE-11711
This commit is contained in:
parent
d6d1efe731
commit
fdfef818ef
1 changed files with 20 additions and 10 deletions
|
@ -254,17 +254,16 @@ HRESULT CSHEnumClassesOfCategories::Initialize(ULONG cImplemented, CATID *pImple
|
||||||
if (!fDsa)
|
if (!fDsa)
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
if (cRequired > 0 || cImplemented == (ULONG)-1)
|
// Parameter validation:
|
||||||
{
|
// - We must have at least one category to manage.
|
||||||
FIXME("Implement required categories class enumeration\n");
|
// - The array pointers must not be NULL if there is a non-zero
|
||||||
return E_NOTIMPL;
|
// element count specified for them.
|
||||||
}
|
if (cImplemented == 0 && cRequired == 0)
|
||||||
|
return E_INVALIDARG;
|
||||||
|
if ((cImplemented && !pImplemented) || (cRequired && !pRequired))
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
// Don't do anything if we have nothing
|
// For each implemented category, create a cache and add it to our local DSA.
|
||||||
if (cRequired == 0 && cImplemented == (ULONG)-1)
|
|
||||||
return E_FAIL;
|
|
||||||
|
|
||||||
// For each implemented category, create a cache and add it to our local DSA
|
|
||||||
for (i = 0; i < cImplemented; i++)
|
for (i = 0; i < cImplemented; i++)
|
||||||
{
|
{
|
||||||
CComCatCachedCategory cachedCat;
|
CComCatCachedCategory cachedCat;
|
||||||
|
@ -273,6 +272,17 @@ HRESULT CSHEnumClassesOfCategories::Initialize(ULONG cImplemented, CATID *pImple
|
||||||
return hr;
|
return hr;
|
||||||
cachedCat.WriteCacheToDSA(fDsa);
|
cachedCat.WriteCacheToDSA(fDsa);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Implement caching of the required categories.
|
||||||
|
if (cRequired > 0)
|
||||||
|
{
|
||||||
|
FIXME("Implement required categories class enumeration\n");
|
||||||
|
|
||||||
|
// Only fail in case we didn't look at the implemented categories.
|
||||||
|
if (cImplemented == 0)
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue