HRESULT ScaWriteWebError7(
    __in_z LPCWSTR wzWebName,
    __in_z LPCWSTR wzRoot,
    SCA_WEB_ERROR* psweList
    )
{
    HRESULT hr = S_OK;

    hr = ScaWriteConfigID(IIS_WEBERROR_BEGIN);
    ExitOnFailure(hr, "Fail to write webError begin ID");

    hr = ScaWriteConfigString(wzWebName);
    ExitOnFailure(hr, "Fail to write webError Web Key");

    hr = ScaWriteConfigString(wzRoot);
    ExitOnFailure(hr, "Fail to write webError Vdir key");

    // Loop through the HTTP headers
    for (SCA_WEB_ERROR* pswe = psweList; pswe; pswe = pswe->psweNext)
    {
        hr = ScaWriteConfigID(IIS_WEBERROR);
        ExitOnFailure(hr, "Fail to write webError ID");

        hr = ScaWriteConfigInteger(pswe->iErrorCode);
        ExitOnFailure(hr, "Fail to write webError code");

        hr = ScaWriteConfigInteger(pswe->iSubCode);
        ExitOnFailure(hr, "Fail to write webError subcode");

        //just write one
        if (*(pswe->wzFile))
        {
            hr = ScaWriteConfigString(pswe->wzFile);
            ExitOnFailure(hr, "Fail to write webError file");
            hr = ScaWriteConfigInteger(0);
            ExitOnFailure(hr, "Fail to write webError file code");
        }
        else if (*(pswe->wzURL))
        {
            hr = ScaWriteConfigString(pswe->wzURL);
            ExitOnFailure(hr, "Fail to write webError URL");
            hr = ScaWriteConfigInteger(1);
            ExitOnFailure(hr, "Fail to write webError URL code");
        }
    }

    hr = ScaWriteConfigID(IIS_WEBERROR_END);
    ExitOnFailure(hr, "Fail to write httpHeader end ID");

LExit:
    return hr;

}
Beispiel #2
0
static HRESULT WriteFilter(const SCA_FILTER* psf)
{
    HRESULT hr = S_OK;

    hr = ScaWriteConfigID(IIS_FILTER);
    ExitOnFailure(hr, "Failed to write filter begin ID");

    hr = ScaWriteConfigID(IIS_CREATE);
    ExitOnFailure(hr, "Failed to write filter create ID");

    //filter Name key
    hr = ScaWriteConfigString(psf->wzKey);
    ExitOnFailure1(hr, "Failed to write key name for filter '%ls'", psf->wzKey);

    //web site name
    hr = ScaWriteConfigString(psf->wzFilterRoot);
    ExitOnFailure(hr, "Failed to write filter web root ");

    // filter path
    hr = ScaWriteConfigString(psf->wzPath);
    ExitOnFailure1(hr, "Failed to write Path for filter '%ls'", psf->wzKey);

    //filter load order
    hr = ScaWriteConfigInteger(psf->iLoadOrder);
    ExitOnFailure1(hr, "Failed to write load order for filter '%ls'", psf->wzKey);

LExit:
    return hr;
}