Ejemplo n.º 1
0
void Cx_PluginLoader::MakeFullPath(wchar_t* fullpath, HMODULE instance,
                                   const wchar_t* path)
{
    if (!path || 0 == path[0] || PathIsRelativeW(path))
    {
        GetModuleFileNameW(instance, fullpath, MAX_PATH);
        PathRemoveFileSpecW(fullpath);
        PathAppendW(fullpath, path);
    }
    else
    {
        wcscpy_s(fullpath, MAX_PATH, path);
    }
    ReplaceSlashes(fullpath);
    PathAddBackslashW(fullpath);
}
Ejemplo n.º 2
0
long Cx_PluginLoader::LoadPluginFiles(const wchar_t* path,
                                      const wchar_t* files,
                                      HMODULE instance,
                                      bool enableDelayLoading)
{
    wchar_t filename[MAX_PATH];

    m_instance = instance;
    MakeFullPath(filename, instance, path);

    const size_t len0 = wcslen(filename);
    wchar_t* nameend = filename + len0;

    std::vector<std::wstring> filenames;
    size_t i, j;

    for (i = 0; files[i] != 0; )
    {
        while (issep(files[i]))
        {
            i++;
        }
        for (j = i; files[j] != 0 && !issep(files[j]); j++)
        {
        }
        if (j > i)
        {
            wcsncpy_s(nameend, MAX_PATH - len0, files + i,
                MAX_PATH - len0 < j - i ? MAX_PATH - len0 : j - i);
            nameend[j - i] = 0;
            ReplaceSlashes(filename);
            if (wcschr(nameend, L'.') == NULL)
                wcscat_s(filename, MAX_PATH, L".plugin" PLNEXT);
            filenames.push_back(filename);
        }
        i = j;
    }

    return InLoadPlugins(filenames, enableDelayLoading);
}
Ejemplo n.º 3
0
CStdString OfflineDataStore::GetKeyNameForDocID(const CStdString& sDocID)
{
	CStdString sKeyName = GetRegistryKeyName() + _T("\\") + ReplaceSlashes(sDocID);
	return sKeyName;
}