Пример #1
0
vector<AppSpecificEntry> LpmConfigurationReaderV1::readAppSpecificEntries(void)
{
    vector<AppSpecificEntry> appSpecificEntries;

    //
    // Since this configuration does not have the numAppSpecificEntries we loop through
    // till we fail to read. We handle it in the catch block.
    //
    UIntN appIndex;
    try
    {
        for (appIndex = 0; ; appIndex++)
        {
            vector<string> appNames = readAppNames(appIndex);

            string key = "LPMSet";
            UIntN lpmSetIndex = getPolicyServices().platformConfigurationData->readConfigurationUInt32(
                root() + keyPath() + key);

            appSpecificEntries.push_back(AppSpecificEntry(appNames, lpmSetIndex));

            if (appIndex >= LpmEntriesIndexLimit::MaxAppEntryIndex)
            {
                throw dptf_exception("App Entries exceeded max value");
            }
        }
    }
    catch (dptf_exception& e)
    {
        string msg = e.what();
        postInfoMessage(PolicyMessage(FLF,
            "Error msg (" + msg + "). Last appIndex = " + to_string(appIndex),
            Constants::Invalid));
        return appSpecificEntries;
    }

    return appSpecificEntries;

}
Пример #2
0
vector<AppSpecificEntry> LpmConfigurationReaderV0::readAppSpecificEntries(void)
{
    m_lpmSets.clear();

    vector<AppSpecificEntry> appSpecificEntries;
    UIntN entryIndex = 0;
    try
    {
        string key = "NumAppSpecificEntries";
        UIntN numEntries = getPolicyServices().platformConfigurationData->readConfigurationUInt32(
            root() + key);

        if (numEntries == 0)
        {
            throw dptf_exception("No app specific entries for v0");
        }

        for (entryIndex = 0; entryIndex < numEntries; entryIndex++)
        {
            vector<string> appNames = readAppNames(entryIndex);
            vector<LpmEntry> lpmEntries = readLpmEntries();

            appSpecificEntries.push_back(AppSpecificEntry(appNames, entryIndex));
            m_lpmSets.push_back(LpmSet(entryIndex, lpmEntries));
        }
    }
    catch (dptf_exception& e)
    {
        string msg = e.what();
        m_policyServices.messageLogging->writeMessageDebug(PolicyMessage(FLF,
            "Error msg (" + msg + "). Last entryIndex = " + to_string(entryIndex),
            Constants::Invalid));
    }

    return appSpecificEntries;
}