Example #1
0
HRESULT ScaFiltersInstall7(
    __in SCA_FILTER* psfList
    )
{
    HRESULT hr = S_OK;
    SCA_FILTER* psf = psfList;

    if (!psf)
    {
        ExitFunction();
    }
    //write global filters
    hr = ScaWriteConfigID(IIS_FILTER_GLOBAL_BEGIN);
    ExitOnFailure(hr, "Failed to write filter begin ID");
    while (psf)
    {
        if (WcaIsInstalling(psf->isInstalled, psf->isAction))
        {
            if (0 == wcscmp(psf->wzFilterRoot, L"/"))
            {
                hr = WriteFilter(psf);
            }
        }
        psf = psf->psfNext;
    }
    hr = ScaWriteConfigID(IIS_FILTER_END);
    ExitOnFailure(hr, "Failed to write filter ID");

    psf = psfList;

    //Write Web Site Filters
    hr = ScaWriteConfigID(IIS_FILTER_BEGIN);
    ExitOnFailure(hr, "Failed to write filter begin ID");
    while (psf)
    {
        if (WcaIsInstalling(psf->isInstalled, psf->isAction))
        {
            if (0 != wcscmp(psf->wzFilterRoot, L"/"))
            {
                hr = WriteFilter(psf);
            }
        }
        psf = psf->psfNext;
    }
    hr = ScaWriteConfigID(IIS_FILTER_END);
    ExitOnFailure(hr, "Failed to write filter ID");

LExit:

    return hr;
}
void FilterWriter::WriteFilterNames(tinyxml2::XMLNode* node, const FilterList &filterList)
{
    for (Filter filter : filterList) {
        WriteFilter(node, filter);
    }
}